diff options
Diffstat (limited to 'src/daemon/https/x509/x509.h')
-rw-r--r-- | src/daemon/https/x509/x509.h | 520 |
1 files changed, 271 insertions, 249 deletions
diff --git a/src/daemon/https/x509/x509.h b/src/daemon/https/x509/x509.h index 87a81954..3afda0da 100644 --- a/src/daemon/https/x509/x509.h +++ b/src/daemon/https/x509/x509.h | |||
@@ -90,17 +90,19 @@ extern "C" | |||
90 | int MHD_gnutls_x509_crt_init (MHD_gnutls_x509_crt_t * cert); | 90 | int MHD_gnutls_x509_crt_init (MHD_gnutls_x509_crt_t * cert); |
91 | void MHD_gnutls_x509_crt_deinit (MHD_gnutls_x509_crt_t cert); | 91 | void MHD_gnutls_x509_crt_deinit (MHD_gnutls_x509_crt_t cert); |
92 | int MHD_gnutls_x509_crt_import (MHD_gnutls_x509_crt_t cert, | 92 | int MHD_gnutls_x509_crt_import (MHD_gnutls_x509_crt_t cert, |
93 | const MHD_gnutls_datum_t * data, | 93 | const MHD_gnutls_datum_t * data, |
94 | MHD_gnutls_x509_crt_fmt_t format); | 94 | MHD_gnutls_x509_crt_fmt_t format); |
95 | int MHD_gnutls_x509_crt_export (MHD_gnutls_x509_crt_t cert, | 95 | int MHD_gnutls_x509_crt_export (MHD_gnutls_x509_crt_t cert, |
96 | MHD_gnutls_x509_crt_fmt_t format, | 96 | MHD_gnutls_x509_crt_fmt_t format, |
97 | void *output_data, size_t * output_data_size); | 97 | void *output_data, |
98 | size_t * output_data_size); | ||
98 | int MHD_gnutls_x509_crt_check_hostname (MHD_gnutls_x509_crt_t cert, | 99 | int MHD_gnutls_x509_crt_check_hostname (MHD_gnutls_x509_crt_t cert, |
99 | const char *hostname); | 100 | const char *hostname); |
100 | 101 | ||
101 | int MHD_gnutls_x509_crt_get_signature_algorithm (MHD_gnutls_x509_crt_t cert); | 102 | int MHD_gnutls_x509_crt_get_signature_algorithm (MHD_gnutls_x509_crt_t |
103 | cert); | ||
102 | int MHD_gnutls_x509_crt_get_signature (MHD_gnutls_x509_crt_t cert, | 104 | int MHD_gnutls_x509_crt_get_signature (MHD_gnutls_x509_crt_t cert, |
103 | char *sig, size_t * sizeof_sig); | 105 | char *sig, size_t * sizeof_sig); |
104 | int MHD_gnutls_x509_crt_get_version (MHD_gnutls_x509_crt_t cert); | 106 | int MHD_gnutls_x509_crt_get_version (MHD_gnutls_x509_crt_t cert); |
105 | 107 | ||
106 | #define GNUTLS_CRL_REASON_UNUSED 128 | 108 | #define GNUTLS_CRL_REASON_UNUSED 128 |
@@ -116,86 +118,90 @@ extern "C" | |||
116 | time_t MHD_gnutls_x509_crt_get_activation_time (MHD_gnutls_x509_crt_t cert); | 118 | time_t MHD_gnutls_x509_crt_get_activation_time (MHD_gnutls_x509_crt_t cert); |
117 | time_t MHD_gnutls_x509_crt_get_expiration_time (MHD_gnutls_x509_crt_t cert); | 119 | time_t MHD_gnutls_x509_crt_get_expiration_time (MHD_gnutls_x509_crt_t cert); |
118 | int MHD_gnutls_x509_crt_get_serial (MHD_gnutls_x509_crt_t cert, | 120 | int MHD_gnutls_x509_crt_get_serial (MHD_gnutls_x509_crt_t cert, |
119 | void *result, size_t * result_size); | 121 | void *result, size_t * result_size); |
120 | 122 | ||
121 | int MHD_gnutls_x509_crt_get_pk_algorithm (MHD_gnutls_x509_crt_t cert, | 123 | int MHD_gnutls_x509_crt_get_pk_algorithm (MHD_gnutls_x509_crt_t cert, |
122 | unsigned int *bits); | 124 | unsigned int *bits); |
123 | int MHD_gnutls_x509_crt_get_subject_alt_name (MHD_gnutls_x509_crt_t cert, | 125 | int MHD_gnutls_x509_crt_get_subject_alt_name (MHD_gnutls_x509_crt_t cert, |
124 | unsigned int seq, | 126 | unsigned int seq, |
125 | void *ret, | 127 | void *ret, |
126 | size_t * ret_size, | 128 | size_t * ret_size, |
127 | unsigned int *critical); | 129 | unsigned int *critical); |
128 | int MHD_gnutls_x509_crt_get_ca_status (MHD_gnutls_x509_crt_t cert, | 130 | int MHD_gnutls_x509_crt_get_ca_status (MHD_gnutls_x509_crt_t cert, |
129 | unsigned int *critical); | 131 | unsigned int *critical); |
130 | /* The key_usage flags are defined in gnutls.h. They are the | 132 | /* The key_usage flags are defined in gnutls.h. They are the |
131 | * GNUTLS_KEY_* definitions. | 133 | * GNUTLS_KEY_* definitions. |
132 | */ | 134 | */ |
133 | int MHD_gnutls_x509_crt_get_key_usage (MHD_gnutls_x509_crt_t cert, | 135 | int MHD_gnutls_x509_crt_get_key_usage (MHD_gnutls_x509_crt_t cert, |
134 | unsigned int *key_usage, | 136 | unsigned int *key_usage, |
135 | unsigned int *critical); | 137 | unsigned int *critical); |
136 | int MHD_gnutls_x509_crt_set_key_usage (MHD_gnutls_x509_crt_t crt, | 138 | int MHD_gnutls_x509_crt_set_key_usage (MHD_gnutls_x509_crt_t crt, |
137 | unsigned int usage); | 139 | unsigned int usage); |
138 | 140 | ||
139 | int MHD_gnutls_x509_dn_oid_known (const char *oid); | 141 | int MHD_gnutls_x509_dn_oid_known (const char *oid); |
140 | 142 | ||
141 | /* Read extensions by sequence number. */ | 143 | /* Read extensions by sequence number. */ |
142 | int MHD_gnutls_x509_crt_set_extension_by_oid (MHD_gnutls_x509_crt_t crt, | 144 | int MHD_gnutls_x509_crt_set_extension_by_oid (MHD_gnutls_x509_crt_t crt, |
143 | const char *oid, | 145 | const char *oid, |
144 | const void *buf, | 146 | const void *buf, |
145 | size_t sizeof_buf, | 147 | size_t sizeof_buf, |
146 | unsigned int critical); | 148 | unsigned int critical); |
147 | 149 | ||
148 | /* X.509 Certificate writing. | 150 | /* X.509 Certificate writing. |
149 | */ | 151 | */ |
150 | int MHD_gnutls_x509_crt_set_dn_by_oid (MHD_gnutls_x509_crt_t crt, | 152 | int MHD_gnutls_x509_crt_set_dn_by_oid (MHD_gnutls_x509_crt_t crt, |
151 | const char *oid, | 153 | const char *oid, |
152 | unsigned int raw_flag, | 154 | unsigned int raw_flag, |
153 | const void *name, | 155 | const void *name, |
154 | unsigned int sizeof_name); | 156 | unsigned int sizeof_name); |
155 | int MHD_gnutls_x509_crt_set_issuer_dn_by_oid (MHD_gnutls_x509_crt_t crt, | 157 | int MHD_gnutls_x509_crt_set_issuer_dn_by_oid (MHD_gnutls_x509_crt_t crt, |
156 | const char *oid, | 158 | const char *oid, |
157 | unsigned int raw_flag, | 159 | unsigned int raw_flag, |
158 | const void *name, | 160 | const void *name, |
159 | unsigned int sizeof_name); | 161 | unsigned int sizeof_name); |
160 | int MHD_gnutls_x509_crt_set_version (MHD_gnutls_x509_crt_t crt, | 162 | int MHD_gnutls_x509_crt_set_version (MHD_gnutls_x509_crt_t crt, |
161 | unsigned int version); | 163 | unsigned int version); |
162 | int MHD_gnutls_x509_crt_set_key (MHD_gnutls_x509_crt_t crt, | 164 | int MHD_gnutls_x509_crt_set_key (MHD_gnutls_x509_crt_t crt, |
163 | MHD_gnutls_x509_privkey_t key); | 165 | MHD_gnutls_x509_privkey_t key); |
164 | int MHD_gnutls_x509_crt_set_ca_status (MHD_gnutls_x509_crt_t crt, unsigned int ca); | 166 | int MHD_gnutls_x509_crt_set_ca_status (MHD_gnutls_x509_crt_t crt, |
167 | unsigned int ca); | ||
165 | int MHD_gnutls_x509_crt_set_basic_constraints (MHD_gnutls_x509_crt_t crt, | 168 | int MHD_gnutls_x509_crt_set_basic_constraints (MHD_gnutls_x509_crt_t crt, |
166 | unsigned int ca, | 169 | unsigned int ca, |
167 | int pathLenConstraint); | 170 | int pathLenConstraint); |
168 | int MHD_gnutls_x509_crt_set_subject_alternative_name (MHD_gnutls_x509_crt_t crt, | 171 | int MHD_gnutls_x509_crt_set_subject_alternative_name (MHD_gnutls_x509_crt_t |
169 | MHD_gnutls_x509_subject_alt_name_t | 172 | crt, |
170 | type, | 173 | MHD_gnutls_x509_subject_alt_name_t |
171 | const char *data_string); | 174 | type, |
175 | const char | ||
176 | *data_string); | ||
172 | int MHD_gnutls_x509_crt_sign (MHD_gnutls_x509_crt_t crt, | 177 | int MHD_gnutls_x509_crt_sign (MHD_gnutls_x509_crt_t crt, |
173 | MHD_gnutls_x509_crt_t issuer, | 178 | MHD_gnutls_x509_crt_t issuer, |
174 | MHD_gnutls_x509_privkey_t issuer_key); | 179 | MHD_gnutls_x509_privkey_t issuer_key); |
175 | int MHD_gnutls_x509_crt_sign2 (MHD_gnutls_x509_crt_t crt, | 180 | int MHD_gnutls_x509_crt_sign2 (MHD_gnutls_x509_crt_t crt, |
176 | MHD_gnutls_x509_crt_t issuer, | 181 | MHD_gnutls_x509_crt_t issuer, |
177 | MHD_gnutls_x509_privkey_t issuer_key, | 182 | MHD_gnutls_x509_privkey_t issuer_key, |
178 | enum MHD_GNUTLS_HashAlgorithm, | 183 | enum MHD_GNUTLS_HashAlgorithm, |
179 | unsigned int flags); | 184 | unsigned int flags); |
180 | int MHD_gnutls_x509_crt_set_activation_time (MHD_gnutls_x509_crt_t cert, | 185 | int MHD_gnutls_x509_crt_set_activation_time (MHD_gnutls_x509_crt_t cert, |
181 | time_t act_time); | 186 | time_t act_time); |
182 | int MHD_gnutls_x509_crt_set_expiration_time (MHD_gnutls_x509_crt_t cert, | 187 | int MHD_gnutls_x509_crt_set_expiration_time (MHD_gnutls_x509_crt_t cert, |
183 | time_t exp_time); | 188 | time_t exp_time); |
184 | int MHD_gnutls_x509_crt_set_serial (MHD_gnutls_x509_crt_t cert, | 189 | int MHD_gnutls_x509_crt_set_serial (MHD_gnutls_x509_crt_t cert, |
185 | const void *serial, size_t serial_size); | 190 | const void *serial, size_t serial_size); |
186 | 191 | ||
187 | int MHD_gnutls_x509_crt_set_subject_key_id (MHD_gnutls_x509_crt_t cert, | 192 | int MHD_gnutls_x509_crt_set_subject_key_id (MHD_gnutls_x509_crt_t cert, |
188 | const void *id, size_t id_size); | 193 | const void *id, size_t id_size); |
189 | 194 | ||
190 | int MHD_gnutls_x509_crt_set_proxy_dn (MHD_gnutls_x509_crt_t crt, | 195 | int MHD_gnutls_x509_crt_set_proxy_dn (MHD_gnutls_x509_crt_t crt, |
191 | MHD_gnutls_x509_crt_t eecrt, | 196 | MHD_gnutls_x509_crt_t eecrt, |
192 | unsigned int raw_flag, | 197 | unsigned int raw_flag, |
193 | const void *name, | 198 | const void *name, |
194 | unsigned int sizeof_name); | 199 | unsigned int sizeof_name); |
195 | int MHD_gnutls_x509_crt_set_proxy (MHD_gnutls_x509_crt_t crt, | 200 | int MHD_gnutls_x509_crt_set_proxy (MHD_gnutls_x509_crt_t crt, |
196 | int pathLenConstraint, | 201 | int pathLenConstraint, |
197 | const char *policyLanguage, | 202 | const char *policyLanguage, |
198 | const char *policy, size_t sizeof_policy); | 203 | const char *policy, |
204 | size_t sizeof_policy); | ||
199 | 205 | ||
200 | typedef enum MHD_gnutls_certificate_print_formats | 206 | typedef enum MHD_gnutls_certificate_print_formats |
201 | { | 207 | { |
@@ -205,31 +211,31 @@ extern "C" | |||
205 | } MHD_gnutls_certificate_print_formats_t; | 211 | } MHD_gnutls_certificate_print_formats_t; |
206 | 212 | ||
207 | int MHD_gnutls_x509_crt_print (MHD_gnutls_x509_crt_t cert, | 213 | int MHD_gnutls_x509_crt_print (MHD_gnutls_x509_crt_t cert, |
208 | MHD_gnutls_certificate_print_formats_t format, | 214 | MHD_gnutls_certificate_print_formats_t |
209 | MHD_gnutls_datum_t * out); | 215 | format, MHD_gnutls_datum_t * out); |
210 | int MHD_gnutls_x509_crl_print (MHD_gnutls_x509_crl_t crl, | 216 | int MHD_gnutls_x509_crl_print (MHD_gnutls_x509_crl_t crl, |
211 | MHD_gnutls_certificate_print_formats_t format, | 217 | MHD_gnutls_certificate_print_formats_t |
212 | MHD_gnutls_datum_t * out); | 218 | format, MHD_gnutls_datum_t * out); |
213 | 219 | ||
214 | /* Access to internal Certificate fields. | 220 | /* Access to internal Certificate fields. |
215 | */ | 221 | */ |
216 | int MHD_gnutls_x509_crt_get_raw_issuer_dn (MHD_gnutls_x509_crt_t cert, | 222 | int MHD_gnutls_x509_crt_get_raw_issuer_dn (MHD_gnutls_x509_crt_t cert, |
217 | MHD_gnutls_datum_t * start); | 223 | MHD_gnutls_datum_t * start); |
218 | int MHD_gnutls_x509_crt_get_raw_dn (MHD_gnutls_x509_crt_t cert, | 224 | int MHD_gnutls_x509_crt_get_raw_dn (MHD_gnutls_x509_crt_t cert, |
219 | MHD_gnutls_datum_t * start); | 225 | MHD_gnutls_datum_t * start); |
220 | 226 | ||
221 | /* RDN handling. | 227 | /* RDN handling. |
222 | */ | 228 | */ |
223 | int MHD_gnutls_x509_rdn_get (const MHD_gnutls_datum_t * idn, | 229 | int MHD_gnutls_x509_rdn_get (const MHD_gnutls_datum_t * idn, |
224 | char *buf, size_t * sizeof_buf); | 230 | char *buf, size_t * sizeof_buf); |
225 | int MHD_gnutls_x509_rdn_get_oid (const MHD_gnutls_datum_t * idn, | 231 | int MHD_gnutls_x509_rdn_get_oid (const MHD_gnutls_datum_t * idn, |
226 | int indx, void *buf, size_t * sizeof_buf); | 232 | int indx, void *buf, size_t * sizeof_buf); |
227 | 233 | ||
228 | int MHD_gnutls_x509_rdn_get_by_oid (const MHD_gnutls_datum_t * idn, | 234 | int MHD_gnutls_x509_rdn_get_by_oid (const MHD_gnutls_datum_t * idn, |
229 | const char *oid, | 235 | const char *oid, |
230 | int indx, | 236 | int indx, |
231 | unsigned int raw_flag, | 237 | unsigned int raw_flag, |
232 | void *buf, size_t * sizeof_buf); | 238 | void *buf, size_t * sizeof_buf); |
233 | 239 | ||
234 | typedef void *MHD_gnutls_x509_dn_t; | 240 | typedef void *MHD_gnutls_x509_dn_t; |
235 | 241 | ||
@@ -241,30 +247,32 @@ extern "C" | |||
241 | } MHD_gnutls_x509_ava_st; | 247 | } MHD_gnutls_x509_ava_st; |
242 | 248 | ||
243 | int MHD_gnutls_x509_crt_get_subject (MHD_gnutls_x509_crt_t cert, | 249 | int MHD_gnutls_x509_crt_get_subject (MHD_gnutls_x509_crt_t cert, |
244 | MHD_gnutls_x509_dn_t * dn); | 250 | MHD_gnutls_x509_dn_t * dn); |
245 | /* CRL handling functions. | 251 | /* CRL handling functions. |
246 | */ | 252 | */ |
247 | int MHD_gnutls_x509_crl_init (MHD_gnutls_x509_crl_t * crl); | 253 | int MHD_gnutls_x509_crl_init (MHD_gnutls_x509_crl_t * crl); |
248 | void MHD_gnutls_x509_crl_deinit (MHD_gnutls_x509_crl_t crl); | 254 | void MHD_gnutls_x509_crl_deinit (MHD_gnutls_x509_crl_t crl); |
249 | 255 | ||
250 | int MHD_gnutls_x509_crl_import (MHD_gnutls_x509_crl_t crl, | 256 | int MHD_gnutls_x509_crl_import (MHD_gnutls_x509_crl_t crl, |
251 | const MHD_gnutls_datum_t * data, | 257 | const MHD_gnutls_datum_t * data, |
252 | MHD_gnutls_x509_crt_fmt_t format); | 258 | MHD_gnutls_x509_crt_fmt_t format); |
253 | int MHD_gnutls_x509_crl_export (MHD_gnutls_x509_crl_t crl, | 259 | int MHD_gnutls_x509_crl_export (MHD_gnutls_x509_crl_t crl, |
254 | MHD_gnutls_x509_crt_fmt_t format, | 260 | MHD_gnutls_x509_crt_fmt_t format, |
255 | void *output_data, size_t * output_data_size); | 261 | void *output_data, |
262 | size_t * output_data_size); | ||
256 | 263 | ||
257 | int MHD_gnutls_x509_crl_get_issuer_dn_by_oid (MHD_gnutls_x509_crl_t crl, | 264 | int MHD_gnutls_x509_crl_get_issuer_dn_by_oid (MHD_gnutls_x509_crl_t crl, |
258 | const char *oid, | 265 | const char *oid, |
259 | int indx, | 266 | int indx, |
260 | unsigned int raw_flag, | 267 | unsigned int raw_flag, |
261 | void *buf, size_t * sizeof_buf); | 268 | void *buf, |
262 | int MHD_gnutls_x509_crl_get_dn_oid (MHD_gnutls_x509_crl_t crl, | 269 | size_t * sizeof_buf); |
263 | int indx, void *oid, size_t * sizeof_oid); | 270 | int MHD_gnutls_x509_crl_get_dn_oid (MHD_gnutls_x509_crl_t crl, int indx, |
271 | void *oid, size_t * sizeof_oid); | ||
264 | 272 | ||
265 | int MHD_gnutls_x509_crl_get_signature_algorithm (MHD_gnutls_x509_crl_t crl); | 273 | int MHD_gnutls_x509_crl_get_signature_algorithm (MHD_gnutls_x509_crl_t crl); |
266 | int MHD_gnutls_x509_crl_get_signature (MHD_gnutls_x509_crl_t crl, | 274 | int MHD_gnutls_x509_crl_get_signature (MHD_gnutls_x509_crl_t crl, |
267 | char *sig, size_t * sizeof_sig); | 275 | char *sig, size_t * sizeof_sig); |
268 | int MHD_gnutls_x509_crl_get_version (MHD_gnutls_x509_crl_t crl); | 276 | int MHD_gnutls_x509_crl_get_version (MHD_gnutls_x509_crl_t crl); |
269 | 277 | ||
270 | time_t MHD_gnutls_x509_crl_get_this_update (MHD_gnutls_x509_crl_t crl); | 278 | time_t MHD_gnutls_x509_crl_get_this_update (MHD_gnutls_x509_crl_t crl); |
@@ -272,37 +280,38 @@ extern "C" | |||
272 | 280 | ||
273 | int MHD_gnutls_x509_crl_get_crt_count (MHD_gnutls_x509_crl_t crl); | 281 | int MHD_gnutls_x509_crl_get_crt_count (MHD_gnutls_x509_crl_t crl); |
274 | int MHD_gnutls_x509_crl_get_crt_serial (MHD_gnutls_x509_crl_t crl, | 282 | int MHD_gnutls_x509_crl_get_crt_serial (MHD_gnutls_x509_crl_t crl, |
275 | int indx, | 283 | int indx, |
276 | unsigned char *serial, | 284 | unsigned char *serial, |
277 | size_t * serial_size, time_t * t); | 285 | size_t * serial_size, time_t * t); |
278 | #define MHD_gnutls_x509_crl_get_certificate_count MHD_gnutls_x509_crl_get_crt_count | 286 | #define MHD_gnutls_x509_crl_get_certificate_count MHD_gnutls_x509_crl_get_crt_count |
279 | #define MHD_gnutls_x509_crl_get_certificate MHD_gnutls_x509_crl_get_crt_serial | 287 | #define MHD_gnutls_x509_crl_get_certificate MHD_gnutls_x509_crl_get_crt_serial |
280 | 288 | ||
281 | int MHD_gnutls_x509_crl_check_issuer (MHD_gnutls_x509_crl_t crl, | 289 | int MHD_gnutls_x509_crl_check_issuer (MHD_gnutls_x509_crl_t crl, |
282 | MHD_gnutls_x509_crt_t issuer); | 290 | MHD_gnutls_x509_crt_t issuer); |
283 | 291 | ||
284 | /* CRL writing. | 292 | /* CRL writing. |
285 | */ | 293 | */ |
286 | int MHD_gnutls_x509_crl_set_version (MHD_gnutls_x509_crl_t crl, | 294 | int MHD_gnutls_x509_crl_set_version (MHD_gnutls_x509_crl_t crl, |
287 | unsigned int version); | 295 | unsigned int version); |
288 | int MHD_gnutls_x509_crl_sign (MHD_gnutls_x509_crl_t crl, | 296 | int MHD_gnutls_x509_crl_sign (MHD_gnutls_x509_crl_t crl, |
289 | MHD_gnutls_x509_crt_t issuer, | 297 | MHD_gnutls_x509_crt_t issuer, |
290 | MHD_gnutls_x509_privkey_t issuer_key); | 298 | MHD_gnutls_x509_privkey_t issuer_key); |
291 | int MHD_gnutls_x509_crl_sign2 (MHD_gnutls_x509_crl_t crl, | 299 | int MHD_gnutls_x509_crl_sign2 (MHD_gnutls_x509_crl_t crl, |
292 | MHD_gnutls_x509_crt_t issuer, | 300 | MHD_gnutls_x509_crt_t issuer, |
293 | MHD_gnutls_x509_privkey_t issuer_key, | 301 | MHD_gnutls_x509_privkey_t issuer_key, |
294 | enum MHD_GNUTLS_HashAlgorithm, | 302 | enum MHD_GNUTLS_HashAlgorithm, |
295 | unsigned int flags); | 303 | unsigned int flags); |
296 | int MHD_gnutls_x509_crl_set_this_update (MHD_gnutls_x509_crl_t crl, | 304 | int MHD_gnutls_x509_crl_set_this_update (MHD_gnutls_x509_crl_t crl, |
297 | time_t act_time); | 305 | time_t act_time); |
298 | int MHD_gnutls_x509_crl_set_next_update (MHD_gnutls_x509_crl_t crl, | 306 | int MHD_gnutls_x509_crl_set_next_update (MHD_gnutls_x509_crl_t crl, |
299 | time_t exp_time); | 307 | time_t exp_time); |
300 | int MHD_gnutls_x509_crl_set_crt_serial (MHD_gnutls_x509_crl_t crl, | 308 | int MHD_gnutls_x509_crl_set_crt_serial (MHD_gnutls_x509_crl_t crl, |
301 | const void *serial, | 309 | const void *serial, |
302 | size_t serial_size, | 310 | size_t serial_size, |
303 | time_t revocation_time); | 311 | time_t revocation_time); |
304 | int MHD_gnutls_x509_crl_set_crt (MHD_gnutls_x509_crl_t crl, | 312 | int MHD_gnutls_x509_crl_set_crt (MHD_gnutls_x509_crl_t crl, |
305 | MHD_gnutls_x509_crt_t crt, time_t revocation_time); | 313 | MHD_gnutls_x509_crt_t crt, |
314 | time_t revocation_time); | ||
306 | 315 | ||
307 | /* PKCS7 structures handling | 316 | /* PKCS7 structures handling |
308 | */ | 317 | */ |
@@ -312,29 +321,32 @@ extern "C" | |||
312 | int MHD_gnutls_pkcs7_init (MHD_gnutls_pkcs7_t * pkcs7); | 321 | int MHD_gnutls_pkcs7_init (MHD_gnutls_pkcs7_t * pkcs7); |
313 | void MHD_gnutls_pkcs7_deinit (MHD_gnutls_pkcs7_t pkcs7); | 322 | void MHD_gnutls_pkcs7_deinit (MHD_gnutls_pkcs7_t pkcs7); |
314 | int MHD_gnutls_pkcs7_import (MHD_gnutls_pkcs7_t pkcs7, | 323 | int MHD_gnutls_pkcs7_import (MHD_gnutls_pkcs7_t pkcs7, |
315 | const MHD_gnutls_datum_t * data, | 324 | const MHD_gnutls_datum_t * data, |
316 | MHD_gnutls_x509_crt_fmt_t format); | 325 | MHD_gnutls_x509_crt_fmt_t format); |
317 | int MHD_gnutls_pkcs7_export (MHD_gnutls_pkcs7_t pkcs7, | 326 | int MHD_gnutls_pkcs7_export (MHD_gnutls_pkcs7_t pkcs7, |
318 | MHD_gnutls_x509_crt_fmt_t format, | 327 | MHD_gnutls_x509_crt_fmt_t format, |
319 | void *output_data, size_t * output_data_size); | 328 | void *output_data, size_t * output_data_size); |
320 | 329 | ||
321 | int MHD_gnutls_pkcs7_get_crt_count (MHD_gnutls_pkcs7_t pkcs7); | 330 | int MHD_gnutls_pkcs7_get_crt_count (MHD_gnutls_pkcs7_t pkcs7); |
322 | int MHD_gnutls_pkcs7_get_crt_raw (MHD_gnutls_pkcs7_t pkcs7, | 331 | int MHD_gnutls_pkcs7_get_crt_raw (MHD_gnutls_pkcs7_t pkcs7, |
323 | int indx, | 332 | int indx, |
324 | void *certificate, size_t * certificate_size); | 333 | void *certificate, |
334 | size_t * certificate_size); | ||
325 | 335 | ||
326 | int MHD_gnutls_pkcs7_set_crt_raw (MHD_gnutls_pkcs7_t pkcs7, | 336 | int MHD_gnutls_pkcs7_set_crt_raw (MHD_gnutls_pkcs7_t pkcs7, |
327 | const MHD_gnutls_datum_t * crt); | 337 | const MHD_gnutls_datum_t * crt); |
328 | int MHD_gnutls_pkcs7_set_crt (MHD_gnutls_pkcs7_t pkcs7, MHD_gnutls_x509_crt_t crt); | 338 | int MHD_gnutls_pkcs7_set_crt (MHD_gnutls_pkcs7_t pkcs7, |
339 | MHD_gnutls_x509_crt_t crt); | ||
329 | int MHD_gnutls_pkcs7_delete_crt (MHD_gnutls_pkcs7_t pkcs7, int indx); | 340 | int MHD_gnutls_pkcs7_delete_crt (MHD_gnutls_pkcs7_t pkcs7, int indx); |
330 | 341 | ||
331 | int MHD_gnutls_pkcs7_get_crl_raw (MHD_gnutls_pkcs7_t pkcs7, | 342 | int MHD_gnutls_pkcs7_get_crl_raw (MHD_gnutls_pkcs7_t pkcs7, |
332 | int indx, void *crl, size_t * crl_size); | 343 | int indx, void *crl, size_t * crl_size); |
333 | int MHD_gnutls_pkcs7_get_crl_count (MHD_gnutls_pkcs7_t pkcs7); | 344 | int MHD_gnutls_pkcs7_get_crl_count (MHD_gnutls_pkcs7_t pkcs7); |
334 | 345 | ||
335 | int MHD_gnutls_pkcs7_set_crl_raw (MHD_gnutls_pkcs7_t pkcs7, | 346 | int MHD_gnutls_pkcs7_set_crl_raw (MHD_gnutls_pkcs7_t pkcs7, |
336 | const MHD_gnutls_datum_t * crt); | 347 | const MHD_gnutls_datum_t * crt); |
337 | int MHD_gnutls_pkcs7_set_crl (MHD_gnutls_pkcs7_t pkcs7, MHD_gnutls_x509_crl_t crl); | 348 | int MHD_gnutls_pkcs7_set_crl (MHD_gnutls_pkcs7_t pkcs7, |
349 | MHD_gnutls_x509_crl_t crl); | ||
338 | int MHD_gnutls_pkcs7_delete_crl (MHD_gnutls_pkcs7_t pkcs7, int indx); | 350 | int MHD_gnutls_pkcs7_delete_crl (MHD_gnutls_pkcs7_t pkcs7, int indx); |
339 | 351 | ||
340 | /* X.509 Certificate verification functions. | 352 | /* X.509 Certificate verification functions. |
@@ -375,28 +387,29 @@ extern "C" | |||
375 | } MHD_gnutls_certificate_verify_flags; | 387 | } MHD_gnutls_certificate_verify_flags; |
376 | 388 | ||
377 | int MHD_gnutls_x509_crt_check_issuer (MHD_gnutls_x509_crt_t cert, | 389 | int MHD_gnutls_x509_crt_check_issuer (MHD_gnutls_x509_crt_t cert, |
378 | MHD_gnutls_x509_crt_t issuer); | 390 | MHD_gnutls_x509_crt_t issuer); |
379 | 391 | ||
380 | int MHD_gnutls_x509_crt_list_verify (const MHD_gnutls_x509_crt_t * cert_list, | 392 | int MHD_gnutls_x509_crt_list_verify (const MHD_gnutls_x509_crt_t * |
381 | int cert_list_length, | 393 | cert_list, int cert_list_length, |
382 | const MHD_gnutls_x509_crt_t * CA_list, | 394 | const MHD_gnutls_x509_crt_t * CA_list, |
383 | int CA_list_length, | 395 | int CA_list_length, |
384 | const MHD_gnutls_x509_crl_t * CRL_list, | 396 | const MHD_gnutls_x509_crl_t * CRL_list, |
385 | int CRL_list_length, | 397 | int CRL_list_length, |
386 | unsigned int flags, unsigned int *verify); | 398 | unsigned int flags, |
399 | unsigned int *verify); | ||
387 | 400 | ||
388 | int MHD_gnutls_x509_crt_verify (MHD_gnutls_x509_crt_t cert, | 401 | int MHD_gnutls_x509_crt_verify (MHD_gnutls_x509_crt_t cert, |
389 | const MHD_gnutls_x509_crt_t * CA_list, | 402 | const MHD_gnutls_x509_crt_t * CA_list, |
390 | int CA_list_length, | 403 | int CA_list_length, |
391 | unsigned int flags, unsigned int *verify); | 404 | unsigned int flags, unsigned int *verify); |
392 | int MHD_gnutls_x509_crl_verify (MHD_gnutls_x509_crl_t crl, | 405 | int MHD_gnutls_x509_crl_verify (MHD_gnutls_x509_crl_t crl, |
393 | const MHD_gnutls_x509_crt_t * CA_list, | 406 | const MHD_gnutls_x509_crt_t * CA_list, |
394 | int CA_list_length, | 407 | int CA_list_length, |
395 | unsigned int flags, unsigned int *verify); | 408 | unsigned int flags, unsigned int *verify); |
396 | 409 | ||
397 | int MHD_gnutls_x509_crt_check_revocation (MHD_gnutls_x509_crt_t cert, | 410 | int MHD_gnutls_x509_crt_check_revocation (MHD_gnutls_x509_crt_t cert, |
398 | const MHD_gnutls_x509_crl_t * | 411 | const MHD_gnutls_x509_crl_t * |
399 | crl_list, int crl_list_length); | 412 | crl_list, int crl_list_length); |
400 | 413 | ||
401 | 414 | ||
402 | /* Flags for the MHD_gnutls_x509_privkey_export_pkcs8() function. | 415 | /* Flags for the MHD_gnutls_x509_privkey_export_pkcs8() function. |
@@ -420,62 +433,65 @@ extern "C" | |||
420 | int MHD_gnutls_x509_privkey_init (MHD_gnutls_x509_privkey_t * key); | 433 | int MHD_gnutls_x509_privkey_init (MHD_gnutls_x509_privkey_t * key); |
421 | void MHD_gnutls_x509_privkey_deinit (MHD_gnutls_x509_privkey_t key); | 434 | void MHD_gnutls_x509_privkey_deinit (MHD_gnutls_x509_privkey_t key); |
422 | int MHD_gnutls_x509_privkey_cpy (MHD_gnutls_x509_privkey_t dst, | 435 | int MHD_gnutls_x509_privkey_cpy (MHD_gnutls_x509_privkey_t dst, |
423 | MHD_gnutls_x509_privkey_t src); | 436 | MHD_gnutls_x509_privkey_t src); |
424 | int MHD_gnutls_x509_privkey_import (MHD_gnutls_x509_privkey_t key, | 437 | int MHD_gnutls_x509_privkey_import (MHD_gnutls_x509_privkey_t key, |
425 | const MHD_gnutls_datum_t * data, | 438 | const MHD_gnutls_datum_t * data, |
426 | MHD_gnutls_x509_crt_fmt_t format); | 439 | MHD_gnutls_x509_crt_fmt_t format); |
427 | int MHD_gnutls_x509_privkey_import_pkcs8 (MHD_gnutls_x509_privkey_t key, | 440 | int MHD_gnutls_x509_privkey_import_pkcs8 (MHD_gnutls_x509_privkey_t key, |
428 | const MHD_gnutls_datum_t * data, | 441 | const MHD_gnutls_datum_t * data, |
429 | MHD_gnutls_x509_crt_fmt_t format, | 442 | MHD_gnutls_x509_crt_fmt_t format, |
430 | const char *pass, unsigned int flags); | 443 | const char *pass, |
444 | unsigned int flags); | ||
431 | int MHD_gnutls_x509_privkey_import_rsa_raw (MHD_gnutls_x509_privkey_t key, | 445 | int MHD_gnutls_x509_privkey_import_rsa_raw (MHD_gnutls_x509_privkey_t key, |
432 | const MHD_gnutls_datum_t * m, | 446 | const MHD_gnutls_datum_t * m, |
433 | const MHD_gnutls_datum_t * e, | 447 | const MHD_gnutls_datum_t * e, |
434 | const MHD_gnutls_datum_t * d, | 448 | const MHD_gnutls_datum_t * d, |
435 | const MHD_gnutls_datum_t * p, | 449 | const MHD_gnutls_datum_t * p, |
436 | const MHD_gnutls_datum_t * q, | 450 | const MHD_gnutls_datum_t * q, |
437 | const MHD_gnutls_datum_t * u); | 451 | const MHD_gnutls_datum_t * u); |
438 | int MHD_gnutls_x509_privkey_export_dsa_raw (MHD_gnutls_x509_privkey_t key, | 452 | int MHD_gnutls_x509_privkey_export_dsa_raw (MHD_gnutls_x509_privkey_t key, |
439 | MHD_gnutls_datum_t * p, | 453 | MHD_gnutls_datum_t * p, |
440 | MHD_gnutls_datum_t * q, | 454 | MHD_gnutls_datum_t * q, |
441 | MHD_gnutls_datum_t * g, | 455 | MHD_gnutls_datum_t * g, |
442 | MHD_gnutls_datum_t * y, | 456 | MHD_gnutls_datum_t * y, |
443 | MHD_gnutls_datum_t * x); | 457 | MHD_gnutls_datum_t * x); |
444 | int MHD_gnutls_x509_privkey_import_dsa_raw (MHD_gnutls_x509_privkey_t key, | 458 | int MHD_gnutls_x509_privkey_import_dsa_raw (MHD_gnutls_x509_privkey_t key, |
445 | const MHD_gnutls_datum_t * p, | 459 | const MHD_gnutls_datum_t * p, |
446 | const MHD_gnutls_datum_t * q, | 460 | const MHD_gnutls_datum_t * q, |
447 | const MHD_gnutls_datum_t * g, | 461 | const MHD_gnutls_datum_t * g, |
448 | const MHD_gnutls_datum_t * y, | 462 | const MHD_gnutls_datum_t * y, |
449 | const MHD_gnutls_datum_t * x); | 463 | const MHD_gnutls_datum_t * x); |
450 | 464 | ||
451 | int MHD_gnutls_x509_privkey_get_pk_algorithm (MHD_gnutls_x509_privkey_t key); | 465 | int MHD_gnutls_x509_privkey_get_pk_algorithm (MHD_gnutls_x509_privkey_t |
466 | key); | ||
452 | int MHD_gnutls_x509_privkey_get_key_id (MHD_gnutls_x509_privkey_t key, | 467 | int MHD_gnutls_x509_privkey_get_key_id (MHD_gnutls_x509_privkey_t key, |
453 | unsigned int flags, | 468 | unsigned int flags, |
454 | unsigned char *output_data, | 469 | unsigned char *output_data, |
455 | size_t * output_data_size); | 470 | size_t * output_data_size); |
456 | 471 | ||
457 | int MHD_gnutls_x509_privkey_export (MHD_gnutls_x509_privkey_t key, | 472 | int MHD_gnutls_x509_privkey_export (MHD_gnutls_x509_privkey_t key, |
458 | MHD_gnutls_x509_crt_fmt_t format, | 473 | MHD_gnutls_x509_crt_fmt_t format, |
459 | void *output_data, | 474 | void *output_data, |
460 | size_t * output_data_size); | 475 | size_t * output_data_size); |
461 | int MHD_gnutls_x509_privkey_export_pkcs8 (MHD_gnutls_x509_privkey_t key, | 476 | int MHD_gnutls_x509_privkey_export_pkcs8 (MHD_gnutls_x509_privkey_t key, |
462 | MHD_gnutls_x509_crt_fmt_t format, | 477 | MHD_gnutls_x509_crt_fmt_t format, |
463 | const char *password, | 478 | const char *password, |
464 | unsigned int flags, | 479 | unsigned int flags, |
465 | void *output_data, | 480 | void *output_data, |
466 | size_t * output_data_size); | 481 | size_t * output_data_size); |
467 | int MHD_gnutls_x509_privkey_export_rsa_raw (MHD_gnutls_x509_privkey_t key, | 482 | int MHD_gnutls_x509_privkey_export_rsa_raw (MHD_gnutls_x509_privkey_t key, |
468 | MHD_gnutls_datum_t * m, | 483 | MHD_gnutls_datum_t * m, |
469 | MHD_gnutls_datum_t * e, | 484 | MHD_gnutls_datum_t * e, |
470 | MHD_gnutls_datum_t * d, | 485 | MHD_gnutls_datum_t * d, |
471 | MHD_gnutls_datum_t * p, | 486 | MHD_gnutls_datum_t * p, |
472 | MHD_gnutls_datum_t * q, | 487 | MHD_gnutls_datum_t * q, |
473 | MHD_gnutls_datum_t * u); | 488 | MHD_gnutls_datum_t * u); |
474 | 489 | ||
475 | int MHD_gnutls_x509_privkey_verify_data (MHD_gnutls_x509_privkey_t key, | 490 | int MHD_gnutls_x509_privkey_verify_data (MHD_gnutls_x509_privkey_t key, |
476 | unsigned int flags, | 491 | unsigned int flags, |
477 | const MHD_gnutls_datum_t * data, | 492 | const MHD_gnutls_datum_t * data, |
478 | const MHD_gnutls_datum_t * signature); | 493 | const MHD_gnutls_datum_t * |
494 | signature); | ||
479 | 495 | ||
480 | /* Certificate request stuff. | 496 | /* Certificate request stuff. |
481 | */ | 497 | */ |
@@ -485,53 +501,57 @@ extern "C" | |||
485 | int MHD_gnutls_x509_crq_init (MHD_gnutls_x509_crq_t * crq); | 501 | int MHD_gnutls_x509_crq_init (MHD_gnutls_x509_crq_t * crq); |
486 | void MHD_gnutls_x509_crq_deinit (MHD_gnutls_x509_crq_t crq); | 502 | void MHD_gnutls_x509_crq_deinit (MHD_gnutls_x509_crq_t crq); |
487 | int MHD_gnutls_x509_crq_import (MHD_gnutls_x509_crq_t crq, | 503 | int MHD_gnutls_x509_crq_import (MHD_gnutls_x509_crq_t crq, |
488 | const MHD_gnutls_datum_t * data, | 504 | const MHD_gnutls_datum_t * data, |
489 | MHD_gnutls_x509_crt_fmt_t format); | 505 | MHD_gnutls_x509_crt_fmt_t format); |
490 | int MHD_gnutls_x509_crq_get_pk_algorithm (MHD_gnutls_x509_crq_t crq, | 506 | int MHD_gnutls_x509_crq_get_pk_algorithm (MHD_gnutls_x509_crq_t crq, |
491 | unsigned int *bits); | 507 | unsigned int *bits); |
492 | int MHD_gnutls_x509_crq_get_dn (MHD_gnutls_x509_crq_t crq, | 508 | int MHD_gnutls_x509_crq_get_dn (MHD_gnutls_x509_crq_t crq, |
493 | char *buf, size_t * sizeof_buf); | 509 | char *buf, size_t * sizeof_buf); |
494 | int MHD_gnutls_x509_crq_get_dn_oid (MHD_gnutls_x509_crq_t crq, | 510 | int MHD_gnutls_x509_crq_get_dn_oid (MHD_gnutls_x509_crq_t crq, |
495 | int indx, void *oid, size_t * sizeof_oid); | 511 | int indx, void *oid, |
512 | size_t * sizeof_oid); | ||
496 | int MHD_gnutls_x509_crq_get_dn_by_oid (MHD_gnutls_x509_crq_t crq, | 513 | int MHD_gnutls_x509_crq_get_dn_by_oid (MHD_gnutls_x509_crq_t crq, |
497 | const char *oid, | 514 | const char *oid, int indx, |
498 | int indx, | 515 | unsigned int raw_flag, void *buf, |
499 | unsigned int raw_flag, | 516 | size_t * sizeof_buf); |
500 | void *buf, size_t * sizeof_buf); | ||
501 | int MHD_gnutls_x509_crq_set_dn_by_oid (MHD_gnutls_x509_crq_t crq, | 517 | int MHD_gnutls_x509_crq_set_dn_by_oid (MHD_gnutls_x509_crq_t crq, |
502 | const char *oid, | 518 | const char *oid, |
503 | unsigned int raw_flag, | 519 | unsigned int raw_flag, |
504 | const void *name, | 520 | const void *name, |
505 | unsigned int sizeof_name); | 521 | unsigned int sizeof_name); |
506 | int MHD_gnutls_x509_crq_set_version (MHD_gnutls_x509_crq_t crq, | 522 | int MHD_gnutls_x509_crq_set_version (MHD_gnutls_x509_crq_t crq, |
507 | unsigned int version); | 523 | unsigned int version); |
508 | int MHD_gnutls_x509_crq_set_key (MHD_gnutls_x509_crq_t crq, | 524 | int MHD_gnutls_x509_crq_set_key (MHD_gnutls_x509_crq_t crq, |
509 | MHD_gnutls_x509_privkey_t key); | 525 | MHD_gnutls_x509_privkey_t key); |
510 | int MHD_gnutls_x509_crq_sign2 (MHD_gnutls_x509_crq_t crq, | 526 | int MHD_gnutls_x509_crq_sign2 (MHD_gnutls_x509_crq_t crq, |
511 | MHD_gnutls_x509_privkey_t key, | 527 | MHD_gnutls_x509_privkey_t key, |
512 | enum MHD_GNUTLS_HashAlgorithm, | 528 | enum MHD_GNUTLS_HashAlgorithm, |
513 | unsigned int flags); | 529 | unsigned int flags); |
514 | int MHD_gnutls_x509_crq_sign (MHD_gnutls_x509_crq_t crq, MHD_gnutls_x509_privkey_t key); | 530 | int MHD_gnutls_x509_crq_sign (MHD_gnutls_x509_crq_t crq, |
531 | MHD_gnutls_x509_privkey_t key); | ||
515 | 532 | ||
516 | int MHD_gnutls_x509_crq_set_challenge_password (MHD_gnutls_x509_crq_t crq, | 533 | int MHD_gnutls_x509_crq_set_challenge_password (MHD_gnutls_x509_crq_t crq, |
517 | const char *pass); | 534 | const char *pass); |
518 | int MHD_gnutls_x509_crq_get_challenge_password (MHD_gnutls_x509_crq_t crq, | 535 | int MHD_gnutls_x509_crq_get_challenge_password (MHD_gnutls_x509_crq_t crq, |
519 | char *pass, | 536 | char *pass, |
520 | size_t * sizeof_pass); | 537 | size_t * sizeof_pass); |
521 | 538 | ||
522 | int MHD_gnutls_x509_crq_set_attribute_by_oid (MHD_gnutls_x509_crq_t crq, | 539 | int MHD_gnutls_x509_crq_set_attribute_by_oid (MHD_gnutls_x509_crq_t crq, |
523 | const char *oid, | 540 | const char *oid, |
524 | void *buf, size_t sizeof_buf); | 541 | void *buf, size_t sizeof_buf); |
525 | int MHD_gnutls_x509_crq_get_attribute_by_oid (MHD_gnutls_x509_crq_t crq, | 542 | int MHD_gnutls_x509_crq_get_attribute_by_oid (MHD_gnutls_x509_crq_t crq, |
526 | const char *oid, | 543 | const char *oid, |
527 | int indx, | 544 | int indx, |
528 | void *buf, size_t * sizeof_buf); | 545 | void *buf, |
546 | size_t * sizeof_buf); | ||
529 | 547 | ||
530 | int MHD_gnutls_x509_crq_export (MHD_gnutls_x509_crq_t crq, | 548 | int MHD_gnutls_x509_crq_export (MHD_gnutls_x509_crq_t crq, |
531 | MHD_gnutls_x509_crt_fmt_t format, | 549 | MHD_gnutls_x509_crt_fmt_t format, |
532 | void *output_data, size_t * output_data_size); | 550 | void *output_data, |
551 | size_t * output_data_size); | ||
533 | 552 | ||
534 | int MHD_gnutls_x509_crt_set_crq (MHD_gnutls_x509_crt_t crt, MHD_gnutls_x509_crq_t crq); | 553 | int MHD_gnutls_x509_crt_set_crq (MHD_gnutls_x509_crt_t crt, |
554 | MHD_gnutls_x509_crq_t crq); | ||
535 | 555 | ||
536 | #ifdef __cplusplus | 556 | #ifdef __cplusplus |
537 | } | 557 | } |
@@ -605,65 +625,66 @@ typedef struct MHD_gtls_x509_privkey_int | |||
605 | } MHD_gnutls_x509_privkey_int; | 625 | } MHD_gnutls_x509_privkey_int; |
606 | 626 | ||
607 | int MHD_gnutls_x509_crt_get_issuer_dn_by_oid (MHD_gnutls_x509_crt_t cert, | 627 | int MHD_gnutls_x509_crt_get_issuer_dn_by_oid (MHD_gnutls_x509_crt_t cert, |
608 | const char *oid, | 628 | const char *oid, |
609 | int indx, | 629 | int indx, |
610 | unsigned int raw_flag, | 630 | unsigned int raw_flag, |
611 | void *buf, size_t * sizeof_buf); | 631 | void *buf, size_t * sizeof_buf); |
612 | int MHD_gnutls_x509_crt_get_subject_alt_name (MHD_gnutls_x509_crt_t cert, | 632 | int MHD_gnutls_x509_crt_get_subject_alt_name (MHD_gnutls_x509_crt_t cert, |
613 | unsigned int seq, | 633 | unsigned int seq, |
614 | void *ret, | 634 | void *ret, |
615 | size_t * ret_size, | 635 | size_t * ret_size, |
616 | unsigned int *critical); | 636 | unsigned int *critical); |
617 | int MHD_gnutls_x509_crt_get_dn_by_oid (MHD_gnutls_x509_crt_t cert, | 637 | int MHD_gnutls_x509_crt_get_dn_by_oid (MHD_gnutls_x509_crt_t cert, |
618 | const char *oid, | 638 | const char *oid, |
619 | int indx, | 639 | int indx, |
620 | unsigned int raw_flag, | 640 | unsigned int raw_flag, |
621 | void *buf, size_t * sizeof_buf); | 641 | void *buf, size_t * sizeof_buf); |
622 | int MHD_gnutls_x509_crt_get_ca_status (MHD_gnutls_x509_crt_t cert, | 642 | int MHD_gnutls_x509_crt_get_ca_status (MHD_gnutls_x509_crt_t cert, |
623 | unsigned int *critical); | 643 | unsigned int *critical); |
624 | int MHD_gnutls_x509_crt_get_pk_algorithm (MHD_gnutls_x509_crt_t cert, | 644 | int MHD_gnutls_x509_crt_get_pk_algorithm (MHD_gnutls_x509_crt_t cert, |
625 | unsigned int *bits); | 645 | unsigned int *bits); |
626 | 646 | ||
627 | int MHD_gnutls_x509_crt_get_serial (MHD_gnutls_x509_crt_t cert, | 647 | int MHD_gnutls_x509_crt_get_serial (MHD_gnutls_x509_crt_t cert, |
628 | void *result, size_t * result_size); | 648 | void *result, size_t * result_size); |
629 | 649 | ||
630 | int MHD__gnutls_x509_compare_raw_dn (const MHD_gnutls_datum_t * dn1, | 650 | int MHD__gnutls_x509_compare_raw_dn (const MHD_gnutls_datum_t * dn1, |
631 | const MHD_gnutls_datum_t * dn2); | 651 | const MHD_gnutls_datum_t * dn2); |
632 | 652 | ||
633 | int MHD_gnutls_x509_crt_check_revocation (MHD_gnutls_x509_crt_t cert, | 653 | int MHD_gnutls_x509_crt_check_revocation (MHD_gnutls_x509_crt_t cert, |
634 | const MHD_gnutls_x509_crl_t * crl_list, | 654 | const MHD_gnutls_x509_crl_t * |
635 | int crl_list_length); | 655 | crl_list, int crl_list_length); |
636 | 656 | ||
637 | int MHD__gnutls_x509_crl_cpy (MHD_gnutls_x509_crl_t dest, MHD_gnutls_x509_crl_t src); | 657 | int MHD__gnutls_x509_crl_cpy (MHD_gnutls_x509_crl_t dest, |
658 | MHD_gnutls_x509_crl_t src); | ||
638 | int MHD__gnutls_x509_crl_get_raw_issuer_dn (MHD_gnutls_x509_crl_t crl, | 659 | int MHD__gnutls_x509_crl_get_raw_issuer_dn (MHD_gnutls_x509_crl_t crl, |
639 | MHD_gnutls_datum_t * dn); | 660 | MHD_gnutls_datum_t * dn); |
640 | int MHD_gnutls_x509_crl_get_crt_count (MHD_gnutls_x509_crl_t crl); | 661 | int MHD_gnutls_x509_crl_get_crt_count (MHD_gnutls_x509_crl_t crl); |
641 | int MHD_gnutls_x509_crl_get_crt_serial (MHD_gnutls_x509_crl_t crl, | 662 | int MHD_gnutls_x509_crl_get_crt_serial (MHD_gnutls_x509_crl_t crl, |
642 | int indx, | 663 | int indx, |
643 | unsigned char *serial, | 664 | unsigned char *serial, |
644 | size_t * serial_size, time_t * t); | 665 | size_t * serial_size, time_t * t); |
645 | 666 | ||
646 | void MHD_gnutls_x509_crl_deinit (MHD_gnutls_x509_crl_t crl); | 667 | void MHD_gnutls_x509_crl_deinit (MHD_gnutls_x509_crl_t crl); |
647 | int MHD_gnutls_x509_crl_init (MHD_gnutls_x509_crl_t * crl); | 668 | int MHD_gnutls_x509_crl_init (MHD_gnutls_x509_crl_t * crl); |
648 | int MHD_gnutls_x509_crl_import (MHD_gnutls_x509_crl_t crl, | 669 | int MHD_gnutls_x509_crl_import (MHD_gnutls_x509_crl_t crl, |
649 | const MHD_gnutls_datum_t * data, | 670 | const MHD_gnutls_datum_t * data, |
650 | MHD_gnutls_x509_crt_fmt_t format); | 671 | MHD_gnutls_x509_crt_fmt_t format); |
651 | int MHD_gnutls_x509_crl_export (MHD_gnutls_x509_crl_t crl, | 672 | int MHD_gnutls_x509_crl_export (MHD_gnutls_x509_crl_t crl, |
652 | MHD_gnutls_x509_crt_fmt_t format, | 673 | MHD_gnutls_x509_crt_fmt_t format, |
653 | void *output_data, size_t * output_data_size); | 674 | void *output_data, size_t * output_data_size); |
654 | 675 | ||
655 | int MHD_gnutls_x509_crt_init (MHD_gnutls_x509_crt_t * cert); | 676 | int MHD_gnutls_x509_crt_init (MHD_gnutls_x509_crt_t * cert); |
656 | void MHD_gnutls_x509_crt_deinit (MHD_gnutls_x509_crt_t cert); | 677 | void MHD_gnutls_x509_crt_deinit (MHD_gnutls_x509_crt_t cert); |
657 | int MHD_gnutls_x509_crt_import (MHD_gnutls_x509_crt_t cert, | 678 | int MHD_gnutls_x509_crt_import (MHD_gnutls_x509_crt_t cert, |
658 | const MHD_gnutls_datum_t * data, | 679 | const MHD_gnutls_datum_t * data, |
659 | MHD_gnutls_x509_crt_fmt_t format); | 680 | MHD_gnutls_x509_crt_fmt_t format); |
660 | int MHD_gnutls_x509_crt_export (MHD_gnutls_x509_crt_t cert, | 681 | int MHD_gnutls_x509_crt_export (MHD_gnutls_x509_crt_t cert, |
661 | MHD_gnutls_x509_crt_fmt_t format, | 682 | MHD_gnutls_x509_crt_fmt_t format, |
662 | void *output_data, size_t * output_data_size); | 683 | void *output_data, size_t * output_data_size); |
663 | 684 | ||
664 | int MHD_gnutls_x509_crt_get_key_usage (MHD_gnutls_x509_crt_t cert, | 685 | int MHD_gnutls_x509_crt_get_key_usage (MHD_gnutls_x509_crt_t cert, |
665 | unsigned int *key_usage, | 686 | unsigned int *key_usage, |
666 | unsigned int *critical); | 687 | unsigned int *critical); |
667 | int MHD_gnutls_x509_crt_get_signature_algorithm (MHD_gnutls_x509_crt_t cert); | 688 | int MHD_gnutls_x509_crt_get_signature_algorithm (MHD_gnutls_x509_crt_t cert); |
668 | int MHD_gnutls_x509_crt_get_version (MHD_gnutls_x509_crt_t cert); | 689 | int MHD_gnutls_x509_crt_get_version (MHD_gnutls_x509_crt_t cert); |
669 | 690 | ||
@@ -671,30 +692,31 @@ int MHD_gnutls_x509_privkey_init (MHD_gnutls_x509_privkey_t * key); | |||
671 | void MHD_gnutls_x509_privkey_deinit (MHD_gnutls_x509_privkey_t key); | 692 | void MHD_gnutls_x509_privkey_deinit (MHD_gnutls_x509_privkey_t key); |
672 | 693 | ||
673 | int MHD_gnutls_x509_privkey_generate (MHD_gnutls_x509_privkey_t key, | 694 | int MHD_gnutls_x509_privkey_generate (MHD_gnutls_x509_privkey_t key, |
674 | enum MHD_GNUTLS_PublicKeyAlgorithm algo, | 695 | enum MHD_GNUTLS_PublicKeyAlgorithm algo, |
675 | unsigned int bits, unsigned int flags); | 696 | unsigned int bits, unsigned int flags); |
676 | 697 | ||
677 | int MHD_gnutls_x509_privkey_import (MHD_gnutls_x509_privkey_t key, | 698 | int MHD_gnutls_x509_privkey_import (MHD_gnutls_x509_privkey_t key, |
678 | const MHD_gnutls_datum_t * data, | 699 | const MHD_gnutls_datum_t * data, |
679 | MHD_gnutls_x509_crt_fmt_t format); | 700 | MHD_gnutls_x509_crt_fmt_t format); |
680 | int MHD_gnutls_x509_privkey_get_pk_algorithm (MHD_gnutls_x509_privkey_t key); | 701 | int MHD_gnutls_x509_privkey_get_pk_algorithm (MHD_gnutls_x509_privkey_t key); |
681 | int MHD_gnutls_x509_privkey_import_rsa_raw (MHD_gnutls_x509_privkey_t key, | 702 | int MHD_gnutls_x509_privkey_import_rsa_raw (MHD_gnutls_x509_privkey_t key, |
682 | const MHD_gnutls_datum_t * m, | 703 | const MHD_gnutls_datum_t * m, |
683 | const MHD_gnutls_datum_t * e, | 704 | const MHD_gnutls_datum_t * e, |
684 | const MHD_gnutls_datum_t * d, | 705 | const MHD_gnutls_datum_t * d, |
685 | const MHD_gnutls_datum_t * p, | 706 | const MHD_gnutls_datum_t * p, |
686 | const MHD_gnutls_datum_t * q, | 707 | const MHD_gnutls_datum_t * q, |
687 | const MHD_gnutls_datum_t * u); | 708 | const MHD_gnutls_datum_t * u); |
688 | int MHD_gnutls_x509_privkey_export_rsa_raw (MHD_gnutls_x509_privkey_t key, | 709 | int MHD_gnutls_x509_privkey_export_rsa_raw (MHD_gnutls_x509_privkey_t key, |
689 | MHD_gnutls_datum_t * m, | 710 | MHD_gnutls_datum_t * m, |
690 | MHD_gnutls_datum_t * e, | 711 | MHD_gnutls_datum_t * e, |
691 | MHD_gnutls_datum_t * d, | 712 | MHD_gnutls_datum_t * d, |
692 | MHD_gnutls_datum_t * p, | 713 | MHD_gnutls_datum_t * p, |
693 | MHD_gnutls_datum_t * q, | 714 | MHD_gnutls_datum_t * q, |
694 | MHD_gnutls_datum_t * u); | 715 | MHD_gnutls_datum_t * u); |
695 | int MHD_gnutls_x509_privkey_export (MHD_gnutls_x509_privkey_t key, | 716 | int MHD_gnutls_x509_privkey_export (MHD_gnutls_x509_privkey_t key, |
696 | MHD_gnutls_x509_crt_fmt_t format, | 717 | MHD_gnutls_x509_crt_fmt_t format, |
697 | void *output_data, size_t * output_data_size); | 718 | void *output_data, |
719 | size_t * output_data_size); | ||
698 | 720 | ||
699 | #define GNUTLS_CRL_REASON_UNUSED 128 | 721 | #define GNUTLS_CRL_REASON_UNUSED 128 |
700 | #define GNUTLS_CRL_REASON_KEY_COMPROMISE 64 | 722 | #define GNUTLS_CRL_REASON_KEY_COMPROMISE 64 |