mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 12:02:47 -05:00
Try to make our PGP signing more useful:
* All the PuTTY tools for Windows and Unix now contain the fingerprints of the Master Keys. The method for accessing them is crude but universal: a new "-pgpfp" command-line option. (Except Unix PuTTYgen, which takes "--pgpfp" just to be awkward.) * Move the key policy discussion from putty-website/keys.html to putty/doc/pgpkeys.but, and autogenerate the former from the latter. Also tweak the text somewhat and include the fingerprints of the Master Keys themselves. (I've merged the existing autogeneration scripts into a single new one; I've left the old scripts and keys.html around until such time as the webmonster reviews the changes and plumbs in the new script; he should remove the old files then.) [originally from svn r5524] [this svn revision also touched putty-website]
This commit is contained in:
@ -2058,67 +2058,14 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
/*
|
||||
* Find out if Pageant is already running.
|
||||
*/
|
||||
already_running = FALSE;
|
||||
if (agent_exists())
|
||||
already_running = TRUE;
|
||||
else {
|
||||
already_running = agent_exists();
|
||||
|
||||
if (!prev) {
|
||||
wndclass.style = 0;
|
||||
wndclass.lpfnWndProc = WndProc;
|
||||
wndclass.cbClsExtra = 0;
|
||||
wndclass.cbWndExtra = 0;
|
||||
wndclass.hInstance = inst;
|
||||
wndclass.hIcon = LoadIcon(inst, MAKEINTRESOURCE(IDI_MAINICON));
|
||||
wndclass.hCursor = LoadCursor(NULL, IDC_IBEAM);
|
||||
wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
|
||||
wndclass.lpszMenuName = NULL;
|
||||
wndclass.lpszClassName = APPNAME;
|
||||
|
||||
RegisterClass(&wndclass);
|
||||
}
|
||||
|
||||
keylist = NULL;
|
||||
|
||||
hwnd = CreateWindow(APPNAME, APPNAME,
|
||||
WS_OVERLAPPEDWINDOW | WS_VSCROLL,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
100, 100, NULL, NULL, inst, NULL);
|
||||
|
||||
/* Set up a system tray icon */
|
||||
AddTrayIcon(hwnd);
|
||||
|
||||
/* Accelerators used: nsvkxa */
|
||||
systray_menu = CreatePopupMenu();
|
||||
if (putty_path) {
|
||||
session_menu = CreateMenu();
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_PUTTY, "&New Session");
|
||||
AppendMenu(systray_menu, MF_POPUP | MF_ENABLED,
|
||||
(UINT) session_menu, "&Saved Sessions");
|
||||
AppendMenu(systray_menu, MF_SEPARATOR, 0, 0);
|
||||
}
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_VIEWKEYS,
|
||||
"&View Keys");
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_ADDKEY, "Add &Key");
|
||||
AppendMenu(systray_menu, MF_SEPARATOR, 0, 0);
|
||||
if (help_path)
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_HELP, "&Help");
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_ABOUT, "&About");
|
||||
AppendMenu(systray_menu, MF_SEPARATOR, 0, 0);
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_CLOSE, "E&xit");
|
||||
initial_menuitems_count = GetMenuItemCount(session_menu);
|
||||
|
||||
/* Set the default menu item. */
|
||||
SetMenuDefaultItem(systray_menu, IDM_VIEWKEYS, FALSE);
|
||||
|
||||
ShowWindow(hwnd, SW_HIDE);
|
||||
|
||||
/*
|
||||
* Initialise storage for RSA keys.
|
||||
*/
|
||||
/*
|
||||
* Initialise storage for RSA keys.
|
||||
*/
|
||||
if (!already_running) {
|
||||
rsakeys = newtree234(cmpkeys_rsa);
|
||||
ssh2keys = newtree234(cmpkeys_ssh2);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2131,7 +2078,12 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
*/
|
||||
split_into_argv(cmdline, &argc, &argv, &argstart);
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "-c")) {
|
||||
if (!strcmp(argv[i], "-pgpfp")) {
|
||||
pgp_fingerprints();
|
||||
if (advapi)
|
||||
FreeLibrary(advapi);
|
||||
return 1;
|
||||
} else if (!strcmp(argv[i], "-c")) {
|
||||
/*
|
||||
* If we see `-c', then the rest of the
|
||||
* command line should be treated as a
|
||||
@ -2182,6 +2134,56 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!prev) {
|
||||
wndclass.style = 0;
|
||||
wndclass.lpfnWndProc = WndProc;
|
||||
wndclass.cbClsExtra = 0;
|
||||
wndclass.cbWndExtra = 0;
|
||||
wndclass.hInstance = inst;
|
||||
wndclass.hIcon = LoadIcon(inst, MAKEINTRESOURCE(IDI_MAINICON));
|
||||
wndclass.hCursor = LoadCursor(NULL, IDC_IBEAM);
|
||||
wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
|
||||
wndclass.lpszMenuName = NULL;
|
||||
wndclass.lpszClassName = APPNAME;
|
||||
|
||||
RegisterClass(&wndclass);
|
||||
}
|
||||
|
||||
keylist = NULL;
|
||||
|
||||
hwnd = CreateWindow(APPNAME, APPNAME,
|
||||
WS_OVERLAPPEDWINDOW | WS_VSCROLL,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
100, 100, NULL, NULL, inst, NULL);
|
||||
|
||||
/* Set up a system tray icon */
|
||||
AddTrayIcon(hwnd);
|
||||
|
||||
/* Accelerators used: nsvkxa */
|
||||
systray_menu = CreatePopupMenu();
|
||||
if (putty_path) {
|
||||
session_menu = CreateMenu();
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_PUTTY, "&New Session");
|
||||
AppendMenu(systray_menu, MF_POPUP | MF_ENABLED,
|
||||
(UINT) session_menu, "&Saved Sessions");
|
||||
AppendMenu(systray_menu, MF_SEPARATOR, 0, 0);
|
||||
}
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_VIEWKEYS,
|
||||
"&View Keys");
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_ADDKEY, "Add &Key");
|
||||
AppendMenu(systray_menu, MF_SEPARATOR, 0, 0);
|
||||
if (help_path)
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_HELP, "&Help");
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_ABOUT, "&About");
|
||||
AppendMenu(systray_menu, MF_SEPARATOR, 0, 0);
|
||||
AppendMenu(systray_menu, MF_ENABLED, IDM_CLOSE, "E&xit");
|
||||
initial_menuitems_count = GetMenuItemCount(session_menu);
|
||||
|
||||
/* Set the default menu item. */
|
||||
SetMenuDefaultItem(systray_menu, IDM_VIEWKEYS, FALSE);
|
||||
|
||||
ShowWindow(hwnd, SW_HIDE);
|
||||
|
||||
/*
|
||||
* Main message loop.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user