diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_lu.c | 18 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.h | 6 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c index ee72e67d1a..143ad152ba 100644 --- a/src/lib/libcrypto/x509/x509_lu.c +++ b/src/lib/libcrypto/x509/x509_lu.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_lu.c,v 1.35 2021/10/31 16:20:37 tb Exp $ */ | 1 | /* $OpenBSD: x509_lu.c,v 1.36 2021/10/31 16:23:45 tb 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 | * |
| @@ -321,6 +321,22 @@ X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) | |||
| 321 | } | 321 | } |
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | X509_OBJECT * | ||
| 325 | X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, | ||
| 326 | X509_NAME *name) | ||
| 327 | { | ||
| 328 | X509_OBJECT *ret; | ||
| 329 | |||
| 330 | if ((ret = X509_OBJECT_new()) == NULL) | ||
| 331 | return NULL; | ||
| 332 | if (!X509_STORE_CTX_get_by_subject(vs, type, name, ret)) { | ||
| 333 | X509_OBJECT_free(ret); | ||
| 334 | return NULL; | ||
| 335 | } | ||
| 336 | |||
| 337 | return ret; | ||
| 338 | } | ||
| 339 | |||
| 324 | int | 340 | int |
| 325 | X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, | 341 | X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, |
| 326 | X509_NAME *name, X509_OBJECT *ret) | 342 | X509_NAME *name, X509_OBJECT *ret) |
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h index b78c857cdb..1889217233 100644 --- a/src/lib/libcrypto/x509/x509_vfy.h +++ b/src/lib/libcrypto/x509/x509_vfy.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_vfy.h,v 1.41 2021/10/31 16:20:37 tb Exp $ */ | 1 | /* $OpenBSD: x509_vfy.h,v 1.42 2021/10/31 16:23:46 tb 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 | * |
| @@ -500,6 +500,10 @@ int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); | |||
| 500 | int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, | 500 | int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, |
| 501 | X509_NAME *name, X509_OBJECT *ret); | 501 | X509_NAME *name, X509_OBJECT *ret); |
| 502 | #define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject | 502 | #define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject |
| 503 | #if defined(LIBRESSL_NEW_API) | ||
| 504 | X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, | ||
| 505 | X509_LOOKUP_TYPE type, X509_NAME *name); | ||
| 506 | #endif | ||
| 503 | 507 | ||
| 504 | int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, | 508 | int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, |
| 505 | long argl, char **ret); | 509 | long argl, char **ret); |
