summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_ext.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/x509_ext.c')
-rw-r--r--src/lib/libcrypto/x509/x509_ext.c106
1 files changed, 29 insertions, 77 deletions
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c
index 1d76ecfcfd..f8565a60b2 100644
--- a/src/lib/libcrypto/x509/x509_ext.c
+++ b/src/lib/libcrypto/x509/x509_ext.c
@@ -57,166 +57,118 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "stack.h" 60#include <openssl/stack.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include "asn1.h" 62#include <openssl/asn1.h>
63#include "objects.h" 63#include <openssl/objects.h>
64#include "evp.h" 64#include <openssl/evp.h>
65#include "x509.h" 65#include <openssl/x509.h>
66 66
67int X509_CRL_get_ext_count(x) 67int X509_CRL_get_ext_count(X509_CRL *x)
68X509_CRL *x;
69 { 68 {
70 return(X509v3_get_ext_count(x->crl->extensions)); 69 return(X509v3_get_ext_count(x->crl->extensions));
71 } 70 }
72 71
73int X509_CRL_get_ext_by_NID(x,nid,lastpos) 72int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos)
74X509_CRL *x;
75int nid;
76int lastpos;
77 { 73 {
78 return(X509v3_get_ext_by_NID(x->crl->extensions,nid,lastpos)); 74 return(X509v3_get_ext_by_NID(x->crl->extensions,nid,lastpos));
79 } 75 }
80 76
81int X509_CRL_get_ext_by_OBJ(x,obj,lastpos) 77int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos)
82X509_CRL *x;
83ASN1_OBJECT *obj;
84int lastpos;
85 { 78 {
86 return(X509v3_get_ext_by_OBJ(x->crl->extensions,obj,lastpos)); 79 return(X509v3_get_ext_by_OBJ(x->crl->extensions,obj,lastpos));
87 } 80 }
88 81
89int X509_CRL_get_ext_by_critical(x,crit,lastpos) 82int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos)
90X509_CRL *x;
91int crit;
92int lastpos;
93 { 83 {
94 return(X509v3_get_ext_by_critical(x->crl->extensions,crit,lastpos)); 84 return(X509v3_get_ext_by_critical(x->crl->extensions,crit,lastpos));
95 } 85 }
96 86
97X509_EXTENSION *X509_CRL_get_ext(x,loc) 87X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc)
98X509_CRL *x;
99int loc;
100 { 88 {
101 return(X509v3_get_ext(x->crl->extensions,loc)); 89 return(X509v3_get_ext(x->crl->extensions,loc));
102 } 90 }
103 91
104X509_EXTENSION *X509_CRL_delete_ext(x,loc) 92X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc)
105X509_CRL *x;
106int loc;
107 { 93 {
108 return(X509v3_delete_ext(x->crl->extensions,loc)); 94 return(X509v3_delete_ext(x->crl->extensions,loc));
109 } 95 }
110 96
111int X509_CRL_add_ext(x,ex,loc) 97int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
112X509_CRL *x;
113X509_EXTENSION *ex;
114int loc;
115 { 98 {
116 return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL); 99 return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL);
117 } 100 }
118 101
119int X509_get_ext_count(x) 102int X509_get_ext_count(X509 *x)
120X509 *x;
121 { 103 {
122 return(X509v3_get_ext_count(x->cert_info->extensions)); 104 return(X509v3_get_ext_count(x->cert_info->extensions));
123 } 105 }
124 106
125int X509_get_ext_by_NID(x,nid,lastpos) 107int X509_get_ext_by_NID(X509 *x, int nid, int lastpos)
126X509 *x;
127int nid;
128int lastpos;
129 { 108 {
130 return(X509v3_get_ext_by_NID(x->cert_info->extensions,nid,lastpos)); 109 return(X509v3_get_ext_by_NID(x->cert_info->extensions,nid,lastpos));
131 } 110 }
132 111
133int X509_get_ext_by_OBJ(x,obj,lastpos) 112int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos)
134X509 *x;
135ASN1_OBJECT *obj;
136int lastpos;
137 { 113 {
138 return(X509v3_get_ext_by_OBJ(x->cert_info->extensions,obj,lastpos)); 114 return(X509v3_get_ext_by_OBJ(x->cert_info->extensions,obj,lastpos));
139 } 115 }
140 116
141int X509_get_ext_by_critical(x,crit,lastpos) 117int X509_get_ext_by_critical(X509 *x, int crit, int lastpos)
142X509 *x;
143int crit;
144int lastpos;
145 { 118 {
146 return(X509v3_get_ext_by_critical(x->cert_info->extensions,crit,lastpos)); 119 return(X509v3_get_ext_by_critical(x->cert_info->extensions,crit,lastpos));
147 } 120 }
148 121
149X509_EXTENSION *X509_get_ext(x,loc) 122X509_EXTENSION *X509_get_ext(X509 *x, int loc)
150X509 *x;
151int loc;
152 { 123 {
153 return(X509v3_get_ext(x->cert_info->extensions,loc)); 124 return(X509v3_get_ext(x->cert_info->extensions,loc));
154 } 125 }
155 126
156X509_EXTENSION *X509_delete_ext(x,loc) 127X509_EXTENSION *X509_delete_ext(X509 *x, int loc)
157X509 *x;
158int loc;
159 { 128 {
160 return(X509v3_delete_ext(x->cert_info->extensions,loc)); 129 return(X509v3_delete_ext(x->cert_info->extensions,loc));
161 } 130 }
162 131
163int X509_add_ext(x,ex,loc) 132int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc)
164X509 *x;
165X509_EXTENSION *ex;
166int loc;
167 { 133 {
168 return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL); 134 return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL);
169 } 135 }
170 136
171int X509_REVOKED_get_ext_count(x) 137int X509_REVOKED_get_ext_count(X509_REVOKED *x)
172X509_REVOKED *x;
173 { 138 {
174 return(X509v3_get_ext_count(x->extensions)); 139 return(X509v3_get_ext_count(x->extensions));
175 } 140 }
176 141
177int X509_REVOKED_get_ext_by_NID(x,nid,lastpos) 142int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos)
178X509_REVOKED *x;
179int nid;
180int lastpos;
181 { 143 {
182 return(X509v3_get_ext_by_NID(x->extensions,nid,lastpos)); 144 return(X509v3_get_ext_by_NID(x->extensions,nid,lastpos));
183 } 145 }
184 146
185int X509_REVOKED_get_ext_by_OBJ(x,obj,lastpos) 147int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj,
186X509_REVOKED *x; 148 int lastpos)
187ASN1_OBJECT *obj;
188int lastpos;
189 { 149 {
190 return(X509v3_get_ext_by_OBJ(x->extensions,obj,lastpos)); 150 return(X509v3_get_ext_by_OBJ(x->extensions,obj,lastpos));
191 } 151 }
192 152
193int X509_REVOKED_get_ext_by_critical(x,crit,lastpos) 153int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos)
194X509_REVOKED *x;
195int crit;
196int lastpos;
197 { 154 {
198 return(X509v3_get_ext_by_critical(x->extensions,crit,lastpos)); 155 return(X509v3_get_ext_by_critical(x->extensions,crit,lastpos));
199 } 156 }
200 157
201X509_EXTENSION *X509_REVOKED_get_ext(x,loc) 158X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc)
202X509_REVOKED *x;
203int loc;
204 { 159 {
205 return(X509v3_get_ext(x->extensions,loc)); 160 return(X509v3_get_ext(x->extensions,loc));
206 } 161 }
207 162
208X509_EXTENSION *X509_REVOKED_delete_ext(x,loc) 163X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc)
209X509_REVOKED *x;
210int loc;
211 { 164 {
212 return(X509v3_delete_ext(x->extensions,loc)); 165 return(X509v3_delete_ext(x->extensions,loc));
213 } 166 }
214 167
215int X509_REVOKED_add_ext(x,ex,loc) 168int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc)
216X509_REVOKED *x;
217X509_EXTENSION *ex;
218int loc;
219 { 169 {
220 return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL); 170 return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL);
221 } 171 }
222 172
173IMPLEMENT_STACK_OF(X509_EXTENSION)
174IMPLEMENT_ASN1_SET_OF(X509_EXTENSION)