X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwindlg.c;h=17327866edb44d132a24f3c202044badb158aec4;hb=1de7240eb88fa24a8532ded116b4ec72dd213008;hp=61ba9ad1a0e2abfa7551643172bddd53a15f4bd9;hpb=442627408fc562f99c90a306ef66a652fca5b55b;p=PuTTY.git diff --git a/windows/windlg.c b/windows/windlg.c index 61ba9ad1..17327866 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -67,8 +67,8 @@ void force_normal(HWND hwnd) recurse = 0; } -static int CALLBACK LogProc(HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK LogProc(HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam) { int i; @@ -162,8 +162,8 @@ static int CALLBACK LogProc(HWND hwnd, UINT msg, return 0; } -static int CALLBACK LicenceProc(HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: @@ -189,8 +189,8 @@ static int CALLBACK LicenceProc(HWND hwnd, UINT msg, return 0; } -static int CALLBACK AboutProc(HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam) { char *str; @@ -291,8 +291,8 @@ static void SaneEndDialog(HWND hwnd, int ret) /* * Null dialog procedure. */ -static int CALLBACK NullDlgProc(HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK NullDlgProc(HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam) { return 0; } @@ -375,8 +375,8 @@ static void create_controls(HWND hwnd, char *path) * (Being a dialog procedure, in general it returns 0 if the default * dialog processing should be performed, and 1 if it should not.) */ -static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam) { HWND hw, treeview; struct treeview_faff tvfaff; @@ -513,6 +513,7 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg, * And create the actual control set for that panel, to * match the initial treeview selection. */ + assert(firstpath); /* config.c must have given us _something_ */ create_controls(hwnd, firstpath); dlg_refresh(NULL, &dp); /* and set up control values */ } @@ -785,8 +786,8 @@ void showabout(HWND hwnd) DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd, AboutProc); } -int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype, - char *keystr, char *fingerprint, +int verify_ssh_host_key(void *frontend, char *host, int port, + const char *keytype, char *keystr, char *fingerprint, void (*callback)(void *ctx, int result), void *ctx) { int ret; @@ -894,6 +895,33 @@ int askalg(void *frontend, const char *algtype, const char *algname, return 0; } +int askhk(void *frontend, const char *algname, const char *betteralgs, + void (*callback)(void *ctx, int result), void *ctx) +{ + static const char mbtitle[] = "%s Security Alert"; + static const char msg[] = + "The first host key type we have stored for this server\n" + "is %s, which is below the configured warning threshold.\n" + "The server also provides the following types of host key\n" + "above the threshold, which we do not have stored:\n" + "%s\n" + "Do you want to continue with this connection?\n"; + char *message, *title; + int mbret; + + message = dupprintf(msg, algname, betteralgs); + title = dupprintf(mbtitle, appname); + mbret = MessageBox(NULL, message, title, + MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2); + socket_reselect_all(); + sfree(message); + sfree(title); + if (mbret == IDYES) + return 1; + else + return 0; +} + /* * Ask whether to wipe a session log file before writing to it. * Returns 2 for wipe, 1 for append, 0 for cancel (don't log).