diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/x_x509.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/x_x509.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/x_x509.c b/src/lib/libcrypto/asn1/x_x509.c index 08e4dba9e8..e3499f620f 100644 --- a/src/lib/libcrypto/asn1/x_x509.c +++ b/src/lib/libcrypto/asn1/x_x509.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x_x509.c,v 1.37 2023/07/07 19:37:53 beck Exp $ */ | 1 | /* $OpenBSD: x_x509.c,v 1.38 2024/04/09 13:55:02 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 | * |
| @@ -149,24 +149,28 @@ d2i_X509_CINF(X509_CINF **a, const unsigned char **in, long len) | |||
| 149 | return (X509_CINF *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, | 149 | return (X509_CINF *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, |
| 150 | &X509_CINF_it); | 150 | &X509_CINF_it); |
| 151 | } | 151 | } |
| 152 | LCRYPTO_ALIAS(d2i_X509_CINF); | ||
| 152 | 153 | ||
| 153 | int | 154 | int |
| 154 | i2d_X509_CINF(X509_CINF *a, unsigned char **out) | 155 | i2d_X509_CINF(X509_CINF *a, unsigned char **out) |
| 155 | { | 156 | { |
| 156 | return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CINF_it); | 157 | return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CINF_it); |
| 157 | } | 158 | } |
| 159 | LCRYPTO_ALIAS(i2d_X509_CINF); | ||
| 158 | 160 | ||
| 159 | X509_CINF * | 161 | X509_CINF * |
| 160 | X509_CINF_new(void) | 162 | X509_CINF_new(void) |
| 161 | { | 163 | { |
| 162 | return (X509_CINF *)ASN1_item_new(&X509_CINF_it); | 164 | return (X509_CINF *)ASN1_item_new(&X509_CINF_it); |
| 163 | } | 165 | } |
| 166 | LCRYPTO_ALIAS(X509_CINF_new); | ||
| 164 | 167 | ||
| 165 | void | 168 | void |
| 166 | X509_CINF_free(X509_CINF *a) | 169 | X509_CINF_free(X509_CINF *a) |
| 167 | { | 170 | { |
| 168 | ASN1_item_free((ASN1_VALUE *)a, &X509_CINF_it); | 171 | ASN1_item_free((ASN1_VALUE *)a, &X509_CINF_it); |
| 169 | } | 172 | } |
| 173 | LCRYPTO_ALIAS(X509_CINF_free); | ||
| 170 | /* X509 top level structure needs a bit of customisation */ | 174 | /* X509 top level structure needs a bit of customisation */ |
| 171 | 175 | ||
| 172 | static int | 176 | static int |
| @@ -216,6 +220,7 @@ x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) | |||
| 216 | 220 | ||
| 217 | return 1; | 221 | return 1; |
| 218 | } | 222 | } |
| 223 | LCRYPTO_ALIAS(d2i_X509_CINF); | ||
| 219 | 224 | ||
| 220 | static const ASN1_AUX X509_aux = { | 225 | static const ASN1_AUX X509_aux = { |
| 221 | .app_data = NULL, | 226 | .app_data = NULL, |
| @@ -259,30 +264,35 @@ d2i_X509(X509 **a, const unsigned char **in, long len) | |||
| 259 | return (X509 *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, | 264 | return (X509 *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, |
| 260 | &X509_it); | 265 | &X509_it); |
| 261 | } | 266 | } |
| 267 | LCRYPTO_ALIAS(d2i_X509); | ||
| 262 | 268 | ||
| 263 | int | 269 | int |
| 264 | i2d_X509(X509 *a, unsigned char **out) | 270 | i2d_X509(X509 *a, unsigned char **out) |
| 265 | { | 271 | { |
| 266 | return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_it); | 272 | return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_it); |
| 267 | } | 273 | } |
| 274 | LCRYPTO_ALIAS(i2d_X509); | ||
| 268 | 275 | ||
| 269 | X509 * | 276 | X509 * |
| 270 | X509_new(void) | 277 | X509_new(void) |
| 271 | { | 278 | { |
| 272 | return (X509 *)ASN1_item_new(&X509_it); | 279 | return (X509 *)ASN1_item_new(&X509_it); |
| 273 | } | 280 | } |
| 281 | LCRYPTO_ALIAS(X509_new); | ||
| 274 | 282 | ||
| 275 | void | 283 | void |
| 276 | X509_free(X509 *a) | 284 | X509_free(X509 *a) |
| 277 | { | 285 | { |
| 278 | ASN1_item_free((ASN1_VALUE *)a, &X509_it); | 286 | ASN1_item_free((ASN1_VALUE *)a, &X509_it); |
| 279 | } | 287 | } |
| 288 | LCRYPTO_ALIAS(X509_free); | ||
| 280 | 289 | ||
| 281 | X509 * | 290 | X509 * |
| 282 | X509_dup(X509 *x) | 291 | X509_dup(X509 *x) |
| 283 | { | 292 | { |
| 284 | return ASN1_item_dup(&X509_it, x); | 293 | return ASN1_item_dup(&X509_it, x); |
| 285 | } | 294 | } |
| 295 | LCRYPTO_ALIAS(X509_dup); | ||
| 286 | 296 | ||
| 287 | int | 297 | int |
| 288 | X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 298 | X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
| @@ -291,18 +301,21 @@ X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | |||
| 291 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, argl, argp, | 301 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, argl, argp, |
| 292 | new_func, dup_func, free_func); | 302 | new_func, dup_func, free_func); |
| 293 | } | 303 | } |
| 304 | LCRYPTO_ALIAS(X509_get_ex_new_index); | ||
| 294 | 305 | ||
| 295 | int | 306 | int |
| 296 | X509_set_ex_data(X509 *r, int idx, void *arg) | 307 | X509_set_ex_data(X509 *r, int idx, void *arg) |
| 297 | { | 308 | { |
| 298 | return (CRYPTO_set_ex_data(&r->ex_data, idx, arg)); | 309 | return (CRYPTO_set_ex_data(&r->ex_data, idx, arg)); |
| 299 | } | 310 | } |
| 311 | LCRYPTO_ALIAS(X509_set_ex_data); | ||
| 300 | 312 | ||
| 301 | void * | 313 | void * |
| 302 | X509_get_ex_data(X509 *r, int idx) | 314 | X509_get_ex_data(X509 *r, int idx) |
| 303 | { | 315 | { |
| 304 | return (CRYPTO_get_ex_data(&r->ex_data, idx)); | 316 | return (CRYPTO_get_ex_data(&r->ex_data, idx)); |
| 305 | } | 317 | } |
| 318 | LCRYPTO_ALIAS(X509_get_ex_data); | ||
| 306 | 319 | ||
| 307 | /* X509_AUX ASN1 routines. X509_AUX is the name given to | 320 | /* X509_AUX ASN1 routines. X509_AUX is the name given to |
| 308 | * a certificate with extra info tagged on the end. Since these | 321 | * a certificate with extra info tagged on the end. Since these |
| @@ -340,6 +353,7 @@ d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) | |||
| 340 | X509_free(ret); | 353 | X509_free(ret); |
| 341 | return NULL; | 354 | return NULL; |
| 342 | } | 355 | } |
| 356 | LCRYPTO_ALIAS(d2i_X509_AUX); | ||
| 343 | 357 | ||
| 344 | int | 358 | int |
| 345 | i2d_X509_AUX(X509 *a, unsigned char **pp) | 359 | i2d_X509_AUX(X509 *a, unsigned char **pp) |
| @@ -351,6 +365,7 @@ i2d_X509_AUX(X509 *a, unsigned char **pp) | |||
| 351 | length += i2d_X509_CERT_AUX(a->aux, pp); | 365 | length += i2d_X509_CERT_AUX(a->aux, pp); |
| 352 | return length; | 366 | return length; |
| 353 | } | 367 | } |
| 368 | LCRYPTO_ALIAS(i2d_X509_AUX); | ||
| 354 | 369 | ||
| 355 | int | 370 | int |
| 356 | i2d_re_X509_tbs(X509 *x, unsigned char **pp) | 371 | i2d_re_X509_tbs(X509 *x, unsigned char **pp) |
| @@ -358,6 +373,7 @@ i2d_re_X509_tbs(X509 *x, unsigned char **pp) | |||
| 358 | x->cert_info->enc.modified = 1; | 373 | x->cert_info->enc.modified = 1; |
| 359 | return i2d_X509_CINF(x->cert_info, pp); | 374 | return i2d_X509_CINF(x->cert_info, pp); |
| 360 | } | 375 | } |
| 376 | LCRYPTO_ALIAS(i2d_re_X509_tbs); | ||
| 361 | 377 | ||
| 362 | void | 378 | void |
| 363 | X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, | 379 | X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, |
| @@ -368,9 +384,11 @@ X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, | |||
| 368 | if (palg != NULL) | 384 | if (palg != NULL) |
| 369 | *palg = x->sig_alg; | 385 | *palg = x->sig_alg; |
| 370 | } | 386 | } |
| 387 | LCRYPTO_ALIAS(X509_get0_signature); | ||
| 371 | 388 | ||
| 372 | int | 389 | int |
| 373 | X509_get_signature_nid(const X509 *x) | 390 | X509_get_signature_nid(const X509 *x) |
| 374 | { | 391 | { |
| 375 | return OBJ_obj2nid(x->sig_alg->algorithm); | 392 | return OBJ_obj2nid(x->sig_alg->algorithm); |
| 376 | } | 393 | } |
| 394 | LCRYPTO_ALIAS(X509_get_signature_nid); | ||
