From 412fea3ffaa29ad0a1c9457eb5ceeda51b06811e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 29 Jun 2021 11:11:24 -0500 Subject: [PATCH] crypto: Make hkdf_extract take void * This makes it easier to use from unit tests and other places which might be dealing with const char * data. --- src/crypto.c | 4 ++-- src/crypto.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index 6c70eb9a..fe91a0b3 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -770,9 +770,9 @@ bool kdf_sha384(const void *key, size_t key_len, * * Null key equates to a zero key (makes calls in EAP-PWD more convenient) */ -bool hkdf_extract(enum l_checksum_type type, const uint8_t *key, +bool hkdf_extract(enum l_checksum_type type, const void *key, size_t key_len, uint8_t num_args, - uint8_t *out, ...) + void *out, ...) { struct l_checksum *hmac; struct iovec iov[num_args]; diff --git a/src/crypto.h b/src/crypto.h index 89e2402c..65e6c6ef 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -109,8 +109,8 @@ bool prf_sha1(const void *key, size_t key_len, bool prf_plus_sha1(const void *key, size_t key_len, const void *prefix, size_t prefix_len, const void *data, size_t data_len, void *output, size_t size); -bool hkdf_extract(enum l_checksum_type type, const uint8_t *key, size_t key_len, - uint8_t num_args, uint8_t *out, ...); +bool hkdf_extract(enum l_checksum_type type, const void *key, size_t key_len, + uint8_t num_args, void *out, ...); bool hkdf_expand(enum l_checksum_type type, const uint8_t *key, size_t key_len, const char *info, size_t info_len, void *out,