diff options
author | tb <> | 2018-05-18 17:59:16 +0000 |
---|---|---|
committer | tb <> | 2018-05-18 17:59:16 +0000 |
commit | ed50d2df6e31a2b7e21685507224930405da7aa9 (patch) | |
tree | dda47b18b95071feec237614d83aec3971853ff6 /src/lib | |
parent | 4add99b8c6cbd8e11583f180cb4ed618f9929a25 (diff) | |
download | openbsd-ed50d2df6e31a2b7e21685507224930405da7aa9.tar.gz openbsd-ed50d2df6e31a2b7e21685507224930405da7aa9.tar.bz2 openbsd-ed50d2df6e31a2b7e21685507224930405da7aa9.zip |
Add a const qualifier to the 'X509_NAME_ENTRY *ne' argument of
X509_NAME_add_entry(3).
tested in a bulk build by sthen,
ok jsing
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/x509/x509.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509name.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index 0b3a63b6ec..43af626613 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.53 2018/05/18 17:56:12 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.54 2018/05/18 17:59:16 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 | * |
@@ -1103,7 +1103,7 @@ int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, | |||
1103 | int lastpos); | 1103 | int lastpos); |
1104 | X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); | 1104 | X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); |
1105 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); | 1105 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); |
1106 | int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, | 1106 | int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, |
1107 | int loc, int set); | 1107 | int loc, int set); |
1108 | int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, | 1108 | int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, |
1109 | unsigned char *bytes, int len, int loc, int set); | 1109 | unsigned char *bytes, int len, int loc, int set); |
diff --git a/src/lib/libcrypto/x509/x509name.c b/src/lib/libcrypto/x509/x509name.c index 9ff2a907b4..fc804f5428 100644 --- a/src/lib/libcrypto/x509/x509name.c +++ b/src/lib/libcrypto/x509/x509name.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509name.c,v 1.19 2018/05/18 17:56:12 tb Exp $ */ | 1 | /* $OpenBSD: x509name.c,v 1.20 2018/05/18 17:59:16 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 | * |
@@ -235,7 +235,8 @@ X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, | |||
235 | /* if set is -1, append to previous set, 0 'a new one', and 1, | 235 | /* if set is -1, append to previous set, 0 'a new one', and 1, |
236 | * prepend to the guy we are about to stomp on. */ | 236 | * prepend to the guy we are about to stomp on. */ |
237 | int | 237 | int |
238 | X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) | 238 | X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, |
239 | int set) | ||
239 | { | 240 | { |
240 | X509_NAME_ENTRY *new_name = NULL; | 241 | X509_NAME_ENTRY *new_name = NULL; |
241 | int n, i, inc; | 242 | int n, i, inc; |
@@ -268,7 +269,8 @@ X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) | |||
268 | set = sk_X509_NAME_ENTRY_value(sk, loc)->set; | 269 | set = sk_X509_NAME_ENTRY_value(sk, loc)->set; |
269 | } | 270 | } |
270 | 271 | ||
271 | if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL) | 272 | /* OpenSSL has ASN1-generated X509_NAME_ENTRY_dup() without const. */ |
273 | if ((new_name = X509_NAME_ENTRY_dup((X509_NAME_ENTRY *)ne)) == NULL) | ||
272 | goto err; | 274 | goto err; |
273 | new_name->set = set; | 275 | new_name->set = set; |
274 | if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) { | 276 | if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) { |