summaryrefslogtreecommitdiffstats
path: root/crypto/dh/dh_key.c
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>2000-02-05 14:17:32 +0000
committerUlf Möller <ulf@openssl.org>2000-02-05 14:17:32 +0000
commit9b141126d4b6f0636bc047e81b846c193ae26611 (patch)
treec8786c99bfccc8b9899cad5c3aa30f29ada5e1b9 /crypto/dh/dh_key.c
parent7e708ebee066d0308a335579b546326220dc8317 (diff)
New functions BN_CTX_start(), BN_CTX_get(), BN_CTX_end() to access
temporary BIGNUMs. BN_CTX still uses a fixed number of BIGNUMs, but the BN_CTX implementation could now easily be changed.
Diffstat (limited to 'crypto/dh/dh_key.c')
-rw-r--r--crypto/dh/dh_key.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
index 4e6a0fc0ef..0c7eeaf260 100644
--- a/crypto/dh/dh_key.c
+++ b/crypto/dh/dh_key.c
@@ -161,7 +161,8 @@ static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
int ret= -1;
BN_CTX_init(&ctx);
- tmp= &(ctx.bn[ctx.tos++]);
+ BN_CTX_start(&ctx);
+ tmp = BN_CTX_get(&ctx);
if (dh->priv_key == NULL)
{
@@ -184,6 +185,7 @@ static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
ret=BN_bn2bin(tmp,key);
err:
+ BN_CTX_end(&ctx);
BN_CTX_free(&ctx);
return(ret);
}