Skip to content

Commit

Permalink
crypto: handle unsupported AES ciphers in webcrypto
Browse files Browse the repository at this point in the history
Refs: electron/electron#36256
PR-URL: #45321
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
  • Loading branch information
panva authored and danielleadams committed Dec 28, 2022
1 parent 2c22768 commit 85d71bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/crypto/crypto_aes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,10 @@ Maybe<bool> AESCipherTraits::AdditionalConfig(
}

params->cipher = EVP_get_cipherbynid(cipher_nid);
CHECK_NOT_NULL(params->cipher);
if (params->cipher == nullptr) {
THROW_ERR_CRYPTO_UNKNOWN_CIPHER(env);
return Nothing<bool>();
}

if (params->iv.size() <
static_cast<size_t>(EVP_CIPHER_iv_length(params->cipher))) {
Expand Down

0 comments on commit 85d71bb

Please sign in to comment.