116 |
if (!path) |
if (!path) |
117 |
return NULL; |
return NULL; |
118 |
p = get_reg_entry_gpg ("OptFile"); |
p = get_reg_entry_gpg ("OptFile"); |
119 |
if (p && !strcmp (p, "")) { |
if (p) { |
120 |
nlen = strlen (path) + 64; |
nlen = strlen (p) + 4; |
|
optfile = new char[nlen + 1]; |
|
|
if (!optfile) |
|
|
BUG (0); |
|
|
_snprintf (optfile, nlen, "%s\\"GPG_CONF, path); |
|
|
} |
|
|
else if (p) { |
|
|
nlen = strlen( p ) + 4; |
|
121 |
optfile = new char[nlen + 1]; |
optfile = new char[nlen + 1]; |
122 |
if (!optfile) |
if (!optfile) |
123 |
BUG (NULL); |
BUG (NULL); |
357 |
int rc = 1; |
int rc = 1; |
358 |
|
|
359 |
/* Convert the needed GPG version to the integer format. */ |
/* Convert the needed GPG version to the integer format. */ |
360 |
rc = parse_version_nr (need_gpg_ver, |
if (parse_version_nr (need_gpg_ver, |
361 |
&need_major, &need_minor, &need_patch); |
&need_major, &need_minor, &need_patch)) |
362 |
if (rc) |
return 1; |
|
return rc; |
|
363 |
|
|
364 |
gpgme_new (&ctx); |
gpgme_new (&ctx); |
365 |
inf = gpgme_ctx_get_engine_info (ctx); |
inf = gpgme_ctx_get_engine_info (ctx); |
374 |
if (strstr (eng, "IDEA")) |
if (strstr (eng, "IDEA")) |
375 |
idea_available = 1; |
idea_available = 1; |
376 |
free (eng); |
free (eng); |
377 |
rc = parse_version_nr (inf->version, &major, &minor, &patch); |
if (parse_version_nr (inf->version, &major, &minor, &patch)) { |
|
if (rc) { |
|
378 |
gpgme_release (ctx); |
gpgme_release (ctx); |
379 |
return rc; |
return 1; |
380 |
} |
} |
381 |
|
|
382 |
if (major > need_major) |
if (major > need_major) |
907 |
hwnd = GetDesktopWindow (); |
hwnd = GetDesktopWindow (); |
908 |
|
|
909 |
pring = get_fileopen_dlg (hwnd, _("Please choose your public keyring"), |
pring = get_fileopen_dlg (hwnd, _("Please choose your public keyring"), |
910 |
_("GPG Keyrings (*.gpg)\0*.gpg\0\0"),NULL); |
"GPG Keyrings (*.gpg)\0*.gpg\0\0",NULL); |
911 |
if (!pring) { |
if (!pring) { |
912 |
msg_box (hwnd, _("No keyring was chosen. Exit."), _("WinPT Error"), MB_ERR); |
msg_box (hwnd, _("No keyring was chosen. Exit."), _("WinPT Error"), MB_ERR); |
913 |
free_if_alloc (path); |
free_if_alloc (path); |
927 |
free_if_alloc (file); |
free_if_alloc (file); |
928 |
|
|
929 |
sring = get_fileopen_dlg (hwnd, _("Please choose your secret keyring"), |
sring = get_fileopen_dlg (hwnd, _("Please choose your secret keyring"), |
930 |
_("GPG Keyrings (*.gpg)\0*.gpg\0\0"), NULL); |
"GPG Keyrings (*.gpg)\0*.gpg\0\0", NULL); |
931 |
if (!sring) { |
if (!sring) { |
932 |
msg_box( NULL, _("No keyring was chosen. Exit."), _("WinPT Error"), MB_ERR ); |
msg_box( NULL, _("No keyring was chosen. Exit."), _("WinPT Error"), MB_ERR ); |
933 |
return WPTERR_GENERAL; |
return WPTERR_GENERAL; |