143 |
static int |
static int |
144 |
check_crypto_engine (void) |
check_crypto_engine (void) |
145 |
{ |
{ |
146 |
int ma=1, mi=2, pa=4; /* GPG 1.2.4 */ |
int ma=1, mi=4, pa=0; /* GPG 1.4.0 */ |
147 |
int rc; |
int rc; |
148 |
|
|
149 |
rc = check_gnupg_engine (&ma, &mi, &pa); |
rc = check_gnupg_engine (&ma, &mi, &pa); |
154 |
else if (rc) { |
else if (rc) { |
155 |
log_box (_("WinPT Error"), MB_ERR, |
log_box (_("WinPT Error"), MB_ERR, |
156 |
_("Sorry, you need a newer GPG version.\n" |
_("Sorry, you need a newer GPG version.\n" |
157 |
"GPG version %d.%d.%d requred GPG version 1.2.4"), |
"GPG version %d.%d.%d required GPG version 1.4.0"), |
158 |
ma, mi, pa); |
ma, mi, pa); |
159 |
return rc; |
return rc; |
160 |
} |
} |
219 |
int first_start = 0, start_gpgprefs = 0; |
int first_start = 0, start_gpgprefs = 0; |
220 |
const char * s; |
const char * s; |
221 |
MSG msg; |
MSG msg; |
222 |
HWND hwnd; |
HWND hwnd = NULL; |
223 |
|
|
224 |
glob_hinst = hinst; |
glob_hinst = hinst; |
225 |
|
|
243 |
return 0; |
return 0; |
244 |
} |
} |
245 |
|
|
246 |
if (cmdline && stristr (cmdline, "--mobile")) |
if (cmdline && stristr (cmdline, "--mobile")) { |
247 |
|
msg_box (NULL, "WARNING: mobile modus is not fully implemented yet!", |
248 |
|
"WinPT", MB_INFO); |
249 |
mobile = 1; |
mobile = 1; |
250 |
|
} |
251 |
|
|
252 |
set_default_kserver (); |
set_default_kserver (); |
253 |
|
|
444 |
return 0; |
return 0; |
445 |
} |
} |
446 |
} |
} |
447 |
|
|
448 |
if (start_gpgprefs) |
if (start_gpgprefs) { |
|
{ |
|
449 |
char *ring; |
char *ring; |
450 |
size_t size = 0; |
size_t size = 0; |
451 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
457 |
} |
} |
458 |
|
|
459 |
if (first_start) { |
if (first_start) { |
460 |
struct key_wizard_s c, dummy; |
struct first_start_s fs; |
461 |
|
struct genkey_s c; |
462 |
|
HWND h; |
463 |
start: |
start: |
464 |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_FIRST, hwnd, |
h = GetDesktopWindow (); |
465 |
first_run_dlg_proc, (LPARAM)&dummy); |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, h, |
466 |
switch (dummy.interactive) |
gpgprefs_dlg_proc, NULL); |
467 |
{ |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_FIRST, h, |
468 |
|
first_run_dlg_proc, (LPARAM)&fs); |
469 |
|
switch (fs.choice) { |
470 |
case SETUP_KEYGEN: |
case SETUP_KEYGEN: |
471 |
c.interactive = 1; |
c.interactive = 1; |
472 |
|
c.first_start = 1; |
473 |
rc = DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYWIZARD, |
rc = DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYWIZARD, |
474 |
hwnd, keygen_wizard_dlg_proc, (LPARAM)&c); |
h, keygen_wizard_dlg_proc, (LPARAM)&c); |
475 |
if (!rc) |
if (!rc) |
476 |
goto start; |
goto start; |
477 |
break; |
break; |
484 |
} |
} |
485 |
break; |
break; |
486 |
|
|
|
case SETUP_EXISTING: |
|
|
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
|
|
gpgprefs_dlg_proc, NULL); |
|
|
break; |
|
|
|
|
487 |
case -1: |
case -1: |
488 |
DestroyWindow (hwnd); |
DestroyWindow (hwnd); |
489 |
free_gnupg_table (); |
free_gnupg_table (); |