summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2018-05-18 17:53:09 +0000
committertb <tb@openbsd.org>2018-05-18 17:53:09 +0000
commit00f6920d92b35662629f8b8193d26bd73ae6dd59 (patch)
tree9d2e67bd37605a9807bf3dc7505af482354156ad
parentX509_LOOKUP_by_alias() now takes a 'const char str *' and (diff)
downloadwireguard-openbsd-00f6920d92b35662629f8b8193d26bd73ae6dd59.tar.xz
wireguard-openbsd-00f6920d92b35662629f8b8193d26bd73ae6dd59.zip
Add const qualifiers to the 'obj' and 'bytes' arguments of
X509_NAME_ENTRY_create_by_NID(3), X509_NAME_ENTRY_create_by_OBJ(3), and X509_NAME_ENTRY_set_object(3). tested in a bulk build by sthen ok jsing
-rw-r--r--lib/libcrypto/x509/x509.h10
-rw-r--r--lib/libcrypto/x509/x509name.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h
index 1ddf276a937..44585c943fb 100644
--- a/lib/libcrypto/x509/x509.h
+++ b/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.51 2018/05/18 16:55:58 tb Exp $ */
+/* $OpenBSD: x509.h,v 1.52 2018/05/18 17:53:09 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1112,14 +1112,14 @@ int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
const char *field, int type, const unsigned char *bytes, int len);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
- int type,unsigned char *bytes, int len);
+ int type, const unsigned char *bytes, int len);
int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
const unsigned char *bytes, int len, int loc, int set);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
- ASN1_OBJECT *obj, int type,const unsigned char *bytes,
- int len);
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
- ASN1_OBJECT *obj);
+ const ASN1_OBJECT *obj);
int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
const unsigned char *bytes, int len);
ASN1_OBJECT * X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
diff --git a/lib/libcrypto/x509/x509name.c b/lib/libcrypto/x509/x509name.c
index 3912ca039ed..678b073a399 100644
--- a/lib/libcrypto/x509/x509name.c
+++ b/lib/libcrypto/x509/x509name.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509name.c,v 1.17 2018/05/01 19:01:28 tb Exp $ */
+/* $OpenBSD: x509name.c,v 1.18 2018/05/18 17:53:09 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -308,7 +308,7 @@ X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
X509_NAME_ENTRY *
X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,
- unsigned char *bytes, int len)
+ const unsigned char *bytes, int len)
{
ASN1_OBJECT *obj;
X509_NAME_ENTRY *nentry;
@@ -324,8 +324,8 @@ X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,
}
X509_NAME_ENTRY *
-X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, ASN1_OBJECT *obj, int type,
- const unsigned char *bytes, int len)
+X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, const ASN1_OBJECT *obj,
+ int type, const unsigned char *bytes, int len)
{
X509_NAME_ENTRY *ret;
@@ -351,7 +351,7 @@ err:
}
int
-X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj)
+X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj)
{
if ((ne == NULL) || (obj == NULL)) {
X509error(ERR_R_PASSED_NULL_PARAMETER);