summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3/v3_cpols.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_cpols.c')
-rw-r--r--src/lib/libcrypto/x509v3/v3_cpols.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_cpols.c b/src/lib/libcrypto/x509v3/v3_cpols.c
index 867525f336..a40f490aa9 100644
--- a/src/lib/libcrypto/x509v3/v3_cpols.c
+++ b/src/lib/libcrypto/x509v3/v3_cpols.c
@@ -3,7 +3,7 @@
3 * project 1999. 3 * project 1999.
4 */ 4 */
5/* ==================================================================== 5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 6 * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
@@ -63,6 +63,8 @@
63#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66#include "pcy_int.h"
67
66/* Certificate policies extension support: this one is a bit complex... */ 68/* Certificate policies extension support: this one is a bit complex... */
67 69
68static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent); 70static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent);
@@ -75,7 +77,7 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
75 STACK_OF(CONF_VALUE) *unot, int ia5org); 77 STACK_OF(CONF_VALUE) *unot, int ia5org);
76static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos); 78static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos);
77 79
78X509V3_EXT_METHOD v3_cpols = { 80const X509V3_EXT_METHOD v3_cpols = {
79NID_certificate_policies, 0,ASN1_ITEM_ref(CERTIFICATEPOLICIES), 81NID_certificate_policies, 0,ASN1_ITEM_ref(CERTIFICATEPOLICIES),
800,0,0,0, 820,0,0,0,
810,0, 830,0,
@@ -348,7 +350,7 @@ static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos)
348 return 1; 350 return 1;
349 351
350 merr: 352 merr:
351 X509V3err(X509V3_F_NOTICE_SECTION,ERR_R_MALLOC_FAILURE); 353 X509V3err(X509V3_F_NREF_NOS,ERR_R_MALLOC_FAILURE);
352 354
353 err: 355 err:
354 sk_ASN1_INTEGER_pop_free(nnums, ASN1_STRING_free); 356 sk_ASN1_INTEGER_pop_free(nnums, ASN1_STRING_free);
@@ -429,3 +431,19 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
429 notice->exptext->data); 431 notice->exptext->data);
430} 432}
431 433
434void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent)
435 {
436 const X509_POLICY_DATA *dat = node->data;
437
438 BIO_printf(out, "%*sPolicy: ", indent, "");
439
440 i2a_ASN1_OBJECT(out, dat->valid_policy);
441 BIO_puts(out, "\n");
442 BIO_printf(out, "%*s%s\n", indent + 2, "",
443 node_data_critical(dat) ? "Critical" : "Non Critical");
444 if (dat->qualifier_set)
445 print_qualifiers(out, dat->qualifier_set, indent + 2);
446 else
447 BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, "");
448 }
449