]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add some missing 'const' in ssh.c arrays.
authorSimon Tatham <anakin@pobox.com>
Fri, 25 Mar 2016 16:22:57 +0000 (16:22 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 25 Mar 2016 16:32:18 +0000 (16:32 +0000)
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

diff --git a/ssh.c b/ssh.c
index d03f2967523ca40ccf0ffbecce4c0faa2dd6a961..75515df11a4558e77853cc158f0bd150f2622df6 100644 (file)
--- 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;