summaryrefslogtreecommitdiff
path: root/crypto/dsa
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-08-02 14:00:52 -0400
committerRich Salz <rsalz@openssl.org>2017-08-03 10:45:17 -0400
commitddc6a5c8f5900959bdbdfee79e1625a3f7808acd (patch)
tree3121037aca10793706bbc4b8800b40ba305a1c06 /crypto/dsa
parentae3947de09522206d61c0206a733517b10a910f8 (diff)
downloadopenssl-new-ddc6a5c8f5900959bdbdfee79e1625a3f7808acd.tar.gz
Add RAND_priv_bytes() for private keys
Add a new global DRBG for private keys used by RAND_priv_bytes. Add BN_priv_rand() and BN_priv_rand_range() which use RAND_priv_bytes(). Change callers to use the appropriate BN_priv... function. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4076)
Diffstat (limited to 'crypto/dsa')
-rw-r--r--crypto/dsa/dsa_key.c2
-rw-r--r--crypto/dsa/dsa_ossl.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c
index 31442b1cff..7ced03d083 100644
--- a/crypto/dsa/dsa_key.c
+++ b/crypto/dsa/dsa_key.c
@@ -38,7 +38,7 @@ static int dsa_builtin_keygen(DSA *dsa)
priv_key = dsa->priv_key;
do
- if (!BN_rand_range(priv_key, dsa->q))
+ if (!BN_priv_rand_range(priv_key, dsa->q))
goto err;
while (BN_is_zero(priv_key)) ;
diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c
index 479337763b..a3b2069c1f 100644
--- a/crypto/dsa/dsa_ossl.c
+++ b/crypto/dsa/dsa_ossl.c
@@ -175,7 +175,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
if (!BN_generate_dsa_nonce(k, dsa->q, dsa->priv_key, dgst,
dlen, ctx))
goto err;
- } else if (!BN_rand_range(k, dsa->q))
+ } else if (!BN_priv_rand_range(k, dsa->q))
goto err;
} while (BN_is_zero(k));