X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=windows%2Fwinpgen.c;h=98c2097ebb8400c7957346121e13fdd6b31192e3;hb=7acc0a2aa1377ddd575ab635d364b48fd8686fce;hp=bff5ae874547220e67d0584dcc9e61b3abd0b9f9;hpb=00960d8695e35faf6176f452fa09b5fef7b3d623;p=PuTTY.git diff --git a/windows/winpgen.c b/windows/winpgen.c index bff5ae87..98c2097e 100644 --- a/windows/winpgen.c +++ b/windows/winpgen.c @@ -134,7 +134,7 @@ static void progress_update(void *param, int action, int phase, int iprogress) } } -extern char ver[]; +extern const char ver[]; struct PassphraseProcStruct { char **passphrase; @@ -297,10 +297,12 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, } { + char *buildinfo_text = buildinfo("\r\n"); char *text = dupprintf - ("Pageant\r\n\r\n%s\r\n\r\n%s", - ver, + ("PuTTYgen\r\n\r\n%s\r\n\r\n%s\r\n\r\n%s", + ver, buildinfo_text, "\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved."); + sfree(buildinfo_text); SetDlgItemText(hwnd, 1000, text); sfree(text); } @@ -1515,10 +1517,12 @@ void cleanup_exit(int code) int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) { - int argc; + int argc, i; char **argv; int ret; + dll_hijacking_protection(); + InitCommonControls(); hinst = inst; hwnd = NULL; @@ -1530,36 +1534,24 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) split_into_argv(cmdline, &argc, &argv, NULL); - if (argc > 0) { - if (!strcmp(argv[0], "-pgpfp")) { + for (i = 0; i < argc; i++) { + if (!strcmp(argv[i], "-pgpfp")) { pgp_fingerprints(); - exit(1); + return 1; + } else if (!strcmp(argv[i], "-restrict-acl") || + !strcmp(argv[i], "-restrict_acl") || + !strcmp(argv[i], "-restrictacl")) { + restrict_process_acl(); } else { /* * Assume the first argument to be a private key file, and * attempt to load it. */ - cmdline_keyfile = argv[0]; + cmdline_keyfile = argv[i]; + break; } } -#if !defined UNPROTECT && !defined NO_SECURITY - /* - * Protect our process. - */ - { - char *error = NULL; - if (!setprocessacl(error)) { - char *message = dupprintf("Could not restrict process ACL: %s", - error); - MessageBox(NULL, message, "PuTTYgen Warning", - MB_ICONWARNING | MB_OK); - sfree(message); - sfree(error); - } - } -#endif - random_ref(); ret = DialogBox(hinst, MAKEINTRESOURCE(201), NULL, MainDlgProc) != IDOK;