diff options
author | Mattias Andrée <maandree@kth.se> | 2024-09-04 21:41:59 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-09-04 21:41:59 +0200 |
commit | 1a9ebda1a5294e91db3015d4536ce36f62ec7058 (patch) | |
tree | bc7118da36d7aadb25aab4feee8c460abf4148e8 /libhashsum_init_hasher_from_string.c | |
parent | Fix and test BLAKE2 support (diff) | |
download | libhashsum-1a9ebda1a5294e91db3015d4536ce36f62ec7058.tar.gz libhashsum-1a9ebda1a5294e91db3015d4536ce36f62ec7058.tar.bz2 libhashsum-1a9ebda1a5294e91db3015d4536ce36f62ec7058.tar.xz |
Add more BLAKE2 tests and fix keyed BLAKE2 support in libhashsum_init_hasher_from_string
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libhashsum_init_hasher_from_string.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libhashsum_init_hasher_from_string.c b/libhashsum_init_hasher_from_string.c index ffd23eb..e7a26d0 100644 --- a/libhashsum_init_hasher_from_string.c +++ b/libhashsum_init_hasher_from_string.c @@ -256,7 +256,10 @@ next: if (*p++ != ']' || *p) goto einval; - r = initfunc(this, n, salti ? salt : NULL, pepperi ? pepper : NULL, key, keyi); + if (keyi > SIZE_MAX / 8U) + goto einval; + + r = initfunc(this, n, salti ? salt : NULL, pepperi ? pepper : NULL, key, keyi * 8U); free(key); return r; |