Various tweaks to header comments to remind me which bits are meant to be
[u/mdw/putty] / puttygen.c
index e16b4f3..a8945b5 100644 (file)
@@ -1,9 +1,7 @@
 /*
- * PuTTY key generation front end.
+ * PuTTY key generation front end (Windows).
  */
 
-#include <windows.h>
-#include <commctrl.h>
 #include <time.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -12,7 +10,8 @@
 
 #include "putty.h"
 #include "ssh.h"
-#include "winstuff.h"
+
+#include <commctrl.h>
 
 #ifdef MSVC4
 #define ICON_BIG        1
@@ -405,7 +404,7 @@ static void setupbigedit2(HWND hwnd, int id, int idstatic,
     strcpy(p, key->comment);
     SetDlgItemText(hwnd, id, buffer);
     SetDlgItemText(hwnd, idstatic, "&Public key for pasting into "
-                  "OpenSSH authorized_keys2 file:");
+                  "OpenSSH authorized_keys file:");
     sfree(pub_blob);
     sfree(buffer);
 }
@@ -681,14 +680,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 +856,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 +899,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);
@@ -929,7 +928,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
                       IDC_BITSSTATIC, IDC_BITS, 20);
            endbox(&cp);
        }
-       CheckRadioButton(hwnd, IDC_KEYSSH1, IDC_KEYSSH2DSA, IDC_KEYSSH1);
+       CheckRadioButton(hwnd, IDC_KEYSSH1, IDC_KEYSSH2DSA, IDC_KEYSSH2RSA);
        CheckMenuRadioItem(state->keymenu, IDC_KEYSSH1, IDC_KEYSSH2DSA,
                           IDC_KEYSSH1, MF_BYCOMMAND);
        SetDlgItemInt(hwnd, IDC_BITS, DEFAULT_KEYSIZE, FALSE);
@@ -1107,6 +1106,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 +1201,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 +1236,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) {