diff options
author | tb <> | 2018-05-18 19:28:27 +0000 |
---|---|---|
committer | tb <> | 2018-05-18 19:28:27 +0000 |
commit | 8f0380c45f6d68d154c00d69c95ab79609a0cd2d (patch) | |
tree | b0b90c4c5881d826304b70527e219a4c38b1f50c | |
parent | 6d0ad79537e2da5fef8cb4f37397db382c5b87b4 (diff) | |
download | openbsd-8f0380c45f6d68d154c00d69c95ab79609a0cd2d.tar.gz openbsd-8f0380c45f6d68d154c00d69c95ab79609a0cd2d.tar.bz2 openbsd-8f0380c45f6d68d154c00d69c95ab79609a0cd2d.zip |
Add const to the 'x' and 'obj' arguments of:
X509_get_ext(3), X509_get_ext_by_NID(3), X509_get_ext_by_OBJ(3),
X509_get_ext_by_critical(3), X509_get_ext_count(3), X509_get_ext_d2i(3).
tested in a bulk by sthen
ok jsing
-rw-r--r-- | src/lib/libcrypto/x509/x509.h | 15 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_ext.c | 14 |
2 files changed, 15 insertions, 14 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index e99e8e0238..e77d090d96 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509.h,v 1.64 2018/05/18 19:24:08 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.65 2018/05/18 19:28:27 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1140,14 +1140,15 @@ X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); | |||
1140 | STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, | 1140 | STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, |
1141 | X509_EXTENSION *ex, int loc); | 1141 | X509_EXTENSION *ex, int loc); |
1142 | 1142 | ||
1143 | int X509_get_ext_count(X509 *x); | 1143 | int X509_get_ext_count(const X509 *x); |
1144 | int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); | 1144 | int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos); |
1145 | int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); | 1145 | int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, |
1146 | int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); | 1146 | int lastpos); |
1147 | X509_EXTENSION *X509_get_ext(X509 *x, int loc); | 1147 | int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos); |
1148 | X509_EXTENSION *X509_get_ext(const X509 *x, int loc); | ||
1148 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); | 1149 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); |
1149 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); | 1150 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); |
1150 | void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); | 1151 | void * X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx); |
1151 | int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, | 1152 | int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, |
1152 | unsigned long flags); | 1153 | unsigned long flags); |
1153 | 1154 | ||
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c index 2903f2b7a1..21374a26e2 100644 --- a/src/lib/libcrypto/x509/x509_ext.c +++ b/src/lib/libcrypto/x509/x509_ext.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_ext.c,v 1.11 2018/05/18 18:37:23 tb Exp $ */ | 1 | /* $OpenBSD: x509_ext.c,v 1.12 2018/05/18 19:28:27 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -121,32 +121,32 @@ X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) | |||
121 | } | 121 | } |
122 | 122 | ||
123 | int | 123 | int |
124 | X509_get_ext_count(X509 *x) | 124 | X509_get_ext_count(const X509 *x) |
125 | { | 125 | { |
126 | return (X509v3_get_ext_count(x->cert_info->extensions)); | 126 | return (X509v3_get_ext_count(x->cert_info->extensions)); |
127 | } | 127 | } |
128 | 128 | ||
129 | int | 129 | int |
130 | X509_get_ext_by_NID(X509 *x, int nid, int lastpos) | 130 | X509_get_ext_by_NID(const X509 *x, int nid, int lastpos) |
131 | { | 131 | { |
132 | return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos)); | 132 | return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos)); |
133 | } | 133 | } |
134 | 134 | ||
135 | int | 135 | int |
136 | X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos) | 136 | X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos) |
137 | { | 137 | { |
138 | return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos)); | 138 | return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos)); |
139 | } | 139 | } |
140 | 140 | ||
141 | int | 141 | int |
142 | X509_get_ext_by_critical(X509 *x, int crit, int lastpos) | 142 | X509_get_ext_by_critical(const X509 *x, int crit, int lastpos) |
143 | { | 143 | { |
144 | return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit, | 144 | return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit, |
145 | lastpos)); | 145 | lastpos)); |
146 | } | 146 | } |
147 | 147 | ||
148 | X509_EXTENSION * | 148 | X509_EXTENSION * |
149 | X509_get_ext(X509 *x, int loc) | 149 | X509_get_ext(const X509 *x, int loc) |
150 | { | 150 | { |
151 | return (X509v3_get_ext(x->cert_info->extensions, loc)); | 151 | return (X509v3_get_ext(x->cert_info->extensions, loc)); |
152 | } | 152 | } |
@@ -164,7 +164,7 @@ X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) | |||
164 | } | 164 | } |
165 | 165 | ||
166 | void * | 166 | void * |
167 | X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) | 167 | X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx) |
168 | { | 168 | { |
169 | return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); | 169 | return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); |
170 | } | 170 | } |