Parse non-v1 SCTs less awkwardly.
[openssl.git] / crypto / x509v3 / pcy_int.h
index 33d6adfb961f573fba56ce585b8a68074224c013..ccff92846e40e3e03613c4d7ca82ee5dbf36a517 100644 (file)
@@ -1,5 +1,5 @@
 /* pcy_int.h */
 /* pcy_int.h */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project 2004.
  */
 /* ====================================================================
  * project 2004.
  */
 /* ====================================================================
  *
  */
 
  *
  */
 
-DECLARE_STACK_OF(X509_POLICY_DATA)
-DECLARE_STACK_OF(X509_POLICY_REF)
-DECLARE_STACK_OF(X509_POLICY_NODE)
 
 typedef struct X509_POLICY_DATA_st X509_POLICY_DATA;
 
 typedef struct X509_POLICY_DATA_st X509_POLICY_DATA;
-typedef struct X509_POLICY_REF_st X509_POLICY_REF;
+
+DECLARE_STACK_OF(X509_POLICY_DATA)
 
 /* Internal structures */
 
 
 /* Internal structures */
 
@@ -110,16 +108,6 @@ struct X509_POLICY_DATA_st
 
 #define POLICY_DATA_FLAG_CRITICAL              0x10
 
 
 #define POLICY_DATA_FLAG_CRITICAL              0x10
 
-/* This structure is an entry from a table of mapped policies which
- * cross reference the policy it refers to.
- */
-
-struct X509_POLICY_REF_st
-       {
-       ASN1_OBJECT *subjectDomainPolicy;
-       const X509_POLICY_DATA *data;
-       };
-
 /* This structure is cached with a certificate */
 
 struct X509_POLICY_CACHE_st {
 /* This structure is cached with a certificate */
 
 struct X509_POLICY_CACHE_st {
@@ -127,8 +115,6 @@ struct X509_POLICY_CACHE_st {
        X509_POLICY_DATA *anyPolicy;
        /* other policy data */
        STACK_OF(X509_POLICY_DATA) *data;
        X509_POLICY_DATA *anyPolicy;
        /* other policy data */
        STACK_OF(X509_POLICY_DATA) *data;
-       /* If policyMappings extension present a table of mapped policies */
-       STACK_OF(X509_POLICY_REF) *maps;
        /* If InhibitAnyPolicy present this is its value or -1 if absent. */
        long any_skip;
        /* If policyConstraints and requireExplicitPolicy present this is its
        /* If InhibitAnyPolicy present this is its value or -1 if absent. */
        long any_skip;
        /* If policyConstraints and requireExplicitPolicy present this is its
@@ -188,11 +174,12 @@ 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 */
 
-X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id,
+X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, const ASN1_OBJECT *id,
                                                                int crit);
 void policy_data_free(X509_POLICY_DATA *data);
 
                                                                int crit);
 void policy_data_free(X509_POLICY_DATA *data);
 
@@ -208,15 +195,18 @@ void policy_cache_init(void);
 void policy_cache_free(X509_POLICY_CACHE *cache);
 
 X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level,
 void policy_cache_free(X509_POLICY_CACHE *cache);
 
 X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level,
+                                       const X509_POLICY_NODE *parent, 
                                        const ASN1_OBJECT *id);
 
 X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk,
                                                const ASN1_OBJECT *id);
 
 X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
                                        const ASN1_OBJECT *id);
 
 X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk,
                                                const ASN1_OBJECT *id);
 
 X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
-                       X509_POLICY_DATA *data,
+                       const X509_POLICY_DATA *data,
                        X509_POLICY_NODE *parent,
                        X509_POLICY_TREE *tree);
 void policy_node_free(X509_POLICY_NODE *node);
                        X509_POLICY_NODE *parent,
                        X509_POLICY_TREE *tree);
 void policy_node_free(X509_POLICY_NODE *node);
+int policy_node_match(const X509_POLICY_LEVEL *lvl,
+                     const X509_POLICY_NODE *node, const ASN1_OBJECT *oid);
 
 const X509_POLICY_CACHE *policy_cache_set(X509 *x);
 
 const X509_POLICY_CACHE *policy_cache_set(X509 *x);