diff options
author | Hans Nilsson <[email protected]> | 2017-11-01 10:30:30 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-11-01 10:30:30 +0100 |
commit | 911fdf9b551c3069255e53fa8483de21f82b9f38 (patch) | |
tree | 6b7b82631db84de2b811b2f4463d1cfb80cb7ec2 /lib/crypto/c_src/crypto.c | |
parent | 4f4569db6dde076f16990f74d7f9609d609dee40 (diff) | |
parent | 850375f7de788d9d3b3252adb65b3491d5d10efc (diff) | |
download | otp-911fdf9b551c3069255e53fa8483de21f82b9f38.tar.gz otp-911fdf9b551c3069255e53fa8483de21f82b9f38.tar.bz2 otp-911fdf9b551c3069255e53fa8483de21f82b9f38.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 53fe233790..c4e80e3153 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -277,7 +277,7 @@ static HMAC_CTX *HMAC_CTX_new() static void HMAC_CTX_free(HMAC_CTX *ctx) { HMAC_CTX_cleanup(ctx); - return CRYPTO_free(ctx); + CRYPTO_free(ctx); } #define EVP_MD_CTX_new() EVP_MD_CTX_create() @@ -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); |