mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* certlist.c (gpgsm_add_to_certlist): Check that the specified
name identifies a certificate unambiguously. (gpgsm_find_cert): Ditto. * server.c (cmd_listkeys): Check that the data stream is available. (cmd_listsecretkeys): Ditto. (has_option): New. (cmd_sign): Fix ambiguousity in option recognition. * gpgsm.c (main): Enable --logger-fd. * encrypt.c (gpgsm_encrypt): Increased buffer size for better performance. * call-agent.c (gpgsm_agent_pksign): Check the S-Exp received from the agent. * keylist.c (list_cert_colon): Filter out control characters.
This commit is contained in:
parent
6aa7267865
commit
2a28f5d0ae
10 changed files with 79 additions and 21 deletions
|
@ -43,7 +43,6 @@ gpgsm_add_to_certlist (const char *name, CERTLIST *listaddr)
|
|||
KEYDB_HANDLE kh = NULL;
|
||||
KsbaCert cert = NULL;
|
||||
|
||||
/* fixme: check that we identify excactly one cert with the name */
|
||||
rc = keydb_classify_name (name, &desc);
|
||||
if (!rc)
|
||||
{
|
||||
|
@ -55,6 +54,14 @@ gpgsm_add_to_certlist (const char *name, CERTLIST *listaddr)
|
|||
rc = keydb_search (kh, &desc, 1);
|
||||
if (!rc)
|
||||
rc = keydb_get_cert (kh, &cert);
|
||||
if (!rc)
|
||||
{
|
||||
rc = keydb_search (kh, &desc, 1);
|
||||
if (rc == -1)
|
||||
rc = 0;
|
||||
else if (!rc)
|
||||
rc = GNUPG_Ambiguous_Name;
|
||||
}
|
||||
if (!rc)
|
||||
rc = gpgsm_validate_path (cert);
|
||||
if (!rc)
|
||||
|
@ -100,7 +107,6 @@ gpgsm_find_cert (const char *name, KsbaCert *r_cert)
|
|||
KEYDB_HANDLE kh = NULL;
|
||||
|
||||
*r_cert = NULL;
|
||||
/* fixme: check that we identify excactly one cert with the name */
|
||||
rc = keydb_classify_name (name, &desc);
|
||||
if (!rc)
|
||||
{
|
||||
|
@ -112,9 +118,23 @@ gpgsm_find_cert (const char *name, KsbaCert *r_cert)
|
|||
rc = keydb_search (kh, &desc, 1);
|
||||
if (!rc)
|
||||
rc = keydb_get_cert (kh, r_cert);
|
||||
if (!rc)
|
||||
{
|
||||
rc = keydb_search (kh, &desc, 1);
|
||||
if (rc == -1)
|
||||
rc = 0;
|
||||
else
|
||||
{
|
||||
if (!rc)
|
||||
rc = GNUPG_Ambiguous_Name;
|
||||
ksba_cert_release (*r_cert);
|
||||
*r_cert = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keydb_release (kh);
|
||||
return rc == -1? GNUPG_No_Public_Key: rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue