summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2022-12-26 16:00:36 +0000
committertb <>2022-12-26 16:00:36 +0000
commitb136a3e4186528672b8452c4cb65385b1fcf1f76 (patch)
treedc6aa354209a07bd8a61f90255e1290ea28a4715
parent471c7bb8d044f694f47493ac01435c3e778fa245 (diff)
downloadopenbsd-b136a3e4186528672b8452c4cb65385b1fcf1f76.tar.gz
openbsd-b136a3e4186528672b8452c4cb65385b1fcf1f76.tar.bz2
openbsd-b136a3e4186528672b8452c4cb65385b1fcf1f76.zip
Prepare to provide X509_CRL_get0_sigalg()
This is an obvious omission from the OpenSSL 1.1 and OpenSSL 3 API which does not provide a way to access the tbs sigalg of a CRL. This is needed in security/pivy. From Alex Wilson ok jsing
-rw-r--r--src/lib/libcrypto/asn1/x_crl.c8
-rw-r--r--src/lib/libcrypto/x509/x509.h6
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c
index 9c300af808..f637bddd36 100644
--- a/src/lib/libcrypto/asn1/x_crl.c
+++ b/src/lib/libcrypto/asn1/x_crl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_crl.c,v 1.38 2022/11/26 16:08:50 tb Exp $ */ 1/* $OpenBSD: x_crl.c,v 1.39 2022/12/26 16:00:36 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 *
@@ -755,3 +755,9 @@ X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
755 if (palg != NULL) 755 if (palg != NULL)
756 *palg = crl->sig_alg; 756 *palg = crl->sig_alg;
757} 757}
758
759const X509_ALGOR *
760X509_CRL_get0_tbs_sigalg(const X509_CRL *crl)
761{
762 return crl->crl->sig_alg;
763}
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 0ff66587b9..4ecad066c1 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.91 2022/12/26 07:18:53 jmc Exp $ */ 1/* $OpenBSD: x509.h,v 1.92 2022/12/26 16:00:36 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 *
@@ -400,6 +400,10 @@ STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl);
400void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, 400void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
401 const X509_ALGOR **palg); 401 const X509_ALGOR **palg);
402 402
403#if defined(LIBRESSL_INTERNAL) || defined(LIBRESSL_NEXT_API)
404const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_CRL *crl);
405#endif
406
403int X509_REQ_get_signature_nid(const X509_REQ *req); 407int X509_REQ_get_signature_nid(const X509_REQ *req);
404 408
405void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, 409void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,