diff options
author | Sverker Eriksson <[email protected]> | 2016-05-26 16:54:02 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-05-26 16:54:02 +0200 |
commit | 1af338179c779913470cd701e4f37b79565143cb (patch) | |
tree | 5d95542f644871fcccd00d28250011317e457d9e | |
parent | 5342559492f503fe288275aaa97a31ded791a3d6 (diff) | |
download | otp-1af338179c779913470cd701e4f37b79565143cb.tar.gz otp-1af338179c779913470cd701e4f37b79565143cb.tar.bz2 otp-1af338179c779913470cd701e4f37b79565143cb.zip |
crypto: Allow any AES-GCM tag length for non-EVP impl
Same fix as was done for EVP in f4f588683dce36c447017.
-rw-r--r-- | lib/crypto/c_src/crypto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 1eccc669bb..839be9e3f3 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -1790,7 +1790,7 @@ static ERL_NIF_TERM aes_gcm_decrypt_NO_EVP(ErlNifEnv* env, int argc, const ERL_N || !enif_inspect_binary(env, argv[1], &iv) || iv.size == 0 || !enif_inspect_iolist_as_binary(env, argv[2], &aad) || !enif_inspect_iolist_as_binary(env, argv[3], &in) - || !enif_inspect_iolist_as_binary(env, argv[4], &tag) || tag.size != EVP_GCM_TLS_TAG_LEN) { + || !enif_inspect_iolist_as_binary(env, argv[4], &tag)) { return enif_make_badarg(env); } @@ -1809,7 +1809,7 @@ static ERL_NIF_TERM aes_gcm_decrypt_NO_EVP(ErlNifEnv* env, int argc, const ERL_N goto out_err; /* calculate and check the tag */ - if (CRYPTO_gcm128_finish(ctx, tag.data, EVP_GCM_TLS_TAG_LEN)) + if (CRYPTO_gcm128_finish(ctx, tag.data, tag.size)) goto out_err; CRYPTO_gcm128_release(ctx); |