Skip to content

Commit

Permalink
src: fix error handling in ExportJWKAsymmetricKey
Browse files Browse the repository at this point in the history
Because call sites check IsNothing() on the return value of
ExportJWKAsymmetricKey() and ignore the boolean value if the return
value is Just (i.e., not nothing), this function must return Nothing()
instead of Just(false) when throwing a JavaScript error.

PR-URL: #53767
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
tniessen authored and marco-ippolito committed Aug 19, 2024
1 parent 06683bd commit c281dcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/crypto_keys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ Maybe<bool> ExportJWKAsymmetricKey(
case EVP_PKEY_X448: return ExportJWKEdKey(env, key, target);
}
THROW_ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE(env);
return Just(false);
return Nothing<bool>();
}

std::shared_ptr<KeyObjectData> ImportJWKAsymmetricKey(
Expand Down

0 comments on commit c281dcc

Please sign in to comment.