summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2018-02-22 16:53:42 +0000
committerjsing <jsing@openbsd.org>2018-02-22 16:53:42 +0000
commit62c8eba608934b1060ba174b7c13d9fa8b9e9931 (patch)
treefa0a0d6ed4a0b68d75a89358cbafd10b6781df49
parentProvide X509_REQ_get_signature_nid(). (diff)
downloadwireguard-openbsd-62c8eba608934b1060ba174b7c13d9fa8b9e9931.tar.xz
wireguard-openbsd-62c8eba608934b1060ba174b7c13d9fa8b9e9931.zip
Provide X509_CRL_up_ref().
-rw-r--r--lib/libcrypto/Symbols.list1
-rw-r--r--lib/libcrypto/x509/x509.h4
-rw-r--r--lib/libcrypto/x509/x509cset.c9
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list
index fb10bdedd65..3b4cbc386f3 100644
--- a/lib/libcrypto/Symbols.list
+++ b/lib/libcrypto/Symbols.list
@@ -2675,6 +2675,7 @@ X509_CRL_set_version
X509_CRL_sign
X509_CRL_sign_ctx
X509_CRL_sort
+X509_CRL_up_ref
X509_CRL_verify
X509_EXTENSIONS_it
X509_EXTENSION_create_by_NID
diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h
index 9033b1d4d9a..3dc636473f8 100644
--- a/lib/libcrypto/x509/x509.h
+++ b/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.34 2018/02/22 16:50:30 jsing Exp $ */
+/* $OpenBSD: x509.h,v 1.35 2018/02/22 16:53:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -606,6 +606,8 @@ extern "C" {
#define X509_CRL_get_issuer(x) ((x)->crl->issuer)
#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
+int X509_CRL_up_ref(X509_CRL *x);
+
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,
diff --git a/lib/libcrypto/x509/x509cset.c b/lib/libcrypto/x509/x509cset.c
index 88de63debd5..3fc31cd519d 100644
--- a/lib/libcrypto/x509/x509cset.c
+++ b/lib/libcrypto/x509/x509cset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509cset.c,v 1.12 2018/02/22 16:47:50 jsing Exp $ */
+/* $OpenBSD: x509cset.c,v 1.13 2018/02/22 16:53:42 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
@@ -64,6 +64,13 @@
#include <openssl/x509.h>
int
+X509_CRL_up_ref(X509_CRL *x)
+{
+ int refs = CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509_CRL);
+ return (refs > 1) ? 1 : 0;
+}
+
+int
X509_CRL_set_version(X509_CRL *x, long version)
{
if (x == NULL)