diff options
-rw-r--r-- | lib/libcrypto/x509/x509.h | 4 | ||||
-rw-r--r-- | lib/libcrypto/x509/x509name.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index 0b3a63b6ec6..43af6266136 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.53 2018/05/18 17:56:12 tb Exp $ */ +/* $OpenBSD: x509.h,v 1.54 2018/05/18 17:59:16 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1103,7 +1103,7 @@ int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, int lastpos); X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); -int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, +int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, int set); int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len, int loc, int set); diff --git a/lib/libcrypto/x509/x509name.c b/lib/libcrypto/x509/x509name.c index 9ff2a907b4e..fc804f54286 100644 --- a/lib/libcrypto/x509/x509name.c +++ b/lib/libcrypto/x509/x509name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509name.c,v 1.19 2018/05/18 17:56:12 tb Exp $ */ +/* $OpenBSD: x509name.c,v 1.20 2018/05/18 17:59:16 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -235,7 +235,8 @@ X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, /* if set is -1, append to previous set, 0 'a new one', and 1, * prepend to the guy we are about to stomp on. */ int -X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) +X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, + int set) { X509_NAME_ENTRY *new_name = NULL; int n, i, inc; @@ -268,7 +269,8 @@ X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) set = sk_X509_NAME_ENTRY_value(sk, loc)->set; } - if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL) + /* OpenSSL has ASN1-generated X509_NAME_ENTRY_dup() without const. */ + if ((new_name = X509_NAME_ENTRY_dup((X509_NAME_ENTRY *)ne)) == NULL) goto err; new_name->set = set; if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) { |