summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-01-19 19:52:16 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 09:13:01 +1100
commit091c302829210c41e7f57c3f094c7b9c054306f0 (patch)
tree800de5dc85b877a85d1f269ae5bb09b0dc3fa7a7 /sshd.c
parent4e62cc68ce4ba20245d208b252e74e91d3785b74 (diff)
upstream commit
update packet.c & isolate, introduce struct ssh a) switch packet.c to buffer api and isolate per-connection info into struct ssh b) (de)serialization of the state is moved from monitor to packet.c c) the old packet.c API is implemented in opacket.[ch] d) compress.c/h is removed and integrated into packet.c with and ok djm@
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sshd.c b/sshd.c
index a4611e4d3..e45303988 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.433 2015/01/17 18:53:34 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.434 2015/01/19 19:52:16 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -188,9 +188,6 @@ int num_listen_socks = 0;
188char *client_version_string = NULL; 188char *client_version_string = NULL;
189char *server_version_string = NULL; 189char *server_version_string = NULL;
190 190
191/* for rekeying XXX fixme */
192Kex *xxx_kex;
193
194/* Daemon's agent connection */ 191/* Daemon's agent connection */
195int auth_sock = -1; 192int auth_sock = -1;
196int have_agent = 0; 193int have_agent = 0;
@@ -663,7 +660,7 @@ privsep_preauth(Authctxt *authctxt)
663 /* Set up unprivileged child process to deal with network data */ 660 /* Set up unprivileged child process to deal with network data */
664 pmonitor = monitor_init(); 661 pmonitor = monitor_init();
665 /* Store a pointer to the kex for later rekeying */ 662 /* Store a pointer to the kex for later rekeying */
666 pmonitor->m_pkex = &xxx_kex; 663 pmonitor->m_pkex = &active_state->kex;
667 664
668 if (use_privsep == PRIVSEP_ON) 665 if (use_privsep == PRIVSEP_ON)
669 box = ssh_sandbox_init(pmonitor); 666 box = ssh_sandbox_init(pmonitor);
@@ -2192,8 +2189,7 @@ main(int ac, char **av)
2192 do_authenticated(authctxt); 2189 do_authenticated(authctxt);
2193 2190
2194 /* The connection has been terminated. */ 2191 /* The connection has been terminated. */
2195 packet_get_state(MODE_IN, NULL, NULL, NULL, &ibytes); 2192 packet_get_bytes(&ibytes, &obytes);
2196 packet_get_state(MODE_OUT, NULL, NULL, NULL, &obytes);
2197 verbose("Transferred: sent %llu, received %llu bytes", 2193 verbose("Transferred: sent %llu, received %llu bytes",
2198 (unsigned long long)obytes, (unsigned long long)ibytes); 2194 (unsigned long long)obytes, (unsigned long long)ibytes);
2199 2195
@@ -2505,6 +2501,7 @@ do_ssh2_kex(void)
2505 2501
2506 /* start key exchange */ 2502 /* start key exchange */
2507 kex = kex_setup(myproposal); 2503 kex = kex_setup(myproposal);
2504 active_state->kex = kex;
2508#ifdef WITH_OPENSSL 2505#ifdef WITH_OPENSSL
2509 kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server; 2506 kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server;
2510 kex->kex[KEX_DH_GRP14_SHA1] = kexdh_server; 2507 kex->kex[KEX_DH_GRP14_SHA1] = kexdh_server;
@@ -2521,8 +2518,6 @@ do_ssh2_kex(void)
2521 kex->host_key_index=&get_hostkey_index; 2518 kex->host_key_index=&get_hostkey_index;
2522 kex->sign = sshd_hostkey_sign; 2519 kex->sign = sshd_hostkey_sign;
2523 2520
2524 xxx_kex = kex;
2525
2526 dispatch_run(DISPATCH_BLOCK, &kex->done, kex); 2521 dispatch_run(DISPATCH_BLOCK, &kex->done, kex);
2527 2522
2528 session_id2 = kex->session_id; 2523 session_id2 = kex->session_id;