aboutsummaryrefslogtreecommitdiff
path: root/crypto/bn/bn_ctx.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-11-08 10:05:34 +0000
committerBodo Möller <bodo@openssl.org>2000-11-08 10:05:34 +0000
commit7f7b8d687173bd65ba2acea130ea25bd809e41b6 (patch)
tree3fe79e869d224338a2dc7e12241bf7694d686f35 /crypto/bn/bn_ctx.c
parentbb7e632aef4ca511feb9f3dae29cccbab984c057 (diff)
downloadopenssl-7f7b8d687173bd65ba2acea130ea25bd809e41b6.zip
openssl-7f7b8d687173bd65ba2acea130ea25bd809e41b6.tar.gz
openssl-7f7b8d687173bd65ba2acea130ea25bd809e41b6.tar.bz2
BN_CTX-related fixes.
Diffstat (limited to 'crypto/bn/bn_ctx.c')
-rw-r--r--crypto/bn/bn_ctx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/bn/bn_ctx.c b/crypto/bn/bn_ctx.c
index b1a8d75..28b334f 100644
--- a/crypto/bn/bn_ctx.c
+++ b/crypto/bn/bn_ctx.c
@@ -112,8 +112,14 @@ void BN_CTX_start(BN_CTX *ctx)
ctx->depth++;
}
+
BIGNUM *BN_CTX_get(BN_CTX *ctx)
{
+ /* Note: If BN_CTX_get is ever changed to allocate BIGNUMs dynamically,
+ * make sure that if BN_CTX_get fails once it will return NULL again
+ * until BN_CTX_end is called. (This is so that callers have to check
+ * only the last return value.)
+ */
if (ctx->depth > BN_CTX_NUM_POS || ctx->tos >= BN_CTX_NUM)
{
if (!ctx->too_many)