comparison svr-session.c @ 1546:bb8eaa26bc93 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Mon, 26 Feb 2018 22:44:48 +0800
parents 5916af64acd4 d1a8a05216ff
children 2f64cb3d3007
comparison
equal deleted inserted replaced
1530:63fa53d3b6c7 1546:bb8eaa26bc93
41 #include "runopts.h" 41 #include "runopts.h"
42 #include "crypto_desc.h" 42 #include "crypto_desc.h"
43 #include "fuzz.h" 43 #include "fuzz.h"
44 44
45 static void svr_remoteclosed(void); 45 static void svr_remoteclosed(void);
46 static void svr_algos_initialise(void);
46 47
47 struct serversession svr_ses; /* GLOBAL */ 48 struct serversession svr_ses; /* GLOBAL */
48 49
49 static const packettype svr_packettypes[] = { 50 static const packettype svr_packettypes[] = {
50 {SSH_MSG_CHANNEL_DATA, recv_msg_channel_data}, 51 {SSH_MSG_CHANNEL_DATA, recv_msg_channel_data},
101 svr_ses.server_pid = getpid(); 102 svr_ses.server_pid = getpid();
102 #endif 103 #endif
103 svr_authinitialise(); 104 svr_authinitialise();
104 chaninitialise(svr_chantypes); 105 chaninitialise(svr_chantypes);
105 svr_chansessinitialise(); 106 svr_chansessinitialise();
107 svr_algos_initialise();
106 108
107 /* for logging the remote address */ 109 /* for logging the remote address */
108 get_socket_address(ses.sock_in, NULL, NULL, &host, &port, 0); 110 get_socket_address(ses.sock_in, NULL, NULL, &host, &port, 0);
109 len = strlen(host) + strlen(port) + 2; 111 len = strlen(host) + strlen(port) + 2;
110 svr_ses.addrstring = m_malloc(len); 112 svr_ses.addrstring = m_malloc(len);
252 ses.sock_out = -1; 254 ses.sock_out = -1;
253 dropbear_close("Exited normally"); 255 dropbear_close("Exited normally");
254 256
255 } 257 }
256 258
259 static void svr_algos_initialise(void) {
260 #if DROPBEAR_DH_GROUP1 && DROPBEAR_DH_GROUP1_CLIENTONLY
261 algo_type *algo;
262 for (algo = sshkex; algo->name; algo++) {
263 if (strcmp(algo->name, "diffie-hellman-group1-sha1") == 0) {
264 algo->usable = 0;
265 }
266 }
267 #endif
268 }
269