diff options
| author | job <> | 2023-02-23 18:12:32 +0000 |
|---|---|---|
| committer | job <> | 2023-02-23 18:12:32 +0000 |
| commit | a08222b8bebdd9bb3795304dce3e988df2c7595c (patch) | |
| tree | a66ebeded65ea7f94fc6820531700d59a0ed41b5 /src/lib/libcrypto/x509 | |
| parent | 8f4cd3e0e032f13354ee58ce3544243dfb8b9553 (diff) | |
| download | openbsd-a08222b8bebdd9bb3795304dce3e988df2c7595c.tar.gz openbsd-a08222b8bebdd9bb3795304dce3e988df2c7595c.tar.bz2 openbsd-a08222b8bebdd9bb3795304dce3e988df2c7595c.zip | |
Introduce X509_get0_uids() accessor function
By introducing X509_get0_uids(), one can add RPKI profile compliance
checks to conform the absence of the issuerUID and subjectUID.
OK tb@ jsing@
Diffstat (limited to 'src/lib/libcrypto/x509')
| -rw-r--r-- | src/lib/libcrypto/x509/x509.h | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_set.c | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index 4ecad066c1..e31f7182d3 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509.h,v 1.92 2022/12/26 16:00:36 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.93 2023/02/23 18:12:32 job 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 | * |
| @@ -771,6 +771,10 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, | |||
| 771 | #endif | 771 | #endif |
| 772 | 772 | ||
| 773 | const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); | 773 | const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); |
| 774 | #if defined(LIBRESSL_INTERNAL) || defined(LIBRESSL_NEXT_API) | ||
| 775 | void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid, | ||
| 776 | const ASN1_BIT_STRING **psuid); | ||
| 777 | #endif | ||
| 774 | const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); | 778 | const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); |
| 775 | int X509_set_version(X509 *x, long version); | 779 | int X509_set_version(X509 *x, long version); |
| 776 | long X509_get_version(const X509 *x); | 780 | long X509_get_version(const X509 *x); |
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c index e65ffb3b4d..19e0f2b55f 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.23 2023/02/16 08:38:17 tb Exp $ */ | 1 | /* $OpenBSD: x509_set.c,v 1.24 2023/02/23 18:12:32 job 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 | * |
| @@ -242,3 +242,14 @@ X509_get_X509_PUBKEY(const X509 *x) | |||
| 242 | return x->cert_info->key; | 242 | return x->cert_info->key; |
| 243 | } | 243 | } |
| 244 | LCRYPTO_ALIAS(X509_get_X509_PUBKEY); | 244 | LCRYPTO_ALIAS(X509_get_X509_PUBKEY); |
| 245 | |||
| 246 | void | ||
| 247 | X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid, | ||
| 248 | const ASN1_BIT_STRING **psuid) | ||
| 249 | { | ||
| 250 | if (piuid != NULL) | ||
| 251 | *piuid = x->cert_info->issuerUID; | ||
| 252 | if (psuid != NULL) | ||
| 253 | *psuid = x->cert_info->subjectUID; | ||
| 254 | } | ||
| 255 | LCRYPTO_ALIAS(X509_get0_uids); | ||
