From 4c079dcc64daa8d64a7252bfc3ba9a7cf7654773 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 24 Aug 2023 17:56:23 +0300 Subject: [PATCH] Increment hmac_sha*_vector() maximum num_elem value to 25 This is needed for FTE MIC calculation for Reassociation Request frmae when using MLO which could add 15 link addresses into the input data. Signed-off-by: Jouni Malinen --- src/crypto/sha256.c | 6 +++--- src/crypto/sha384.c | 6 +++--- src/crypto/sha512.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/crypto/sha256.c b/src/crypto/sha256.c index 1ad106864..8e57efc01 100644 --- a/src/crypto/sha256.c +++ b/src/crypto/sha256.c @@ -28,11 +28,11 @@ int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem, { unsigned char k_pad[64]; /* padding - key XORd with ipad/opad */ unsigned char tk[32]; - const u8 *_addr[11]; - size_t _len[11], i; + const u8 *_addr[26]; + size_t _len[26], i; int ret; - if (num_elem > 10) { + if (num_elem > 25) { /* * Fixed limit on the number of fragments to avoid having to * allocate memory (which could fail). diff --git a/src/crypto/sha384.c b/src/crypto/sha384.c index fd84b82b1..8fd69e2d8 100644 --- a/src/crypto/sha384.c +++ b/src/crypto/sha384.c @@ -28,10 +28,10 @@ int hmac_sha384_vector(const u8 *key, size_t key_len, size_t num_elem, { unsigned char k_pad[128]; /* padding - key XORd with ipad/opad */ unsigned char tk[48]; - const u8 *_addr[11]; - size_t _len[11], i; + const u8 *_addr[26]; + size_t _len[26], i; - if (num_elem > 10) { + if (num_elem > 25) { /* * Fixed limit on the number of fragments to avoid having to * allocate memory (which could fail). diff --git a/src/crypto/sha512.c b/src/crypto/sha512.c index f60a57672..d0b123fb6 100644 --- a/src/crypto/sha512.c +++ b/src/crypto/sha512.c @@ -28,10 +28,10 @@ int hmac_sha512_vector(const u8 *key, size_t key_len, size_t num_elem, { unsigned char k_pad[128]; /* padding - key XORd with ipad/opad */ unsigned char tk[64]; - const u8 *_addr[11]; - size_t _len[11], i; + const u8 *_addr[26]; + size_t _len[26], i; - if (num_elem > 10) { + if (num_elem > 25) { /* * Fixed limit on the number of fragments to avoid having to * allocate memory (which could fail). -- 2.47.2