mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* call-dirmngr.c (inq_certificate): Changed for new interface semantic.
* certlist.c (gpgsm_find_cert): New. DirMngr should now work. Remember that there is a --disable-crl-check option in gpgsm to be used when there is a problem with the dirmngr communication or you want to do faster tests.
This commit is contained in:
parent
9b3370dadf
commit
438b2bcb8c
4 changed files with 77 additions and 17 deletions
|
@ -86,3 +86,31 @@ gpgsm_release_certlist (CERTLIST list)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* Like gpgsm_add_to_certlist, but lookonly for one certificate */
|
||||
int
|
||||
gpgsm_find_cert (const char *name, KsbaCert *r_cert)
|
||||
{
|
||||
int rc;
|
||||
KEYDB_SEARCH_DESC desc;
|
||||
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)
|
||||
{
|
||||
kh = keydb_new (0);
|
||||
if (!kh)
|
||||
rc = GNUPG_Out_Of_Core;
|
||||
else
|
||||
{
|
||||
rc = keydb_search (kh, &desc, 1);
|
||||
if (!rc)
|
||||
rc = keydb_get_cert (kh, r_cert);
|
||||
}
|
||||
}
|
||||
|
||||
keydb_release (kh);
|
||||
return rc == -1? GNUPG_No_Public_Key: rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue