Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/crypto/crypto_aes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ WebCryptoCipherStatus AES_Cipher(Environment* env,
CHECK_EQ(key_data.GetKeyType(), kKeyTypeSecret);

auto ctx = CipherCtxPointer::New();
CHECK(ctx);
if (!ctx) {
return WebCryptoCipherStatus::FAILED;
}

if (params.cipher.isWrapMode()) {
ctx.setAllowWrap();
Expand Down
6 changes: 5 additions & 1 deletion src/crypto/crypto_cipher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ void CipherBase::CommonInit(const char* cipher_type,
MarkPopErrorOnReturn mark_pop_error_on_return;
CHECK(!ctx_);
ctx_ = CipherCtxPointer::New();
CHECK(ctx_);
if (!ctx_) {
return ThrowCryptoError(env(),
mark_pop_error_on_return.peekError(),
"EVP_CIPHER_CTX_new");
}

if (cipher.isWrapMode()) {
ctx_.setAllowWrap();
Expand Down
Loading