# HG changeset patch # User Matt Johnston # Date 1124901809 0 # Node ID ad1b24e39bf38851c8abc8ce254c46619d8731cb # Parent 9a9c6d633972fd977f35d853d19fbccf2c6bb0ab Make a variables static - Patch from Andreas Mohr diff -r 9a9c6d633972 -r ad1b24e39bf3 common-algo.c --- a/common-algo.c Fri Jul 29 05:37:20 2005 +0000 +++ b/common-algo.c Wed Aug 24 16:43:29 2005 +0000 @@ -33,19 +33,19 @@ {&cipher_desc, keysize, blocksize} */ #ifdef DROPBEAR_AES128_CBC -const struct dropbear_cipher dropbear_aes128 = +static const struct dropbear_cipher dropbear_aes128 = {&aes_desc, 16, 16}; #endif #ifdef DROPBEAR_BLOWFISH_CBC -const struct dropbear_cipher dropbear_blowfish = +static const struct dropbear_cipher dropbear_blowfish = {&blowfish_desc, 16, 8}; #endif #ifdef DROPBEAR_TWOFISH128_CBC -const struct dropbear_cipher dropbear_twofish128 = +static const struct dropbear_cipher dropbear_twofish128 = {&twofish_desc, 16, 16}; #endif #ifdef DROPBEAR_3DES_CBC -const struct dropbear_cipher dropbear_3des = +static const struct dropbear_cipher dropbear_3des = {&des3_desc, 24, 8}; #endif @@ -57,11 +57,11 @@ {&hash_desc, keysize, hashsize} */ #ifdef DROPBEAR_SHA1_HMAC -const struct dropbear_hash dropbear_sha1 = +static const struct dropbear_hash dropbear_sha1 = {&sha1_desc, 20, 20}; #endif #ifdef DROPBEAR_MD5_HMAC -const struct dropbear_hash dropbear_md5 = +static const struct dropbear_hash dropbear_md5 = {&md5_desc, 16, 16}; #endif diff -r 9a9c6d633972 -r ad1b24e39bf3 common-kex.c --- a/common-kex.c Fri Jul 29 05:37:20 2005 +0000 +++ b/common-kex.c Wed Aug 24 16:43:29 2005 +0000 @@ -35,7 +35,7 @@ #include "random.h" /* diffie-hellman-group1-sha1 value for p */ -const unsigned char dh_p_val[] = { +static const unsigned char dh_p_val[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, 0x02, 0x0B, 0xBE, 0xA6, @@ -47,8 +47,9 @@ 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE6, 0x53, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; +#define DH_P_LEN sizeof(dh_p_val) -const int DH_G_VAL = 2; +static const int DH_G_VAL = 2; static void kexinitialise(); void gen_new_keys(); diff -r 9a9c6d633972 -r ad1b24e39bf3 kex.h --- a/kex.h Fri Jul 29 05:37:20 2005 +0000 +++ b/kex.h Wed Aug 24 16:43:29 2005 +0000 @@ -42,11 +42,6 @@ void send_msg_kexdh_init(); /* client */ void recv_msg_kexdh_reply(); /* client */ -extern const unsigned char dh_p_val[]; -#define DH_P_LEN 128 /* The length of the dh_p_val array */ - -extern const int DH_G_VAL; /* == 2 */ - struct KEXState { unsigned sentkexinit : 1; /*set when we've sent/recv kexinit packet */