mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Fix HMAC operation when hex key has bytes >= 0x80 (#437)
Add test vectors from RFC4231
This commit is contained in:
@@ -72,7 +72,7 @@ class HMAC extends Operation {
|
||||
msg = Utils.arrayBufferToStr(input, false),
|
||||
hasher = CryptoApi.getHasher(hashFunc);
|
||||
|
||||
const mac = CryptoApi.getHmac(CryptoApi.encoder.fromUtf(key), hasher);
|
||||
const mac = CryptoApi.getHmac(key, hasher);
|
||||
mac.update(msg);
|
||||
return CryptoApi.encoder.toHex(mac.finalize());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user