comparison common-kex.c @ 682:4edea9f363d0

Add rough support for choosing ciphers/hashes with "-c" or "-m"
author Matt Johnston <matt@ucc.asn.au>
date Thu, 17 May 2012 00:12:42 +0800
parents 4222a1039b06
children 63f8d6c469cf
comparison
equal deleted inserted replaced
678:6e0899b56ac4 682:4edea9f363d0
104 buf_put_algolist(ses.writepayload, sshkex); 104 buf_put_algolist(ses.writepayload, sshkex);
105 105
106 /* server_host_key_algorithms */ 106 /* server_host_key_algorithms */
107 buf_put_algolist(ses.writepayload, sshhostkey); 107 buf_put_algolist(ses.writepayload, sshhostkey);
108 108
109 /* encryption_algorithms_client_to_server */ 109 #ifdef ENABLE_USER_ALGO_LIST
110 buf_put_algolist(ses.writepayload, sshciphers); 110 if (opts.cipher_list)
111 111 {
112 /* encryption_algorithms_server_to_client */ 112 /* encryption_algorithms_client_to_server */
113 buf_put_algolist(ses.writepayload, sshciphers); 113 buf_putbytes(ses.writepayload, opts.cipher_list, strlen(opts.cipher_list));
114 114 /* encryption_algorithms_server_to_client */
115 /* mac_algorithms_client_to_server */ 115 buf_putbytes(ses.writepayload, opts.cipher_list, strlen(opts.cipher_list));
116 buf_put_algolist(ses.writepayload, sshhashes); 116 }
117 117 else
118 /* mac_algorithms_server_to_client */ 118 #endif
119 buf_put_algolist(ses.writepayload, sshhashes); 119 {
120 /* encryption_algorithms_client_to_server */
121 buf_put_algolist(ses.writepayload, sshciphers);
122 /* encryption_algorithms_server_to_client */
123 buf_put_algolist(ses.writepayload, sshciphers);
124 }
125
126 #ifdef ENABLE_USER_ALGO_LIST
127 if (opts.mac_list)
128 {
129 /* mac_algorithms_client_to_server */
130 buf_putbytes(ses.writepayload, opts.mac_list, strlen(opts.mac_list));
131 /* mac_algorithms_server_to_client */
132 buf_putbytes(ses.writepayload, opts.mac_list, strlen(opts.mac_list));
133 }
134 else
135 #endif
136 {
137 /* mac_algorithms_client_to_server */
138 buf_put_algolist(ses.writepayload, sshhashes);
139 /* mac_algorithms_server_to_client */
140 buf_put_algolist(ses.writepayload, sshhashes);
141 }
142
120 143
121 /* compression_algorithms_client_to_server */ 144 /* compression_algorithms_client_to_server */
122 buf_put_algolist(ses.writepayload, ses.compress_algos); 145 buf_put_algolist(ses.writepayload, ses.compress_algos);
123 146
124 /* compression_algorithms_server_to_client */ 147 /* compression_algorithms_server_to_client */