aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-11-01 10:29:48 +0100
committerHans Nilsson <[email protected]>2017-11-01 10:29:48 +0100
commit850375f7de788d9d3b3252adb65b3491d5d10efc (patch)
tree6acd211eb57f5752060656e148db2c2f9cc9b2ff
parentb9c307c5e43575d88b83005e94fd9c1095fd48f6 (diff)
parent56cde6ea14c6b2d81e94d7f4517aedbd5ffb8582 (diff)
downloadotp-850375f7de788d9d3b3252adb65b3491d5d10efc.tar.gz
otp-850375f7de788d9d3b3252adb65b3491d5d10efc.tar.bz2
otp-850375f7de788d9d3b3252adb65b3491d5d10efc.zip
Merge branch 'hans/crypto/DH_generate_parameters_deprecated/OTP-14639' into maint
-rw-r--r--lib/crypto/c_src/crypto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 5d411785e9..c4e80e3153 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);