From 79fe96155a9486a58c1ce588069975346b4f4a22 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 15 May 2015 10:12:05 +0100 Subject: [PATCH] Const-correctness in struct ssh_hash. The 'bytes' function should take a const void * as input, not a void *. --- ssh.h | 2 +- sshsh256.c | 2 +- sshsh512.c | 2 +- sshsha.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ssh.h b/ssh.h index 1924d9f1..272bc8b9 100644 --- a/ssh.h +++ b/ssh.h @@ -335,7 +335,7 @@ struct ssh_mac { struct ssh_hash { void *(*init)(void); /* also allocates context */ - void (*bytes)(void *, void *, int); + void (*bytes)(void *, const void *, int); void (*final)(void *, unsigned char *); /* also frees context */ int hlen; /* output length in bytes */ char *text_name; diff --git a/sshsh256.c b/sshsh256.c index 76b77efe..b583c9b3 100644 --- a/sshsh256.c +++ b/sshsh256.c @@ -200,7 +200,7 @@ static void *sha256_init(void) return s; } -static void sha256_bytes(void *handle, void *p, int len) +static void sha256_bytes(void *handle, const void *p, int len) { SHA256_State *s = handle; diff --git a/sshsh512.c b/sshsh512.c index b734c735..f0f13510 100644 --- a/sshsh512.c +++ b/sshsh512.c @@ -331,7 +331,7 @@ static void *sha512_init(void) return s; } -static void sha512_bytes(void *handle, void *p, int len) +static void sha512_bytes(void *handle, const void *p, int len) { SHA512_State *s = handle; diff --git a/sshsha.c b/sshsha.c index 4870bba8..4d24e7b2 100644 --- a/sshsha.c +++ b/sshsha.c @@ -230,7 +230,7 @@ static void *sha1_init(void) return s; } -static void sha1_bytes(void *handle, void *p, int len) +static void sha1_bytes(void *handle, const void *p, int len) { SHA_State *s = handle; -- 2.45.2