47 |
static char *gpg_secring = NULL; |
static char *gpg_secring = NULL; |
48 |
|
|
49 |
|
|
50 |
|
/* Return 1 if no cache is available. |
51 |
|
This can be the case if WinPT were run in command line mode. */ |
52 |
int |
int |
53 |
keycache_not_available (void) |
keycache_not_available (void) |
54 |
{ |
{ |
64 |
int n = gpg_keycache_get_size (pub); |
int n = gpg_keycache_get_size (pub); |
65 |
|
|
66 |
/* XXX: update the value when the cache has changed. */ |
/* XXX: update the value when the cache has changed. */ |
67 |
sprintf (tmpbuf, "%d", n); |
_snprintf (tmpbuf, sizeof (tmpbuf)-1, "%d", n); |
68 |
set_reg_key (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys", tmpbuf); |
set_reg_key (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys", tmpbuf); |
69 |
|
|
70 |
if (pub) { |
if (pub) { |
110 |
if (secring != NULL) { |
if (secring != NULL) { |
111 |
free_if_alloc (gpg_secring); |
free_if_alloc (gpg_secring); |
112 |
gpg_secring = get_gnupg_keyring (0, NO_STRICT); |
gpg_secring = get_gnupg_keyring (0, NO_STRICT); |
113 |
|
log_debug ("keycache_init: secring path '%s'\r\n", gpg_secring); |
114 |
} |
} |
115 |
|
|
116 |
p = get_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys"); |
p = get_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys"); |