aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2020-01-26 15:04:54 (GMT)
committerJouni Malinen <j@w1.fi>2020-01-26 15:04:54 (GMT)
commit12da39b389d4b78fd486d5ab607a0a639cbe7c58 (patch)
tree9f4d9ad4d4ffc25e83d796c68df395e50cb392bb /src/crypto
parent07dd83dd77d5a6e6ebb0e3805ca7a9664257ccd5 (diff)
downloadhostap-12da39b389d4b78fd486d5ab607a0a639cbe7c58.zip
hostap-12da39b389d4b78fd486d5ab607a0a639cbe7c58.tar.gz
hostap-12da39b389d4b78fd486d5ab607a0a639cbe7c58.tar.bz2
crypto: Allow up to 10 fragments for hmac_sha*_vector()
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>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/sha256.c6
-rw-r--r--src/crypto/sha384.c6
-rw-r--r--src/crypto/sha512.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/crypto/sha256.c b/src/crypto/sha256.c
index b55e976..17af964 100644
--- a/src/crypto/sha256.c
+++ b/src/crypto/sha256.c
@@ -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).
diff --git a/src/crypto/sha384.c b/src/crypto/sha384.c
index ee136ce..fd84b82 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[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).
diff --git a/src/crypto/sha512.c b/src/crypto/sha512.c
index 66311c3..f60a576 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[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).