]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
crypto: Allow up to 10 fragments for hmac_sha*_vector()
authorJouni Malinen <j@w1.fi>
Sun, 26 Jan 2020 15:04:54 +0000 (17:04 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 26 Jan 2020 15:04:54 +0000 (17:04 +0200)
This increases the limit of how many data fragments can be supported
with the internal HMAC implementation. The previous limit was hit with
some FT use cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/crypto/sha256.c
src/crypto/sha384.c
src/crypto/sha512.c

index b55e976f37b01763c95157efc4398543e51ff398..17af964ad049f1efd7a0cac5a877dfa1e766cad7 100644 (file)
@@ -28,10 +28,10 @@ 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[6];
-       size_t _len[6], i;
+       const u8 *_addr[11];
+       size_t _len[11], i;
 
-       if (num_elem > 5) {
+       if (num_elem > 10) {
                /*
                 * Fixed limit on the number of fragments to avoid having to
                 * allocate memory (which could fail).
index ee136ce99b7e9969f08696706a97e28c69bd1f1d..fd84b82b1afac5a95d67813d22606f0dd13743f8 100644 (file)
@@ -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[6];
-       size_t _len[6], i;
+       const u8 *_addr[11];
+       size_t _len[11], i;
 
-       if (num_elem > 5) {
+       if (num_elem > 10) {
                /*
                 * Fixed limit on the number of fragments to avoid having to
                 * allocate memory (which could fail).
index 66311c3739208dafc0b55f8a94c73d469b83372a..f60a5767234626a4fa61dc24d3e05780a0ffb290 100644 (file)
@@ -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[6];
-       size_t _len[6], i;
+       const u8 *_addr[11];
+       size_t _len[11], i;
 
-       if (num_elem > 5) {
+       if (num_elem > 10) {
                /*
                 * Fixed limit on the number of fragments to avoid having to
                 * allocate memory (which could fail).