summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2018-05-18 14:19:47 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2018-05-18 14:19:47 +0000
commitbdcba9831aa2bd37c0552fda2ceb4e46b2123ac8 (patch)
tree6bfa8a401de3aba44ba5955c7dec4c22249fde0a /lib/libcrypto
parent1b9381ee28620fc6fe91ea1cdac35351be2e5f68 (diff)
Add const qualifiers to the X509_CRL *x and ASN1_OBJECT *obj arguments of
X509_CRL_get_ext_count(3), X509_CRL_get_ext_by_NID(3), X509_CRL_get_ext_by_OBJ(3), X509_CRL_get_ext_by_critical(3), X509_CRL_get_ext(3), X509_CRL_get_ext_d2i(3). ok jsing
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/x509/x509.h22
-rw-r--r--lib/libcrypto/x509/x509_ext.c14
2 files changed, 20 insertions, 16 deletions
diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h
index aac63ea92b9..ffde40fbfc2 100644
--- a/lib/libcrypto/x509/x509.h
+++ b/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.49 2018/05/13 10:36:35 tb Exp $ */
+/* $OpenBSD: x509.h,v 1.50 2018/05/18 14:19:46 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1149,16 +1149,20 @@ void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
unsigned long flags);
-int X509_CRL_get_ext_count(X509_CRL *x);
-int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
-int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos);
-int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);
-X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
+int X509_CRL_get_ext_count(const X509_CRL *x);
+int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid,
+ int lastpos);
+int X509_CRL_get_ext_by_OBJ(const X509_CRL *x,
+ const ASN1_OBJECT *obj, int lastpos);
+int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit,
+ int lastpos);
+X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
-void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
-int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
- unsigned long flags);
+void * X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit,
+ int *idx);
+int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value,
+ int crit, unsigned long flags);
int X509_REVOKED_get_ext_count(X509_REVOKED *x);
int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
diff --git a/lib/libcrypto/x509/x509_ext.c b/lib/libcrypto/x509/x509_ext.c
index e90befaba11..a0f85426efc 100644
--- a/lib/libcrypto/x509/x509_ext.c
+++ b/lib/libcrypto/x509/x509_ext.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_ext.c,v 1.9 2015/02/10 08:33:10 jsing Exp $ */
+/* $OpenBSD: x509_ext.c,v 1.10 2018/05/18 14:19:46 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -66,31 +66,31 @@
#include <openssl/x509v3.h>
int
-X509_CRL_get_ext_count(X509_CRL *x)
+X509_CRL_get_ext_count(const X509_CRL *x)
{
return (X509v3_get_ext_count(x->crl->extensions));
}
int
-X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos)
+X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos)
{
return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos));
}
int
-X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos)
+X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, int lastpos)
{
return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos));
}
int
-X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos)
+X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos)
{
return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos));
}
X509_EXTENSION *
-X509_CRL_get_ext(X509_CRL *x, int loc)
+X509_CRL_get_ext(const X509_CRL *x, int loc)
{
return (X509v3_get_ext(x->crl->extensions, loc));
}
@@ -102,7 +102,7 @@ X509_CRL_delete_ext(X509_CRL *x, int loc)
}
void *
-X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx)
+X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx)
{
return X509V3_get_d2i(x->crl->extensions, nid, crit, idx);
}