summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/dh/dh_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/openssl/openssl/crypto/dh/dh_key.c')
-rw-r--r--deps/openssl/openssl/crypto/dh/dh_key.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/deps/openssl/openssl/crypto/dh/dh_key.c b/deps/openssl/openssl/crypto/dh/dh_key.c
index b53a063244..4f85be7e49 100644
--- a/deps/openssl/openssl/crypto/dh/dh_key.c
+++ b/deps/openssl/openssl/crypto/dh/dh_key.c
@@ -116,14 +116,14 @@ static int generate_key(DH *dh)
if (generate_new_key) {
if (dh->q) {
do {
- if (!BN_rand_range(priv_key, dh->q))
+ if (!BN_priv_rand_range(priv_key, dh->q))
goto err;
}
while (BN_is_zero(priv_key) || BN_is_one(priv_key));
} else {
/* secret exponent length */
l = dh->length ? dh->length : BN_num_bits(dh->p) - 1;
- if (!BN_rand(priv_key, l, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
+ if (!BN_priv_rand(priv_key, l, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
goto err;
}
}
@@ -155,7 +155,7 @@ static int generate_key(DH *dh)
if (priv_key != dh->priv_key)
BN_free(priv_key);
BN_CTX_free(ctx);
- return (ok);
+ return ok;
}
static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
@@ -209,7 +209,7 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
BN_CTX_end(ctx);
BN_CTX_free(ctx);
}
- return (ret);
+ return ret;
}
static int dh_bn_mod_exp(const DH *dh, BIGNUM *r,
@@ -222,11 +222,11 @@ static int dh_bn_mod_exp(const DH *dh, BIGNUM *r,
static int dh_init(DH *dh)
{
dh->flags |= DH_FLAG_CACHE_MONT_P;
- return (1);
+ return 1;
}
static int dh_finish(DH *dh)
{
BN_MONT_CTX_free(dh->method_mont_p);
- return (1);
+ return 1;
}