#include "keydb.h"
#include "util.h"
#include "i18n.h"
-#include "cipher.h"
/* Return true if Libgcrypt's RNG is in faked mode. */
for (; sk_list; sk_list = sk_rover)
{
sk_rover = sk_list->next;
- if (sk_list->pk)
- free_public_key (sk_list->pk);
+ free_public_key (sk_list->pk);
xfree (sk_list);
}
}
}
-/* FIXME: We ignore the UNLOCK flag - should not be needed anymore. */
gpg_error_t
-build_sk_list (strlist_t locusr, SK_LIST *ret_sk_list,
- int unlock, unsigned int use)
+build_sk_list (strlist_t locusr, SK_LIST *ret_sk_list, unsigned int use)
{
gpg_error_t err;
SK_LIST sk_list = NULL;
else
{
SK_LIST r;
-
+
if (random_is_faked () && !is_insecure (pk))
{
log_info (_("key is not flagged as insecure - "
pk = NULL;
log_info (_("skipped: secret key already present\n"));
}
- /* Fixme: We could change the next test by a call to gpg-agent which
- would then cache the passphrase. */
- /* else if (unlock && (rc = check_secret_key (sk, 0))) */
- /* { */
- /* free_secret_key (sk); */
- /* sk = NULL; */
- /* log_error (_("skipped \"%s\": %s\n"), */
- /* locusr->d, g10_errstr (rc)); */
- /* write_status_text_and_buffer */
- /* (STATUS_INV_SGNR, get_inv_recpsgnr_code (rc), */
- /* locusr->d, strlen (locusr->d), -1); */
- /* } */
else if ((err = openpgp_pk_test_algo2 (pk->pubkey_algo, use)))
{
free_public_key (pk);
else
{
SK_LIST r;
-
+
if (pk->version == 4 && (use & PUBKEY_USAGE_SIG)
&& pk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E)
{
write_status_text (STATUS_NO_SGNR, "0");
err = gpg_error (GPG_ERR_NO_USER_ID);
}
-
+
if (err)
release_sk_list (sk_list);
else