diff options
author | Bodo Möller <bodo@openssl.org> | 2005-05-26 04:30:49 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2005-05-26 04:30:49 +0000 |
commit | c61f571ce02ab6ab8ffe0c33a03b4a32ae83516e (patch) | |
tree | 47de58e8d6ec3a9db1d239c99b9ba172074eb5a8 /crypto/bn/bn_blind.c | |
parent | 60192e96b80fd9ec0776c9db0497c066c97a7cf9 (diff) |
check BN_copy() return value
Diffstat (limited to 'crypto/bn/bn_blind.c')
-rw-r--r-- | crypto/bn/bn_blind.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/bn/bn_blind.c b/crypto/bn/bn_blind.c index 40e742dbad..ca22d4f8bd 100644 --- a/crypto/bn/bn_blind.c +++ b/crypto/bn/bn_blind.c @@ -207,6 +207,8 @@ int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx) { + int ret = 1; + bn_check_top(n); if ((b->A == NULL) || (b->Ai == NULL)) @@ -216,9 +218,13 @@ int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx) } if (r != NULL) - BN_copy(r, b->Ai); + { + if (!BN_copy(r, b->Ai)) ret=0; + } - return BN_mod_mul(n,n,b->A,b->mod,ctx); + if (!BN_mod_mul(n,n,b->A,b->mod,ctx)) ret=0; + + return ret; } int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) @@ -351,4 +357,3 @@ err: return ret; } - |