Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Smith <brian@briansmith.org>2016-03-25 23:11:04 +0300
committerDavid Benjamin <davidben@google.com>2016-04-19 02:19:08 +0300
commitd035730ac7ebb82fbf1895fea50c29048bb6edb2 (patch)
treee56505005fa06b932fba1ea93b3f5b15a109b662 /include/openssl/bn.h
parent51b0d5b1e86590c6e828b11ede90db04916e9ff1 (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.h8
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. */