mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
(check_and_store): Do not update the stats for hidden
imports of issuer certs.
This commit is contained in:
parent
93e9f9aedd
commit
6d96ca16cf
@ -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>
|
2004-04-28 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* gpgsm.c: New command --keydb-clear-some-cert-flags.
|
* gpgsm.c: New command --keydb-clear-some-cert-flags.
|
||||||
|
23
sm/import.c
23
sm/import.c
@ -139,11 +139,13 @@ check_and_store (CTRL ctrl, struct stats_s *stats, ksba_cert_t cert, int depth)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
stats->count++;
|
if (stats)
|
||||||
|
stats->count++;
|
||||||
if ( depth >= 50 )
|
if ( depth >= 50 )
|
||||||
{
|
{
|
||||||
log_error (_("certificate chain too long\n"));
|
log_error (_("certificate chain too long\n"));
|
||||||
stats->not_imported++;
|
if (stats)
|
||||||
|
stats->not_imported++;
|
||||||
print_import_problem (ctrl, cert, 3);
|
print_import_problem (ctrl, cert, 3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -167,12 +169,14 @@ check_and_store (CTRL ctrl, struct stats_s *stats, ksba_cert_t cert, int depth)
|
|||||||
if (!existed)
|
if (!existed)
|
||||||
{
|
{
|
||||||
print_imported_status (ctrl, cert, 1);
|
print_imported_status (ctrl, cert, 1);
|
||||||
stats->imported++;
|
if (stats)
|
||||||
|
stats->imported++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_imported_status (ctrl, cert, 0);
|
print_imported_status (ctrl, cert, 0);
|
||||||
stats->unchanged++;
|
if (stats)
|
||||||
|
stats->unchanged++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt.verbose > 1 && existed)
|
if (opt.verbose > 1 && existed)
|
||||||
@ -192,24 +196,27 @@ 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
|
/* Now lets walk up the chain and import all certificates up
|
||||||
the chain. This is required in case we already stored
|
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))
|
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);
|
ksba_cert_release (next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("error storing certificate\n"));
|
log_error (_("error storing certificate\n"));
|
||||||
stats->not_imported++;
|
if (stats)
|
||||||
|
stats->not_imported++;
|
||||||
print_import_problem (ctrl, cert, 4);
|
print_import_problem (ctrl, cert, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("basic certificate checks failed - not imported\n"));
|
log_error (_("basic certificate checks failed - not imported\n"));
|
||||||
stats->not_imported++;
|
if (stats)
|
||||||
|
stats->not_imported++;
|
||||||
print_import_problem (ctrl, cert,
|
print_import_problem (ctrl, cert,
|
||||||
gpg_err_code (rc) == GPG_ERR_MISSING_CERT? 2 :
|
gpg_err_code (rc) == GPG_ERR_MISSING_CERT? 2 :
|
||||||
gpg_err_code (rc) == GPG_ERR_BAD_CERT? 1 : 0);
|
gpg_err_code (rc) == GPG_ERR_BAD_CERT? 1 : 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user