From 52746ae793c1407c9b1cb045b2f789f7f4e133ed Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 25 Mar 2016 16:22:57 +0000 Subject: [PATCH] Add some missing 'const' in ssh.c arrays. I noticed this in passing while tinkering with the hostkey_algs array: these arrays are full of pointers-to-const, but are not also themselves declared const, which they should have been all along. --- ssh.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ssh.c b/ssh.c index d03f2967..75515df1 100644 --- a/ssh.c +++ b/ssh.c @@ -421,10 +421,10 @@ const static struct ssh_signkey_with_user_pref_id hostkey_algs[] = { { &ssh_rsa, HK_RSA }, }; -const static struct ssh_mac *macs[] = { +const static struct ssh_mac *const macs[] = { &ssh_hmac_sha256, &ssh_hmac_sha1, &ssh_hmac_sha1_96, &ssh_hmac_md5 }; -const static struct ssh_mac *buggymacs[] = { +const static struct ssh_mac *const buggymacs[] = { &ssh_hmac_sha1_buggy, &ssh_hmac_sha1_96_buggy, &ssh_hmac_md5 }; @@ -451,7 +451,7 @@ const static struct ssh_compress ssh_comp_none = { ssh_comp_none_disable, NULL }; extern const struct ssh_compress ssh_zlib; -const static struct ssh_compress *compressions[] = { +const static struct ssh_compress *const compressions[] = { &ssh_zlib, &ssh_comp_none }; @@ -6312,7 +6312,7 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen, void *our_kexinit; int our_kexinitlen; int kex_init_value, kex_reply_value; - const struct ssh_mac **maclist; + const struct ssh_mac *const *maclist; int nmacs; const struct ssh2_cipher *cscipher_tobe; const struct ssh2_cipher *sccipher_tobe;