]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Const-correctness in struct ssh_hash.
authorSimon Tatham <anakin@pobox.com>
Fri, 15 May 2015 09:12:05 +0000 (10:12 +0100)
committerSimon Tatham <anakin@pobox.com>
Fri, 15 May 2015 09:12:05 +0000 (10:12 +0100)
The 'bytes' function should take a const void * as input, not a void *.

ssh.h
sshsh256.c
sshsh512.c
sshsha.c

diff --git a/ssh.h b/ssh.h
index 1924d9f16ee7595d7af7f3bb41061663483119dc..272bc8b94c090a0812b670a9c7e4062a66c2d249 100644 (file)
--- 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;
index 76b77efe2943bbb3eaa4ddabc71f2c6eaa200eb5..b583c9b3f2dd9d4a920fed4112f4878a986d888d 100644 (file)
@@ -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;
 
index b734c735de86516dae71764ef485987f9ce8ee2f..f0f135108142be6594c31f023ac24007e076853a 100644 (file)
@@ -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;
 
index 4870bba86ee2f0e04fb2b5afc33b91f35e552ef0..4d24e7b2652926b9ac25949d83566f550c342576 100644 (file)
--- 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;