[gq-commit] gq/src dt_cert.c,1.3,1.4 dt_crl.c,1.1,1.2
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2002-06-27 20:01:31
|
Update of /cvsroot/gqclient/gq/src In directory usw-pr-cvs1:/tmp/cvs-serv27249 Modified Files: dt_cert.c dt_crl.c Log Message: Contributed by Bernhard Reiter <ber...@in...>: * Fix an off-by-one error regarding version numbers of certificates and CRLs * Add the number of revoked certificates to the info shown for a CRL Index: dt_cert.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/dt_cert.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dt_cert.c 11 Jun 2002 21:15:25 -0000 1.3 --- dt_cert.c 27 Jun 2002 20:01:26 -0000 1.4 *************** *** 218,223 **** gtk_clist_append(GTK_CLIST(clist), cols); BIO_reset(bufbio); ! BIO_printf(bufbio, "%ld", X509_get_version(x)); BIO_get_mem_ptr(bufbio, &bm); --- 218,225 ---- gtk_clist_append(GTK_CLIST(clist), cols); + /* Version: + * Version 0x00 actually means Version 1 */ BIO_reset(bufbio); ! BIO_printf(bufbio, "%ld", X509_get_version(x) + 1); BIO_get_mem_ptr(bufbio, &bm); Index: dt_crl.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/dt_crl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dt_crl.c 11 Jun 2002 21:15:25 -0000 1.1 --- dt_crl.c 27 Jun 2002 20:01:26 -0000 1.2 *************** *** 149,152 **** --- 149,155 ---- BUF_MEM *bm; char *cols[3] = { NULL, NULL, NULL }; + STACK_OF(X509_REVOKED) *rev; + /* X509_REVOKED *r; + int i; */ X509_NAME_print(bufbio, n, 0); *************** *** 175,180 **** gtk_clist_append(GTK_CLIST(clist), cols); BIO_reset(bufbio); ! BIO_printf(bufbio, "%ld", X509_CRL_get_version(x)); BIO_get_mem_ptr(bufbio, &bm); --- 178,207 ---- gtk_clist_append(GTK_CLIST(clist), cols); + /* list of revoked certs */ + + rev = X509_CRL_get_REVOKED(x); + /* NOTE: we do _not_ have to free rev, it is part + of the CRL itself */ + cols[0] = _("Number of revoked certificates"); + BIO_reset(bufbio); ! BIO_printf(bufbio, "%ld", sk_X509_REVOKED_num(rev)); ! BIO_get_mem_ptr(bufbio, &bm); ! cols[1] = bm->data; ! ! /* ! for(i = 0 ; i < sk_X509_REVOKED_num(rev) ; i++) { ! r = sk_X509_REVOKED_value(rev, i); ! BIO_printf(bufbio, "%ld", r->serialNumber); ! BIO_get_mem_ptr(bufbio, &bm); ! cols[1] = bm->data; ! } ! */ ! gtk_clist_append(GTK_CLIST(clist), cols); ! ! /* Version: ! * Version 0x00 actually means Version 1 */ ! BIO_reset(bufbio); ! BIO_printf(bufbio, "%ld", X509_CRL_get_version(x) + 1); BIO_get_mem_ptr(bufbio, &bm); |