1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* base64.c (base64_reader_cb): Try to detect an S/MIME body part.

* certdump.c (print_sexp): Renamed to gpgsm_dump_serial, made
global.
(print_time): Renamed to gpgsm_dump_time, made global.
(gpgsm_dump_serial): Take a real S-Expression as argument and
print the first item.
* keylist.c (list_cert_colon): Ditto.
* keydb.c (keydb_search_issuer_sn): Ditto.
* decrypt.c (print_integer_sexp): Removed and made callers
use gpgsm_dump_serial.
* verify.c (print_time): Removed, made callers use gpgsm_dump_time.
This commit is contained in:
Werner Koch 2001-12-20 13:25:08 +00:00
parent 3341f8a55d
commit 5f116e9540
8 changed files with 101 additions and 83 deletions

View file

@ -33,20 +33,24 @@
#include "gpgsm.h"
#include "keydb.h"
static void
print_sexp (KsbaConstSexp p)
/* print the first element of an S-Expression */
void
gpgsm_dump_serial (KsbaConstSexp p)
{
unsigned long n;
KsbaConstSexp endp;
if (!p)
log_printf ("none");
else if (*p != '(')
log_printf ("ERROR - not an S-expression");
else
{
p++;
n = strtoul (p, (char**)&endp, 10);
p = endp;
if (*p!=':')
log_printf ("ERROR - invalid value");
log_printf ("ERROR - invalid S-expression");
else
{
for (p++; n; n--, p++)
@ -57,8 +61,8 @@ print_sexp (KsbaConstSexp p)
static void
print_time (time_t t)
void
gpgsm_dump_time (time_t t)
{
if (!t)
@ -77,6 +81,7 @@ print_time (time_t t)
}
}
static void
print_dn (char *p)
{
@ -100,17 +105,17 @@ gpgsm_dump_cert (const char *text, KsbaCert cert)
{
sexp = ksba_cert_get_serial (cert);
log_debug (" serial: ");
print_sexp (sexp);
gpgsm_dump_serial (sexp);
ksba_free (sexp);
log_printf ("\n");
t = ksba_cert_get_validity (cert, 0);
log_debug (" notBefore: ");
print_time (t);
gpgsm_dump_time (t);
log_printf ("\n");
t = ksba_cert_get_validity (cert, 1);
log_debug (" notAfter: ");
print_time (t);
gpgsm_dump_time (t);
log_printf ("\n");
dn = ksba_cert_get_issuer (cert, 0);
@ -133,3 +138,5 @@ gpgsm_dump_cert (const char *text, KsbaCert cert)
}
log_debug ("END Certificate\n");
}