Commit d07f742c authored by Rusty Russell's avatar Rusty Russell

hkdf_sha256: okm is a void *.

Making arbitrary bytes a uchar* is always a bit nasty for the caller.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 2581e470
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <assert.h> #include <assert.h>
#include <string.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 *s, size_t ssize,
const void *k, size_t ksize, const void *k, size_t ksize,
const void *info, size_t isize) const void *info, size_t isize)
...@@ -83,7 +83,7 @@ void hkdf_sha256(unsigned char *okm, size_t okm_size, ...@@ -83,7 +83,7 @@ void hkdf_sha256(unsigned char *okm, size_t okm_size,
while (okm_size > sizeof(t)) { while (okm_size > sizeof(t)) {
memcpy(okm, &t, sizeof(t)); memcpy(okm, &t, sizeof(t));
okm += sizeof(t); okm = (char *)okm + sizeof(t);
okm_size -= sizeof(t); okm_size -= sizeof(t);
c++; c++;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* @info: pointer to info * @info: pointer to info
* @isize: the number of bytes pointed to by @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 *s, size_t ssize,
const void *k, size_t ksize, const void *k, size_t ksize,
const void *info, size_t isize); const void *info, size_t isize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment