mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* import.c (gpgsm_import): Just do a basic cert check before
storing it. * certpath.c (gpgsm_basic_cert_check): New. * keydb.c (keydb_store_cert): New. * import.c (store_cert): Removed and change all caller to use the new function. * verify.c (store_cert): Ditto. * certlist.c (gpgsm_add_to_certlist): Validate the path * certpath.c (gpgsm_validate_path): Check the trust list. * call-agent.c (gpgsm_agent_istrusted): New.
This commit is contained in:
parent
9dd0040085
commit
a9979e26a5
11 changed files with 352 additions and 80 deletions
30
sm/import.c
30
sm/import.c
|
@ -35,32 +35,6 @@
|
|||
#include "i18n.h"
|
||||
|
||||
|
||||
static void
|
||||
store_cert (KsbaCert cert)
|
||||
{
|
||||
KEYDB_HANDLE kh;
|
||||
int rc;
|
||||
|
||||
kh = keydb_new (0);
|
||||
if (!kh)
|
||||
{
|
||||
log_error (_("failed to allocated keyDB handle\n"));
|
||||
return;
|
||||
}
|
||||
rc = keydb_locate_writable (kh, 0);
|
||||
if (rc)
|
||||
log_error (_("error finding writable keyDB: %s\n"), gnupg_strerror (rc));
|
||||
|
||||
rc = keydb_insert_cert (kh, cert);
|
||||
if (rc)
|
||||
{
|
||||
log_error (_("error storing certificate: %s\n"), gnupg_strerror (rc));
|
||||
}
|
||||
keydb_release (kh);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int
|
||||
gpgsm_import (CTRL ctrl, int in_fd)
|
||||
|
@ -100,8 +74,8 @@ gpgsm_import (CTRL ctrl, int in_fd)
|
|||
goto leave;
|
||||
}
|
||||
|
||||
if ( !gpgsm_validate_path (cert) )
|
||||
store_cert (cert);
|
||||
if ( !gpgsm_basic_cert_check (cert) )
|
||||
keydb_store_cert (cert);
|
||||
|
||||
leave:
|
||||
ksba_cert_release (cert);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue