Skip to content

Commit

Permalink
hkdf_sha256: okm is a void *.
Browse files Browse the repository at this point in the history
Making arbitrary bytes a uchar* is always a bit nasty for the caller.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Dec 5, 2016
1 parent 2581e47 commit d07f742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ccan/crypto/hkdf_sha256/hkdf_sha256.c
Expand Up @@ -4,7 +4,7 @@
#include <assert.h>
#include <string.h>

void hkdf_sha256(unsigned char *okm, size_t okm_size,
void hkdf_sha256(void *okm, size_t okm_size,
const void *s, size_t ssize,
const void *k, size_t ksize,
const void *info, size_t isize)
Expand Down Expand Up @@ -83,7 +83,7 @@ void hkdf_sha256(unsigned char *okm, size_t okm_size,

while (okm_size > sizeof(t)) {
memcpy(okm, &t, sizeof(t));
okm += sizeof(t);
okm = (char *)okm + sizeof(t);
okm_size -= sizeof(t);

c++;
Expand Down
2 changes: 1 addition & 1 deletion ccan/crypto/hkdf_sha256/hkdf_sha256.h
Expand Up @@ -15,7 +15,7 @@
* @info: pointer to info
* @isize: the number of bytes pointed to by @info
*/
void hkdf_sha256(unsigned char *okm, size_t okm_size,
void hkdf_sha256(void *okm, size_t okm_size,
const void *s, size_t ssize,
const void *k, size_t ksize,
const void *info, size_t isize);
Expand Down

0 comments on commit d07f742

Please sign in to comment.