crypto: remove unneeded guard

createCFRGRaw() will always return an object. The error for an undefined
return value will never occur.

PR-URL: https://github.com/nodejs/node/pull/43856
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Rich Trott authored and Michaël Zasso committed 2022-07-31 18:10:44 +02:00
1 parent 51643323ba
commit 3449472f3d
2 files changed
+1 -3

No files matched your search

-2
View File
@@ -291,8 +291,6 @@ async function cfrgImportKey(
case 'raw': {
verifyAcceptableCfrgKeyUse(name, 'public', usagesSet);
keyObject = createCFRGRawKey(name, keyData, true);
if (keyObject === undefined)
throw lazyDOMException('Unable to import CFRG key', 'OperationError');
break;
}
}
+1 -1
View File
@@ -85,7 +85,7 @@ for (const m of [[kKeyEncodingPKCS1, 'pkcs1'], [kKeyEncodingPKCS8, 'pkcs8'],
encodingNames[m[0]] = m[1];
// Creating the KeyObject class is a little complicated due to inheritance
// and that fact that KeyObjects should be transferrable between threads,
// and the fact that KeyObjects should be transferrable between threads,
// which requires the KeyObject base class to be implemented in C++.
// The creation requires a callback to make sure that the NativeKeyObject
// base class cannot exist without the other KeyObject implementations.