1 | /* |
2 | * WARNING: do not edit! |
3 | * Generated by Makefile from include/openssl/x509.h.in |
4 | * |
5 | * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. |
6 | * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved |
7 | * |
8 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
9 | * this file except in compliance with the License. You can obtain a copy |
10 | * in the file LICENSE in the source distribution or at |
11 | * https://www.openssl.org/source/license.html |
12 | */ |
13 | |
14 | |
15 | |
16 | #ifndef OPENSSL_X509_H |
17 | # define OPENSSL_X509_H |
18 | # pragma once |
19 | |
20 | # include <openssl/macros.h> |
21 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
22 | # define |
23 | # endif |
24 | |
25 | # include <openssl/e_os2.h> |
26 | # include <openssl/types.h> |
27 | # include <openssl/symhacks.h> |
28 | # include <openssl/buffer.h> |
29 | # include <openssl/evp.h> |
30 | # include <openssl/bio.h> |
31 | # include <openssl/asn1.h> |
32 | # include <openssl/safestack.h> |
33 | # include <openssl/ec.h> |
34 | |
35 | # ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
36 | # include <openssl/rsa.h> |
37 | # include <openssl/dsa.h> |
38 | # include <openssl/dh.h> |
39 | # endif |
40 | |
41 | # include <openssl/sha.h> |
42 | # include <openssl/x509err.h> |
43 | # ifndef OPENSSL_NO_STDIO |
44 | # include <stdio.h> |
45 | # endif |
46 | |
47 | #ifdef __cplusplus |
48 | extern "C" { |
49 | #endif |
50 | |
51 | /* Needed stacks for types defined in other headers */ |
52 | SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME, X509_NAME, X509_NAME) |
53 | #define sk_X509_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_sk_type(sk)) |
54 | #define sk_X509_NAME_value(sk, idx) ((X509_NAME *)OPENSSL_sk_value(ossl_check_const_X509_NAME_sk_type(sk), (idx))) |
55 | #define sk_X509_NAME_new(cmp) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new(ossl_check_X509_NAME_compfunc_type(cmp))) |
56 | #define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null()) |
57 | #define sk_X509_NAME_new_reserve(cmp, n) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_compfunc_type(cmp), (n))) |
58 | #define sk_X509_NAME_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_sk_type(sk), (n)) |
59 | #define sk_X509_NAME_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_sk_type(sk)) |
60 | #define sk_X509_NAME_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_sk_type(sk)) |
61 | #define sk_X509_NAME_delete(sk, i) ((X509_NAME *)OPENSSL_sk_delete(ossl_check_X509_NAME_sk_type(sk), (i))) |
62 | #define sk_X509_NAME_delete_ptr(sk, ptr) ((X509_NAME *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))) |
63 | #define sk_X509_NAME_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) |
64 | #define sk_X509_NAME_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) |
65 | #define sk_X509_NAME_pop(sk) ((X509_NAME *)OPENSSL_sk_pop(ossl_check_X509_NAME_sk_type(sk))) |
66 | #define sk_X509_NAME_shift(sk) ((X509_NAME *)OPENSSL_sk_shift(ossl_check_X509_NAME_sk_type(sk))) |
67 | #define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk),ossl_check_X509_NAME_freefunc_type(freefunc)) |
68 | #define sk_X509_NAME_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), (idx)) |
69 | #define sk_X509_NAME_set(sk, idx, ptr) ((X509_NAME *)OPENSSL_sk_set(ossl_check_X509_NAME_sk_type(sk), (idx), ossl_check_X509_NAME_type(ptr))) |
70 | #define sk_X509_NAME_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) |
71 | #define sk_X509_NAME_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) |
72 | #define sk_X509_NAME_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), pnum) |
73 | #define sk_X509_NAME_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_sk_type(sk)) |
74 | #define sk_X509_NAME_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_sk_type(sk)) |
75 | #define sk_X509_NAME_dup(sk) ((STACK_OF(X509_NAME) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_sk_type(sk))) |
76 | #define sk_X509_NAME_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_sk_type(sk), ossl_check_X509_NAME_copyfunc_type(copyfunc), ossl_check_X509_NAME_freefunc_type(freefunc))) |
77 | #define sk_X509_NAME_set_cmp_func(sk, cmp) ((sk_X509_NAME_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_compfunc_type(cmp))) |
78 | SKM_DEFINE_STACK_OF_INTERNAL(X509, X509, X509) |
79 | #define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk)) |
80 | #define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx))) |
81 | #define sk_X509_new(cmp) ((STACK_OF(X509) *)OPENSSL_sk_new(ossl_check_X509_compfunc_type(cmp))) |
82 | #define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null()) |
83 | #define sk_X509_new_reserve(cmp, n) ((STACK_OF(X509) *)OPENSSL_sk_new_reserve(ossl_check_X509_compfunc_type(cmp), (n))) |
84 | #define sk_X509_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_sk_type(sk), (n)) |
85 | #define sk_X509_free(sk) OPENSSL_sk_free(ossl_check_X509_sk_type(sk)) |
86 | #define sk_X509_zero(sk) OPENSSL_sk_zero(ossl_check_X509_sk_type(sk)) |
87 | #define sk_X509_delete(sk, i) ((X509 *)OPENSSL_sk_delete(ossl_check_X509_sk_type(sk), (i))) |
88 | #define sk_X509_delete_ptr(sk, ptr) ((X509 *)OPENSSL_sk_delete_ptr(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))) |
89 | #define sk_X509_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) |
90 | #define sk_X509_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) |
91 | #define sk_X509_pop(sk) ((X509 *)OPENSSL_sk_pop(ossl_check_X509_sk_type(sk))) |
92 | #define sk_X509_shift(sk) ((X509 *)OPENSSL_sk_shift(ossl_check_X509_sk_type(sk))) |
93 | #define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk),ossl_check_X509_freefunc_type(freefunc)) |
94 | #define sk_X509_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), (idx)) |
95 | #define sk_X509_set(sk, idx, ptr) ((X509 *)OPENSSL_sk_set(ossl_check_X509_sk_type(sk), (idx), ossl_check_X509_type(ptr))) |
96 | #define sk_X509_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) |
97 | #define sk_X509_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) |
98 | #define sk_X509_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), pnum) |
99 | #define sk_X509_sort(sk) OPENSSL_sk_sort(ossl_check_X509_sk_type(sk)) |
100 | #define sk_X509_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_sk_type(sk)) |
101 | #define sk_X509_dup(sk) ((STACK_OF(X509) *)OPENSSL_sk_dup(ossl_check_const_X509_sk_type(sk))) |
102 | #define sk_X509_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_sk_type(sk), ossl_check_X509_copyfunc_type(copyfunc), ossl_check_X509_freefunc_type(freefunc))) |
103 | #define sk_X509_set_cmp_func(sk, cmp) ((sk_X509_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_sk_type(sk), ossl_check_X509_compfunc_type(cmp))) |
104 | SKM_DEFINE_STACK_OF_INTERNAL(X509_REVOKED, X509_REVOKED, X509_REVOKED) |
105 | #define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk)) |
106 | #define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx))) |
107 | #define sk_X509_REVOKED_new(cmp) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new(ossl_check_X509_REVOKED_compfunc_type(cmp))) |
108 | #define sk_X509_REVOKED_new_null() ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_null()) |
109 | #define sk_X509_REVOKED_new_reserve(cmp, n) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_reserve(ossl_check_X509_REVOKED_compfunc_type(cmp), (n))) |
110 | #define sk_X509_REVOKED_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_REVOKED_sk_type(sk), (n)) |
111 | #define sk_X509_REVOKED_free(sk) OPENSSL_sk_free(ossl_check_X509_REVOKED_sk_type(sk)) |
112 | #define sk_X509_REVOKED_zero(sk) OPENSSL_sk_zero(ossl_check_X509_REVOKED_sk_type(sk)) |
113 | #define sk_X509_REVOKED_delete(sk, i) ((X509_REVOKED *)OPENSSL_sk_delete(ossl_check_X509_REVOKED_sk_type(sk), (i))) |
114 | #define sk_X509_REVOKED_delete_ptr(sk, ptr) ((X509_REVOKED *)OPENSSL_sk_delete_ptr(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))) |
115 | #define sk_X509_REVOKED_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) |
116 | #define sk_X509_REVOKED_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) |
117 | #define sk_X509_REVOKED_pop(sk) ((X509_REVOKED *)OPENSSL_sk_pop(ossl_check_X509_REVOKED_sk_type(sk))) |
118 | #define sk_X509_REVOKED_shift(sk) ((X509_REVOKED *)OPENSSL_sk_shift(ossl_check_X509_REVOKED_sk_type(sk))) |
119 | #define sk_X509_REVOKED_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_REVOKED_sk_type(sk),ossl_check_X509_REVOKED_freefunc_type(freefunc)) |
120 | #define sk_X509_REVOKED_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), (idx)) |
121 | #define sk_X509_REVOKED_set(sk, idx, ptr) ((X509_REVOKED *)OPENSSL_sk_set(ossl_check_X509_REVOKED_sk_type(sk), (idx), ossl_check_X509_REVOKED_type(ptr))) |
122 | #define sk_X509_REVOKED_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) |
123 | #define sk_X509_REVOKED_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) |
124 | #define sk_X509_REVOKED_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), pnum) |
125 | #define sk_X509_REVOKED_sort(sk) OPENSSL_sk_sort(ossl_check_X509_REVOKED_sk_type(sk)) |
126 | #define sk_X509_REVOKED_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_REVOKED_sk_type(sk)) |
127 | #define sk_X509_REVOKED_dup(sk) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_dup(ossl_check_const_X509_REVOKED_sk_type(sk))) |
128 | #define sk_X509_REVOKED_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_copyfunc_type(copyfunc), ossl_check_X509_REVOKED_freefunc_type(freefunc))) |
129 | #define sk_X509_REVOKED_set_cmp_func(sk, cmp) ((sk_X509_REVOKED_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_compfunc_type(cmp))) |
130 | SKM_DEFINE_STACK_OF_INTERNAL(X509_CRL, X509_CRL, X509_CRL) |
131 | #define sk_X509_CRL_num(sk) OPENSSL_sk_num(ossl_check_const_X509_CRL_sk_type(sk)) |
132 | #define sk_X509_CRL_value(sk, idx) ((X509_CRL *)OPENSSL_sk_value(ossl_check_const_X509_CRL_sk_type(sk), (idx))) |
133 | #define sk_X509_CRL_new(cmp) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new(ossl_check_X509_CRL_compfunc_type(cmp))) |
134 | #define sk_X509_CRL_new_null() ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_null()) |
135 | #define sk_X509_CRL_new_reserve(cmp, n) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_reserve(ossl_check_X509_CRL_compfunc_type(cmp), (n))) |
136 | #define sk_X509_CRL_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_CRL_sk_type(sk), (n)) |
137 | #define sk_X509_CRL_free(sk) OPENSSL_sk_free(ossl_check_X509_CRL_sk_type(sk)) |
138 | #define sk_X509_CRL_zero(sk) OPENSSL_sk_zero(ossl_check_X509_CRL_sk_type(sk)) |
139 | #define sk_X509_CRL_delete(sk, i) ((X509_CRL *)OPENSSL_sk_delete(ossl_check_X509_CRL_sk_type(sk), (i))) |
140 | #define sk_X509_CRL_delete_ptr(sk, ptr) ((X509_CRL *)OPENSSL_sk_delete_ptr(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))) |
141 | #define sk_X509_CRL_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) |
142 | #define sk_X509_CRL_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) |
143 | #define sk_X509_CRL_pop(sk) ((X509_CRL *)OPENSSL_sk_pop(ossl_check_X509_CRL_sk_type(sk))) |
144 | #define sk_X509_CRL_shift(sk) ((X509_CRL *)OPENSSL_sk_shift(ossl_check_X509_CRL_sk_type(sk))) |
145 | #define sk_X509_CRL_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_CRL_sk_type(sk),ossl_check_X509_CRL_freefunc_type(freefunc)) |
146 | #define sk_X509_CRL_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), (idx)) |
147 | #define sk_X509_CRL_set(sk, idx, ptr) ((X509_CRL *)OPENSSL_sk_set(ossl_check_X509_CRL_sk_type(sk), (idx), ossl_check_X509_CRL_type(ptr))) |
148 | #define sk_X509_CRL_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) |
149 | #define sk_X509_CRL_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) |
150 | #define sk_X509_CRL_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), pnum) |
151 | #define sk_X509_CRL_sort(sk) OPENSSL_sk_sort(ossl_check_X509_CRL_sk_type(sk)) |
152 | #define sk_X509_CRL_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_CRL_sk_type(sk)) |
153 | #define sk_X509_CRL_dup(sk) ((STACK_OF(X509_CRL) *)OPENSSL_sk_dup(ossl_check_const_X509_CRL_sk_type(sk))) |
154 | #define sk_X509_CRL_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_CRL) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_CRL_sk_type(sk), ossl_check_X509_CRL_copyfunc_type(copyfunc), ossl_check_X509_CRL_freefunc_type(freefunc))) |
155 | #define sk_X509_CRL_set_cmp_func(sk, cmp) ((sk_X509_CRL_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_compfunc_type(cmp))) |
156 | |
157 | |
158 | /* Flags for X509_get_signature_info() */ |
159 | /* Signature info is valid */ |
160 | # define X509_SIG_INFO_VALID 0x1 |
161 | /* Signature is suitable for TLS use */ |
162 | # define X509_SIG_INFO_TLS 0x2 |
163 | |
164 | # define X509_FILETYPE_PEM 1 |
165 | # define X509_FILETYPE_ASN1 2 |
166 | # define X509_FILETYPE_DEFAULT 3 |
167 | |
168 | # define X509v3_KU_DIGITAL_SIGNATURE 0x0080 |
169 | # define X509v3_KU_NON_REPUDIATION 0x0040 |
170 | # define X509v3_KU_KEY_ENCIPHERMENT 0x0020 |
171 | # define X509v3_KU_DATA_ENCIPHERMENT 0x0010 |
172 | # define X509v3_KU_KEY_AGREEMENT 0x0008 |
173 | # define X509v3_KU_KEY_CERT_SIGN 0x0004 |
174 | # define X509v3_KU_CRL_SIGN 0x0002 |
175 | # define X509v3_KU_ENCIPHER_ONLY 0x0001 |
176 | # define X509v3_KU_DECIPHER_ONLY 0x8000 |
177 | # define X509v3_KU_UNDEF 0xffff |
178 | |
179 | struct X509_algor_st { |
180 | ASN1_OBJECT *algorithm; |
181 | ASN1_TYPE *parameter; |
182 | } /* X509_ALGOR */ ; |
183 | |
184 | typedef STACK_OF(X509_ALGOR) X509_ALGORS; |
185 | |
186 | typedef struct X509_val_st { |
187 | ASN1_TIME *notBefore; |
188 | ASN1_TIME *notAfter; |
189 | } X509_VAL; |
190 | |
191 | typedef struct X509_sig_st X509_SIG; |
192 | |
193 | typedef struct X509_name_entry_st X509_NAME_ENTRY; |
194 | |
195 | SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME_ENTRY, X509_NAME_ENTRY, X509_NAME_ENTRY) |
196 | #define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk)) |
197 | #define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx))) |
198 | #define sk_X509_NAME_ENTRY_new(cmp) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp))) |
199 | #define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null()) |
200 | #define sk_X509_NAME_ENTRY_new_reserve(cmp, n) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp), (n))) |
201 | #define sk_X509_NAME_ENTRY_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_ENTRY_sk_type(sk), (n)) |
202 | #define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk)) |
203 | #define sk_X509_NAME_ENTRY_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_ENTRY_sk_type(sk)) |
204 | #define sk_X509_NAME_ENTRY_delete(sk, i) ((X509_NAME_ENTRY *)OPENSSL_sk_delete(ossl_check_X509_NAME_ENTRY_sk_type(sk), (i))) |
205 | #define sk_X509_NAME_ENTRY_delete_ptr(sk, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))) |
206 | #define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) |
207 | #define sk_X509_NAME_ENTRY_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) |
208 | #define sk_X509_NAME_ENTRY_pop(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_pop(ossl_check_X509_NAME_ENTRY_sk_type(sk))) |
209 | #define sk_X509_NAME_ENTRY_shift(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_shift(ossl_check_X509_NAME_ENTRY_sk_type(sk))) |
210 | #define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk),ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc)) |
211 | #define sk_X509_NAME_ENTRY_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), (idx)) |
212 | #define sk_X509_NAME_ENTRY_set(sk, idx, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_set(ossl_check_X509_NAME_ENTRY_sk_type(sk), (idx), ossl_check_X509_NAME_ENTRY_type(ptr))) |
213 | #define sk_X509_NAME_ENTRY_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) |
214 | #define sk_X509_NAME_ENTRY_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) |
215 | #define sk_X509_NAME_ENTRY_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), pnum) |
216 | #define sk_X509_NAME_ENTRY_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_ENTRY_sk_type(sk)) |
217 | #define sk_X509_NAME_ENTRY_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_ENTRY_sk_type(sk)) |
218 | #define sk_X509_NAME_ENTRY_dup(sk) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))) |
219 | #define sk_X509_NAME_ENTRY_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_copyfunc_type(copyfunc), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))) |
220 | #define sk_X509_NAME_ENTRY_set_cmp_func(sk, cmp) ((sk_X509_NAME_ENTRY_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_compfunc_type(cmp))) |
221 | |
222 | |
223 | # define X509_EX_V_NETSCAPE_HACK 0x8000 |
224 | # define X509_EX_V_INIT 0x0001 |
225 | typedef struct X509_extension_st X509_EXTENSION; |
226 | SKM_DEFINE_STACK_OF_INTERNAL(X509_EXTENSION, X509_EXTENSION, X509_EXTENSION) |
227 | #define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk)) |
228 | #define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx))) |
229 | #define sk_X509_EXTENSION_new(cmp) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new(ossl_check_X509_EXTENSION_compfunc_type(cmp))) |
230 | #define sk_X509_EXTENSION_new_null() ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_null()) |
231 | #define sk_X509_EXTENSION_new_reserve(cmp, n) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_reserve(ossl_check_X509_EXTENSION_compfunc_type(cmp), (n))) |
232 | #define sk_X509_EXTENSION_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_EXTENSION_sk_type(sk), (n)) |
233 | #define sk_X509_EXTENSION_free(sk) OPENSSL_sk_free(ossl_check_X509_EXTENSION_sk_type(sk)) |
234 | #define sk_X509_EXTENSION_zero(sk) OPENSSL_sk_zero(ossl_check_X509_EXTENSION_sk_type(sk)) |
235 | #define sk_X509_EXTENSION_delete(sk, i) ((X509_EXTENSION *)OPENSSL_sk_delete(ossl_check_X509_EXTENSION_sk_type(sk), (i))) |
236 | #define sk_X509_EXTENSION_delete_ptr(sk, ptr) ((X509_EXTENSION *)OPENSSL_sk_delete_ptr(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))) |
237 | #define sk_X509_EXTENSION_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) |
238 | #define sk_X509_EXTENSION_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) |
239 | #define sk_X509_EXTENSION_pop(sk) ((X509_EXTENSION *)OPENSSL_sk_pop(ossl_check_X509_EXTENSION_sk_type(sk))) |
240 | #define sk_X509_EXTENSION_shift(sk) ((X509_EXTENSION *)OPENSSL_sk_shift(ossl_check_X509_EXTENSION_sk_type(sk))) |
241 | #define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk),ossl_check_X509_EXTENSION_freefunc_type(freefunc)) |
242 | #define sk_X509_EXTENSION_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), (idx)) |
243 | #define sk_X509_EXTENSION_set(sk, idx, ptr) ((X509_EXTENSION *)OPENSSL_sk_set(ossl_check_X509_EXTENSION_sk_type(sk), (idx), ossl_check_X509_EXTENSION_type(ptr))) |
244 | #define sk_X509_EXTENSION_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) |
245 | #define sk_X509_EXTENSION_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) |
246 | #define sk_X509_EXTENSION_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), pnum) |
247 | #define sk_X509_EXTENSION_sort(sk) OPENSSL_sk_sort(ossl_check_X509_EXTENSION_sk_type(sk)) |
248 | #define sk_X509_EXTENSION_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_EXTENSION_sk_type(sk)) |
249 | #define sk_X509_EXTENSION_dup(sk) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_dup(ossl_check_const_X509_EXTENSION_sk_type(sk))) |
250 | #define sk_X509_EXTENSION_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_copyfunc_type(copyfunc), ossl_check_X509_EXTENSION_freefunc_type(freefunc))) |
251 | #define sk_X509_EXTENSION_set_cmp_func(sk, cmp) ((sk_X509_EXTENSION_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_compfunc_type(cmp))) |
252 | |
253 | typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; |
254 | typedef struct x509_attributes_st X509_ATTRIBUTE; |
255 | SKM_DEFINE_STACK_OF_INTERNAL(X509_ATTRIBUTE, X509_ATTRIBUTE, X509_ATTRIBUTE) |
256 | #define sk_X509_ATTRIBUTE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ATTRIBUTE_sk_type(sk)) |
257 | #define sk_X509_ATTRIBUTE_value(sk, idx) ((X509_ATTRIBUTE *)OPENSSL_sk_value(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), (idx))) |
258 | #define sk_X509_ATTRIBUTE_new(cmp) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp))) |
259 | #define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_null()) |
260 | #define sk_X509_ATTRIBUTE_new_reserve(cmp, n) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_reserve(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp), (n))) |
261 | #define sk_X509_ATTRIBUTE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ATTRIBUTE_sk_type(sk), (n)) |
262 | #define sk_X509_ATTRIBUTE_free(sk) OPENSSL_sk_free(ossl_check_X509_ATTRIBUTE_sk_type(sk)) |
263 | #define sk_X509_ATTRIBUTE_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ATTRIBUTE_sk_type(sk)) |
264 | #define sk_X509_ATTRIBUTE_delete(sk, i) ((X509_ATTRIBUTE *)OPENSSL_sk_delete(ossl_check_X509_ATTRIBUTE_sk_type(sk), (i))) |
265 | #define sk_X509_ATTRIBUTE_delete_ptr(sk, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_delete_ptr(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))) |
266 | #define sk_X509_ATTRIBUTE_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) |
267 | #define sk_X509_ATTRIBUTE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) |
268 | #define sk_X509_ATTRIBUTE_pop(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_pop(ossl_check_X509_ATTRIBUTE_sk_type(sk))) |
269 | #define sk_X509_ATTRIBUTE_shift(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_shift(ossl_check_X509_ATTRIBUTE_sk_type(sk))) |
270 | #define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk),ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc)) |
271 | #define sk_X509_ATTRIBUTE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), (idx)) |
272 | #define sk_X509_ATTRIBUTE_set(sk, idx, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_set(ossl_check_X509_ATTRIBUTE_sk_type(sk), (idx), ossl_check_X509_ATTRIBUTE_type(ptr))) |
273 | #define sk_X509_ATTRIBUTE_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) |
274 | #define sk_X509_ATTRIBUTE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) |
275 | #define sk_X509_ATTRIBUTE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), pnum) |
276 | #define sk_X509_ATTRIBUTE_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ATTRIBUTE_sk_type(sk)) |
277 | #define sk_X509_ATTRIBUTE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ATTRIBUTE_sk_type(sk)) |
278 | #define sk_X509_ATTRIBUTE_dup(sk) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_dup(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))) |
279 | #define sk_X509_ATTRIBUTE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_copyfunc_type(copyfunc), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))) |
280 | #define sk_X509_ATTRIBUTE_set_cmp_func(sk, cmp) ((sk_X509_ATTRIBUTE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_compfunc_type(cmp))) |
281 | |
282 | typedef struct X509_req_info_st X509_REQ_INFO; |
283 | typedef struct X509_req_st X509_REQ; |
284 | typedef struct x509_cert_aux_st X509_CERT_AUX; |
285 | typedef struct x509_cinf_st X509_CINF; |
286 | |
287 | /* Flags for X509_print_ex() */ |
288 | |
289 | # define X509_FLAG_COMPAT 0 |
290 | # define 1L |
291 | # define X509_FLAG_NO_VERSION (1L << 1) |
292 | # define X509_FLAG_NO_SERIAL (1L << 2) |
293 | # define X509_FLAG_NO_SIGNAME (1L << 3) |
294 | # define X509_FLAG_NO_ISSUER (1L << 4) |
295 | # define X509_FLAG_NO_VALIDITY (1L << 5) |
296 | # define X509_FLAG_NO_SUBJECT (1L << 6) |
297 | # define X509_FLAG_NO_PUBKEY (1L << 7) |
298 | # define X509_FLAG_NO_EXTENSIONS (1L << 8) |
299 | # define X509_FLAG_NO_SIGDUMP (1L << 9) |
300 | # define X509_FLAG_NO_AUX (1L << 10) |
301 | # define X509_FLAG_NO_ATTRIBUTES (1L << 11) |
302 | # define X509_FLAG_NO_IDS (1L << 12) |
303 | # define X509_FLAG_EXTENSIONS_ONLY_KID (1L << 13) |
304 | |
305 | /* Flags specific to X509_NAME_print_ex() */ |
306 | |
307 | /* The field separator information */ |
308 | |
309 | # define XN_FLAG_SEP_MASK (0xf << 16) |
310 | |
311 | # define XN_FLAG_COMPAT 0/* Traditional; use old X509_NAME_print */ |
312 | # define XN_FLAG_SEP_COMMA_PLUS (1 << 16)/* RFC2253 ,+ */ |
313 | # define XN_FLAG_SEP_CPLUS_SPC (2 << 16)/* ,+ spaced: more readable */ |
314 | # define XN_FLAG_SEP_SPLUS_SPC (3 << 16)/* ;+ spaced */ |
315 | # define XN_FLAG_SEP_MULTILINE (4 << 16)/* One line per field */ |
316 | |
317 | # define XN_FLAG_DN_REV (1 << 20)/* Reverse DN order */ |
318 | |
319 | /* How the field name is shown */ |
320 | |
321 | # define XN_FLAG_FN_MASK (0x3 << 21) |
322 | |
323 | # define XN_FLAG_FN_SN 0/* Object short name */ |
324 | # define XN_FLAG_FN_LN (1 << 21)/* Object long name */ |
325 | # define XN_FLAG_FN_OID (2 << 21)/* Always use OIDs */ |
326 | # define XN_FLAG_FN_NONE (3 << 21)/* No field names */ |
327 | |
328 | # define XN_FLAG_SPC_EQ (1 << 23)/* Put spaces round '=' */ |
329 | |
330 | /* |
331 | * This determines if we dump fields we don't recognise: RFC2253 requires |
332 | * this. |
333 | */ |
334 | |
335 | # define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) |
336 | |
337 | # define XN_FLAG_FN_ALIGN (1 << 25)/* Align field names to 20 |
338 | * characters */ |
339 | |
340 | /* Complete set of RFC2253 flags */ |
341 | |
342 | # define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ |
343 | XN_FLAG_SEP_COMMA_PLUS | \ |
344 | XN_FLAG_DN_REV | \ |
345 | XN_FLAG_FN_SN | \ |
346 | XN_FLAG_DUMP_UNKNOWN_FIELDS) |
347 | |
348 | /* readable oneline form */ |
349 | |
350 | # define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \ |
351 | ASN1_STRFLGS_ESC_QUOTE | \ |
352 | XN_FLAG_SEP_CPLUS_SPC | \ |
353 | XN_FLAG_SPC_EQ | \ |
354 | XN_FLAG_FN_SN) |
355 | |
356 | /* readable multiline form */ |
357 | |
358 | # define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \ |
359 | ASN1_STRFLGS_ESC_MSB | \ |
360 | XN_FLAG_SEP_MULTILINE | \ |
361 | XN_FLAG_SPC_EQ | \ |
362 | XN_FLAG_FN_LN | \ |
363 | XN_FLAG_FN_ALIGN) |
364 | |
365 | typedef struct X509_crl_info_st X509_CRL_INFO; |
366 | |
367 | typedef struct private_key_st { |
368 | int version; |
369 | /* The PKCS#8 data types */ |
370 | X509_ALGOR *enc_algor; |
371 | ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ |
372 | /* When decrypted, the following will not be NULL */ |
373 | EVP_PKEY *dec_pkey; |
374 | /* used to encrypt and decrypt */ |
375 | int key_length; |
376 | char *key_data; |
377 | int key_free; /* true if we should auto free key_data */ |
378 | /* expanded version of 'enc_algor' */ |
379 | EVP_CIPHER_INFO cipher; |
380 | } X509_PKEY; |
381 | |
382 | typedef struct X509_info_st { |
383 | X509 *x509; |
384 | X509_CRL *crl; |
385 | X509_PKEY *x_pkey; |
386 | EVP_CIPHER_INFO enc_cipher; |
387 | int enc_len; |
388 | char *enc_data; |
389 | } X509_INFO; |
390 | SKM_DEFINE_STACK_OF_INTERNAL(X509_INFO, X509_INFO, X509_INFO) |
391 | #define sk_X509_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_X509_INFO_sk_type(sk)) |
392 | #define sk_X509_INFO_value(sk, idx) ((X509_INFO *)OPENSSL_sk_value(ossl_check_const_X509_INFO_sk_type(sk), (idx))) |
393 | #define sk_X509_INFO_new(cmp) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new(ossl_check_X509_INFO_compfunc_type(cmp))) |
394 | #define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_null()) |
395 | #define sk_X509_INFO_new_reserve(cmp, n) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_reserve(ossl_check_X509_INFO_compfunc_type(cmp), (n))) |
396 | #define sk_X509_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_INFO_sk_type(sk), (n)) |
397 | #define sk_X509_INFO_free(sk) OPENSSL_sk_free(ossl_check_X509_INFO_sk_type(sk)) |
398 | #define sk_X509_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_X509_INFO_sk_type(sk)) |
399 | #define sk_X509_INFO_delete(sk, i) ((X509_INFO *)OPENSSL_sk_delete(ossl_check_X509_INFO_sk_type(sk), (i))) |
400 | #define sk_X509_INFO_delete_ptr(sk, ptr) ((X509_INFO *)OPENSSL_sk_delete_ptr(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))) |
401 | #define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) |
402 | #define sk_X509_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) |
403 | #define sk_X509_INFO_pop(sk) ((X509_INFO *)OPENSSL_sk_pop(ossl_check_X509_INFO_sk_type(sk))) |
404 | #define sk_X509_INFO_shift(sk) ((X509_INFO *)OPENSSL_sk_shift(ossl_check_X509_INFO_sk_type(sk))) |
405 | #define sk_X509_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_INFO_sk_type(sk),ossl_check_X509_INFO_freefunc_type(freefunc)) |
406 | #define sk_X509_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), (idx)) |
407 | #define sk_X509_INFO_set(sk, idx, ptr) ((X509_INFO *)OPENSSL_sk_set(ossl_check_X509_INFO_sk_type(sk), (idx), ossl_check_X509_INFO_type(ptr))) |
408 | #define sk_X509_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) |
409 | #define sk_X509_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) |
410 | #define sk_X509_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), pnum) |
411 | #define sk_X509_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_X509_INFO_sk_type(sk)) |
412 | #define sk_X509_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_INFO_sk_type(sk)) |
413 | #define sk_X509_INFO_dup(sk) ((STACK_OF(X509_INFO) *)OPENSSL_sk_dup(ossl_check_const_X509_INFO_sk_type(sk))) |
414 | #define sk_X509_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_INFO_sk_type(sk), ossl_check_X509_INFO_copyfunc_type(copyfunc), ossl_check_X509_INFO_freefunc_type(freefunc))) |
415 | #define sk_X509_INFO_set_cmp_func(sk, cmp) ((sk_X509_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_compfunc_type(cmp))) |
416 | |
417 | |
418 | /* |
419 | * The next 2 structures and their 8 routines are used to manipulate Netscape's |
420 | * spki structures - useful if you are writing a CA web page |
421 | */ |
422 | typedef struct Netscape_spkac_st { |
423 | X509_PUBKEY *pubkey; |
424 | ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ |
425 | } NETSCAPE_SPKAC; |
426 | |
427 | typedef struct Netscape_spki_st { |
428 | NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ |
429 | X509_ALGOR sig_algor; |
430 | ASN1_BIT_STRING *signature; |
431 | } NETSCAPE_SPKI; |
432 | |
433 | /* Netscape certificate sequence structure */ |
434 | typedef struct Netscape_certificate_sequence { |
435 | ASN1_OBJECT *type; |
436 | STACK_OF(X509) *certs; |
437 | } NETSCAPE_CERT_SEQUENCE; |
438 | |
439 | /*- Unused (and iv length is wrong) |
440 | typedef struct CBCParameter_st |
441 | { |
442 | unsigned char iv[8]; |
443 | } CBC_PARAM; |
444 | */ |
445 | |
446 | /* Password based encryption structure */ |
447 | |
448 | typedef struct PBEPARAM_st { |
449 | ASN1_OCTET_STRING *salt; |
450 | ASN1_INTEGER *iter; |
451 | } PBEPARAM; |
452 | |
453 | /* Password based encryption V2 structures */ |
454 | |
455 | typedef struct PBE2PARAM_st { |
456 | X509_ALGOR *keyfunc; |
457 | X509_ALGOR *encryption; |
458 | } PBE2PARAM; |
459 | |
460 | typedef struct PBKDF2PARAM_st { |
461 | /* Usually OCTET STRING but could be anything */ |
462 | ASN1_TYPE *salt; |
463 | ASN1_INTEGER *iter; |
464 | ASN1_INTEGER *keylength; |
465 | X509_ALGOR *prf; |
466 | } PBKDF2PARAM; |
467 | |
468 | #ifndef OPENSSL_NO_SCRYPT |
469 | typedef struct SCRYPT_PARAMS_st { |
470 | ASN1_OCTET_STRING *salt; |
471 | ASN1_INTEGER *costParameter; |
472 | ASN1_INTEGER *blockSize; |
473 | ASN1_INTEGER *parallelizationParameter; |
474 | ASN1_INTEGER *keyLength; |
475 | } SCRYPT_PARAMS; |
476 | #endif |
477 | |
478 | #ifdef __cplusplus |
479 | } |
480 | #endif |
481 | |
482 | # include <openssl/x509_vfy.h> |
483 | # include <openssl/pkcs7.h> |
484 | |
485 | #ifdef __cplusplus |
486 | extern "C" { |
487 | #endif |
488 | |
489 | # define X509_EXT_PACK_UNKNOWN 1 |
490 | # define X509_EXT_PACK_STRING 2 |
491 | |
492 | # define (x) X509_get_pubkey(x)/*****/ |
493 | # define (a) X509_REQ_get_pubkey(a) |
494 | # define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) |
495 | |
496 | void X509_CRL_set_default_method(const X509_CRL_METHOD *meth); |
497 | X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl), |
498 | int (*crl_free) (X509_CRL *crl), |
499 | int (*crl_lookup) (X509_CRL *crl, |
500 | X509_REVOKED **ret, |
501 | const |
502 | ASN1_INTEGER *serial, |
503 | const |
504 | X509_NAME *issuer), |
505 | int (*crl_verify) (X509_CRL *crl, |
506 | EVP_PKEY *pk)); |
507 | void X509_CRL_METHOD_free(X509_CRL_METHOD *m); |
508 | |
509 | void X509_CRL_set_meth_data(X509_CRL *crl, void *dat); |
510 | void *X509_CRL_get_meth_data(X509_CRL *crl); |
511 | |
512 | const char *X509_verify_cert_error_string(long n); |
513 | |
514 | int X509_verify(X509 *a, EVP_PKEY *r); |
515 | int X509_self_signed(X509 *cert, int verify_signature); |
516 | |
517 | int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx, |
518 | const char *propq); |
519 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); |
520 | int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); |
521 | int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); |
522 | |
523 | NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len); |
524 | char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); |
525 | EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); |
526 | int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); |
527 | |
528 | int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); |
529 | |
530 | int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent); |
531 | int X509_signature_print(BIO *bp, const X509_ALGOR *alg, |
532 | const ASN1_STRING *sig); |
533 | |
534 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
535 | int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); |
536 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); |
537 | int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx); |
538 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); |
539 | int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx); |
540 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); |
541 | |
542 | int X509_pubkey_digest(const X509 *data, const EVP_MD *type, |
543 | unsigned char *md, unsigned int *len); |
544 | int X509_digest(const X509 *data, const EVP_MD *type, |
545 | unsigned char *md, unsigned int *len); |
546 | ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert, |
547 | EVP_MD **md_used, int *md_is_fallback); |
548 | int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, |
549 | unsigned char *md, unsigned int *len); |
550 | int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, |
551 | unsigned char *md, unsigned int *len); |
552 | int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, |
553 | unsigned char *md, unsigned int *len); |
554 | |
555 | X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); |
556 | X509_CRL *X509_CRL_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); |
557 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
558 | # include <openssl/http.h> /* OSSL_HTTP_REQ_CTX_nbio_d2i */ |
559 | # define X509_http_nbio(rctx, pcert) \ |
560 | OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcert, ASN1_ITEM_rptr(X509)) |
561 | # define X509_CRL_http_nbio(rctx, pcrl) \ |
562 | OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcrl, ASN1_ITEM_rptr(X509_CRL)) |
563 | # endif |
564 | |
565 | # ifndef OPENSSL_NO_STDIO |
566 | X509 *d2i_X509_fp(FILE *fp, X509 **x509); |
567 | int i2d_X509_fp(FILE *fp, const X509 *x509); |
568 | X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl); |
569 | int i2d_X509_CRL_fp(FILE *fp, const X509_CRL *crl); |
570 | X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req); |
571 | int i2d_X509_REQ_fp(FILE *fp, const X509_REQ *req); |
572 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
573 | OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa); |
574 | OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_fp(FILE *fp, const RSA *rsa); |
575 | OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa); |
576 | OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_fp(FILE *fp, const RSA *rsa); |
577 | OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa); |
578 | OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_fp(FILE *fp, const RSA *rsa); |
579 | # endif |
580 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
581 | # ifndef OPENSSL_NO_DSA |
582 | OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); |
583 | OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_fp(FILE *fp, const DSA *dsa); |
584 | OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); |
585 | OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_fp(FILE *fp, const DSA *dsa); |
586 | # endif |
587 | # endif |
588 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
589 | # ifndef OPENSSL_NO_EC |
590 | OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); |
591 | OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_fp(FILE *fp, const EC_KEY *eckey); |
592 | OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); |
593 | OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_fp(FILE *fp, const EC_KEY *eckey); |
594 | # endif /* OPENSSL_NO_EC */ |
595 | # endif /* OPENSSL_NO_DEPRECATED_3_0 */ |
596 | X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8); |
597 | int i2d_PKCS8_fp(FILE *fp, const X509_SIG *p8); |
598 | X509_PUBKEY *d2i_X509_PUBKEY_fp(FILE *fp, X509_PUBKEY **xpk); |
599 | int i2d_X509_PUBKEY_fp(FILE *fp, const X509_PUBKEY *xpk); |
600 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, |
601 | PKCS8_PRIV_KEY_INFO **p8inf); |
602 | int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, const PKCS8_PRIV_KEY_INFO *p8inf); |
603 | int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, const EVP_PKEY *key); |
604 | int i2d_PrivateKey_fp(FILE *fp, const EVP_PKEY *pkey); |
605 | EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, |
606 | const char *propq); |
607 | EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); |
608 | int i2d_PUBKEY_fp(FILE *fp, const EVP_PKEY *pkey); |
609 | EVP_PKEY *d2i_PUBKEY_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, |
610 | const char *propq); |
611 | EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); |
612 | # endif |
613 | |
614 | X509 *d2i_X509_bio(BIO *bp, X509 **x509); |
615 | int i2d_X509_bio(BIO *bp, const X509 *x509); |
616 | X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl); |
617 | int i2d_X509_CRL_bio(BIO *bp, const X509_CRL *crl); |
618 | X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req); |
619 | int i2d_X509_REQ_bio(BIO *bp, const X509_REQ *req); |
620 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
621 | OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa); |
622 | OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_bio(BIO *bp, const RSA *rsa); |
623 | OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa); |
624 | OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_bio(BIO *bp, const RSA *rsa); |
625 | OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa); |
626 | OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_bio(BIO *bp, const RSA *rsa); |
627 | # endif |
628 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
629 | # ifndef OPENSSL_NO_DSA |
630 | OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); |
631 | OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_bio(BIO *bp, const DSA *dsa); |
632 | OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); |
633 | OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_bio(BIO *bp, const DSA *dsa); |
634 | # endif |
635 | # endif |
636 | |
637 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
638 | # ifndef OPENSSL_NO_EC |
639 | OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey); |
640 | OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_bio(BIO *bp, const EC_KEY *eckey); |
641 | OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey); |
642 | OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_bio(BIO *bp, const EC_KEY *eckey); |
643 | # endif /* OPENSSL_NO_EC */ |
644 | # endif /* OPENSSL_NO_DEPRECATED_3_0 */ |
645 | |
646 | X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8); |
647 | int i2d_PKCS8_bio(BIO *bp, const X509_SIG *p8); |
648 | X509_PUBKEY *d2i_X509_PUBKEY_bio(BIO *bp, X509_PUBKEY **xpk); |
649 | int i2d_X509_PUBKEY_bio(BIO *bp, const X509_PUBKEY *xpk); |
650 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, |
651 | PKCS8_PRIV_KEY_INFO **p8inf); |
652 | int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, const PKCS8_PRIV_KEY_INFO *p8inf); |
653 | int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, const EVP_PKEY *key); |
654 | int i2d_PrivateKey_bio(BIO *bp, const EVP_PKEY *pkey); |
655 | EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, |
656 | const char *propq); |
657 | EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); |
658 | int i2d_PUBKEY_bio(BIO *bp, const EVP_PKEY *pkey); |
659 | EVP_PKEY *d2i_PUBKEY_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, |
660 | const char *propq); |
661 | EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); |
662 | |
663 | DECLARE_ASN1_DUP_FUNCTION(X509) |
664 | DECLARE_ASN1_DUP_FUNCTION(X509_ALGOR) |
665 | DECLARE_ASN1_DUP_FUNCTION(X509_ATTRIBUTE) |
666 | DECLARE_ASN1_DUP_FUNCTION(X509_CRL) |
667 | DECLARE_ASN1_DUP_FUNCTION(X509_EXTENSION) |
668 | DECLARE_ASN1_DUP_FUNCTION(X509_PUBKEY) |
669 | DECLARE_ASN1_DUP_FUNCTION(X509_REQ) |
670 | DECLARE_ASN1_DUP_FUNCTION(X509_REVOKED) |
671 | int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, |
672 | void *pval); |
673 | void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, |
674 | const void **ppval, const X509_ALGOR *algor); |
675 | void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); |
676 | int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); |
677 | int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src); |
678 | |
679 | DECLARE_ASN1_DUP_FUNCTION(X509_NAME) |
680 | DECLARE_ASN1_DUP_FUNCTION(X509_NAME_ENTRY) |
681 | |
682 | int X509_cmp_time(const ASN1_TIME *s, time_t *t); |
683 | int X509_cmp_current_time(const ASN1_TIME *s); |
684 | int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm, |
685 | const ASN1_TIME *start, const ASN1_TIME *end); |
686 | ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t); |
687 | ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s, |
688 | int offset_day, long offset_sec, time_t *t); |
689 | ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj); |
690 | |
691 | const char *X509_get_default_cert_area(void); |
692 | const char *X509_get_default_cert_dir(void); |
693 | const char *X509_get_default_cert_file(void); |
694 | const char *X509_get_default_cert_dir_env(void); |
695 | const char *X509_get_default_cert_file_env(void); |
696 | const char *X509_get_default_private_dir(void); |
697 | |
698 | X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
699 | X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey); |
700 | |
701 | DECLARE_ASN1_FUNCTIONS(X509_ALGOR) |
702 | DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) |
703 | DECLARE_ASN1_FUNCTIONS(X509_VAL) |
704 | |
705 | DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) |
706 | |
707 | X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq); |
708 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); |
709 | EVP_PKEY *X509_PUBKEY_get0(const X509_PUBKEY *key); |
710 | EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key); |
711 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain); |
712 | long X509_get_pathlen(X509 *x); |
713 | DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY) |
714 | EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length, |
715 | OSSL_LIB_CTX *libctx, const char *propq); |
716 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
717 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,RSA, RSA_PUBKEY) |
718 | # endif |
719 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
720 | # ifndef OPENSSL_NO_DSA |
721 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,DSA, DSA_PUBKEY) |
722 | # endif |
723 | # endif |
724 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
725 | # ifndef OPENSSL_NO_EC |
726 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, EC_KEY, EC_PUBKEY) |
727 | # endif |
728 | # endif |
729 | |
730 | DECLARE_ASN1_FUNCTIONS(X509_SIG) |
731 | void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg, |
732 | const ASN1_OCTET_STRING **pdigest); |
733 | void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, |
734 | ASN1_OCTET_STRING **pdigest); |
735 | |
736 | DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) |
737 | DECLARE_ASN1_FUNCTIONS(X509_REQ) |
738 | X509_REQ *X509_REQ_new_ex(OSSL_LIB_CTX *libctx, const char *propq); |
739 | |
740 | DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) |
741 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); |
742 | |
743 | DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) |
744 | DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) |
745 | |
746 | DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) |
747 | |
748 | DECLARE_ASN1_FUNCTIONS(X509_NAME) |
749 | |
750 | int X509_NAME_set(X509_NAME **xn, const X509_NAME *name); |
751 | |
752 | DECLARE_ASN1_FUNCTIONS(X509_CINF) |
753 | DECLARE_ASN1_FUNCTIONS(X509) |
754 | X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq); |
755 | DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) |
756 | |
757 | #define X509_get_ex_new_index(l, p, newf, dupf, freef) \ |
758 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef) |
759 | int X509_set_ex_data(X509 *r, int idx, void *arg); |
760 | void *X509_get_ex_data(const X509 *r, int idx); |
761 | DECLARE_ASN1_ENCODE_FUNCTIONS_only(X509,X509_AUX) |
762 | |
763 | int i2d_re_X509_tbs(X509 *x, unsigned char **pp); |
764 | |
765 | int X509_SIG_INFO_get(const X509_SIG_INFO *siginf, int *mdnid, int *pknid, |
766 | int *secbits, uint32_t *flags); |
767 | void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid, |
768 | int secbits, uint32_t flags); |
769 | |
770 | int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits, |
771 | uint32_t *flags); |
772 | |
773 | void X509_get0_signature(const ASN1_BIT_STRING **psig, |
774 | const X509_ALGOR **palg, const X509 *x); |
775 | int X509_get_signature_nid(const X509 *x); |
776 | |
777 | void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id); |
778 | ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x); |
779 | void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id); |
780 | ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x); |
781 | |
782 | int X509_alias_set1(X509 *x, const unsigned char *name, int len); |
783 | int X509_keyid_set1(X509 *x, const unsigned char *id, int len); |
784 | unsigned char *X509_alias_get0(X509 *x, int *len); |
785 | unsigned char *X509_keyid_get0(X509 *x, int *len); |
786 | |
787 | DECLARE_ASN1_FUNCTIONS(X509_REVOKED) |
788 | DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) |
789 | DECLARE_ASN1_FUNCTIONS(X509_CRL) |
790 | X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx, const char *propq); |
791 | |
792 | int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); |
793 | int X509_CRL_get0_by_serial(X509_CRL *crl, |
794 | X509_REVOKED **ret, const ASN1_INTEGER *serial); |
795 | int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x); |
796 | |
797 | X509_PKEY *X509_PKEY_new(void); |
798 | void X509_PKEY_free(X509_PKEY *a); |
799 | |
800 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) |
801 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) |
802 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) |
803 | |
804 | X509_INFO *X509_INFO_new(void); |
805 | void X509_INFO_free(X509_INFO *a); |
806 | char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size); |
807 | |
808 | #ifndef OPENSSL_NO_DEPRECATED_3_0 |
809 | OSSL_DEPRECATEDIN_3_0 |
810 | int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1, |
811 | ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey); |
812 | OSSL_DEPRECATEDIN_3_0 |
813 | int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, |
814 | unsigned char *md, unsigned int *len); |
815 | OSSL_DEPRECATEDIN_3_0 |
816 | int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2, |
817 | ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, |
818 | const EVP_MD *type); |
819 | #endif |
820 | int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data, |
821 | unsigned char *md, unsigned int *len); |
822 | int ASN1_item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg, |
823 | const ASN1_BIT_STRING *signature, const void *data, |
824 | EVP_PKEY *pkey); |
825 | int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg, |
826 | const ASN1_BIT_STRING *signature, const void *data, |
827 | EVP_MD_CTX *ctx); |
828 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, |
829 | ASN1_BIT_STRING *signature, const void *data, |
830 | EVP_PKEY *pkey, const EVP_MD *md); |
831 | int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, |
832 | X509_ALGOR *algor2, ASN1_BIT_STRING *signature, |
833 | const void *data, EVP_MD_CTX *ctx); |
834 | |
835 | #define X509_VERSION_1 0 |
836 | #define X509_VERSION_2 1 |
837 | #define X509_VERSION_3 2 |
838 | |
839 | long X509_get_version(const X509 *x); |
840 | int X509_set_version(X509 *x, long version); |
841 | int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); |
842 | ASN1_INTEGER *X509_get_serialNumber(X509 *x); |
843 | const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x); |
844 | int X509_set_issuer_name(X509 *x, const X509_NAME *name); |
845 | X509_NAME *X509_get_issuer_name(const X509 *a); |
846 | int X509_set_subject_name(X509 *x, const X509_NAME *name); |
847 | X509_NAME *X509_get_subject_name(const X509 *a); |
848 | const ASN1_TIME * X509_get0_notBefore(const X509 *x); |
849 | ASN1_TIME *X509_getm_notBefore(const X509 *x); |
850 | int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm); |
851 | const ASN1_TIME *X509_get0_notAfter(const X509 *x); |
852 | ASN1_TIME *X509_getm_notAfter(const X509 *x); |
853 | int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm); |
854 | int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); |
855 | int X509_up_ref(X509 *x); |
856 | int X509_get_signature_type(const X509 *x); |
857 | |
858 | # ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
859 | # define X509_get_notBefore X509_getm_notBefore |
860 | # define X509_get_notAfter X509_getm_notAfter |
861 | # define X509_set_notBefore X509_set1_notBefore |
862 | # define X509_set_notAfter X509_set1_notAfter |
863 | #endif |
864 | |
865 | |
866 | /* |
867 | * This one is only used so that a binary form can output, as in |
868 | * i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf) |
869 | */ |
870 | X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); |
871 | const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); |
872 | void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid, |
873 | const ASN1_BIT_STRING **psuid); |
874 | const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); |
875 | |
876 | EVP_PKEY *X509_get0_pubkey(const X509 *x); |
877 | EVP_PKEY *X509_get_pubkey(X509 *x); |
878 | ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); |
879 | |
880 | #define X509_REQ_VERSION_1 0 |
881 | |
882 | long X509_REQ_get_version(const X509_REQ *req); |
883 | int X509_REQ_set_version(X509_REQ *x, long version); |
884 | X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req); |
885 | int X509_REQ_set_subject_name(X509_REQ *req, const X509_NAME *name); |
886 | void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, |
887 | const X509_ALGOR **palg); |
888 | void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig); |
889 | int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg); |
890 | int X509_REQ_get_signature_nid(const X509_REQ *req); |
891 | int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); |
892 | int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); |
893 | EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req); |
894 | EVP_PKEY *X509_REQ_get0_pubkey(const X509_REQ *req); |
895 | X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req); |
896 | int X509_REQ_extension_nid(int nid); |
897 | int *X509_REQ_get_extension_nids(void); |
898 | void X509_REQ_set_extension_nids(int *nids); |
899 | STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); |
900 | int X509_REQ_add_extensions_nid(X509_REQ *req, |
901 | const STACK_OF(X509_EXTENSION) *exts, int nid); |
902 | int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *ext); |
903 | int X509_REQ_get_attr_count(const X509_REQ *req); |
904 | int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos); |
905 | int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, |
906 | int lastpos); |
907 | X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); |
908 | X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); |
909 | int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); |
910 | int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, |
911 | const ASN1_OBJECT *obj, int type, |
912 | const unsigned char *bytes, int len); |
913 | int X509_REQ_add1_attr_by_NID(X509_REQ *req, |
914 | int nid, int type, |
915 | const unsigned char *bytes, int len); |
916 | int X509_REQ_add1_attr_by_txt(X509_REQ *req, |
917 | const char *attrname, int type, |
918 | const unsigned char *bytes, int len); |
919 | |
920 | #define X509_CRL_VERSION_1 0 |
921 | #define X509_CRL_VERSION_2 1 |
922 | |
923 | int X509_CRL_set_version(X509_CRL *x, long version); |
924 | int X509_CRL_set_issuer_name(X509_CRL *x, const X509_NAME *name); |
925 | int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); |
926 | int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); |
927 | int X509_CRL_sort(X509_CRL *crl); |
928 | int X509_CRL_up_ref(X509_CRL *crl); |
929 | |
930 | # ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
931 | # define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate |
932 | # define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate |
933 | #endif |
934 | |
935 | long X509_CRL_get_version(const X509_CRL *crl); |
936 | const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); |
937 | const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); |
938 | #ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
939 | OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl); |
940 | OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl); |
941 | #endif |
942 | X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); |
943 | const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); |
944 | STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); |
945 | void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, |
946 | const X509_ALGOR **palg); |
947 | int X509_CRL_get_signature_nid(const X509_CRL *crl); |
948 | int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp); |
949 | |
950 | const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x); |
951 | int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); |
952 | const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x); |
953 | int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); |
954 | const STACK_OF(X509_EXTENSION) * |
955 | X509_REVOKED_get0_extensions(const X509_REVOKED *r); |
956 | |
957 | X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, |
958 | EVP_PKEY *skey, const EVP_MD *md, unsigned int flags); |
959 | |
960 | int X509_REQ_check_private_key(const X509_REQ *req, EVP_PKEY *pkey); |
961 | |
962 | int X509_check_private_key(const X509 *cert, const EVP_PKEY *pkey); |
963 | int X509_chain_check_suiteb(int *perror_depth, |
964 | X509 *x, STACK_OF(X509) *chain, |
965 | unsigned long flags); |
966 | int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags); |
967 | void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs); |
968 | STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); |
969 | |
970 | int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); |
971 | unsigned long X509_issuer_and_serial_hash(X509 *a); |
972 | |
973 | int X509_issuer_name_cmp(const X509 *a, const X509 *b); |
974 | unsigned long X509_issuer_name_hash(X509 *a); |
975 | |
976 | int X509_subject_name_cmp(const X509 *a, const X509 *b); |
977 | unsigned long X509_subject_name_hash(X509 *x); |
978 | |
979 | # ifndef OPENSSL_NO_MD5 |
980 | unsigned long X509_issuer_name_hash_old(X509 *a); |
981 | unsigned long X509_subject_name_hash_old(X509 *x); |
982 | # endif |
983 | |
984 | # define X509_ADD_FLAG_DEFAULT 0 |
985 | # define X509_ADD_FLAG_UP_REF 0x1 |
986 | # define X509_ADD_FLAG_PREPEND 0x2 |
987 | # define X509_ADD_FLAG_NO_DUP 0x4 |
988 | # define X509_ADD_FLAG_NO_SS 0x8 |
989 | int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags); |
990 | int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags); |
991 | |
992 | int X509_cmp(const X509 *a, const X509 *b); |
993 | int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); |
994 | #ifndef OPENSSL_NO_DEPRECATED_3_0 |
995 | # define X509_NAME_hash(x) X509_NAME_hash_ex(x, NULL, NULL, NULL) |
996 | OSSL_DEPRECATEDIN_3_0 int X509_certificate_type(const X509 *x, |
997 | const EVP_PKEY *pubkey); |
998 | #endif |
999 | unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx, |
1000 | const char *propq, int *ok); |
1001 | unsigned long X509_NAME_hash_old(const X509_NAME *x); |
1002 | |
1003 | int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); |
1004 | int X509_CRL_match(const X509_CRL *a, const X509_CRL *b); |
1005 | int X509_aux_print(BIO *out, X509 *x, int indent); |
1006 | # ifndef OPENSSL_NO_STDIO |
1007 | int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag, |
1008 | unsigned long cflag); |
1009 | int X509_print_fp(FILE *bp, X509 *x); |
1010 | int X509_CRL_print_fp(FILE *bp, X509_CRL *x); |
1011 | int X509_REQ_print_fp(FILE *bp, X509_REQ *req); |
1012 | int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, |
1013 | unsigned long flags); |
1014 | # endif |
1015 | |
1016 | int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase); |
1017 | int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, |
1018 | unsigned long flags); |
1019 | int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag, |
1020 | unsigned long cflag); |
1021 | int X509_print(BIO *bp, X509 *x); |
1022 | int X509_ocspid_print(BIO *bp, X509 *x); |
1023 | int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag); |
1024 | int X509_CRL_print(BIO *bp, X509_CRL *x); |
1025 | int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, |
1026 | unsigned long cflag); |
1027 | int X509_REQ_print(BIO *bp, X509_REQ *req); |
1028 | |
1029 | int X509_NAME_entry_count(const X509_NAME *name); |
1030 | int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid, |
1031 | char *buf, int len); |
1032 | int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj, |
1033 | char *buf, int len); |
1034 | |
1035 | /* |
1036 | * NOTE: you should be passing -1, not 0 as lastpos. The functions that use |
1037 | * lastpos, search after that position on. |
1038 | */ |
1039 | int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos); |
1040 | int X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj, |
1041 | int lastpos); |
1042 | X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc); |
1043 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); |
1044 | int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, |
1045 | int loc, int set); |
1046 | int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type, |
1047 | const unsigned char *bytes, int len, int loc, |
1048 | int set); |
1049 | int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, |
1050 | const unsigned char *bytes, int len, int loc, |
1051 | int set); |
1052 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, |
1053 | const char *field, int type, |
1054 | const unsigned char *bytes, |
1055 | int len); |
1056 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, |
1057 | int type, |
1058 | const unsigned char *bytes, |
1059 | int len); |
1060 | int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, |
1061 | const unsigned char *bytes, int len, int loc, |
1062 | int set); |
1063 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, |
1064 | const ASN1_OBJECT *obj, int type, |
1065 | const unsigned char *bytes, |
1066 | int len); |
1067 | int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj); |
1068 | int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, |
1069 | const unsigned char *bytes, int len); |
1070 | ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne); |
1071 | ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne); |
1072 | int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne); |
1073 | |
1074 | int X509_NAME_get0_der(const X509_NAME *nm, const unsigned char **pder, |
1075 | size_t *pderlen); |
1076 | |
1077 | int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); |
1078 | int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, |
1079 | int nid, int lastpos); |
1080 | int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, |
1081 | const ASN1_OBJECT *obj, int lastpos); |
1082 | int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, |
1083 | int crit, int lastpos); |
1084 | X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); |
1085 | X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); |
1086 | STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, |
1087 | X509_EXTENSION *ex, int loc); |
1088 | |
1089 | int X509_get_ext_count(const X509 *x); |
1090 | int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos); |
1091 | int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos); |
1092 | int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos); |
1093 | X509_EXTENSION *X509_get_ext(const X509 *x, int loc); |
1094 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); |
1095 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); |
1096 | void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx); |
1097 | int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, |
1098 | unsigned long flags); |
1099 | |
1100 | int X509_CRL_get_ext_count(const X509_CRL *x); |
1101 | int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos); |
1102 | int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, |
1103 | int lastpos); |
1104 | int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos); |
1105 | X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc); |
1106 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); |
1107 | int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); |
1108 | void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx); |
1109 | int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, |
1110 | unsigned long flags); |
1111 | |
1112 | int X509_REVOKED_get_ext_count(const X509_REVOKED *x); |
1113 | int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos); |
1114 | int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj, |
1115 | int lastpos); |
1116 | int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit, |
1117 | int lastpos); |
1118 | X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc); |
1119 | X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); |
1120 | int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); |
1121 | void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, |
1122 | int *idx); |
1123 | int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, |
1124 | unsigned long flags); |
1125 | |
1126 | X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, |
1127 | int nid, int crit, |
1128 | ASN1_OCTET_STRING *data); |
1129 | X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, |
1130 | const ASN1_OBJECT *obj, int crit, |
1131 | ASN1_OCTET_STRING *data); |
1132 | int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj); |
1133 | int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); |
1134 | int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data); |
1135 | ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex); |
1136 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); |
1137 | int X509_EXTENSION_get_critical(const X509_EXTENSION *ex); |
1138 | |
1139 | int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); |
1140 | int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, |
1141 | int lastpos); |
1142 | int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, |
1143 | const ASN1_OBJECT *obj, int lastpos); |
1144 | X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); |
1145 | X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); |
1146 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, |
1147 | X509_ATTRIBUTE *attr); |
1148 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) |
1149 | **x, const ASN1_OBJECT *obj, |
1150 | int type, |
1151 | const unsigned char *bytes, |
1152 | int len); |
1153 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) |
1154 | **x, int nid, int type, |
1155 | const unsigned char *bytes, |
1156 | int len); |
1157 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) |
1158 | **x, const char *attrname, |
1159 | int type, |
1160 | const unsigned char *bytes, |
1161 | int len); |
1162 | void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x, |
1163 | const ASN1_OBJECT *obj, int lastpos, int type); |
1164 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, |
1165 | int atrtype, const void *data, |
1166 | int len); |
1167 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, |
1168 | const ASN1_OBJECT *obj, |
1169 | int atrtype, const void *data, |
1170 | int len); |
1171 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, |
1172 | const char *atrname, int type, |
1173 | const unsigned char *bytes, |
1174 | int len); |
1175 | int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); |
1176 | int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, |
1177 | const void *data, int len); |
1178 | void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, |
1179 | void *data); |
1180 | int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr); |
1181 | ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); |
1182 | ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); |
1183 | |
1184 | int EVP_PKEY_get_attr_count(const EVP_PKEY *key); |
1185 | int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos); |
1186 | int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, |
1187 | int lastpos); |
1188 | X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); |
1189 | X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); |
1190 | int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr); |
1191 | int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, |
1192 | const ASN1_OBJECT *obj, int type, |
1193 | const unsigned char *bytes, int len); |
1194 | int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, |
1195 | int nid, int type, |
1196 | const unsigned char *bytes, int len); |
1197 | int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, |
1198 | const char *attrname, int type, |
1199 | const unsigned char *bytes, int len); |
1200 | |
1201 | /* lookup a cert from a X509 STACK */ |
1202 | X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, const X509_NAME *name, |
1203 | const ASN1_INTEGER *serial); |
1204 | X509 *X509_find_by_subject(STACK_OF(X509) *sk, const X509_NAME *name); |
1205 | |
1206 | DECLARE_ASN1_FUNCTIONS(PBEPARAM) |
1207 | DECLARE_ASN1_FUNCTIONS(PBE2PARAM) |
1208 | DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) |
1209 | #ifndef OPENSSL_NO_SCRYPT |
1210 | DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS) |
1211 | #endif |
1212 | |
1213 | int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, |
1214 | const unsigned char *salt, int saltlen); |
1215 | int PKCS5_pbe_set0_algor_ex(X509_ALGOR *algor, int alg, int iter, |
1216 | const unsigned char *salt, int saltlen, |
1217 | OSSL_LIB_CTX *libctx); |
1218 | |
1219 | X509_ALGOR *PKCS5_pbe_set(int alg, int iter, |
1220 | const unsigned char *salt, int saltlen); |
1221 | X509_ALGOR *PKCS5_pbe_set_ex(int alg, int iter, |
1222 | const unsigned char *salt, int saltlen, |
1223 | OSSL_LIB_CTX *libctx); |
1224 | |
1225 | X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, |
1226 | unsigned char *salt, int saltlen); |
1227 | X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, |
1228 | unsigned char *salt, int saltlen, |
1229 | unsigned char *aiv, int prf_nid); |
1230 | X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter, |
1231 | unsigned char *salt, int saltlen, |
1232 | unsigned char *aiv, int prf_nid, |
1233 | OSSL_LIB_CTX *libctx); |
1234 | |
1235 | #ifndef OPENSSL_NO_SCRYPT |
1236 | X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher, |
1237 | const unsigned char *salt, int saltlen, |
1238 | unsigned char *aiv, uint64_t N, uint64_t r, |
1239 | uint64_t p); |
1240 | #endif |
1241 | |
1242 | X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, |
1243 | int prf_nid, int keylen); |
1244 | X509_ALGOR *PKCS5_pbkdf2_set_ex(int iter, unsigned char *salt, int saltlen, |
1245 | int prf_nid, int keylen, |
1246 | OSSL_LIB_CTX *libctx); |
1247 | |
1248 | /* PKCS#8 utilities */ |
1249 | |
1250 | DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) |
1251 | |
1252 | EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8); |
1253 | EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx, |
1254 | const char *propq); |
1255 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey); |
1256 | |
1257 | int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, |
1258 | int version, int ptype, void *pval, |
1259 | unsigned char *penc, int penclen); |
1260 | int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, |
1261 | const unsigned char **pk, int *ppklen, |
1262 | const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8); |
1263 | |
1264 | const STACK_OF(X509_ATTRIBUTE) * |
1265 | PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); |
1266 | int PKCS8_pkey_add1_attr(PKCS8_PRIV_KEY_INFO *p8, X509_ATTRIBUTE *attr); |
1267 | int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, |
1268 | const unsigned char *bytes, int len); |
1269 | int PKCS8_pkey_add1_attr_by_OBJ(PKCS8_PRIV_KEY_INFO *p8, const ASN1_OBJECT *obj, |
1270 | int type, const unsigned char *bytes, int len); |
1271 | |
1272 | |
1273 | void X509_PUBKEY_set0_public_key(X509_PUBKEY *pub, |
1274 | unsigned char *penc, int penclen); |
1275 | int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, |
1276 | int ptype, void *pval, |
1277 | unsigned char *penc, int penclen); |
1278 | int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, |
1279 | const unsigned char **pk, int *ppklen, |
1280 | X509_ALGOR **pa, const X509_PUBKEY *pub); |
1281 | int X509_PUBKEY_eq(const X509_PUBKEY *a, const X509_PUBKEY *b); |
1282 | |
1283 | # ifdef __cplusplus |
1284 | } |
1285 | # endif |
1286 | #endif |
1287 | |