123 |
p = get_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys"); |
p = get_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys"); |
124 |
if (p && *p != ' ') { |
if (p && *p != ' ') { |
125 |
val = atoi (p); |
val = atoi (p); |
126 |
free_if_alloc (p); |
free_if_alloc (p); |
|
memset (&pfx, 0, sizeof (pfx)); |
|
127 |
} |
} |
128 |
|
|
129 |
|
memset (&pfx, 0, sizeof (pfx)); |
130 |
/* Release old contexts first. */ |
/* Release old contexts first. */ |
131 |
keycache_release (0); |
keycache_release (0); |
132 |
|
|
141 |
if (!err) |
if (!err) |
142 |
err = gpg_keycache_init (sec, NULL, 1); |
err = gpg_keycache_init (sec, NULL, 1); |
143 |
if (!err && pubring && *pubring) |
if (!err && pubring && *pubring) |
144 |
err = gpg_keycache_prepare( pub, pubring, NULL); |
err = gpg_keycache_prepare (pub, pubring, NULL); |
145 |
if (!err && secring && * secring) |
if (!err && secring && * secring) |
146 |
err = gpg_keycache_prepare (sec, NULL, secring); |
err = gpg_keycache_prepare (sec, NULL, secring); |
147 |
if (!err) |
if (!err) |
157 |
gpg_keycache_t |
gpg_keycache_t |
158 |
keycache_get_ctx (int is_pub) |
keycache_get_ctx (int is_pub) |
159 |
{ |
{ |
160 |
return is_pub? pub : sec; |
gpg_keycache_t ctx; |
161 |
|
|
162 |
|
ctx = is_pub? pub : sec; |
163 |
|
if (!ctx) |
164 |
|
BUG (0); |
165 |
|
return ctx; |
166 |
} |
} |
167 |
|
|
168 |
|
|
182 |
*r_key = NULL; |
*r_key = NULL; |
183 |
cache = keycache_get_ctx (mode); |
cache = keycache_get_ctx (mode); |
184 |
if (!cache) |
if (!cache) |
185 |
BUG( NULL ); |
BUG (0); |
186 |
if (!c) |
if (!c) |
187 |
err = gpg_keycache_find_key (cache, keyid, 0, r_key); |
err = gpg_keycache_find_key (cache, keyid, 0, r_key); |
188 |
else |
else |