Skip to content
Open
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
6 changes: 6 additions & 0 deletions src/crypto/crypto_x509.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,12 @@ MaybeLocal<Object> GetPubKey(Environment* env, const ncrypto::Rsa& rsa) {
}

MaybeLocal<Value> GetModulusString(Environment* env, const BIGNUM* n) {
// FIX: Reject non-positive modulus (zero or negative)
// Addresses issue #63824
if (n == nullptr || BN_is_zero(n) || BN_is_negative(n)) {
return Undefined(env->isolate());
}

auto bio = BIOPointer::New(n);
if (!bio) [[unlikely]]
return {};
Expand Down
Loading