Implement crypto.subtle.sign/verify with HMAC (#34223)

* Allow importing HMAC keys

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement crypto.subtle.sign with HMAC

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement crypto.subtle.verify with HMAC

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2024-11-11 20:32:51 +01:00 committed by GitHub
parent deddcf2c7a
commit 8d3d7b7403
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 461 additions and 531 deletions

View file

@ -28,6 +28,7 @@ pub enum Handle {
Aes256(Vec<u8>),
Pbkdf2(Vec<u8>),
Hkdf(Vec<u8>),
Hmac(Vec<u8>),
}
/// <https://w3c.github.io/webcrypto/#cryptokey-interface>
@ -150,6 +151,7 @@ impl Handle {
Self::Aes256(bytes) => bytes,
Self::Pbkdf2(bytes) => bytes,
Self::Hkdf(bytes) => bytes,
Self::Hmac(bytes) => bytes,
}
}
}