mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Fix HMAC operation when hex key has bytes >= 0x80 (#437)
Add test vectors from RFC4231
This commit is contained in:
parent
15fbe5a459
commit
63593f1b6c
2 changed files with 298 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue