diff options
author | tb <> | 2018-05-13 06:48:00 +0000 |
---|---|---|
committer | tb <> | 2018-05-13 06:48:00 +0000 |
commit | 583a09c8fc1223d311c580a49606645740ab6048 (patch) | |
tree | 5d58c9676f68a32754ca8b37042e2c12a075a0dc /src/lib | |
parent | f7943a7d637c81a04f4e7be8825fd5bd5d278761 (diff) | |
download | openbsd-583a09c8fc1223d311c580a49606645740ab6048.tar.gz openbsd-583a09c8fc1223d311c580a49606645740ab6048.tar.bz2 openbsd-583a09c8fc1223d311c580a49606645740ab6048.zip |
Add a const qualifier to the ASN1_OBJECT * argument of the following:
EVP_PKEY_get_attr_by_OBJ(3), X509at_get_attr_by_OBJ(3),
X509at_get0_data_by_OBJ(3), X509_REQ_get_attr_by_OBJ(3)
tested in a bulk by sthen
ok beck (as part of a larger diff)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/evp/evp_pkey.c | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509.h | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_att.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_req.c | 5 |
4 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c index 4dcd2a15a9..6e0d5cc3a2 100644 --- a/src/lib/libcrypto/evp/evp_pkey.c +++ b/src/lib/libcrypto/evp/evp_pkey.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_pkey.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: evp_pkey.c,v 1.20 2018/05/13 06:48:00 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -181,7 +181,8 @@ EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | int | 183 | int |
184 | EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, int lastpos) | 184 | EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, |
185 | int lastpos) | ||
185 | { | 186 | { |
186 | return X509at_get_attr_by_OBJ(key->attributes, obj, lastpos); | 187 | return X509at_get_attr_by_OBJ(key->attributes, obj, lastpos); |
187 | } | 188 | } |
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index b2eeac92ae..349265891a 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.46 2018/05/01 19:01:28 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.47 2018/05/13 06:48:00 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 | * |
@@ -1018,7 +1018,7 @@ int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); | |||
1018 | int X509_REQ_get_attr_count(const X509_REQ *req); | 1018 | int X509_REQ_get_attr_count(const X509_REQ *req); |
1019 | int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, | 1019 | int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, |
1020 | int lastpos); | 1020 | int lastpos); |
1021 | int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, | 1021 | int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, |
1022 | int lastpos); | 1022 | int lastpos); |
1023 | X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); | 1023 | X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); |
1024 | X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); | 1024 | X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); |
@@ -1186,8 +1186,8 @@ int X509_EXTENSION_get_critical(X509_EXTENSION *ex); | |||
1186 | int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); | 1186 | int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); |
1187 | int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, | 1187 | int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, |
1188 | int lastpos); | 1188 | int lastpos); |
1189 | int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, | 1189 | int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, |
1190 | int lastpos); | 1190 | const ASN1_OBJECT *obj, int lastpos); |
1191 | X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); | 1191 | X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); |
1192 | X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); | 1192 | X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); |
1193 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, | 1193 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, |
@@ -1202,7 +1202,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, | |||
1202 | const char *attrname, int type, | 1202 | const char *attrname, int type, |
1203 | const unsigned char *bytes, int len); | 1203 | const unsigned char *bytes, int len); |
1204 | void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, | 1204 | void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, |
1205 | ASN1_OBJECT *obj, int lastpos, int type); | 1205 | const ASN1_OBJECT *obj, int lastpos, int type); |
1206 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, | 1206 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, |
1207 | int atrtype, const void *data, int len); | 1207 | int atrtype, const void *data, int len); |
1208 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, | 1208 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, |
@@ -1220,7 +1220,7 @@ ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); | |||
1220 | int EVP_PKEY_get_attr_count(const EVP_PKEY *key); | 1220 | int EVP_PKEY_get_attr_count(const EVP_PKEY *key); |
1221 | int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, | 1221 | int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, |
1222 | int lastpos); | 1222 | int lastpos); |
1223 | int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, | 1223 | int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, |
1224 | int lastpos); | 1224 | int lastpos); |
1225 | X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); | 1225 | X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); |
1226 | X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); | 1226 | X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); |
diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c index 7304118eb3..edadacc2c7 100644 --- a/src/lib/libcrypto/x509/x509_att.c +++ b/src/lib/libcrypto/x509/x509_att.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_att.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: x509_att.c,v 1.16 2018/05/13 06:48:00 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 | * |
@@ -84,8 +84,8 @@ X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | int | 86 | int |
87 | X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, | 87 | X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, |
88 | int lastpos) | 88 | const ASN1_OBJECT *obj, int lastpos) |
89 | { | 89 | { |
90 | int n; | 90 | int n; |
91 | X509_ATTRIBUTE *ex; | 91 | X509_ATTRIBUTE *ex; |
@@ -205,7 +205,7 @@ X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, | |||
205 | } | 205 | } |
206 | 206 | ||
207 | void * | 207 | void * |
208 | X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj, | 208 | X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, |
209 | int lastpos, int type) | 209 | int lastpos, int type) |
210 | { | 210 | { |
211 | int i; | 211 | int i; |
diff --git a/src/lib/libcrypto/x509/x509_req.c b/src/lib/libcrypto/x509/x509_req.c index f87b35c706..b44306b00d 100644 --- a/src/lib/libcrypto/x509/x509_req.c +++ b/src/lib/libcrypto/x509/x509_req.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_req.c,v 1.20 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: x509_req.c,v 1.21 2018/05/13 06:48:00 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 | * |
@@ -286,7 +286,8 @@ X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) | |||
286 | } | 286 | } |
287 | 287 | ||
288 | int | 288 | int |
289 | X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, int lastpos) | 289 | X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, |
290 | int lastpos) | ||
290 | { | 291 | { |
291 | return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); | 292 | return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); |
292 | } | 293 | } |