Skip to content
Permalink
Browse files
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>
  • Loading branch information
Trott authored and danielleadams committed Jul 26, 2022
1 parent c92135a commit e8c66f92a5630f301439735701a8e4ec1eb7dd7d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
@@ -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;
}
}
@@ -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.

0 comments on commit e8c66f9

Please sign in to comment.