aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509v3
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2005-07-24 00:23:57 +0000
committerDr. Stephen Henson <steve@openssl.org>2005-07-24 00:23:57 +0000
commit9aa9d70ddba2aa9a23f7fe2f81efaf4945b2d3bf (patch)
treefdb4057576c1f092a5f85d6cda80cc0274ff7874 /crypto/x509v3
parent231493c93c863527082b55d33292f743a60413fb (diff)
downloadopenssl-9aa9d70ddba2aa9a23f7fe2f81efaf4945b2d3bf.zip
openssl-9aa9d70ddba2aa9a23f7fe2f81efaf4945b2d3bf.tar.gz
openssl-9aa9d70ddba2aa9a23f7fe2f81efaf4945b2d3bf.tar.bz2
Print out previously unsupported fields in CRLDP by i2r instead of i2v.
Cosmetic changes to IDP printout.
Diffstat (limited to 'crypto/x509v3')
-rw-r--r--crypto/x509v3/v3_crld.c75
1 files changed, 41 insertions, 34 deletions
diff --git a/crypto/x509v3/v3_crld.c b/crypto/x509v3/v3_crld.c
index 28a38c1..2dd6932 100644
--- a/crypto/x509v3/v3_crld.c
+++ b/crypto/x509v3/v3_crld.c
@@ -63,42 +63,21 @@
#include <openssl/asn1t.h>
#include <openssl/x509v3.h>
-static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method,
- STACK_OF(DIST_POINT) *crld, STACK_OF(CONF_VALUE) *extlist);
static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+static int i2r_crldp(X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
+ int indent);
X509V3_EXT_METHOD v3_crld = {
NID_crl_distribution_points, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(CRL_DIST_POINTS),
0,0,0,0,
0,0,
-(X509V3_EXT_I2V)i2v_crld,
+0,
(X509V3_EXT_V2I)v2i_crld,
-0,0,
+i2r_crldp,0,
NULL
};
-static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method,
- STACK_OF(DIST_POINT) *crld, STACK_OF(CONF_VALUE) *exts)
-{
- DIST_POINT *point;
- int i;
- for(i = 0; i < sk_DIST_POINT_num(crld); i++) {
- point = sk_DIST_POINT_value(crld, i);
- if(point->distpoint) {
- if(point->distpoint->type == 0)
- exts = i2v_GENERAL_NAMES(NULL,
- point->distpoint->name.fullname, exts);
- else X509V3_add_value("RelativeName","<UNSUPPORTED>", &exts);
- }
- if(point->reasons)
- X509V3_add_value("reasons","<UNSUPPORTED>", &exts);
- if(point->CRLissuer)
- X509V3_add_value("CRLissuer","<UNSUPPORTED>", &exts);
- }
- return exts;
-}
-
static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
{
@@ -209,7 +188,7 @@ static int print_reasons(BIO *out, const char *rname,
if (first)
first = 0;
else
- BIO_puts(out, ",");
+ BIO_puts(out, ", ");
BIO_puts(out, pbn->lname);
}
}
@@ -220,19 +199,24 @@ static int print_reasons(BIO *out, const char *rname,
return 1;
}
-static int print_distpoint(BIO *out, DIST_POINT_NAME *dpn, int indent)
+static int print_gens(BIO *out, STACK_OF(GENERAL_NAME) *gens, int indent)
{
int i;
+ for (i = 0; i < sk_GENERAL_NAME_num(gens); i++)
+ {
+ BIO_printf(out, "%*s", indent + 2, "");
+ GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i));
+ BIO_puts(out, "\n");
+ }
+ return 1;
+ }
+
+static int print_distpoint(BIO *out, DIST_POINT_NAME *dpn, int indent)
+ {
if (dpn->type == 0)
{
- STACK_OF(GENERAL_NAME) *gens;
BIO_printf(out, "%*sFull Name:\n", indent, "");
- gens = dpn->name.fullname;
- for (i = 0; i < sk_GENERAL_NAME_num(gens); i++)
- {
- BIO_printf(out, "%*s", indent + 2, "");
- GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i));
- }
+ print_gens(out, dpn->name.fullname, indent + 2);
}
else
{
@@ -269,3 +253,26 @@ static int i2r_idp(X509V3_EXT_METHOD *method, void *pidp, BIO *out, int indent)
return 1;
}
+
+static int i2r_crldp(X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
+ int indent)
+ {
+ STACK_OF(DIST_POINT) *crld = pcrldp;
+ DIST_POINT *point;
+ int i;
+ for(i = 0; i < sk_DIST_POINT_num(crld); i++)
+ {
+ point = sk_DIST_POINT_value(crld, i);
+ if(point->distpoint)
+ print_distpoint(out, point->distpoint, indent + 2);
+ if(point->reasons)
+ print_reasons(out, "Reasons", point->reasons,
+ indent + 2);
+ if(point->CRLissuer)
+ {
+ BIO_printf(out, "%*sCRL Issuer:\n", indent, "");
+ print_gens(out, point->CRLissuer, indent + 2);
+ }
+ }
+ return 1;
+ }