From babd74ec57f6b3a6f6709d10ec725532deb3ed66 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 19 Jun 2011 13:48:34 +0100 Subject: [PATCH] cleanup: fix up the types of input to hashes to const void* from const uint8_t* It is permissible to pass any object to these functions and expect them to hash it. Signed-off-by: Richard Kettlewell Signed-off-by: Ian Jackson --- md5.c | 2 +- secnet.h | 2 +- sha1.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/md5.c b/md5.c index 9a4dcc3..2e0b9b8 100644 --- a/md5.c +++ b/md5.c @@ -247,7 +247,7 @@ static void *md5_init(void) return ctx; } -static void md5_update(void *sst, uint8_t const *buf, int32_t len) +static void md5_update(void *sst, const void *buf, int32_t len) { struct MD5Context *ctx=sst; diff --git a/secnet.h b/secnet.h index 9cc2205..b60972f 100644 --- a/secnet.h +++ b/secnet.h @@ -438,7 +438,7 @@ struct dh_if { /* HASH interface */ typedef void *hash_init_fn(void); -typedef void hash_update_fn(void *st, uint8_t const *buf, int32_t len); +typedef void hash_update_fn(void *st, const void *buf, int32_t len); typedef void hash_final_fn(void *st, uint8_t *digest); struct hash_if { int32_t len; /* Hash output length in bytes */ diff --git a/sha1.c b/sha1.c index 0bcae87..a0f26e8 100644 --- a/sha1.c +++ b/sha1.c @@ -294,7 +294,7 @@ static void *sha1_init(void) return ctx; } -static void sha1_update(void *sst, uint8_t const *buf, int32_t len) +static void sha1_update(void *sst, const void *buf, int32_t len) { SHA1_CTX *ctx=sst; -- 2.30.2