version 1.70, 2006/11/06 21:25:28 |
version 1.71, 2013/05/17 00:13:14 |
|
|
|
|
/* Try this identity. */ |
/* Try this identity. */ |
debug("Trying RSA authentication via agent with '%.100s'", comment); |
debug("Trying RSA authentication via agent with '%.100s'", comment); |
xfree(comment); |
free(comment); |
|
|
/* Tell the server that we are willing to authenticate using this key. */ |
/* Tell the server that we are willing to authenticate using this key. */ |
packet_start(SSH_CMSG_AUTH_RSA); |
packet_start(SSH_CMSG_AUTH_RSA); |
|
|
*/ |
*/ |
if (type == SSH_SMSG_FAILURE) { |
if (type == SSH_SMSG_FAILURE) { |
debug("Server refused our key."); |
debug("Server refused our key."); |
xfree(comment); |
free(comment); |
return 0; |
return 0; |
} |
} |
/* Otherwise, the server should respond with a challenge. */ |
/* Otherwise, the server should respond with a challenge. */ |
|
|
quit = 1; |
quit = 1; |
} |
} |
memset(passphrase, 0, strlen(passphrase)); |
memset(passphrase, 0, strlen(passphrase)); |
xfree(passphrase); |
free(passphrase); |
if (private != NULL || quit) |
if (private != NULL || quit) |
break; |
break; |
debug2("bad passphrase given, try again..."); |
debug2("bad passphrase given, try again..."); |
} |
} |
} |
} |
/* We no longer need the comment. */ |
/* We no longer need the comment. */ |
xfree(comment); |
free(comment); |
|
|
if (private == NULL) { |
if (private == NULL) { |
if (!options.batch_mode && perm_ok) |
if (!options.batch_mode && perm_ok) |
|
|
packet_check_eom(); |
packet_check_eom(); |
snprintf(prompt, sizeof prompt, "%s%s", challenge, |
snprintf(prompt, sizeof prompt, "%s%s", challenge, |
strchr(challenge, '\n') ? "" : "\nResponse: "); |
strchr(challenge, '\n') ? "" : "\nResponse: "); |
xfree(challenge); |
free(challenge); |
if (i != 0) |
if (i != 0) |
error("Permission denied, please try again."); |
error("Permission denied, please try again."); |
if (options.cipher == SSH_CIPHER_NONE) |
if (options.cipher == SSH_CIPHER_NONE) |
|
|
"Response will be transmitted in clear text."); |
"Response will be transmitted in clear text."); |
response = read_passphrase(prompt, 0); |
response = read_passphrase(prompt, 0); |
if (strcmp(response, "") == 0) { |
if (strcmp(response, "") == 0) { |
xfree(response); |
free(response); |
break; |
break; |
} |
} |
packet_start(SSH_CMSG_AUTH_TIS_RESPONSE); |
packet_start(SSH_CMSG_AUTH_TIS_RESPONSE); |
ssh_put_password(response); |
ssh_put_password(response); |
memset(response, 0, strlen(response)); |
memset(response, 0, strlen(response)); |
xfree(response); |
free(response); |
packet_send(); |
packet_send(); |
packet_write_wait(); |
packet_write_wait(); |
type = packet_read(); |
type = packet_read(); |
|
|
packet_start(SSH_CMSG_AUTH_PASSWORD); |
packet_start(SSH_CMSG_AUTH_PASSWORD); |
ssh_put_password(password); |
ssh_put_password(password); |
memset(password, 0, strlen(password)); |
memset(password, 0, strlen(password)); |
xfree(password); |
free(password); |
packet_send(); |
packet_send(); |
packet_write_wait(); |
packet_write_wait(); |
|
|