version 1.44, 1999/12/01 16:51:19 |
version 1.45, 1999/12/06 20:15:30 |
|
|
if (!load_private_key(authfile, "", private_key, NULL)) { |
if (!load_private_key(authfile, "", private_key, NULL)) { |
char buf[300]; |
char buf[300]; |
snprintf(buf, sizeof buf, "Enter passphrase for RSA key '%.100s': ", |
snprintf(buf, sizeof buf, "Enter passphrase for RSA key '%.100s': ", |
comment); |
comment); |
if (!options.batch_mode) |
if (!options.batch_mode) |
passphrase = read_passphrase(buf, 0); |
passphrase = read_passphrase(buf, 0); |
else { |
else { |
|
|
|
|
/* Send our own protocol version identification. */ |
/* Send our own protocol version identification. */ |
snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", |
snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", |
PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION); |
PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION); |
if (write(connection_out, buf, strlen(buf)) != strlen(buf)) |
if (atomicio(write, connection_out, buf, strlen(buf)) != strlen(buf)) |
fatal("write: %.100s", strerror(errno)); |
fatal("write: %.100s", strerror(errno)); |
} |
} |
|
|
|
|
char prompt[1024]; |
char prompt[1024]; |
char *fp = fingerprint(host_key->e, host_key->n); |
char *fp = fingerprint(host_key->e, host_key->n); |
snprintf(prompt, sizeof(prompt), |
snprintf(prompt, sizeof(prompt), |
"The authenticity of host '%.200s' can't be established.\n" |
"The authenticity of host '%.200s' can't be established.\n" |
"Key fingerprint is %d %s.\n" |
"Key fingerprint is %d %s.\n" |
"Are you sure you want to continue connecting (yes/no)? ", |
"Are you sure you want to continue connecting (yes/no)? ", |
host, BN_num_bits(host_key->n), fp); |
host, BN_num_bits(host_key->n), fp); |
if (!read_yes_or_no(prompt, -1)) |
if (!read_yes_or_no(prompt, -1)) |
fatal("Aborted by user!\n"); |
fatal("Aborted by user!\n"); |
} |
} |
|
|
if ((supported_authentications & (1 << SSH_AUTH_PASSWORD)) && |
if ((supported_authentications & (1 << SSH_AUTH_PASSWORD)) && |
options.password_authentication && !options.batch_mode) { |
options.password_authentication && !options.batch_mode) { |
char prompt[80]; |
char prompt[80]; |
|
|
snprintf(prompt, sizeof(prompt), "%.30s@%.40s's password: ", |
snprintf(prompt, sizeof(prompt), "%.30s@%.40s's password: ", |
server_user, host); |
server_user, host); |
if (try_password_authentication(prompt)) |
if (try_password_authentication(prompt)) |
return; |
return; |
} |
} |