GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: align webcrypto RSA key import/export with other implementations · nodejs/node@934077a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/crypto
    • rsa.js
  • test/parallel
    • test-webcrypto-export-import-rsa.js
    • test-webcrypto-rsa-pss-params.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/crypto/rsa.js‎

Copy file name to clipboardExpand all lines: lib/internal/crypto/rsa.js
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,7 @@ async function rsaImportKey(
326326
'NotSupportedError');
327327
}
328328

329-
if (algorithm.name === 'RSA-PSS') {
330-
if (
331-
keyObject.asymmetricKeyType !== 'rsa' &&
332-
keyObject.asymmetricKeyType !== 'rsa-pss'
333-
) {
334-
throw lazyDOMException('Invalid key type', 'DataError');
335-
}
336-
} else if (keyObject.asymmetricKeyType !== 'rsa') {
329+
if (keyObject.asymmetricKeyType !== 'rsa') {
337330
throw lazyDOMException('Invalid key type', 'DataError');
338331
}
339332

Collapse file

‎test/parallel/test-webcrypto-export-import-rsa.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-webcrypto-export-import-rsa.js
-42Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -481,48 +481,6 @@ const testVectors = [
481481
await Promise.all(variations);
482482
})().then(common.mustCall());
483483

484-
{
485-
const publicPem = fixtures.readKey('rsa_pss_public_2048.pem', 'ascii');
486-
const privatePem = fixtures.readKey('rsa_pss_private_2048.pem', 'ascii');
487-
488-
const publicDer = Buffer.from(
489-
publicPem.replace(
490-
/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,
491-
''
492-
),
493-
'base64'
494-
);
495-
const privateDer = Buffer.from(
496-
privatePem.replace(
497-
/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,
498-
''
499-
),
500-
'base64'
501-
);
502-
503-
(async () => {
504-
const key = await subtle.importKey(
505-
'spki',
506-
publicDer,
507-
{ name: 'RSA-PSS', hash: 'SHA-256' },
508-
true,
509-
['verify']);
510-
const jwk = await subtle.exportKey('jwk', key);
511-
assert.strictEqual(jwk.alg, 'PS256');
512-
})().then(common.mustCall());
513-
514-
(async () => {
515-
const key = await subtle.importKey(
516-
'pkcs8',
517-
privateDer,
518-
{ name: 'RSA-PSS', hash: 'SHA-256' },
519-
true,
520-
['sign']);
521-
const jwk = await subtle.exportKey('jwk', key);
522-
assert.strictEqual(jwk.alg, 'PS256');
523-
})().then(common.mustCall());
524-
}
525-
526484
{
527485
const ecPublic = crypto.createPublicKey(
528486
fixtures.readKey('ec_p256_public.pem'));
Collapse file

‎test/parallel/test-webcrypto-rsa-pss-params.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-webcrypto-rsa-pss-params.js
-40Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.