Skip to content

Commit e8c66f9

Browse files
Trottdanielleadams
authored andcommitted
crypto: remove unneeded guard
createCFRGRaw() will always return an object. The error for an undefined return value will never occur. PR-URL: #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>
1 parent c92135a commit e8c66f9

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/internal/crypto/cfrg.js

-2
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ async function cfrgImportKey(
291291
case 'raw': {
292292
verifyAcceptableCfrgKeyUse(name, 'public', usagesSet);
293293
keyObject = createCFRGRawKey(name, keyData, true);
294-
if (keyObject === undefined)
295-
throw lazyDOMException('Unable to import CFRG key', 'OperationError');
296294
break;
297295
}
298296
}

lib/internal/crypto/keys.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ for (const m of [[kKeyEncodingPKCS1, 'pkcs1'], [kKeyEncodingPKCS8, 'pkcs8'],
8585
encodingNames[m[0]] = m[1];
8686

8787
// Creating the KeyObject class is a little complicated due to inheritance
88-
// and that fact that KeyObjects should be transferrable between threads,
88+
// and the fact that KeyObjects should be transferrable between threads,
8989
// which requires the KeyObject base class to be implemented in C++.
9090
// The creation requires a callback to make sure that the NativeKeyObject
9191
// base class cannot exist without the other KeyObject implementations.

0 commit comments

Comments
 (0)