diff options
author | Doug Hogan <[email protected]> | 2018-12-21 07:44:02 -0800 |
---|---|---|
committer | Doug Hogan <[email protected]> | 2018-12-21 08:23:39 -0800 |
commit | da3831bbe75f68626e362fdadd653becf230cf1f (patch) | |
tree | 3208398c4f867ba7ead9fd54e80839a905360695 /lib/crypto/c_src/crypto.c | |
parent | bd2ce3b7ba891b0bc4872fcf17e2eda44767bcd4 (diff) | |
download | otp-da3831bbe75f68626e362fdadd653becf230cf1f.tar.gz otp-da3831bbe75f68626e362fdadd653becf230cf1f.tar.bz2 otp-da3831bbe75f68626e362fdadd653becf230cf1f.zip |
Make HMAC ctx init internal to hmac.c per PR feedback
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 09171433cc..5b697ba5aa 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -181,14 +181,10 @@ static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info) return __LINE__; } - hmac_context_rtype = enif_open_resource_type(env, NULL, "hmac_context", - (ErlNifResourceDtor*) hmac_context_dtor, - ERL_NIF_RT_CREATE|ERL_NIF_RT_TAKEOVER, - NULL); - if (!hmac_context_rtype) { - PRINTF_ERR0("CRYPTO: Could not open resource type 'hmac_context'"); + if (!init_hmac_ctx(env)) { return __LINE__; } + #if OPENSSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION_PLAIN(1,0,0) evp_md_ctx_rtype = enif_open_resource_type(env, NULL, "EVP_MD_CTX", (ErlNifResourceDtor*) evp_md_ctx_dtor, |