diff options
author | Hans Nilsson <[email protected]> | 2017-10-30 15:38:20 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-11-01 10:29:06 +0100 |
commit | 56cde6ea14c6b2d81e94d7f4517aedbd5ffb8582 (patch) | |
tree | f002dc19d9b262061c1b6197be01742760ae8d98 /lib/crypto/c_src/crypto.c | |
parent | d835bd16a1c87a2513df1892e892f94857ed1c86 (diff) | |
download | otp-56cde6ea14c6b2d81e94d7f4517aedbd5ffb8582.tar.gz otp-56cde6ea14c6b2d81e94d7f4517aedbd5ffb8582.tar.bz2 otp-56cde6ea14c6b2d81e94d7f4517aedbd5ffb8582.zip |
crypto: replaced deprecated DH_generate_parameters
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 53fe233790..ed728c3b49 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -2846,7 +2846,7 @@ static ERL_NIF_TERM rsa_generate_key_nif(ErlNifEnv* env, int argc, const ERL_NIF static ERL_NIF_TERM dh_generate_parameters_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) {/* (PrimeLen, Generator) */ int prime_len, generator; - DH* dh_params; + DH* dh_params = NULL; int p_len, g_len; unsigned char *p_ptr, *g_ptr; ERL_NIF_TERM ret_p, ret_g; @@ -2857,8 +2857,8 @@ static ERL_NIF_TERM dh_generate_parameters_nif(ErlNifEnv* env, int argc, const E return enif_make_badarg(env); } - dh_params = DH_generate_parameters(prime_len, generator, NULL, NULL); - if (dh_params == NULL) { + + if (DH_generate_parameters_ex(dh_params, prime_len, generator, NULL)) { return atom_error; } DH_get0_pqg(dh_params, &dh_p, &dh_q, &dh_g); |