diff options
author | miod <> | 2014-04-13 15:16:40 +0000 |
---|---|---|
committer | miod <> | 2014-04-13 15:16:40 +0000 |
commit | 52628ee3f51f011b463aaedb1a28aa0524b43cb3 (patch) | |
tree | 4bd2adeac981051908ec5756401424bbb4e57d6a /src/lib/libcrypto/rsa/rsa_eay.c | |
parent | 40c22d3625a3818690c889ed6216fedf2be522c9 (diff) | |
download | openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.gz openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.bz2 openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.zip |
Import OpenSSL 1.0.1g
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_eay.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_eay.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c index 2e1ddd48d3..88ee2cb557 100644 --- a/src/lib/libcrypto/rsa/rsa_eay.c +++ b/src/lib/libcrypto/rsa/rsa_eay.c | |||
@@ -847,12 +847,12 @@ static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) | |||
847 | if (!BN_mod(r0,pr1,rsa->p,ctx)) goto err; | 847 | if (!BN_mod(r0,pr1,rsa->p,ctx)) goto err; |
848 | 848 | ||
849 | /* If p < q it is occasionally possible for the correction of | 849 | /* If p < q it is occasionally possible for the correction of |
850 | * adding 'p' if r0 is negative above to leave the result still | 850 | * adding 'p' if r0 is negative above to leave the result still |
851 | * negative. This can break the private key operations: the following | 851 | * negative. This can break the private key operations: the following |
852 | * second correction should *always* correct this rare occurrence. | 852 | * second correction should *always* correct this rare occurrence. |
853 | * This will *never* happen with OpenSSL generated keys because | 853 | * This will *never* happen with OpenSSL generated keys because |
854 | * they ensure p > q [steve] | 854 | * they ensure p > q [steve] |
855 | */ | 855 | */ |
856 | if (BN_is_negative(r0)) | 856 | if (BN_is_negative(r0)) |
857 | if (!BN_add(r0,r0,rsa->p)) goto err; | 857 | if (!BN_add(r0,r0,rsa->p)) goto err; |
858 | if (!BN_mul(r1,r0,rsa->q,ctx)) goto err; | 858 | if (!BN_mul(r1,r0,rsa->q,ctx)) goto err; |