MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / authenticate_kbinteractive

Method authenticate_kbinteractive

src/FTPClientWrapperSSH.cpp:607–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607int FTPClientWrapperSSH::authenticate_kbinteractive(ssh_session session) {
608 int rc;
609
610 KBIntDialog kbdlg;
611
612 rc = ssh_userauth_kbdint(session, NULL, NULL);
613 int i = 0; //upper bound on challenges, it has got to end at some point
614 while (rc == SSH_AUTH_INFO && i < 10) {
615 int res = kbdlg.Create(_MainOutputWindow, session);
616 if (res == -1) {
617 OutErr("[SFTP] Error creating interactive dialog");
618 return SSH_AUTH_ERROR;
619 } else if (res != 1 && res != 0) { //1: Gave answer, 0: No input required
620 OutMsg("[SFTP] Keyboard interactive authentication cancelled.");
621 return SSH_AUTH_ERROR;
622 }
623 rc = ssh_userauth_kbdint(session, NULL, NULL);
624 i++;
625 }
626
627 if (rc == SSH_AUTH_DENIED) {
628 OutMsg("[SFTP] Keyboard interactive authentication denied.");
629 }
630
631 return rc;
632}
633
634int FTPClientWrapperSSH::verify_knownhost(ssh_session session) {
635 int state, rc;

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.45

Tested by

no test coverage detected