X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/54018d95d47e4aff427c4e76f2d952c063ae077b..43536490db8a8c1349aaa7aeeb3c7cc29d9da484:/windows/winplink.c?ds=sidebyside diff --git a/windows/winplink.c b/windows/winplink.c index 9fca63c1..f6596ee3 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -12,7 +12,7 @@ #include "storage.h" #include "tree234.h" -#define WM_AGENT_CALLBACK (WM_XUSER + 4) +#define WM_AGENT_CALLBACK (WM_APP + 4) #define MAX_STDIN_BACKLOG 4096 @@ -94,6 +94,8 @@ void ldisc_update(void *frontend, int echo, int edit) SetConsoleMode(inhandle, mode); } +char *get_ttymode(void *frontend, const char *mode) { return NULL; } + struct input_data { DWORD len; char buffer[4096]; @@ -187,6 +189,25 @@ int from_backend(void *frontend_handle, int is_stderr, return osize + esize; } +int from_backend_untrusted(void *frontend_handle, const char *data, int len) +{ + /* + * No "untrusted" output should get here (the way the code is + * currently, it's all diverted by FLAG_STDERR). + */ + assert(!"Unexpected call to from_backend_untrusted()"); + return 0; /* not reached */ +} + +int get_userpass_input(prompts_t *p, unsigned char *in, int inlen) +{ + int ret; + ret = cmdline_get_passwd_input(p, in, inlen); + if (ret == -1) + ret = console_get_userpass_input(p, in, inlen); + return ret; +} + static DWORD main_thread_id; void agent_schedule_callback(void (*callback)(void *, void *, int), @@ -210,7 +231,8 @@ static void usage(void) printf("Usage: plink [options] [user@]host [command]\n"); printf(" (\"host\" can also be a PuTTY saved session name)\n"); printf("Options:\n"); - printf(" -V print version information\n"); + printf(" -V print version information and exit\n"); + printf(" -pgpfp print PGP key fingerprints and exit\n"); printf(" -v show verbose messages\n"); printf(" -load sessname Load settings from saved session\n"); printf(" -ssh -telnet -rlogin -raw\n"); @@ -282,8 +304,6 @@ int main(int argc, char **argv) int use_subsystem = 0; long now, next; - ssh_get_line = console_get_line; - sklist = NULL; skcount = sksize = 0; /* @@ -339,6 +359,9 @@ int main(int argc, char **argv) use_subsystem = 1; } else if (!strcmp(p, "-V")) { version(); + } else if (!strcmp(p, "-pgpfp")) { + pgp_fingerprints(); + exit(1); } else { fprintf(stderr, "plink: unknown option \"%s\"\n", p); errors = 1; @@ -592,16 +615,16 @@ int main(int argc, char **argv) inhandle = GetStdHandle(STD_INPUT_HANDLE); outhandle = GetStdHandle(STD_OUTPUT_HANDLE); errhandle = GetStdHandle(STD_ERROR_HANDLE); - GetConsoleMode(inhandle, &orig_console_mode); - SetConsoleMode(inhandle, ENABLE_PROCESSED_INPUT); - - main_thread_id = GetCurrentThreadId(); - /* * Turn off ECHO and LINE input modes. We don't care if this * call fails, because we know we aren't necessarily running in * a console. */ + GetConsoleMode(inhandle, &orig_console_mode); + SetConsoleMode(inhandle, ENABLE_PROCESSED_INPUT); + + main_thread_id = GetCurrentThreadId(); + handles[0] = netevent; handles[1] = stdinevent; handles[2] = stdoutevent;