From 37cfec01a2930b0a4290ee552a56b1ab6e71133e Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Mon, 14 Jan 2019 12:54:26 -0800 Subject: [PATCH] crypto: add hmac_sha384 To support OWE group 20, which uses HMAC-SHA384 for hashing the PMK --- src/crypto.c | 7 +++++++ src/crypto.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/crypto.c b/src/crypto.c index 57f202ca..a4a770f9 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -95,6 +95,13 @@ bool hmac_sha256(const void *key, size_t key_len, output, size); } +bool hmac_sha384(const void *key, size_t key_len, + const void *data, size_t data_len, void *output, size_t size) +{ + return hmac_common(L_CHECKSUM_SHA384, key, key_len, data, data_len, + output, size); +} + bool cmac_aes(const void *key, size_t key_len, const void *data, size_t data_len, void *output, size_t size) { diff --git a/src/crypto.h b/src/crypto.h index 8eaff683..50299cb7 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -71,6 +71,8 @@ bool hmac_sha1(const void *key, size_t key_len, const void *data, size_t data_len, void *output, size_t size); bool hmac_sha256(const void *key, size_t key_len, const void *data, size_t data_len, void *output, size_t size); +bool hmac_sha384(const void *key, size_t key_len, + const void *data, size_t data_len, void *output, size_t size); bool cmac_aes(const void *key, size_t key_len, const void *data, size_t data_len, void *output, size_t size);