aboutsummaryrefslogtreecommitdiffstats
path: root/src/pki/commands/print.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-12-09 13:34:17 +0100
committerMartin Willi <martin@revosec.ch>2011-01-05 16:46:00 +0100
commit64bcaae20316ed65f1c2a289afd2e30d922543b2 (patch)
treecff1e7a10eeca6188d8d80125c03550d23bf76df /src/pki/commands/print.c
parent7eeb37dea9819b8f59dae60f4a717d19d98ad2a8 (diff)
downloadstrongswan-64bcaae20316ed65f1c2a289afd2e30d922543b2.tar.bz2
strongswan-64bcaae20316ed65f1c2a289afd2e30d922543b2.tar.xz
pki --print prints NameConstraints
Diffstat (limited to 'src/pki/commands/print.c')
-rw-r--r--src/pki/commands/print.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pki/commands/print.c b/src/pki/commands/print.c
index 35fdaac95..0eb51ccda 100644
--- a/src/pki/commands/print.c
+++ b/src/pki/commands/print.c
@@ -178,6 +178,31 @@ static void print_x509(x509_t *x509)
printf("pathlen: %d\n", len);
}
+ first = TRUE;
+ enumerator = x509->create_name_constraint_enumerator(x509, TRUE);
+ while (enumerator->enumerate(enumerator, &id))
+ {
+ if (first)
+ {
+ printf("Permitted NameConstraints:\n");
+ first = FALSE;
+ }
+ printf(" %Y\n", id);
+ }
+ enumerator->destroy(enumerator);
+ first = TRUE;
+ enumerator = x509->create_name_constraint_enumerator(x509, FALSE);
+ while (enumerator->enumerate(enumerator, &id))
+ {
+ if (first)
+ {
+ printf("Excluded NameConstraints:\n");
+ first = FALSE;
+ }
+ printf(" %Y\n", id);
+ }
+ enumerator->destroy(enumerator);
+
chunk = x509->get_authKeyIdentifier(x509);
if (chunk.ptr)
{