summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-02-22 16:58:46 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-02-22 16:58:46 +0000
commit338c479494814f4926fefa45985bbfad1e5aea1c (patch)
tree43e83099f811528ac2b0169ecf959d310ee65b92
parent21cdcc32c43b934e609b1e7780f897667d3f7564 (diff)
Provide X509_CRL_get0_extensions() and X509_CRL_get_signature_nid().
-rw-r--r--lib/libcrypto/Symbols.list2
-rw-r--r--lib/libcrypto/asn1/x_crl.c14
-rw-r--r--lib/libcrypto/x509/x509.h6
3 files changed, 20 insertions, 2 deletions
diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list
index 3b4cbc386f3..a6404766dbf 100644
--- a/lib/libcrypto/Symbols.list
+++ b/lib/libcrypto/Symbols.list
@@ -2651,6 +2651,7 @@ X509_CRL_dup
X509_CRL_free
X509_CRL_get0_by_cert
X509_CRL_get0_by_serial
+X509_CRL_get0_extensions
X509_CRL_get0_lastUpdate
X509_CRL_get0_nextUpdate
X509_CRL_get0_signature
@@ -2661,6 +2662,7 @@ X509_CRL_get_ext_by_critical
X509_CRL_get_ext_count
X509_CRL_get_ext_d2i
X509_CRL_get_meth_data
+X509_CRL_get_signature_nid
X509_CRL_it
X509_CRL_match
X509_CRL_new
diff --git a/lib/libcrypto/asn1/x_crl.c b/lib/libcrypto/asn1/x_crl.c
index 0da2e9572b3..b8f517d8735 100644
--- a/lib/libcrypto/asn1/x_crl.c
+++ b/lib/libcrypto/asn1/x_crl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x_crl.c,v 1.28 2018/02/20 17:04:58 jsing Exp $ */
+/* $OpenBSD: x_crl.c,v 1.29 2018/02/22 16:58:45 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -686,6 +686,18 @@ X509_CRL_get_meth_data(X509_CRL *crl)
return crl->meth_data;
}
+int
+X509_CRL_get_signature_nid(const X509_CRL *crl)
+{
+ return OBJ_obj2nid(crl->sig_alg->algorithm);
+}
+
+const STACK_OF(X509_EXTENSION) *
+X509_CRL_get0_extensions(const X509_CRL *crl)
+{
+ return crl->crl->extensions;
+}
+
const ASN1_TIME *
X509_CRL_get0_lastUpdate(const X509_CRL *crl)
{
diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h
index 3dc636473f8..4f3c730a8fd 100644
--- a/lib/libcrypto/x509/x509.h
+++ b/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.35 2018/02/22 16:53:42 jsing Exp $ */
+/* $OpenBSD: x509.h,v 1.36 2018/02/22 16:58:45 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -607,7 +607,9 @@ extern "C" {
#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
int X509_CRL_up_ref(X509_CRL *x);
+int X509_CRL_get_signature_nid(const X509_CRL *crl);
+const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
@@ -920,11 +922,13 @@ void X509_REVOKED_free(X509_REVOKED *a);
X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len);
int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out);
extern const ASN1_ITEM X509_REVOKED_it;
+
X509_CRL_INFO *X509_CRL_INFO_new(void);
void X509_CRL_INFO_free(X509_CRL_INFO *a);
X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len);
int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out);
extern const ASN1_ITEM X509_CRL_INFO_it;
+
X509_CRL *X509_CRL_new(void);
void X509_CRL_free(X509_CRL *a);
X509_CRL *d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len);