FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: fix error handling in ExportJWKAsymmetricKey · nodejs/node@0c24b91 · GitHub

/ node Public

Commit 0c24b91

Browse files
authored andcommitted
src: fix error handling in ExportJWKAsymmetricKey
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 <panva.ip@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 2a2620e commit 0c24b91

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/crypto/crypto_keys.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ Maybe<bool> ExportJWKAsymmetricKey(
505505
case EVP_PKEY_X448: return ExportJWKEdKey(env, key, target);
506506
}
507507
THROW_ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE(env);
508-
return Just(false);
508+
return Nothing<bool>();
509509
}
510510

511511
std::shared_ptr<KeyObjectData> ImportJWKAsymmetricKey(

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL