Commit ecf13991 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

New function X509_POLICY_NODE_print()

parent ab23d5ff
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -188,7 +188,8 @@ struct X509_POLICY_TREE_st


/* Useful macros */
/* Useful macros */


#define node_critical(node) ((node)->data->flags & POLICY_DATA_FLAG_CRITICAL)
#define node_data_critical(data) (data->flags & POLICY_DATA_FLAG_CRITICAL)
#define node_critical(node) node_data_critical(node->data)


/* Internal functions */
/* Internal functions */


+19 −1
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@
 * project 1999.
 * project 1999.
 */
 */
/* ====================================================================
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * modification, are permitted provided that the following conditions
@@ -63,6 +63,8 @@
#include <openssl/asn1t.h>
#include <openssl/asn1t.h>
#include <openssl/x509v3.h>
#include <openssl/x509v3.h>


#include "pcy_int.h"

/* Certificate policies extension support: this one is a bit complex... */
/* Certificate policies extension support: this one is a bit complex... */


static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent);
static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent);
@@ -420,3 +422,19 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
							 notice->exptext->data);
							 notice->exptext->data);
}
}


void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent)
	{
	const X509_POLICY_DATA *dat = node->data;

	BIO_printf(out, "%*sPolicy: ", indent, "");
			
	i2a_ASN1_OBJECT(out, dat->valid_policy);
	BIO_puts(out, "\n");
	BIO_printf(out, "%*s%s\n", indent + 2, "",
		node_data_critical(dat) ? "Critical" : "Non Critical");
	if (dat->qualifier_set)
		print_qualifiers(out, dat->qualifier_set, indent + 2);
	else
		BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, "");
	}
	
+3 −1
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@
 * project 1999.
 * project 1999.
 */
 */
/* ====================================================================
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * modification, are permitted provided that the following conditions
@@ -604,6 +604,8 @@ ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
						unsigned long chtype);
						unsigned long chtype);


void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);

/* BEGIN ERROR CODES */
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
/* The following lines are auto generated by the script mkerr.pl. Any changes
 * made after this point may be overwritten when the script is next run.
 * made after this point may be overwritten when the script is next run.