handleMSG_USERAUTH_FAILURE method

void handleMSG_USERAUTH_FAILURE(
  1. MSG_USERAUTH_FAILURE msg
)

If key authentication failed, then try password authentication.

Implementation

void handleMSG_USERAUTH_FAILURE(MSG_USERAUTH_FAILURE msg) {
  if (tracePrint != null) {
    tracePrint(
        '$hostport: MSG_USERAUTH_FAILURE: auth_left="${msg.authLeft}" loadedPw=$loadedPw useauthFail=$userauthFail');
  }
  if (!loadedPw) clearPassword();
  userauthFail++;
  if (userauthFail == 1 && !wrotePw) {
    response(this, 'Password:');
    passwordPrompts = 1;
    getThenSendPassword();
  } else {
    throw FormatException('$hostport: authorization failed');
  }
}