Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! src: refactor SubtleCrypto algorithm and length validations
  • Loading branch information
panva committed Mar 3, 2025
commit a522867af3536046ec99feb11630010f049f946f
4 changes: 2 additions & 2 deletions lib/internal/crypto/mac.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function validateHmacGenerateKeyAlgorithm(algorithm) {
// The Web Crypto spec allows for key lengths that are not multiples of 8. We don't.
if (algorithm.length % 8) {
throw lazyDOMException(
'Unsupported algorith.length',
'Unsupported algorithm.length',
'NotSupportedError');
}
}
Expand Down Expand Up @@ -104,7 +104,7 @@ function validateHmacImportKeyAlgorithm(algorithm) {

// The Web Crypto spec allows for key lengths that are not multiples of 8. We don't.
if (algorithm.length % 8) {
throw lazyDOMException('Unsupported algorith.length', 'NotSupportedError');
throw lazyDOMException('Unsupported algorithm.length', 'NotSupportedError');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-webcrypto-export-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const { subtle } = globalThis.crypto;
length: 1
}, false, ['sign', 'verify']), {
name: 'NotSupportedError',
message: 'Unsupported algorith.length'
message: 'Unsupported algorithm.length'
});
await assert.rejects(
subtle.importKey('jwk', null, {
Expand Down