/** * Returns {@code true} if the associated {@link PasswordFinder} tells that we should retry with a new password that * it will supply. */ @Override public boolean shouldRetry() { AccountResource accountResource = makeAccountResource(); return newPasswordProvider.shouldRetry(accountResource) || pwdf.shouldRetry(accountResource); }
@Override public void handle(Message cmd, SSHPacket buf) throws UserAuthException, TransportException { if (cmd == Message.USERAUTH_60 && newPasswordProvider != null) { log.info("Received SSH_MSG_USERAUTH_PASSWD_CHANGEREQ."); try { String prompt = buf.readString(); buf.readString(); // lang-tag AccountResource resource = makeAccountResource(); char[] newPassword = newPasswordProvider.provideNewPassword(resource, prompt); SSHPacket sshPacket = super.buildReq().putBoolean(true).putSensitiveString(pwdf.reqPassword(resource)).putSensitiveString(newPassword); params.getTransport().write(sshPacket); } catch (Buffer.BufferException e) { throw new TransportException(e); } } else if (cmd == Message.USERAUTH_60) { throw new UserAuthException("Password change request received; unsupported operation (newPassword was 'null')"); } else { super.handle(cmd, buf); } }
@Override public void handle(Message cmd, SSHPacket buf) throws UserAuthException, TransportException { if (cmd == Message.USERAUTH_60 && newPasswordProvider != null) { log.info("Received SSH_MSG_USERAUTH_PASSWD_CHANGEREQ."); try { String prompt = buf.readString(); buf.readString(); // lang-tag AccountResource resource = makeAccountResource(); char[] newPassword = newPasswordProvider.provideNewPassword(resource, prompt); SSHPacket sshPacket = super.buildReq().putBoolean(true).putSensitiveString(pwdf.reqPassword(resource)).putSensitiveString(newPassword); params.getTransport().write(sshPacket); } catch (Buffer.BufferException e) { throw new TransportException(e); } } else if (cmd == Message.USERAUTH_60) { throw new UserAuthException("Password change request received; unsupported operation (newPassword was 'null')"); } else { super.handle(cmd, buf); } }
/** * Returns {@code true} if the associated {@link PasswordFinder} tells that we should retry with a new password that * it will supply. */ @Override public boolean shouldRetry() { AccountResource accountResource = makeAccountResource(); return newPasswordProvider.shouldRetry(accountResource) || pwdf.shouldRetry(accountResource); }