Work towards wish `keyfile-diagnostic'. Many sshpubk.c keyfile-loading
[u/mdw/putty] / puttygen.c
index e16b4f3..3e43b05 100644 (file)
@@ -681,14 +681,14 @@ void load_key_file(HWND hwnd, struct MainDlgState *state,
        if (type == SSH_KEYTYPE_SSH1) {
            if (realtype == type)
                ret = loadrsakey(&filename, &newkey1,
-                                passphrase);
+                                passphrase, NULL);
            else
                ret = import_ssh1(&filename, realtype,
                                  &newkey1, passphrase);
        } else {
            if (realtype == type)
                newkey2 = ssh2_load_userkey(&filename,
-                                           passphrase);
+                                           passphrase, NULL);
            else
                newkey2 = import_ssh2(&filename, realtype,
                                      passphrase);
@@ -857,7 +857,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
            AppendMenu(menu1, MF_ENABLED, IDC_EXPORT_SSHCOM,
                       "Export &ssh.com key");
            AppendMenu(menu, MF_POPUP | MF_ENABLED, (UINT) menu1,
-                      "&Conversions");
+                      "Con&versions");
            state->cvtmenu = menu1;
 
            menu1 = CreateMenu();
@@ -900,7 +900,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
                        "&Public key for pasting into authorized_keys file:",
                        IDC_PKSTATIC, IDC_KEYDISPLAY, 5);
            SendDlgItemMessage(hwnd, IDC_KEYDISPLAY, EM_SETREADONLY, 1, 0);
-           staticedit(&cp, "Key fingerprint:", IDC_FPSTATIC,
+           staticedit(&cp, "Key f&ingerprint:", IDC_FPSTATIC,
                       IDC_FINGERPRINT, 75);
            SendDlgItemMessage(hwnd, IDC_FINGERPRINT, EM_SETREADONLY, 1,
                               0);
@@ -1107,6 +1107,8 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
          case IDC_SAVE:
           case IDC_EXPORT_OPENSSH:
           case IDC_EXPORT_SSHCOM:
+           if (HIWORD(wParam) != BN_CLICKED)
+               break;
            state =
                (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA);
            if (state->key_exists) {
@@ -1200,6 +1202,8 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
            }
            break;
          case IDC_SAVEPUB:
+           if (HIWORD(wParam) != BN_CLICKED)
+               break;
            state =
                (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA);
            if (state->key_exists) {
@@ -1233,6 +1237,8 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
            break;
          case IDC_LOAD:
          case IDC_IMPORT:
+           if (HIWORD(wParam) != BN_CLICKED)
+               break;
            state =
                (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA);
            if (!state->generation_thread_exists) {