static int userauth_passwd(struct ssh *ssh) { char *password, *newpass; int authenticated = 0; int change; u_int len, newlen; change = ssh_packet_get_char(ssh); password = ssh_packet_get_string(ssh, &len); if (change) { /* discard new password from packet */ newpass = ssh_packet_get_string(ssh, &newlen); memset(newpass, 0, newlen); xfree(newpass); } ssh_packet_check_eom(ssh); if (change) logit("password change not supported"); else if (PRIVSEP(auth_password(ssh->authctxt, password)) == 1) authenticated = 1; memset(password, 0, len); xfree(password); return authenticated; }
u_int packet_get_char(void) { return (ssh_packet_get_char(active_state)); }