diff options
author | Sverker Eriksson <[email protected]> | 2013-06-12 15:33:08 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-06-12 15:33:08 +0200 |
commit | 5abf95afb89eb6c2a93f68c08694710e23bab546 (patch) | |
tree | 523d017b1629989468f97af70eae1c192853f7b7 /lib | |
parent | b16dc3553bb2c5618169ede09fe479d83f7bcf40 (diff) | |
parent | 1f8d9f43766fea0e706db8923075ab65a7677daf (diff) | |
download | otp-5abf95afb89eb6c2a93f68c08694710e23bab546.tar.gz otp-5abf95afb89eb6c2a93f68c08694710e23bab546.tar.bz2 otp-5abf95afb89eb6c2a93f68c08694710e23bab546.zip |
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 00abeb9990..35de3dbf0c 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -590,6 +590,14 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) PRINTF_ERR1("CRYPTO: Invalid load_info '%T'", load_info); return 0; } + +#if defined(HAVE_EC) + res_type_ec_key = enif_open_resource_type(env,NULL,"crypto.EC_KEY", + ec_key_dtor, + ERL_NIF_RT_CREATE|ERL_NIF_RT_TAKEOVER, + NULL); +#endif + if (library_refc > 0) { /* Repeated loading of this library (module upgrade). * Atoms and callbacks are already set, we are done. @@ -633,11 +641,6 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) for (i = 0; i < EC_CURVES_CNT; i++) ec_curves[i].atom = enif_make_atom(env,ec_curves[i].name); - - res_type_ec_key = enif_open_resource_type(env,NULL,"crypto.EC_KEY", - ec_key_dtor, - ERL_NIF_RT_CREATE|ERL_NIF_RT_TAKEOVER, - NULL); #endif init_digest_types(env); |