diff options
author | Colin Watson <cjwatson@debian.org> | 2005-01-04 13:07:27 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2005-01-04 13:07:27 +0000 |
commit | fd0f611b70a83d80fe8793af785542ee5541b7cd (patch) | |
tree | bededd22bb7eeec52e20083237ab7e4113445a16 /ssh-keyscan.c | |
parent | c44fe9a5b9d3db96a7249b04d915f17e4a3a3b04 (diff) | |
parent | ebd2ce335af5861020c79fddb1ae35c03bf036cf (diff) |
Merge 3.9p1 to the trunk.
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r-- | ssh-keyscan.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 770409b86..2f9221605 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "includes.h" | 9 | #include "includes.h" |
10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.47 2004/03/08 09:38:05 djm Exp $"); | 10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.50 2004/08/11 21:44:32 avsm Exp $"); |
11 | 11 | ||
12 | #include "openbsd-compat/sys-queue.h" | 12 | #include "openbsd-compat/sys-queue.h" |
13 | 13 | ||
@@ -49,11 +49,7 @@ int timeout = 5; | |||
49 | int maxfd; | 49 | int maxfd; |
50 | #define MAXCON (maxfd - 10) | 50 | #define MAXCON (maxfd - 10) |
51 | 51 | ||
52 | #ifdef HAVE___PROGNAME | ||
53 | extern char *__progname; | 52 | extern char *__progname; |
54 | #else | ||
55 | char *__progname; | ||
56 | #endif | ||
57 | fd_set *read_wait; | 53 | fd_set *read_wait; |
58 | size_t read_wait_size; | 54 | size_t read_wait_size; |
59 | int ncon; | 55 | int ncon; |
@@ -349,6 +345,7 @@ keygrab_ssh2(con *c) | |||
349 | "ssh-dss": "ssh-rsa"; | 345 | "ssh-dss": "ssh-rsa"; |
350 | c->c_kex = kex_setup(myproposal); | 346 | c->c_kex = kex_setup(myproposal); |
351 | c->c_kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client; | 347 | c->c_kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client; |
348 | c->c_kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client; | ||
352 | c->c_kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; | 349 | c->c_kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; |
353 | c->c_kex->verify_host_key = hostjump; | 350 | c->c_kex->verify_host_key = hostjump; |
354 | 351 | ||
@@ -396,8 +393,8 @@ tcpconnect(char *host) | |||
396 | error("socket: %s", strerror(errno)); | 393 | error("socket: %s", strerror(errno)); |
397 | continue; | 394 | continue; |
398 | } | 395 | } |
399 | if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) | 396 | if (set_nonblock(s) == -1) |
400 | fatal("F_SETFL: %s", strerror(errno)); | 397 | fatal("%s: set_nonblock(%d)", __func__, s); |
401 | if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0 && | 398 | if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0 && |
402 | errno != EINPROGRESS) | 399 | errno != EINPROGRESS) |
403 | error("connect (`%s'): %s", host, strerror(errno)); | 400 | error("connect (`%s'): %s", host, strerror(errno)); |
@@ -497,7 +494,7 @@ congreet(int s) | |||
497 | 494 | ||
498 | bufsiz = sizeof(buf); | 495 | bufsiz = sizeof(buf); |
499 | cp = buf; | 496 | cp = buf; |
500 | while (bufsiz-- && (n = read(s, cp, 1)) == 1 && *cp != '\n') { | 497 | while (bufsiz-- && (n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') { |
501 | if (*cp == '\r') | 498 | if (*cp == '\r') |
502 | *cp = '\n'; | 499 | *cp = '\n'; |
503 | cp++; | 500 | cp++; |
@@ -563,7 +560,7 @@ conread(int s) | |||
563 | congreet(s); | 560 | congreet(s); |
564 | return; | 561 | return; |
565 | } | 562 | } |
566 | n = read(s, c->c_data + c->c_off, c->c_len - c->c_off); | 563 | n = atomicio(read, s, c->c_data + c->c_off, c->c_len - c->c_off); |
567 | if (n < 0) { | 564 | if (n < 0) { |
568 | error("read (%s): %s", c->c_name, strerror(errno)); | 565 | error("read (%s): %s", c->c_name, strerror(errno)); |
569 | confree(s); | 566 | confree(s); |