Skip to content

Commit 09ed002

Browse files
committed
fix: throw exception when EVPKeyPointer::NewRSA() fails
1 parent 34f2531 commit 09ed002

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/crypto/crypto_rsa.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,10 @@ KeyObjectData ImportJWKRsaKey(Environment* env,
440440
}
441441

442442
auto pkey = EVPKeyPointer::NewRSA(std::move(rsa));
443-
if (!pkey) return {};
443+
if (!pkey) {
444+
THROW_ERR_CRYPTO_OPERATION_FAILED(env, "Unable to create key pointer");
445+
return {};
446+
}
444447

445448
return KeyObjectData::CreateAsymmetric(type, std::move(pkey));
446449
}

0 commit comments

Comments
 (0)