diff options
author | 2007-12-31 15:27:04 +0000 | |
---|---|---|
committer | 2007-12-31 15:27:04 +0000 | |
commit | 28c82e2b48840f1bfdca1e0a279b35bad5e081f0 (patch) | |
tree | 1644ba198d72a4c0583abdd8d774ffa32eaab5dd | |
parent | use OpenBSD rcs id's (diff) | |
download | wireguard-openbsd-28c82e2b48840f1bfdca1e0a279b35bad5e081f0.tar.xz wireguard-openbsd-28c82e2b48840f1bfdca1e0a279b35bad5e081f0.zip |
When in inetd mode, have sshd generate a Protocol 1 ephemeral server
key only for connections where the client chooses Protocol 1 as opposed
to when it's enabled in the server's config. Speeds up Protocol 2
connections to inetd-mode servers that also allow Protocol 1. bz #440,
based on a patch from bruno at wolff.to, ok markus@
-rw-r--r-- | usr.bin/ssh/sshd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 8d547f47b39..3b67e1514e8 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.352 2007/12/27 14:22:08 dtucker Exp $ */ +/* $OpenBSD: sshd.c,v 1.353 2007/12/31 15:27:04 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1506,10 +1506,6 @@ main(int ac, char **av) /* Get a connection, either from inetd or a listening TCP socket */ if (inetd_flag) { server_accept_inetd(&sock_in, &sock_out); - - if ((options.protocol & SSH_PROTO_1) && - sensitive_data.server_key == NULL) - generate_ephemeral_server_key(); } else { server_listen(); @@ -1668,6 +1664,10 @@ main(int ac, char **av) sshd_exchange_identification(sock_in, sock_out); + /* In inetd mode, generate ephemeral key only for proto 1 connections */ + if (!compat20 && inetd_flag && sensitive_data.server_key == NULL) + generate_ephemeral_server_key(); + packet_set_nonblocking(); /* allocate authentication context */ |