summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509
diff options
context:
space:
mode:
authorjob <>2023-02-23 18:12:32 +0000
committerjob <>2023-02-23 18:12:32 +0000
commita08222b8bebdd9bb3795304dce3e988df2c7595c (patch)
treea66ebeded65ea7f94fc6820531700d59a0ed41b5 /src/lib/libcrypto/x509
parent8f4cd3e0e032f13354ee58ce3544243dfb8b9553 (diff)
downloadopenbsd-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.h6
-rw-r--r--src/lib/libcrypto/x509/x509_set.c13
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
773const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); 773const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
774#if defined(LIBRESSL_INTERNAL) || defined(LIBRESSL_NEXT_API)
775void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid,
776 const ASN1_BIT_STRING **psuid);
777#endif
774const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); 778const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);
775int X509_set_version(X509 *x, long version); 779int X509_set_version(X509 *x, long version);
776long X509_get_version(const X509 *x); 780long 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}
244LCRYPTO_ALIAS(X509_get_X509_PUBKEY); 244LCRYPTO_ALIAS(X509_get_X509_PUBKEY);
245
246void
247X509_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}
255LCRYPTO_ALIAS(X509_get0_uids);