diff options
Diffstat (limited to 'crypto/openssl/crypto/rsa/rsa_gen.c')
-rw-r--r-- | crypto/openssl/crypto/rsa/rsa_gen.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/openssl/crypto/rsa/rsa_gen.c b/crypto/openssl/crypto/rsa/rsa_gen.c index 3ed6edd..95e636d 100644 --- a/crypto/openssl/crypto/rsa/rsa_gen.c +++ b/crypto/openssl/crypto/rsa/rsa_gen.c @@ -74,11 +74,12 @@ RSA *RSA_generate_key(int bits, unsigned long e_value, if (ctx == NULL) goto err; ctx2=BN_CTX_new(); if (ctx2 == NULL) goto err; - r0= &(ctx->bn[0]); - r1= &(ctx->bn[1]); - r2= &(ctx->bn[2]); - r3= &(ctx->bn[3]); - ctx->tos+=4; + BN_CTX_start(ctx); + r0 = BN_CTX_get(ctx); + r1 = BN_CTX_get(ctx); + r2 = BN_CTX_get(ctx); + r3 = BN_CTX_get(ctx); + if (r3 == NULL) goto err; bitsp=(bits+1)/2; bitsq=bits-bitsp; @@ -181,6 +182,7 @@ err: RSAerr(RSA_F_RSA_GENERATE_KEY,ERR_LIB_BN); ok=0; } + BN_CTX_end(ctx); BN_CTX_free(ctx); BN_CTX_free(ctx2); |