projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Check for 0 modulus in BN_MONT_CTX_set
[openssl.git]
/
crypto
/
bn
/
bn_mont.c
diff --git
a/crypto/bn/bn_mont.c
b/crypto/bn/bn_mont.c
index aafd1b852654b60256ab08bc842ba3c34dfa17f6..be95bd55d02064793ee505f171f42d0431294049 100644
(file)
--- a/
crypto/bn/bn_mont.c
+++ b/
crypto/bn/bn_mont.c
@@
-373,6
+373,9
@@
int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
int ret = 0;
BIGNUM *Ri, *R;
+ if (BN_is_zero(mod))
+ return 0;
+
BN_CTX_start(ctx);
if ((Ri = BN_CTX_get(ctx)) == NULL)
goto err;