diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_gen.c')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_gen.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_gen.c b/src/lib/libcrypto/rsa/rsa_gen.c index d46f4f2478..817f177e96 100644 --- a/src/lib/libcrypto/rsa/rsa_gen.c +++ b/src/lib/libcrypto/rsa/rsa_gen.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_gen.c,v 1.18 2016/06/30 02:02:06 bcook Exp $ */ | 1 | /* $OpenBSD: rsa_gen.c,v 1.19 2017/01/21 10:38:29 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -69,6 +69,8 @@ | |||
| 69 | #include <openssl/err.h> | 69 | #include <openssl/err.h> |
| 70 | #include <openssl/rsa.h> | 70 | #include <openssl/rsa.h> |
| 71 | 71 | ||
| 72 | #include "bn_lcl.h" | ||
| 73 | |||
| 72 | static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); | 74 | static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); |
| 73 | 75 | ||
| 74 | /* | 76 | /* |
| @@ -202,11 +204,11 @@ rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) | |||
| 202 | BN_with_flags(&d, rsa->d, BN_FLG_CONSTTIME); | 204 | BN_with_flags(&d, rsa->d, BN_FLG_CONSTTIME); |
| 203 | 205 | ||
| 204 | /* calculate d mod (p-1) */ | 206 | /* calculate d mod (p-1) */ |
| 205 | if (!BN_mod(rsa->dmp1, &d, r1, ctx)) | 207 | if (!BN_mod_ct(rsa->dmp1, &d, r1, ctx)) |
| 206 | goto err; | 208 | goto err; |
| 207 | 209 | ||
| 208 | /* calculate d mod (q-1) */ | 210 | /* calculate d mod (q-1) */ |
| 209 | if (!BN_mod(rsa->dmq1, &d, r2, ctx)) | 211 | if (!BN_mod_ct(rsa->dmq1, &d, r2, ctx)) |
| 210 | goto err; | 212 | goto err; |
| 211 | 213 | ||
| 212 | /* calculate inverse of q mod p */ | 214 | /* calculate inverse of q mod p */ |
