(check_and_store): Do not update the stats for hidden

imports of issuer certs.
This commit is contained in:
Werner Koch 2004-04-30 03:27:10 +00:00
parent 93e9f9aedd
commit 6d96ca16cf
2 changed files with 20 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2004-04-30 Werner Koch <wk@gnupg.org>
* import.c (check_and_store): Do not update the stats for hidden
imports of issuer certs.
2004-04-28 Werner Koch <wk@gnupg.org>
* gpgsm.c: New command --keydb-clear-some-cert-flags.

View File

@ -139,10 +139,12 @@ check_and_store (CTRL ctrl, struct stats_s *stats, ksba_cert_t cert, int depth)
{
int rc;
if (stats)
stats->count++;
if ( depth >= 50 )
{
log_error (_("certificate chain too long\n"));
if (stats)
stats->not_imported++;
print_import_problem (ctrl, cert, 3);
return;
@ -167,11 +169,13 @@ check_and_store (CTRL ctrl, struct stats_s *stats, ksba_cert_t cert, int depth)
if (!existed)
{
print_imported_status (ctrl, cert, 1);
if (stats)
stats->imported++;
}
else
{
print_imported_status (ctrl, cert, 0);
if (stats)
stats->unchanged++;
}
@ -192,16 +196,18 @@ check_and_store (CTRL ctrl, struct stats_s *stats, ksba_cert_t cert, int depth)
/* Now lets walk up the chain and import all certificates up
the chain. This is required in case we already stored
parent certificates in the ephemeral keybox. */
parent certificates in the ephemeral keybox. Do not
update the statistics, though. */
if (!gpgsm_walk_cert_chain (cert, &next))
{
check_and_store (ctrl, stats, next, depth+1);
check_and_store (ctrl, NULL, next, depth+1);
ksba_cert_release (next);
}
}
else
{
log_error (_("error storing certificate\n"));
if (stats)
stats->not_imported++;
print_import_problem (ctrl, cert, 4);
}
@ -209,6 +215,7 @@ check_and_store (CTRL ctrl, struct stats_s *stats, ksba_cert_t cert, int depth)
else
{
log_error (_("basic certificate checks failed - not imported\n"));
if (stats)
stats->not_imported++;
print_import_problem (ctrl, cert,
gpg_err_code (rc) == GPG_ERR_MISSING_CERT? 2 :