mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
sm: Implement initial support for keyboxd.
* sm/gpgsm.h (MAX_FINGERPRINT_LEN): New. * sm/keydb.c (struct keydb_local_s): Change definition of search_result. (keydb_get_cert): Implement keyboxd mode. (keydb_get_flags): Temporary hack for keyboxd mode. Needs to be fixed. (struct store_parm_s, store_inq_cb): New. (keydb_insert_cert): Implement keyboxd mode. (keydb_locate_writable): Make static. (keydb_search_reset): Implement keyboxd mode. (search_status_cb): New. (keydb_search): Implement keyboxd mode. Replace return code -1 by GPG_ERR_NOT_FOUND. (keydb_set_cert_flags): Replace return code -1 by GPG_ERR_NOT_FOUND. * sm/keylist.c (list_cert_colon): Adjust for replacement of -1 by GPG_ERR_NOT_FOUND. (list_internal_keys): Ditto. * sm/sign.c (add_certificate_list): Ditto. * sm/certchain.c (find_up_search_by_keyid): Ditto. (find_up_external, find_up, find_up_dirmngr): Ditto. (gpgsm_walk_cert_chain): Ditto. (get_regtp_ca_info): Ditto. * sm/certlist.c (gpgsm_add_to_certlist): Ditto. (gpgsm_find_cert): Ditto. * sm/delete.c (delete_one): Ditto. * sm/export.c (gpgsm_export): Ditto. (gpgsm_p12_export): Ditto. * sm/import.c (gpgsm_import_files): Ditto. -- Note that keyboxd is not yet able to handle the ephemeral flag. This needs fixing here and in keyboxd. Delete et al. is also not yet implemented. A basic key listing works, though. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
c9677d416e
commit
ed6ebb696e
10 changed files with 382 additions and 91 deletions
|
@ -376,7 +376,7 @@ gpgsm_add_to_certlist (ctrl_t ctrl, const char *name, int secret,
|
|||
|
||||
next_ambigious:
|
||||
rc = keydb_search (ctrl, kh, &desc, 1);
|
||||
if (rc == -1)
|
||||
if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
|
||||
rc = 0;
|
||||
else if (!rc)
|
||||
{
|
||||
|
@ -450,7 +450,7 @@ gpgsm_add_to_certlist (ctrl_t ctrl, const char *name, int secret,
|
|||
{
|
||||
certlist_t cl = xtrycalloc (1, sizeof *cl);
|
||||
if (!cl)
|
||||
rc = out_of_core ();
|
||||
rc = gpg_error_from_syserror ();
|
||||
else
|
||||
{
|
||||
cl->cert = cert; cert = NULL;
|
||||
|
@ -465,7 +465,8 @@ gpgsm_add_to_certlist (ctrl_t ctrl, const char *name, int secret,
|
|||
|
||||
keydb_release (kh);
|
||||
ksba_cert_release (cert);
|
||||
return rc == -1? gpg_error (GPG_ERR_NO_PUBKEY): rc;
|
||||
return (gpg_err_code (rc) == GPG_ERR_NOT_FOUND
|
||||
? gpg_error (GPG_ERR_NO_PUBKEY): rc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -549,7 +550,7 @@ gpgsm_find_cert (ctrl_t ctrl,
|
|||
}
|
||||
next_ambiguous:
|
||||
rc = keydb_search (ctrl, kh, &desc, 1);
|
||||
if (rc == -1)
|
||||
if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
|
||||
rc = 0;
|
||||
else
|
||||
{
|
||||
|
@ -603,5 +604,6 @@ gpgsm_find_cert (ctrl_t ctrl,
|
|||
}
|
||||
|
||||
keydb_release (kh);
|
||||
return rc == -1? gpg_error (GPG_ERR_NO_PUBKEY): rc;
|
||||
return (gpg_err_code (rc) == GPG_ERR_NOT_FOUND?
|
||||
gpg_error (GPG_ERR_NO_PUBKEY): rc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue