diff options
author | Rich Salz <rsalz@akamai.com> | 2015-04-24 16:39:40 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-06-23 17:09:35 -0400 |
commit | 74924dcb3802640d7e2ae2e80ca6515d0a53de7a (patch) | |
tree | 6de4138b01d5f649bdaa32d858bd5fa20e9ad4b6 /crypto/rsa/rsa_gen.c | |
parent | ce7e647bc2c328404b1e3cdac6211773afdefe07 (diff) | |
download | openssl-74924dcb3802640d7e2ae2e80ca6515d0a53de7a.tar.gz |
More secure storage of key material.
Add secure heap for storage of private keys (when possible).
Add BIO_s_secmem(), CBIGNUM, etc.
Add BIO_CTX_secure_new so all BIGNUM's in the context are secure.
Contributed by Akamai Technologies under the Corporate CLA.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/rsa/rsa_gen.c')
-rw-r--r-- | crypto/rsa/rsa_gen.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index e81be75e44..e40186aced 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -117,19 +117,19 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, /* We need the RSA components non-NULL */ if (!rsa->n && ((rsa->n = BN_new()) == NULL)) goto err; - if (!rsa->d && ((rsa->d = BN_new()) == NULL)) + if (!rsa->d && ((rsa->d = BN_secure_new()) == NULL)) goto err; if (!rsa->e && ((rsa->e = BN_new()) == NULL)) goto err; - if (!rsa->p && ((rsa->p = BN_new()) == NULL)) + if (!rsa->p && ((rsa->p = BN_secure_new()) == NULL)) goto err; - if (!rsa->q && ((rsa->q = BN_new()) == NULL)) + if (!rsa->q && ((rsa->q = BN_secure_new()) == NULL)) goto err; - if (!rsa->dmp1 && ((rsa->dmp1 = BN_new()) == NULL)) + if (!rsa->dmp1 && ((rsa->dmp1 = BN_secure_new()) == NULL)) goto err; - if (!rsa->dmq1 && ((rsa->dmq1 = BN_new()) == NULL)) + if (!rsa->dmq1 && ((rsa->dmq1 = BN_secure_new()) == NULL)) goto err; - if (!rsa->iqmp && ((rsa->iqmp = BN_new()) == NULL)) + if (!rsa->iqmp && ((rsa->iqmp = BN_secure_new()) == NULL)) goto err; BN_copy(rsa->e, e_value); |