summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-07 15:38:31 +1100
committerDamien Miller <djm@mindrot.org>1999-12-07 15:38:31 +1100
commit037a0dc0835bb5a442bdcbeecdd5baed723f0b45 (patch)
treed02954d57ac437fd036e3e9544f24559ca8f0f0f /sshconnect.c
parenteabf3417bc73ca9546a3ed489cd809ffdf303853 (diff)
- Merged more OpenBSD changes:
- [atomicio.c authfd.c scp.c serverloop.c ssh.h sshconnect.c sshd.c] move atomicio into it's own file. wrap all socket write()s which were doing write(sock, buf, len) != len, with atomicio() calls. - [auth-skey.c] fd leak - [authfile.c] properly name fd variable - [channels.c] display great hatred towards strcpy - [pty.c pty.h sshd.c] use openpty() if it exists (it does on BSD4_4) - [tildexpand.c] check for ~ expansion past MAXPATHLEN - Modified helper.c to use new atomicio function. - Reformat Makefile a little - Moved RC4 routines from rc4.[ch] into helper.c - Added autoconf code to detect /dev/ptmx (Solaris) and /dev/ptc (AIX)
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sshconnect.c b/sshconnect.c
index 593eade03..e6175f11b 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$Id: sshconnect.c,v 1.16 1999/12/06 00:47:29 damien Exp $"); 11RCSID("$Id: sshconnect.c,v 1.17 1999/12/07 04:38:32 damien Exp $");
12 12
13#ifdef HAVE_OPENSSL 13#ifdef HAVE_OPENSSL
14#include <openssl/bn.h> 14#include <openssl/bn.h>
@@ -537,7 +537,7 @@ try_rsa_authentication(const char *authfile)
537 if (!load_private_key(authfile, "", private_key, NULL)) { 537 if (!load_private_key(authfile, "", private_key, NULL)) {
538 char buf[300]; 538 char buf[300];
539 snprintf(buf, sizeof buf, "Enter passphrase for RSA key '%.100s': ", 539 snprintf(buf, sizeof buf, "Enter passphrase for RSA key '%.100s': ",
540 comment); 540 comment);
541 if (!options.batch_mode) 541 if (!options.batch_mode)
542 passphrase = read_passphrase(buf, 0); 542 passphrase = read_passphrase(buf, 0);
543 else { 543 else {
@@ -1036,8 +1036,8 @@ ssh_exchange_identification()
1036 1036
1037 /* Send our own protocol version identification. */ 1037 /* Send our own protocol version identification. */
1038 snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", 1038 snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n",
1039 PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION); 1039 PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION);
1040 if (write(connection_out, buf, strlen(buf)) != strlen(buf)) 1040 if (atomicio(write, connection_out, buf, strlen(buf)) != strlen(buf))
1041 fatal("write: %.100s", strerror(errno)); 1041 fatal("write: %.100s", strerror(errno));
1042} 1042}
1043 1043
@@ -1292,10 +1292,10 @@ ssh_login(int host_key_valid,
1292 char prompt[1024]; 1292 char prompt[1024];
1293 char *fp = fingerprint(host_key->e, host_key->n); 1293 char *fp = fingerprint(host_key->e, host_key->n);
1294 snprintf(prompt, sizeof(prompt), 1294 snprintf(prompt, sizeof(prompt),
1295 "The authenticity of host '%.200s' can't be established.\n" 1295 "The authenticity of host '%.200s' can't be established.\n"
1296 "Key fingerprint is %d %s.\n" 1296 "Key fingerprint is %d %s.\n"
1297 "Are you sure you want to continue connecting (yes/no)? ", 1297 "Are you sure you want to continue connecting (yes/no)? ",
1298 host, BN_num_bits(host_key->n), fp); 1298 host, BN_num_bits(host_key->n), fp);
1299 if (!read_yes_or_no(prompt, -1)) 1299 if (!read_yes_or_no(prompt, -1))
1300 fatal("Aborted by user!\n"); 1300 fatal("Aborted by user!\n");
1301 } 1301 }
@@ -1599,8 +1599,9 @@ ssh_login(int host_key_valid,
1599 if ((supported_authentications & (1 << SSH_AUTH_PASSWORD)) && 1599 if ((supported_authentications & (1 << SSH_AUTH_PASSWORD)) &&
1600 options.password_authentication && !options.batch_mode) { 1600 options.password_authentication && !options.batch_mode) {
1601 char prompt[80]; 1601 char prompt[80];
1602
1602 snprintf(prompt, sizeof(prompt), "%.30s@%.40s's password: ", 1603 snprintf(prompt, sizeof(prompt), "%.30s@%.40s's password: ",
1603 server_user, host); 1604 server_user, host);
1604 if (try_password_authentication(prompt)) 1605 if (try_password_authentication(prompt))
1605 return; 1606 return;
1606 } 1607 }