218 |
err = gpg_keycache_find_key (kc, defkey, 0, &key); |
err = gpg_keycache_find_key (kc, defkey, 0, &key); |
219 |
else |
else |
220 |
msg_box (NULL, _("No useable secret key found."), |
msg_box (NULL, _("No useable secret key found."), |
221 |
_("WinPT Error"), MB_ERR); |
_("WinPT Warning"), MB_WARN); |
222 |
free_if_alloc (defkey); |
free_if_alloc (defkey); |
223 |
return err? -1 : 0; |
return err? -1 : 0; |
224 |
} |
} |
422 |
} |
} |
423 |
|
|
424 |
|
|
425 |
#include "wptKeyManager.h" |
/* Search for insecure ElGamal keys and return the |
426 |
|
number of founded keys. */ |
427 |
|
static int |
428 |
|
count_insecure_elgkeys (void) |
429 |
|
{ |
430 |
|
gpg_keycache_t pc; |
431 |
|
gpgme_key_t key; |
432 |
|
int n = 0; |
433 |
|
|
434 |
|
pc = keycache_get_ctx (1); |
435 |
|
while (!gpg_keycache_next_key (pc, 0, &key)) { |
436 |
|
if (key->subkeys->pubkey_algo == GPGME_PK_ELG) |
437 |
|
n++; |
438 |
|
} |
439 |
|
gpg_keycache_rewind (pc); |
440 |
|
return n; |
441 |
|
} |
442 |
|
|
443 |
|
|
444 |
/* Main entry point. */ |
/* Main entry point. */ |
445 |
int WINAPI |
int WINAPI |