mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-24 15:17:02 +01:00
gpg: Keep the integrity of the code for KEYINFO command.
* g10/call-agent.c (struct keyinfo_data_parm_s): Remove CARD_AVAILABLE field. (keyinfo_status_cb): Don't touch CARD_AVAILABLE field. (agent_probe_secret_key); Don't check CARD_AVAILABLE field. * g10/import.c (do_transfer): Check if it's card key or not. -- In 2.2 branch, gpg-agent doesn't have a capability to report if card is available or not by KEYINFO command. Thus, this clean up. GnuPG-bug-id: 3456 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
ff42ed0d69
commit
8e3d4f5b63
@ -1788,7 +1788,6 @@ struct keyinfo_data_parm_s
|
|||||||
int is_smartcard;
|
int is_smartcard;
|
||||||
int passphrase_cached;
|
int passphrase_cached;
|
||||||
int cleartext;
|
int cleartext;
|
||||||
int card_available;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1818,8 +1817,6 @@ keyinfo_status_cb (void *opaque, const char *line)
|
|||||||
data->passphrase_cached = (fields[4][0] == '1');
|
data->passphrase_cached = (fields[4][0] == '1');
|
||||||
/* 'P' for protected, 'C' for clear */
|
/* 'P' for protected, 'C' for clear */
|
||||||
data->cleartext = (fields[5][0] == 'C');
|
data->cleartext = (fields[5][0] == 'C');
|
||||||
/* 'A' for card is available */
|
|
||||||
data->card_available = (fields[8][0] == 'A');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -1856,9 +1853,6 @@ agent_probe_secret_key (ctrl_t ctrl, PKT_public_key *pk)
|
|||||||
if (err)
|
if (err)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (keyinfo.card_available)
|
|
||||||
return 4;
|
|
||||||
|
|
||||||
if (keyinfo.passphrase_cached)
|
if (keyinfo.passphrase_cached)
|
||||||
return 3;
|
return 3;
|
||||||
|
|
||||||
|
@ -2839,7 +2839,7 @@ do_transfer (ctrl_t ctrl, kbnode_t keyblock, PKT_public_key *pk,
|
|||||||
int force = 0;
|
int force = 0;
|
||||||
int already_exist = agent_probe_secret_key (ctrl, pk);
|
int already_exist = agent_probe_secret_key (ctrl, pk);
|
||||||
|
|
||||||
if (already_exist == 2 || already_exist == 4)
|
if (already_exist == 2)
|
||||||
{
|
{
|
||||||
if (!opt.quiet)
|
if (!opt.quiet)
|
||||||
log_info (_("key %s: card reference is overridden by key material\n"),
|
log_info (_("key %s: card reference is overridden by key material\n"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user