diff options
Diffstat (limited to 'extensions/crypto/lib.rs')
-rw-r--r-- | extensions/crypto/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/extensions/crypto/lib.rs b/extensions/crypto/lib.rs index 09f237fa6..d1908120d 100644 --- a/extensions/crypto/lib.rs +++ b/extensions/crypto/lib.rs @@ -505,6 +505,11 @@ pub async fn op_crypto_verify_key( .verify(padding, &hashed, &*args.signature) .is_ok() } + Algorithm::Hmac => { + let hash: HmacAlgorithm = args.hash.ok_or_else(not_supported)?.into(); + let key = HmacKey::new(hash, &*args.key.data); + ring::hmac::verify(&key, data, &*args.signature).is_ok() + } _ => return Err(type_error("Unsupported algorithm".to_string())), }; |