diff options
author | Brian Smith <brian@briansmith.org> | 2016-03-25 23:11:04 +0300 |
---|---|---|
committer | David Benjamin <davidben@google.com> | 2016-04-19 02:19:08 +0300 |
commit | d035730ac7ebb82fbf1895fea50c29048bb6edb2 (patch) | |
tree | e56505005fa06b932fba1ea93b3f5b15a109b662 /include/openssl/bn.h | |
parent | 51b0d5b1e86590c6e828b11ede90db04916e9ff1 (diff) |
Make return value of |BN_MONT_CTX_set_locked| int.
This reduces the chance of double-frees.
BUG=10
Change-Id: I11a240e2ea5572effeddc05acb94db08c54a2e0b
Reviewed-on: https://boringssl-review.googlesource.com/7583
Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'include/openssl/bn.h')
-rw-r--r-- | include/openssl/bn.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/openssl/bn.h b/include/openssl/bn.h index 64ec5c96..2f610018 100644 --- a/include/openssl/bn.h +++ b/include/openssl/bn.h @@ -749,11 +749,11 @@ OPENSSL_EXPORT int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, /* BN_MONT_CTX_set_locked takes |lock| and checks whether |*pmont| is NULL. If * so, it creates a new |BN_MONT_CTX| and sets the modulus for it to |mod|. It - * then stores it as |*pmont| and returns it, or NULL on error. + * then stores it as |*pmont|. It returns one on success and zero on error. * - * If |*pmont| is already non-NULL then the existing value is returned. */ -BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, - const BIGNUM *mod, BN_CTX *bn_ctx); + * If |*pmont| is already non-NULL then it does nothing and returns one. */ +int BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, + const BIGNUM *mod, BN_CTX *bn_ctx); /* BN_to_montgomery sets |ret| equal to |a| in the Montgomery domain. It * returns one on success and zero on error. */ |