|
Lines 724-729
userauth_passwd(Authctxt *authctxt)
Link Here
|
| 724 |
static int attempt = 0; |
724 |
static int attempt = 0; |
| 725 |
char prompt[150]; |
725 |
char prompt[150]; |
| 726 |
char *password; |
726 |
char *password; |
|
|
727 |
const char *host = options.host_key_alias ? options.host_key_alias : |
| 728 |
authctxt->host; |
| 727 |
|
729 |
|
| 728 |
if (attempt++ >= options.number_of_password_prompts) |
730 |
if (attempt++ >= options.number_of_password_prompts) |
| 729 |
return 0; |
731 |
return 0; |
|
Lines 732-738
userauth_passwd(Authctxt *authctxt)
Link Here
|
| 732 |
error("Permission denied, please try again."); |
734 |
error("Permission denied, please try again."); |
| 733 |
|
735 |
|
| 734 |
snprintf(prompt, sizeof(prompt), "%.30s@%.128s's password: ", |
736 |
snprintf(prompt, sizeof(prompt), "%.30s@%.128s's password: ", |
| 735 |
authctxt->server_user, authctxt->host); |
737 |
authctxt->server_user, host); |
| 736 |
password = read_passphrase(prompt, 0); |
738 |
password = read_passphrase(prompt, 0); |
| 737 |
packet_start(SSH2_MSG_USERAUTH_REQUEST); |
739 |
packet_start(SSH2_MSG_USERAUTH_REQUEST); |
| 738 |
packet_put_cstring(authctxt->server_user); |
740 |
packet_put_cstring(authctxt->server_user); |
|
Lines 759-764
input_userauth_passwd_changereq(int type
Link Here
|
| 759 |
Authctxt *authctxt = ctxt; |
761 |
Authctxt *authctxt = ctxt; |
| 760 |
char *info, *lang, *password = NULL, *retype = NULL; |
762 |
char *info, *lang, *password = NULL, *retype = NULL; |
| 761 |
char prompt[150]; |
763 |
char prompt[150]; |
|
|
764 |
const char *host = options.host_key_alias ? options.host_key_alias : |
| 765 |
authctxt->host; |
| 762 |
|
766 |
|
| 763 |
debug2("input_userauth_passwd_changereq"); |
767 |
debug2("input_userauth_passwd_changereq"); |
| 764 |
|
768 |
|
|
Lines 779-785
input_userauth_passwd_changereq(int type
Link Here
|
| 779 |
packet_put_char(1); /* additional info */ |
783 |
packet_put_char(1); /* additional info */ |
| 780 |
snprintf(prompt, sizeof(prompt), |
784 |
snprintf(prompt, sizeof(prompt), |
| 781 |
"Enter %.30s@%.128s's old password: ", |
785 |
"Enter %.30s@%.128s's old password: ", |
| 782 |
authctxt->server_user, authctxt->host); |
786 |
authctxt->server_user, host); |
| 783 |
password = read_passphrase(prompt, 0); |
787 |
password = read_passphrase(prompt, 0); |
| 784 |
packet_put_cstring(password); |
788 |
packet_put_cstring(password); |
| 785 |
memset(password, 0, strlen(password)); |
789 |
memset(password, 0, strlen(password)); |
|
Lines 788-794
input_userauth_passwd_changereq(int type
Link Here
|
| 788 |
while (password == NULL) { |
792 |
while (password == NULL) { |
| 789 |
snprintf(prompt, sizeof(prompt), |
793 |
snprintf(prompt, sizeof(prompt), |
| 790 |
"Enter %.30s@%.128s's new password: ", |
794 |
"Enter %.30s@%.128s's new password: ", |
| 791 |
authctxt->server_user, authctxt->host); |
795 |
authctxt->server_user, host); |
| 792 |
password = read_passphrase(prompt, RP_ALLOW_EOF); |
796 |
password = read_passphrase(prompt, RP_ALLOW_EOF); |
| 793 |
if (password == NULL) { |
797 |
if (password == NULL) { |
| 794 |
/* bail out */ |
798 |
/* bail out */ |
|
Lines 796-802
input_userauth_passwd_changereq(int type
Link Here
|
| 796 |
} |
800 |
} |
| 797 |
snprintf(prompt, sizeof(prompt), |
801 |
snprintf(prompt, sizeof(prompt), |
| 798 |
"Retype %.30s@%.128s's new password: ", |
802 |
"Retype %.30s@%.128s's new password: ", |
| 799 |
authctxt->server_user, authctxt->host); |
803 |
authctxt->server_user, host); |
| 800 |
retype = read_passphrase(prompt, 0); |
804 |
retype = read_passphrase(prompt, 0); |
| 801 |
if (strcmp(password, retype) != 0) { |
805 |
if (strcmp(password, retype) != 0) { |
| 802 |
memset(password, 0, strlen(password)); |
806 |
memset(password, 0, strlen(password)); |