comparison svr-session.c @ 1544:d1a8a05216ff

make group1 client-only
author Matt Johnston <matt@ucc.asn.au>
date Mon, 26 Feb 2018 22:42:53 +0800
parents 0c16b4ccbd54
children bb8eaa26bc93
comparison
equal deleted inserted replaced
1543:016b86f03e21 1544:d1a8a05216ff
40 #include "auth.h" 40 #include "auth.h"
41 #include "runopts.h" 41 #include "runopts.h"
42 #include "crypto_desc.h" 42 #include "crypto_desc.h"
43 43
44 static void svr_remoteclosed(void); 44 static void svr_remoteclosed(void);
45 static void svr_algos_initialise(void);
45 46
46 struct serversession svr_ses; /* GLOBAL */ 47 struct serversession svr_ses; /* GLOBAL */
47 48
48 static const packettype svr_packettypes[] = { 49 static const packettype svr_packettypes[] = {
49 {SSH_MSG_CHANNEL_DATA, recv_msg_channel_data}, 50 {SSH_MSG_CHANNEL_DATA, recv_msg_channel_data},
100 svr_ses.server_pid = getpid(); 101 svr_ses.server_pid = getpid();
101 #endif 102 #endif
102 svr_authinitialise(); 103 svr_authinitialise();
103 chaninitialise(svr_chantypes); 104 chaninitialise(svr_chantypes);
104 svr_chansessinitialise(); 105 svr_chansessinitialise();
106 svr_algos_initialise();
105 107
106 /* for logging the remote address */ 108 /* for logging the remote address */
107 get_socket_address(ses.sock_in, NULL, NULL, &host, &port, 0); 109 get_socket_address(ses.sock_in, NULL, NULL, &host, &port, 0);
108 len = strlen(host) + strlen(port) + 2; 110 len = strlen(host) + strlen(port) + 2;
109 svr_ses.addrstring = m_malloc(len); 111 svr_ses.addrstring = m_malloc(len);
241 ses.sock_out = -1; 243 ses.sock_out = -1;
242 dropbear_close("Exited normally"); 244 dropbear_close("Exited normally");
243 245
244 } 246 }
245 247
248 static void svr_algos_initialise(void) {
249 #if DROPBEAR_DH_GROUP1 && DROPBEAR_DH_GROUP1_CLIENTONLY
250 algo_type *algo;
251 for (algo = sshkex; algo->name; algo++) {
252 if (strcmp(algo->name, "diffie-hellman-group1-sha1") == 0) {
253 algo->usable = 0;
254 }
255 }
256 #endif
257 }
258