Skip to content

Commit

Permalink
Revert "Proper key size check"
Browse files Browse the repository at this point in the history
This reverts commit 370ce26.
  • Loading branch information
josevalim committed Oct 5, 2023
1 parent 370ce26 commit 8c9efe9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plug/crypto/message_encryptor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule Plug.Crypto.MessageEncryptor do
"""
def encrypt(message, aad \\ "A128GCM", secret, sign_secret)
when is_binary(message) and (is_binary(aad) or is_list(aad)) and
byte_size(secret) == 32 and
bit_size(secret) in [128, 192, 256] and
is_binary(sign_secret) do
iv = :crypto.strong_rand_bytes(12)
{cipher_text, cipher_tag} = block_encrypt(:chacha20_poly1305, secret, iv, {aad, message})
Expand Down

0 comments on commit 8c9efe9

Please sign in to comment.