diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_set.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_set.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c index 5784f2203e..91d6483a3b 100644 --- a/src/lib/libcrypto/x509/x509_set.c +++ b/src/lib/libcrypto/x509/x509_set.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_set.c,v 1.20 2021/11/01 20:53:08 tb Exp $ */ | 1 | /* $OpenBSD: x509_set.c,v 1.21 2022/11/14 17:48:50 beck Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -70,12 +70,14 @@ X509_get0_extensions(const X509 *x) | |||
70 | { | 70 | { |
71 | return x->cert_info->extensions; | 71 | return x->cert_info->extensions; |
72 | } | 72 | } |
73 | LCRYPTO_ALIAS(X509_get0_extensions) | ||
73 | 74 | ||
74 | const X509_ALGOR * | 75 | const X509_ALGOR * |
75 | X509_get0_tbs_sigalg(const X509 *x) | 76 | X509_get0_tbs_sigalg(const X509 *x) |
76 | { | 77 | { |
77 | return x->cert_info->signature; | 78 | return x->cert_info->signature; |
78 | } | 79 | } |
80 | LCRYPTO_ALIAS(X509_get0_tbs_sigalg) | ||
79 | 81 | ||
80 | int | 82 | int |
81 | X509_set_version(X509 *x, long version) | 83 | X509_set_version(X509 *x, long version) |
@@ -88,12 +90,14 @@ X509_set_version(X509 *x, long version) | |||
88 | } | 90 | } |
89 | return (ASN1_INTEGER_set(x->cert_info->version, version)); | 91 | return (ASN1_INTEGER_set(x->cert_info->version, version)); |
90 | } | 92 | } |
93 | LCRYPTO_ALIAS(X509_set_version) | ||
91 | 94 | ||
92 | long | 95 | long |
93 | X509_get_version(const X509 *x) | 96 | X509_get_version(const X509 *x) |
94 | { | 97 | { |
95 | return ASN1_INTEGER_get(x->cert_info->version); | 98 | return ASN1_INTEGER_get(x->cert_info->version); |
96 | } | 99 | } |
100 | LCRYPTO_ALIAS(X509_get_version) | ||
97 | 101 | ||
98 | int | 102 | int |
99 | X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) | 103 | X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) |
@@ -112,6 +116,7 @@ X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) | |||
112 | } | 116 | } |
113 | return (in != NULL); | 117 | return (in != NULL); |
114 | } | 118 | } |
119 | LCRYPTO_ALIAS(X509_set_serialNumber) | ||
115 | 120 | ||
116 | int | 121 | int |
117 | X509_set_issuer_name(X509 *x, X509_NAME *name) | 122 | X509_set_issuer_name(X509 *x, X509_NAME *name) |
@@ -120,6 +125,7 @@ X509_set_issuer_name(X509 *x, X509_NAME *name) | |||
120 | return (0); | 125 | return (0); |
121 | return (X509_NAME_set(&x->cert_info->issuer, name)); | 126 | return (X509_NAME_set(&x->cert_info->issuer, name)); |
122 | } | 127 | } |
128 | LCRYPTO_ALIAS(X509_set_issuer_name) | ||
123 | 129 | ||
124 | int | 130 | int |
125 | X509_set_subject_name(X509 *x, X509_NAME *name) | 131 | X509_set_subject_name(X509 *x, X509_NAME *name) |
@@ -128,12 +134,14 @@ X509_set_subject_name(X509 *x, X509_NAME *name) | |||
128 | return (0); | 134 | return (0); |
129 | return (X509_NAME_set(&x->cert_info->subject, name)); | 135 | return (X509_NAME_set(&x->cert_info->subject, name)); |
130 | } | 136 | } |
137 | LCRYPTO_ALIAS(X509_set_subject_name) | ||
131 | 138 | ||
132 | const ASN1_TIME * | 139 | const ASN1_TIME * |
133 | X509_get0_notBefore(const X509 *x) | 140 | X509_get0_notBefore(const X509 *x) |
134 | { | 141 | { |
135 | return X509_getm_notBefore(x); | 142 | return X509_getm_notBefore(x); |
136 | } | 143 | } |
144 | LCRYPTO_ALIAS(X509_get0_notBefore) | ||
137 | 145 | ||
138 | ASN1_TIME * | 146 | ASN1_TIME * |
139 | X509_getm_notBefore(const X509 *x) | 147 | X509_getm_notBefore(const X509 *x) |
@@ -142,6 +150,7 @@ X509_getm_notBefore(const X509 *x) | |||
142 | return (NULL); | 150 | return (NULL); |
143 | return x->cert_info->validity->notBefore; | 151 | return x->cert_info->validity->notBefore; |
144 | } | 152 | } |
153 | LCRYPTO_ALIAS(X509_getm_notBefore) | ||
145 | 154 | ||
146 | int | 155 | int |
147 | X509_set_notBefore(X509 *x, const ASN1_TIME *tm) | 156 | X509_set_notBefore(X509 *x, const ASN1_TIME *tm) |
@@ -160,18 +169,21 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm) | |||
160 | } | 169 | } |
161 | return (in != NULL); | 170 | return (in != NULL); |
162 | } | 171 | } |
172 | LCRYPTO_ALIAS(X509_set_notBefore) | ||
163 | 173 | ||
164 | int | 174 | int |
165 | X509_set1_notBefore(X509 *x, const ASN1_TIME *tm) | 175 | X509_set1_notBefore(X509 *x, const ASN1_TIME *tm) |
166 | { | 176 | { |
167 | return X509_set_notBefore(x, tm); | 177 | return X509_set_notBefore(x, tm); |
168 | } | 178 | } |
179 | LCRYPTO_ALIAS(X509_set1_notBefore) | ||
169 | 180 | ||
170 | const ASN1_TIME * | 181 | const ASN1_TIME * |
171 | X509_get0_notAfter(const X509 *x) | 182 | X509_get0_notAfter(const X509 *x) |
172 | { | 183 | { |
173 | return X509_getm_notAfter(x); | 184 | return X509_getm_notAfter(x); |
174 | } | 185 | } |
186 | LCRYPTO_ALIAS(X509_get0_notAfter) | ||
175 | 187 | ||
176 | ASN1_TIME * | 188 | ASN1_TIME * |
177 | X509_getm_notAfter(const X509 *x) | 189 | X509_getm_notAfter(const X509 *x) |
@@ -180,6 +192,7 @@ X509_getm_notAfter(const X509 *x) | |||
180 | return (NULL); | 192 | return (NULL); |
181 | return x->cert_info->validity->notAfter; | 193 | return x->cert_info->validity->notAfter; |
182 | } | 194 | } |
195 | LCRYPTO_ALIAS(X509_getm_notAfter) | ||
183 | 196 | ||
184 | int | 197 | int |
185 | X509_set_notAfter(X509 *x, const ASN1_TIME *tm) | 198 | X509_set_notAfter(X509 *x, const ASN1_TIME *tm) |
@@ -198,12 +211,14 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm) | |||
198 | } | 211 | } |
199 | return (in != NULL); | 212 | return (in != NULL); |
200 | } | 213 | } |
214 | LCRYPTO_ALIAS(X509_set_notAfter) | ||
201 | 215 | ||
202 | int | 216 | int |
203 | X509_set1_notAfter(X509 *x, const ASN1_TIME *tm) | 217 | X509_set1_notAfter(X509 *x, const ASN1_TIME *tm) |
204 | { | 218 | { |
205 | return X509_set_notAfter(x, tm); | 219 | return X509_set_notAfter(x, tm); |
206 | } | 220 | } |
221 | LCRYPTO_ALIAS(X509_set1_notAfter) | ||
207 | 222 | ||
208 | int | 223 | int |
209 | X509_set_pubkey(X509 *x, EVP_PKEY *pkey) | 224 | X509_set_pubkey(X509 *x, EVP_PKEY *pkey) |
@@ -212,15 +227,18 @@ X509_set_pubkey(X509 *x, EVP_PKEY *pkey) | |||
212 | return (0); | 227 | return (0); |
213 | return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); | 228 | return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); |
214 | } | 229 | } |
230 | LCRYPTO_ALIAS(X509_set_pubkey) | ||
215 | 231 | ||
216 | int | 232 | int |
217 | X509_get_signature_type(const X509 *x) | 233 | X509_get_signature_type(const X509 *x) |
218 | { | 234 | { |
219 | return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); | 235 | return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); |
220 | } | 236 | } |
237 | LCRYPTO_ALIAS(X509_get_signature_type) | ||
221 | 238 | ||
222 | X509_PUBKEY * | 239 | X509_PUBKEY * |
223 | X509_get_X509_PUBKEY(const X509 *x) | 240 | X509_get_X509_PUBKEY(const X509 *x) |
224 | { | 241 | { |
225 | return x->cert_info->key; | 242 | return x->cert_info->key; |
226 | } | 243 | } |
244 | LCRYPTO_ALIAS(X509_get_X509_PUBKEY) | ||