summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-06-18 14:50:44 +1000
committerDamien Miller <djm@mindrot.org>2000-06-18 14:50:44 +1000
commitf6d9e2218998559cb67aad55d3f4a0bf53600c41 (patch)
tree87ea430020c66c697e065c164951b3f74b730b76 /sshconnect.c
parent7b22d65034ac280e0b4eaa857c71b17ee3ad7d99 (diff)
- OpenBSD CVS updates:
- deraadt@cvs.openbsd.org 2000/06/17 09:58:46 [channels.c] everyone says "nix it" (remove protocol 2 debugging message) - markus@cvs.openbsd.org 2000/06/17 13:24:34 [sshconnect.c] allow extended server banners - markus@cvs.openbsd.org 2000/06/17 14:30:10 [sshconnect.c] missing atomicio, typo - jakob@cvs.openbsd.org 2000/06/17 16:52:34 [servconf.c servconf.h session.c sshd.8 sshd_config] add support for ssh v2 subsystems. ok markus@. - deraadt@cvs.openbsd.org 2000/06/17 18:57:48 [readconf.c servconf.c] include = in WHITESPACE; markus ok - markus@cvs.openbsd.org 2000/06/17 19:09:10 [auth2.c] implement bug compatibility with ssh-2.0.13 pubkey, server side - markus@cvs.openbsd.org 2000/06/17 21:00:28 [compat.c] initial support for ssh.com's 2.2.0 - markus@cvs.openbsd.org 2000/06/17 21:16:09 [scp.c] typo - markus@cvs.openbsd.org 2000/06/17 22:05:02 [auth-rsa.c auth2.c serverloop.c session.c auth-options.c auth-options.h] split auth-rsa option parsing into auth-options add options support to authorized_keys2 - markus@cvs.openbsd.org 2000/06/17 22:42:54 [session.c] typo
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/sshconnect.c b/sshconnect.c
index bf00159b3..835ca7b3a 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$OpenBSD: sshconnect.c,v 1.74 2000/05/17 16:57:02 markus Exp $"); 11RCSID("$OpenBSD: sshconnect.c,v 1.76 2000/06/17 20:30:10 markus Exp $");
12 12
13#include <openssl/bn.h> 13#include <openssl/bn.h>
14#include <openssl/dsa.h> 14#include <openssl/dsa.h>
@@ -314,23 +314,28 @@ ssh_exchange_identification()
314 int connection_out = packet_get_connection_out(); 314 int connection_out = packet_get_connection_out();
315 315
316 /* Read other side\'s version identification. */ 316 /* Read other side\'s version identification. */
317 for (i = 0; i < sizeof(buf) - 1; i++) { 317 for (;;) {
318 int len = read(connection_in, &buf[i], 1); 318 for (i = 0; i < sizeof(buf) - 1; i++) {
319 if (len < 0) 319 int len = atomicio(read, connection_in, &buf[i], 1);
320 fatal("ssh_exchange_identification: read: %.100s", strerror(errno)); 320 if (len < 0)
321 if (len != 1) 321 fatal("ssh_exchange_identification: read: %.100s", strerror(errno));
322 fatal("ssh_exchange_identification: Connection closed by remote host"); 322 if (len != 1)
323 if (buf[i] == '\r') { 323 fatal("ssh_exchange_identification: Connection closed by remote host");
324 buf[i] = '\n'; 324 if (buf[i] == '\r') {
325 buf[i + 1] = 0; 325 buf[i] = '\n';
326 continue; /**XXX wait for \n */ 326 buf[i + 1] = 0;
327 continue; /**XXX wait for \n */
328 }
329 if (buf[i] == '\n') {
330 buf[i + 1] = 0;
331 break;
332 }
327 } 333 }
328 if (buf[i] == '\n') { 334 buf[sizeof(buf) - 1] = 0;
329 buf[i + 1] = 0; 335 if (strncmp(buf, "SSH-", 4) == 0)
330 break; 336 break;
331 } 337 debug("ssh_exchange_identification: %s", buf);
332 } 338 }
333 buf[sizeof(buf) - 1] = 0;
334 server_version_string = xstrdup(buf); 339 server_version_string = xstrdup(buf);
335 340
336 /* 341 /*