- ctlposinit(&cp, hwnd, 10, 10, 10);
- bartitle(&cp, "Public and private key generation for PuTTY",
- IDC_TITLE);
- beginbox(&cp, "Key",
- IDC_BOX_KEY, IDC_BOXT_KEY);
- cp2 = cp;
- statictext(&cp2, "No key.", IDC_NOKEY);
- cp2 = cp;
- statictext(&cp2, "",
- IDC_GENERATING);
- progressbar(&cp2, IDC_PROGRESS);
- bigeditctrl(&cp,
- "&Public key for pasting into authorized_keys file:",
- IDC_PKSTATIC, IDC_KEYDISPLAY, 7);
- SendDlgItemMessage(hwnd, IDC_KEYDISPLAY, EM_SETREADONLY, 1, 0);
- staticedit(&cp, "Key fingerprint:", IDC_FPSTATIC,
- IDC_FINGERPRINT, 70);
- SendDlgItemMessage(hwnd, IDC_FINGERPRINT, EM_SETREADONLY, 1, 0);
- staticedit(&cp, "Key &comment:", IDC_COMMENTSTATIC,
- IDC_COMMENTEDIT, 70);
- staticpassedit(&cp, "Key p&assphrase:", IDC_PASSPHRASE1STATIC,
- IDC_PASSPHRASE1EDIT, 70);
- staticpassedit(&cp, "C&onfirm passphrase:", IDC_PASSPHRASE2STATIC,
- IDC_PASSPHRASE2EDIT, 70);
- endbox(&cp);
- beginbox(&cp, "Actions",
- IDC_BOX_ACTIONS, IDC_BOXT_ACTIONS);
- staticbtn(&cp, "Generate a public/private key pair",
- IDC_GENSTATIC, "&Generate", IDC_GENERATE);
- staticbtn(&cp, "Load an existing private key file",
- IDC_LOADSTATIC, "&Load", IDC_LOAD);
- staticbtn(&cp, "Save the generated key to a new file",
- IDC_SAVESTATIC, "&Save", IDC_SAVE);
- endbox(&cp);
- }
- /*
- * Initially, hide the progress bar and the key display,
- * and show the no-key display. Also disable the Save
- * button, because with no key we obviously can't save
- * anything.
- */
- hidemany(hwnd, nokey_ids, FALSE);
- hidemany(hwnd, generating_ids, TRUE);
- hidemany(hwnd, gotkey_ids, TRUE);
- EnableWindow(GetDlgItem(hwnd, IDC_SAVE), 0);
+ ctlposinit(&cp, hwnd, 10, 10, 10);
+ bartitle(&cp, "Public and private key generation for PuTTY",
+ IDC_TITLE);
+ beginbox(&cp, "Key", IDC_BOX_KEY);
+ cp2 = cp;
+ statictext(&cp2, "No key.", IDC_NOKEY);
+ cp2 = cp;
+ statictext(&cp2, "", IDC_GENERATING);
+ progressbar(&cp2, IDC_PROGRESS);
+ bigeditctrl(&cp,
+ "&Public key for pasting into authorized_keys file:",
+ IDC_PKSTATIC, IDC_KEYDISPLAY, 7);
+ SendDlgItemMessage(hwnd, IDC_KEYDISPLAY, EM_SETREADONLY, 1, 0);
+ staticedit(&cp, "Key fingerprint:", IDC_FPSTATIC,
+ IDC_FINGERPRINT, 75);
+ SendDlgItemMessage(hwnd, IDC_FINGERPRINT, EM_SETREADONLY, 1,
+ 0);
+ staticedit(&cp, "Key &comment:", IDC_COMMENTSTATIC,
+ IDC_COMMENTEDIT, 75);
+ staticpassedit(&cp, "Key p&assphrase:", IDC_PASSPHRASE1STATIC,
+ IDC_PASSPHRASE1EDIT, 75);
+ staticpassedit(&cp, "C&onfirm passphrase:",
+ IDC_PASSPHRASE2STATIC, IDC_PASSPHRASE2EDIT, 75);
+ endbox(&cp);
+ beginbox(&cp, "Actions", IDC_BOX_ACTIONS);
+ staticbtn(&cp, "Generate a public/private key pair",
+ IDC_GENSTATIC, "&Generate", IDC_GENERATE);
+ staticbtn(&cp, "Load an existing private key file",
+ IDC_LOADSTATIC, "&Load", IDC_LOAD);
+ staticbtn(&cp, "Save the generated key to a new file",
+ IDC_SAVESTATIC, "&Save", IDC_SAVE);
+ endbox(&cp);
+ beginbox(&cp, "Parameters", IDC_BOX_PARAMS);
+ radioline(&cp, "Type of key to generate:", IDC_TYPESTATIC, 2,
+ "SSH&1 (RSA)", IDC_KEYSSH1,
+ "SSH2 &RSA", IDC_KEYSSH2RSA, NULL);
+ staticedit(&cp, "Number of &bits in a generated key:",
+ IDC_BITSSTATIC, IDC_BITS, 20);
+ endbox(&cp);
+ }
+ CheckRadioButton(hwnd, IDC_KEYSSH1, IDC_KEYSSH2RSA, IDC_KEYSSH1);
+ SetDlgItemInt(hwnd, IDC_BITS, DEFAULT_KEYSIZE, FALSE);
+
+ /*
+ * Initially, hide the progress bar and the key display,
+ * and show the no-key display. Also disable the Save
+ * button, because with no key we obviously can't save
+ * anything.
+ */
+ hidemany(hwnd, nokey_ids, FALSE);
+ hidemany(hwnd, generating_ids, TRUE);
+ hidemany(hwnd, gotkey_ids, TRUE);
+ EnableWindow(GetDlgItem(hwnd, IDC_SAVE), 0);