1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpg: Allow overridden key import when stub exists.

* g10/import.c (do_transfer): Force importing when it's card
reference.

--

GnuPG-bug-id: 3456
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-04-18 09:53:24 +09:00
parent d965ee8d65
commit 2c12970550
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -2955,9 +2955,19 @@ do_transfer (ctrl_t ctrl, kbnode_t keyblock, PKT_public_key *pk,
{
gpg_error_t err;
struct import_stats_s subkey_stats = {0};
int force = 0;
int already_exist = agent_probe_secret_key (ctrl, pk);
if (already_exist == 2)
{
if (!opt.quiet)
log_info (_("key %s: card reference is overridden by key material\n"),
keystr_from_pk (pk));
force = 1;
}
err = transfer_secret_keys (ctrl, &subkey_stats, keyblock,
batch, 0, only_marked);
batch, force, only_marked);
if (gpg_err_code (err) == GPG_ERR_NOT_PROCESSED)
{
/* TRANSLATORS: For a smartcard, each private key on host has a