-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Closed
Copy link
Labels
Description
Subsystem
Web Cryptography API
What steps will reproduce the bug?
const kp = await crypto.subtle.generateKey('Ed25519', true, ['sign', 'verify']);
kp.privateKey.usages.pop()
const sig = await crypto.subtle.sign('Ed25519', kp.privateKey, new Uint8Array())
// DOMException [InvalidAccessError]: Unable to use this key to sign
// at signVerify (node:internal/crypto/webcrypto:765:11)
// at SubtleCrypto.sign (node:internal/crypto/webcrypto:811:10)
What is the expected behavior? Why is that the expected behavior?
per the spec, cached copies of the internal slots are returned from these getters and only internal slots are used in the SubtleCrypto operations
What do you see instead?
the actual internal slots are returned, modifying them results in observable changes in behaviour when using the modified CryptoKey