summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3/pcy_int.h
diff options
context:
space:
mode:
authorjsing <>2014-04-21 08:41:26 +0000
committerjsing <>2014-04-21 08:41:26 +0000
commitaf50ddfc8cd7409b6577826223496779c69cd1e0 (patch)
treef2f8e8a8d38afa820e7b749c66023be793b9ca3c /src/lib/libcrypto/x509v3/pcy_int.h
parentf46c697a11680ae5d3ab06393f0bfe2ed1841168 (diff)
downloadopenbsd-af50ddfc8cd7409b6577826223496779c69cd1e0.tar.gz
openbsd-af50ddfc8cd7409b6577826223496779c69cd1e0.tar.bz2
openbsd-af50ddfc8cd7409b6577826223496779c69cd1e0.zip
KNF.
Diffstat (limited to 'src/lib/libcrypto/x509v3/pcy_int.h')
-rw-r--r--src/lib/libcrypto/x509v3/pcy_int.h42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/lib/libcrypto/x509v3/pcy_int.h b/src/lib/libcrypto/x509v3/pcy_int.h
index ccff92846e..4798a23853 100644
--- a/src/lib/libcrypto/x509v3/pcy_int.h
+++ b/src/lib/libcrypto/x509v3/pcy_int.h
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -69,19 +69,18 @@ DECLARE_STACK_OF(X509_POLICY_DATA)
69 * can be kept static and cached with the certificate. 69 * can be kept static and cached with the certificate.
70 */ 70 */
71 71
72struct X509_POLICY_DATA_st 72struct X509_POLICY_DATA_st {
73 {
74 unsigned int flags; 73 unsigned int flags;
75 /* Policy OID and qualifiers for this data */ 74 /* Policy OID and qualifiers for this data */
76 ASN1_OBJECT *valid_policy; 75 ASN1_OBJECT *valid_policy;
77 STACK_OF(POLICYQUALINFO) *qualifier_set; 76 STACK_OF(POLICYQUALINFO) *qualifier_set;
78 STACK_OF(ASN1_OBJECT) *expected_policy_set; 77 STACK_OF(ASN1_OBJECT) *expected_policy_set;
79 }; 78};
80 79
81/* X509_POLICY_DATA flags values */ 80/* X509_POLICY_DATA flags values */
82 81
83/* This flag indicates the structure has been mapped using a policy mapping 82/* This flag indicates the structure has been mapped using a policy mapping
84 * extension. If policy mapping is not active its references get deleted. 83 * extension. If policy mapping is not active its references get deleted.
85 */ 84 */
86 85
87#define POLICY_DATA_FLAG_MAPPED 0x1 86#define POLICY_DATA_FLAG_MAPPED 0x1
@@ -125,24 +124,22 @@ struct X509_POLICY_CACHE_st {
125 * value or -1 if absent. 124 * value or -1 if absent.
126 */ 125 */
127 long map_skip; 126 long map_skip;
128 }; 127};
129 128
130/*#define POLICY_CACHE_FLAG_CRITICAL POLICY_DATA_FLAG_CRITICAL*/ 129/*#define POLICY_CACHE_FLAG_CRITICAL POLICY_DATA_FLAG_CRITICAL*/
131 130
132/* This structure represents the relationship between nodes */ 131/* This structure represents the relationship between nodes */
133 132
134struct X509_POLICY_NODE_st 133struct X509_POLICY_NODE_st {
135 {
136 /* node data this refers to */ 134 /* node data this refers to */
137 const X509_POLICY_DATA *data; 135 const X509_POLICY_DATA *data;
138 /* Parent node */ 136 /* Parent node */
139 X509_POLICY_NODE *parent; 137 X509_POLICY_NODE *parent;
140 /* Number of child nodes */ 138 /* Number of child nodes */
141 int nchild; 139 int nchild;
142 }; 140};
143 141
144struct X509_POLICY_LEVEL_st 142struct X509_POLICY_LEVEL_st {
145 {
146 /* Cert for this level */ 143 /* Cert for this level */
147 X509 *cert; 144 X509 *cert;
148 /* nodes at this level */ 145 /* nodes at this level */
@@ -152,10 +149,9 @@ struct X509_POLICY_LEVEL_st
152 /* Extra data */ 149 /* Extra data */
153 /*STACK_OF(X509_POLICY_DATA) *extra_data;*/ 150 /*STACK_OF(X509_POLICY_DATA) *extra_data;*/
154 unsigned int flags; 151 unsigned int flags;
155 }; 152};
156 153
157struct X509_POLICY_TREE_st 154struct X509_POLICY_TREE_st {
158 {
159 /* This is the tree 'level' data */ 155 /* This is the tree 'level' data */
160 X509_POLICY_LEVEL *levels; 156 X509_POLICY_LEVEL *levels;
161 int nlevel; 157 int nlevel;
@@ -167,7 +163,7 @@ struct X509_POLICY_TREE_st
167 STACK_OF(X509_POLICY_NODE) *auth_policies; 163 STACK_OF(X509_POLICY_NODE) *auth_policies;
168 STACK_OF(X509_POLICY_NODE) *user_policies; 164 STACK_OF(X509_POLICY_NODE) *user_policies;
169 unsigned int flags; 165 unsigned int flags;
170 }; 166};
171 167
172/* Set if anyPolicy present in user policies */ 168/* Set if anyPolicy present in user policies */
173#define POLICY_FLAG_ANY_POLICY 0x2 169#define POLICY_FLAG_ANY_POLICY 0x2
@@ -180,11 +176,11 @@ struct X509_POLICY_TREE_st
180/* Internal functions */ 176/* Internal functions */
181 177
182X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, const ASN1_OBJECT *id, 178X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, const ASN1_OBJECT *id,
183 int crit); 179 int crit);
184void policy_data_free(X509_POLICY_DATA *data); 180void policy_data_free(X509_POLICY_DATA *data);
185 181
186X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, 182X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache,
187 const ASN1_OBJECT *id); 183 const ASN1_OBJECT *id);
188int policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps); 184int policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps);
189 185
190 186
@@ -195,18 +191,16 @@ void policy_cache_init(void);
195void policy_cache_free(X509_POLICY_CACHE *cache); 191void policy_cache_free(X509_POLICY_CACHE *cache);
196 192
197X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level, 193X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level,
198 const X509_POLICY_NODE *parent, 194 const X509_POLICY_NODE *parent, const ASN1_OBJECT *id);
199 const ASN1_OBJECT *id);
200 195
201X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk, 196X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk,
202 const ASN1_OBJECT *id); 197 const ASN1_OBJECT *id);
203 198
204X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, 199X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level,
205 const X509_POLICY_DATA *data, 200 const X509_POLICY_DATA *data, X509_POLICY_NODE *parent,
206 X509_POLICY_NODE *parent, 201 X509_POLICY_TREE *tree);
207 X509_POLICY_TREE *tree);
208void policy_node_free(X509_POLICY_NODE *node); 202void policy_node_free(X509_POLICY_NODE *node);
209int policy_node_match(const X509_POLICY_LEVEL *lvl, 203int policy_node_match(const X509_POLICY_LEVEL *lvl,
210 const X509_POLICY_NODE *node, const ASN1_OBJECT *oid); 204 const X509_POLICY_NODE *node, const ASN1_OBJECT *oid);
211 205
212const X509_POLICY_CACHE *policy_cache_set(X509 *x); 206const X509_POLICY_CACHE *policy_cache_set(X509 *x);