Skip to content
Merged
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
Next Next commit
fixup! crypto: validate this in all webcrypto methods and getters
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
panva and aduh95 authored Apr 22, 2022
commit b0b5572ce920b4eee28a930c9a07a899e63b6934
6 changes: 3 additions & 3 deletions lib/internal/crypto/webcrypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ async function deriveKey(
throw lazyDOMException('Unrecognized name.');
}

return subtle.importKey('raw', bits, derivedKeyAlgorithm, extractable, keyUsages);
return this.importKey('raw', bits, derivedKeyAlgorithm, extractable, keyUsages);
Comment thread
panva marked this conversation as resolved.
Outdated
}

async function exportKeySpki(key) {
Expand Down Expand Up @@ -574,7 +574,7 @@ async function importKey(
async function wrapKey(format, key, wrappingKey, algorithm) {
if (this !== subtle) throw new ERR_INVALID_THIS('SubtleCrypto');
algorithm = normalizeAlgorithm(algorithm);
let keyData = await subtle.exportKey(format, key);
let keyData = await this.exportKey(format, key);

if (format === 'jwk') {
if (keyData == null || typeof keyData !== 'object')
Expand Down Expand Up @@ -624,7 +624,7 @@ async function unwrapKey(
}
}

return subtle.importKey(format, keyData, unwrappedKeyAlgo, extractable, keyUsages);
return this.importKey(format, keyData, unwrappedKeyAlgo, extractable, keyUsages);
}

function signVerify(algorithm, key, data, signature) {
Expand Down