mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
2a2620e7c0
commit
0c24b91bd2
1 file changed
+1
-1
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user