diff options
author | Hans Nilsson <[email protected]> | 2019-03-21 15:14:19 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2019-03-21 15:14:19 +0100 |
commit | e739ec80b5546e8d04f08c1f4a6c0067be2c13a7 (patch) | |
tree | 924e44691620e506c84f483e134706d046e97aaa /lib/crypto/c_src/api_ng.c | |
parent | c75fa5f4a484bc82083b06e7d10a197b2a3fbddc (diff) | |
parent | 7188527f1465c715c7e71e5477f4116f27202288 (diff) | |
download | otp-e739ec80b5546e8d04f08c1f4a6c0067be2c13a7.tar.gz otp-e739ec80b5546e8d04f08c1f4a6c0067be2c13a7.tar.bz2 otp-e739ec80b5546e8d04f08c1f4a6c0067be2c13a7.zip |
Merge branch 'hans/crypto/use_openssl_NO-flags/OTP-15683'
* hans/crypto/use_openssl_NO-flags/OTP-15683:
crypto: Fixup unused label warning
crypto: Fixup 'break strict-aliasing rules' warning
crypto: Fixup 'break strict-aliasing rules' warning
crypto: Fixup the ripemd160 macro chaos
crypto: Test suite fix for unavailable CMAC
crypto: Handle additional OPENSSL_NO_* flags
Diffstat (limited to 'lib/crypto/c_src/api_ng.c')
-rw-r--r-- | lib/crypto/c_src/api_ng.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/crypto/c_src/api_ng.c b/lib/crypto/c_src/api_ng.c index 6a833a0984..f4312114ed 100644 --- a/lib/crypto/c_src/api_ng.c +++ b/lib/crypto/c_src/api_ng.c @@ -207,7 +207,7 @@ static int get_init_args(ErlNifEnv* env, goto err; } - +#ifdef HAVE_RC2 if (EVP_CIPHER_type((*cipherp)->cipher.p) == NID_rc2_cbc) { if (key_bin.size > INT_MAX / 8) { *return_term = EXCP_BADARG(env, "To large rc2_cbc key"); @@ -218,6 +218,7 @@ static int get_init_args(ErlNifEnv* env, goto err; } } +#endif if (ivec_arg == atom_undefined || ivec_len == 0) { @@ -346,7 +347,7 @@ ERL_NIF_TERM ng_crypto_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM arg ret = enif_make_resource(env, ctx_res); if(ctx_res) enif_release_resource(ctx_res); - } else if (enif_get_resource(env, argv[0], evp_cipher_ctx_rtype, (void**)&ctx_res)) { + } else if (enif_get_resource(env, argv[0], (ErlNifResourceType*)evp_cipher_ctx_rtype, (void**)&ctx_res)) { /* Fetch the flag telling if we are going to encrypt (=true) or decrypt (=false) */ if (argv[3] == atom_true) encflg = 1; @@ -426,7 +427,7 @@ ERL_NIF_TERM ng_crypto_update(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[ struct evp_cipher_ctx *ctx_res; ERL_NIF_TERM ret; - if (!enif_get_resource(env, argv[0], evp_cipher_ctx_rtype, (void**)&ctx_res)) + if (!enif_get_resource(env, argv[0], (ErlNifResourceType*)evp_cipher_ctx_rtype, (void**)&ctx_res)) return EXCP_BADARG(env, "Bad 1:st arg"); if (argc == 3) { |