summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2018-02-14 16:46:04 +0000
committerjsing <jsing@openbsd.org>2018-02-14 16:46:04 +0000
commit613b392eb30ae924649b39591c205e9f8c02145b (patch)
treeab33492520cf9f28cfb6d8f9bf19c6d9bcb144a1
parentProvide EVP_PKEY_up_ref(). (diff)
downloadwireguard-openbsd-613b392eb30ae924649b39591c205e9f8c02145b.tar.xz
wireguard-openbsd-613b392eb30ae924649b39591c205e9f8c02145b.zip
Provide ASN1_STRING_get0_data().
-rw-r--r--lib/libcrypto/Symbols.list1
-rw-r--r--lib/libcrypto/asn1/asn1.h5
-rw-r--r--lib/libcrypto/asn1/asn1_lib.c8
3 files changed, 11 insertions, 3 deletions
diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list
index 1cafdf06b4c..276c61b3a42 100644
--- a/lib/libcrypto/Symbols.list
+++ b/lib/libcrypto/Symbols.list
@@ -104,6 +104,7 @@ ASN1_STRING_copy
ASN1_STRING_data
ASN1_STRING_dup
ASN1_STRING_free
+ASN1_STRING_get0_data
ASN1_STRING_get_default_mask
ASN1_STRING_length
ASN1_STRING_length_set
diff --git a/lib/libcrypto/asn1/asn1.h b/lib/libcrypto/asn1/asn1.h
index da16d5c5292..6fc4cd75270 100644
--- a/lib/libcrypto/asn1/asn1.h
+++ b/lib/libcrypto/asn1/asn1.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1.h,v 1.43 2017/05/06 17:12:59 beck Exp $ */
+/* $OpenBSD: asn1.h,v 1.44 2018/02/14 16:46:04 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -784,7 +784,8 @@ void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
int ASN1_STRING_length(const ASN1_STRING *x);
void ASN1_STRING_length_set(ASN1_STRING *x, int n);
int ASN1_STRING_type(ASN1_STRING *x);
-unsigned char * ASN1_STRING_data(ASN1_STRING *x);
+unsigned char *ASN1_STRING_data(ASN1_STRING *x);
+const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
ASN1_BIT_STRING *ASN1_BIT_STRING_new(void);
void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a);
diff --git a/lib/libcrypto/asn1/asn1_lib.c b/lib/libcrypto/asn1/asn1_lib.c
index 852644a7814..970102c213d 100644
--- a/lib/libcrypto/asn1/asn1_lib.c
+++ b/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1_lib.c,v 1.39 2017/05/02 03:59:44 deraadt Exp $ */
+/* $OpenBSD: asn1_lib.c,v 1.40 2018/02/14 16:46:04 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -484,3 +484,9 @@ ASN1_STRING_data(ASN1_STRING *x)
{
return (x->data);
}
+
+const unsigned char *
+ASN1_STRING_get0_data(const ASN1_STRING *x)
+{
+ return (x->data);
+}