summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2018-04-25 11:48:21 +0000
committertb <>2018-04-25 11:48:21 +0000
commitb32b7334e82988558a84760f424f8dd93d902393 (patch)
tree2706fdfa25b0fa2dc71fc06b437d687057013dcc /src
parent2225014e9e21b521735cd7db7cea4d899863d67b (diff)
downloadopenbsd-b32b7334e82988558a84760f424f8dd93d902393.tar.gz
openbsd-b32b7334e82988558a84760f424f8dd93d902393.tar.bz2
openbsd-b32b7334e82988558a84760f424f8dd93d902393.zip
Add const to functions in asn1/asn1.h as they did in OpenSSL.
BIO_f_asn1() will be taken care of later. Tested in a bulk by sthen ok bcook jca jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/asn1/a_bitstr.c7
-rw-r--r--src/lib/libcrypto/asn1/a_enum.c8
-rw-r--r--src/lib/libcrypto/asn1/a_object.c8
-rw-r--r--src/lib/libcrypto/asn1/a_strex.c11
-rw-r--r--src/lib/libcrypto/asn1/a_time_tm.c10
-rw-r--r--src/lib/libcrypto/asn1/a_type.c6
-rw-r--r--src/lib/libcrypto/asn1/asn1.h74
-rw-r--r--src/lib/libcrypto/asn1/asn1_gen.c6
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c4
-rw-r--r--src/lib/libcrypto/asn1/asn_pack.c4
-rw-r--r--src/lib/libcrypto/asn1/evp_asn1.c6
-rw-r--r--src/lib/libcrypto/asn1/f_enum.c4
-rw-r--r--src/lib/libcrypto/asn1/f_int.c4
-rw-r--r--src/lib/libcrypto/asn1/f_string.c4
-rw-r--r--src/lib/libcrypto/asn1/t_bitst.c6
-rw-r--r--src/lib/libcrypto/asn1/tasn_prn.c12
-rw-r--r--src/lib/libcrypto/x509v3/v3_sxnet.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_utl.c4
-rw-r--r--src/lib/libcrypto/x509v3/x509v3.h6
19 files changed, 96 insertions, 92 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c
index 9ba77d6958..8a4a68dbb3 100644
--- a/src/lib/libcrypto/asn1/a_bitstr.c
+++ b/src/lib/libcrypto/asn1/a_bitstr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_bitstr.c,v 1.24 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: a_bitstr.c,v 1.25 2018/04/25 11:48:21 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 *
@@ -222,7 +222,7 @@ ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
222} 222}
223 223
224int 224int
225ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) 225ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n)
226{ 226{
227 int w, v; 227 int w, v;
228 228
@@ -240,7 +240,8 @@ ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n)
240 * 'len' is the length of 'flags'. 240 * 'len' is the length of 'flags'.
241 */ 241 */
242int 242int
243ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, unsigned char *flags, int flags_len) 243ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags,
244 int flags_len)
244{ 245{
245 int i, ok; 246 int i, ok;
246 247
diff --git a/src/lib/libcrypto/asn1/a_enum.c b/src/lib/libcrypto/asn1/a_enum.c
index 23875958bf..c7d3a9a0ac 100644
--- a/src/lib/libcrypto/asn1/a_enum.c
+++ b/src/lib/libcrypto/asn1/a_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_enum.c,v 1.18 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: a_enum.c,v 1.19 2018/04/25 11:48:21 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 *
@@ -104,7 +104,7 @@ ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
104} 104}
105 105
106long 106long
107ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) 107ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a)
108{ 108{
109 int neg = 0, i; 109 int neg = 0, i;
110 long r = 0; 110 long r = 0;
@@ -134,7 +134,7 @@ ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)
134} 134}
135 135
136ASN1_ENUMERATED * 136ASN1_ENUMERATED *
137BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) 137BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai)
138{ 138{
139 ASN1_ENUMERATED *ret; 139 ASN1_ENUMERATED *ret;
140 int len, j; 140 int len, j;
@@ -177,7 +177,7 @@ err:
177} 177}
178 178
179BIGNUM * 179BIGNUM *
180ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) 180ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn)
181{ 181{
182 BIGNUM *ret; 182 BIGNUM *ret;
183 183
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c
index e10af97d36..16c3a1c0fd 100644
--- a/src/lib/libcrypto/asn1/a_object.c
+++ b/src/lib/libcrypto/asn1/a_object.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_object.c,v 1.30 2017/05/02 03:59:44 deraadt Exp $ */ 1/* $OpenBSD: a_object.c,v 1.31 2018/04/25 11:48:21 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 *
@@ -67,7 +67,7 @@
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68 68
69int 69int
70i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) 70i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
71{ 71{
72 unsigned char *p; 72 unsigned char *p;
73 int objsize; 73 int objsize;
@@ -213,13 +213,13 @@ err:
213} 213}
214 214
215int 215int
216i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a) 216i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a)
217{ 217{
218 return OBJ_obj2txt(buf, buf_len, a, 0); 218 return OBJ_obj2txt(buf, buf_len, a, 0);
219} 219}
220 220
221int 221int
222i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a) 222i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a)
223{ 223{
224 char *tmp = NULL; 224 char *tmp = NULL;
225 size_t tlen = 256; 225 size_t tlen = 256;
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c
index f60a70d94d..c0f0d7634d 100644
--- a/src/lib/libcrypto/asn1/a_strex.c
+++ b/src/lib/libcrypto/asn1/a_strex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_strex.c,v 1.25 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: a_strex.c,v 1.26 2018/04/25 11:48:21 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 2000. 3 * project 2000.
4 */ 4 */
@@ -289,7 +289,7 @@ do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, int buflen)
289 */ 289 */
290 290
291static int 291static int
292do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str) 292do_dump(unsigned long lflags, char_io *io_ch, void *arg, const ASN1_STRING *str)
293{ 293{
294 /* Placing the ASN1_STRING in a temp ASN1_TYPE allows 294 /* Placing the ASN1_STRING in a temp ASN1_TYPE allows
295 * the DER encoding to readily obtained 295 * the DER encoding to readily obtained
@@ -346,7 +346,8 @@ static const signed char tag2nbyte[] = {
346 */ 346 */
347 347
348static int 348static int
349do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, ASN1_STRING *str) 349do_print_ex(char_io *io_ch, void *arg, unsigned long lflags,
350 const ASN1_STRING *str)
350{ 351{
351 int outlen, len; 352 int outlen, len;
352 int type; 353 int type;
@@ -605,13 +606,13 @@ X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags)
605} 606}
606 607
607int 608int
608ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags) 609ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags)
609{ 610{
610 return do_print_ex(send_bio_chars, out, flags, str); 611 return do_print_ex(send_bio_chars, out, flags, str);
611} 612}
612 613
613int 614int
614ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags) 615ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags)
615{ 616{
616 return do_print_ex(send_fp_chars, fp, flags, str); 617 return do_print_ex(send_fp_chars, fp, flags, str);
617} 618}
diff --git a/src/lib/libcrypto/asn1/a_time_tm.c b/src/lib/libcrypto/asn1/a_time_tm.c
index b13f7c767f..b6e22cbd27 100644
--- a/src/lib/libcrypto/asn1/a_time_tm.c
+++ b/src/lib/libcrypto/asn1/a_time_tm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_time_tm.c,v 1.14 2017/08/28 17:42:47 jsing Exp $ */ 1/* $OpenBSD: a_time_tm.c,v 1.15 2018/04/25 11:48:21 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2015 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2015 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -337,7 +337,7 @@ ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec)
337} 337}
338 338
339int 339int
340ASN1_TIME_check(ASN1_TIME *t) 340ASN1_TIME_check(const ASN1_TIME *t)
341{ 341{
342 if (t->type != V_ASN1_GENERALIZEDTIME && t->type != V_ASN1_UTCTIME) 342 if (t->type != V_ASN1_GENERALIZEDTIME && t->type != V_ASN1_UTCTIME)
343 return (0); 343 return (0);
@@ -345,7 +345,7 @@ ASN1_TIME_check(ASN1_TIME *t)
345} 345}
346 346
347ASN1_GENERALIZEDTIME * 347ASN1_GENERALIZEDTIME *
348ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out) 348ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out)
349{ 349{
350 ASN1_GENERALIZEDTIME *tmp = NULL; 350 ASN1_GENERALIZEDTIME *tmp = NULL;
351 struct tm tm; 351 struct tm tm;
@@ -386,7 +386,7 @@ ASN1_TIME_set_string(ASN1_TIME *s, const char *str)
386 */ 386 */
387 387
388int 388int
389ASN1_UTCTIME_check(ASN1_UTCTIME *d) 389ASN1_UTCTIME_check(const ASN1_UTCTIME *d)
390{ 390{
391 if (d->type != V_ASN1_UTCTIME) 391 if (d->type != V_ASN1_UTCTIME)
392 return (0); 392 return (0);
@@ -442,7 +442,7 @@ ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t2)
442 */ 442 */
443 443
444int 444int
445ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) 445ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)
446{ 446{
447 if (d->type != V_ASN1_GENERALIZEDTIME) 447 if (d->type != V_ASN1_GENERALIZEDTIME)
448 return (0); 448 return (0);
diff --git a/src/lib/libcrypto/asn1/a_type.c b/src/lib/libcrypto/asn1/a_type.c
index ed1dec0671..11d38300d6 100644
--- a/src/lib/libcrypto/asn1/a_type.c
+++ b/src/lib/libcrypto/asn1/a_type.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_type.c,v 1.19 2016/05/04 15:00:24 tedu Exp $ */ 1/* $OpenBSD: a_type.c,v 1.20 2018/04/25 11:48:21 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 *
@@ -62,7 +62,7 @@
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63 63
64int 64int
65ASN1_TYPE_get(ASN1_TYPE *a) 65ASN1_TYPE_get(const ASN1_TYPE *a)
66{ 66{
67 if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL)) 67 if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL))
68 return (a->type); 68 return (a->type);
@@ -108,7 +108,7 @@ ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value)
108 108
109/* Returns 0 if they are equal, != 0 otherwise. */ 109/* Returns 0 if they are equal, != 0 otherwise. */
110int 110int
111ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b) 111ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
112{ 112{
113 int result = -1; 113 int result = -1;
114 114
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h
index 3a2da6463e..a20471a7ec 100644
--- a/src/lib/libcrypto/asn1/asn1.h
+++ b/src/lib/libcrypto/asn1/asn1.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1.h,v 1.45 2018/03/29 02:29:24 inoguchi Exp $ */ 1/* $OpenBSD: asn1.h,v 1.46 2018/04/25 11:48:21 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 *
@@ -754,14 +754,14 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len);
754int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out); 754int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out);
755extern const ASN1_ITEM ASN1_ANY_it; 755extern const ASN1_ITEM ASN1_ANY_it;
756 756
757int ASN1_TYPE_get(ASN1_TYPE *a); 757int ASN1_TYPE_get(const ASN1_TYPE *a);
758void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); 758void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
759int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); 759int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
760int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); 760int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
761 761
762ASN1_OBJECT *ASN1_OBJECT_new(void ); 762ASN1_OBJECT *ASN1_OBJECT_new(void );
763void ASN1_OBJECT_free(ASN1_OBJECT *a); 763void ASN1_OBJECT_free(ASN1_OBJECT *a);
764int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); 764int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp);
765ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, 765ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
766 long length); 766 long length);
767ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, 767ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
@@ -783,7 +783,7 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
783void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); 783void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
784int ASN1_STRING_length(const ASN1_STRING *x); 784int ASN1_STRING_length(const ASN1_STRING *x);
785void ASN1_STRING_length_set(ASN1_STRING *x, int n); 785void ASN1_STRING_length_set(ASN1_STRING *x, int n);
786int ASN1_STRING_type(ASN1_STRING *x); 786int ASN1_STRING_type(const ASN1_STRING *x);
787unsigned char *ASN1_STRING_data(ASN1_STRING *x); 787unsigned char *ASN1_STRING_data(ASN1_STRING *x);
788const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); 788const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
789 789
@@ -797,16 +797,16 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
797 const unsigned char **pp, long length); 797 const unsigned char **pp, long length);
798int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); 798int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length );
799int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); 799int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
800int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); 800int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n);
801int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, 801int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a,
802 unsigned char *flags, int flags_len); 802 const unsigned char *flags, int flags_len);
803 803
804#ifndef OPENSSL_NO_BIO 804#ifndef OPENSSL_NO_BIO
805int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, 805int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
806 BIT_STRING_BITNAME *tbl, int indent); 806 BIT_STRING_BITNAME *tbl, int indent);
807#endif 807#endif
808int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); 808int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
809int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, 809int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
810 BIT_STRING_BITNAME *tbl); 810 BIT_STRING_BITNAME *tbl);
811 811
812int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); 812int i2d_ASN1_BOOLEAN(int a, unsigned char **pp);
@@ -831,7 +831,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **
831int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out); 831int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out);
832extern const ASN1_ITEM ASN1_ENUMERATED_it; 832extern const ASN1_ITEM ASN1_ENUMERATED_it;
833 833
834int ASN1_UTCTIME_check(ASN1_UTCTIME *a); 834int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
835ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); 835ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
836ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, 836ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
837 int offset_day, long offset_sec); 837 int offset_day, long offset_sec);
@@ -841,7 +841,7 @@ int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
841int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); 841int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
842#endif /* !LIBRESSL_INTERNAL */ 842#endif /* !LIBRESSL_INTERNAL */
843 843
844int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); 844int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
845ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, 845ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
846 time_t t); 846 time_t t);
847ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, 847ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
@@ -943,8 +943,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
943ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); 943ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm);
944ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, 944ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day,
945 long offset_sec); 945 long offset_sec);
946int ASN1_TIME_check(ASN1_TIME *t); 946int ASN1_TIME_check(const ASN1_TIME *t);
947ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, 947ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
948 ASN1_GENERALIZEDTIME **out); 948 ASN1_GENERALIZEDTIME **out);
949int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); 949int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
950 950
@@ -955,15 +955,15 @@ STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a,
955 void (*free_func)(OPENSSL_BLOCK), int ex_tag, int ex_class); 955 void (*free_func)(OPENSSL_BLOCK), int ex_tag, int ex_class);
956 956
957#ifndef OPENSSL_NO_BIO 957#ifndef OPENSSL_NO_BIO
958int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); 958int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a);
959int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); 959int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
960int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); 960int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a);
961int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); 961int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size);
962int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a); 962int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a);
963int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); 963int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
964int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); 964int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type);
965#endif 965#endif
966int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a); 966int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a);
967 967
968int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); 968int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num);
969ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, 969ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
@@ -975,9 +975,9 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
975BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); 975BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
976 976
977int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); 977int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
978long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); 978long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
979ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); 979ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai);
980BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn); 980BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn);
981 981
982/* General */ 982/* General */
983/* given a string, return the correct type, max is the maximum length */ 983/* given a string, return the correct type, max is the maximum length */
@@ -1052,7 +1052,8 @@ int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x);
1052 CHECKED_PTR_OF(const type, x))) 1052 CHECKED_PTR_OF(const type, x)))
1053 1053
1054int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); 1054int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
1055int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); 1055int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str,
1056 unsigned long flags);
1056 1057
1057int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); 1058int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
1058 1059
@@ -1083,7 +1084,7 @@ int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
1083int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); 1084int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
1084int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); 1085int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);
1085int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); 1086int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
1086int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); 1087int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags);
1087int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, 1088int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
1088 unsigned char *buf, int off); 1089 unsigned char *buf, int off);
1089int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); 1090int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent);
@@ -1102,18 +1103,19 @@ extern const ASN1_ITEM NETSCAPE_X509_it;
1102int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); 1103int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
1103 1104
1104int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); 1105int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len);
1105int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len); 1106int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data,
1107 int max_len);
1106int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, 1108int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data,
1107 int len); 1109 int len);
1108int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, 1110int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num,
1109 int max_len); 1111 unsigned char *data, int max_len);
1110 1112
1111STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, 1113STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
1112 d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); 1114 d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK));
1113unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, 1115unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d,
1114 unsigned char **buf, int *len ); 1116 unsigned char **buf, int *len );
1115void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); 1117void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
1116void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); 1118void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it);
1117ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, 1119ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
1118 ASN1_OCTET_STRING **oct); 1120 ASN1_OCTET_STRING **oct);
1119 1121
@@ -1139,15 +1141,15 @@ void ASN1_STRING_TABLE_cleanup(void);
1139/* Old API compatible functions */ 1141/* Old API compatible functions */
1140ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); 1142ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
1141void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); 1143void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
1142ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, 1144ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
1143 long len, const ASN1_ITEM *it); 1145 long len, const ASN1_ITEM *it);
1144int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); 1146int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
1145int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); 1147int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
1146 1148
1147void ASN1_add_oid_module(void); 1149void ASN1_add_oid_module(void);
1148 1150
1149ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); 1151ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf);
1150ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); 1152ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf);
1151 1153
1152/* ASN1 Print flags */ 1154/* ASN1 Print flags */
1153 1155
@@ -1174,15 +1176,15 @@ int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent,
1174 const ASN1_ITEM *it, const ASN1_PCTX *pctx); 1176 const ASN1_ITEM *it, const ASN1_PCTX *pctx);
1175ASN1_PCTX *ASN1_PCTX_new(void); 1177ASN1_PCTX *ASN1_PCTX_new(void);
1176void ASN1_PCTX_free(ASN1_PCTX *p); 1178void ASN1_PCTX_free(ASN1_PCTX *p);
1177unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); 1179unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p);
1178void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); 1180void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);
1179unsigned long ASN1_PCTX_get_nm_flags(ASN1_PCTX *p); 1181unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p);
1180void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); 1182void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags);
1181unsigned long ASN1_PCTX_get_cert_flags(ASN1_PCTX *p); 1183unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p);
1182void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); 1184void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);
1183unsigned long ASN1_PCTX_get_oid_flags(ASN1_PCTX *p); 1185unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p);
1184void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); 1186void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags);
1185unsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p); 1187unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p);
1186void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); 1188void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);
1187 1189
1188BIO_METHOD *BIO_f_asn1(void); 1190BIO_METHOD *BIO_f_asn1(void);
diff --git a/src/lib/libcrypto/asn1/asn1_gen.c b/src/lib/libcrypto/asn1/asn1_gen.c
index f84cc6136b..ad7802cb11 100644
--- a/src/lib/libcrypto/asn1/asn1_gen.c
+++ b/src/lib/libcrypto/asn1/asn1_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_gen.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: asn1_gen.c,v 1.17 2018/04/25 11:48:21 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 2002. 3 * project 2002.
4 */ 4 */
@@ -121,7 +121,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype);
121static int asn1_str2tag(const char *tagstr, int len); 121static int asn1_str2tag(const char *tagstr, int len);
122 122
123ASN1_TYPE * 123ASN1_TYPE *
124ASN1_generate_nconf(char *str, CONF *nconf) 124ASN1_generate_nconf(const char *str, CONF *nconf)
125{ 125{
126 X509V3_CTX cnf; 126 X509V3_CTX cnf;
127 127
@@ -133,7 +133,7 @@ ASN1_generate_nconf(char *str, CONF *nconf)
133} 133}
134 134
135ASN1_TYPE * 135ASN1_TYPE *
136ASN1_generate_v3(char *str, X509V3_CTX *cnf) 136ASN1_generate_v3(const char *str, X509V3_CTX *cnf)
137{ 137{
138 ASN1_TYPE *ret; 138 ASN1_TYPE *ret;
139 tag_exp_arg asn1_tags; 139 tag_exp_arg asn1_tags;
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index 970102c213..ffd3ad6a46 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.40 2018/02/14 16:46:04 jsing Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.41 2018/04/25 11:48:21 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 *
@@ -474,7 +474,7 @@ ASN1_STRING_length_set(ASN1_STRING *x, int len)
474} 474}
475 475
476int 476int
477ASN1_STRING_type(ASN1_STRING *x) 477ASN1_STRING_type(const ASN1_STRING *x)
478{ 478{
479 return (x->type); 479 return (x->type);
480} 480}
diff --git a/src/lib/libcrypto/asn1/asn_pack.c b/src/lib/libcrypto/asn1/asn_pack.c
index 09d150583a..1a5420e42b 100644
--- a/src/lib/libcrypto/asn1/asn_pack.c
+++ b/src/lib/libcrypto/asn1/asn_pack.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn_pack.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: asn_pack.c,v 1.17 2018/04/25 11:48:21 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 */
@@ -203,7 +203,7 @@ err:
203/* Extract an ASN1 object from an ASN1_STRING */ 203/* Extract an ASN1 object from an ASN1_STRING */
204 204
205void * 205void *
206ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it) 206ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it)
207{ 207{
208 const unsigned char *p; 208 const unsigned char *p;
209 void *ret; 209 void *ret;
diff --git a/src/lib/libcrypto/asn1/evp_asn1.c b/src/lib/libcrypto/asn1/evp_asn1.c
index 5f74da1546..ec63557770 100644
--- a/src/lib/libcrypto/asn1/evp_asn1.c
+++ b/src/lib/libcrypto/asn1/evp_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_asn1.c,v 1.20 2017/11/28 16:51:21 jsing Exp $ */ 1/* $OpenBSD: evp_asn1.c,v 1.21 2018/04/25 11:48:21 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 *
@@ -79,7 +79,7 @@ ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
79} 79}
80 80
81int 81int
82ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len) 82ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len)
83{ 83{
84 int ret, num; 84 int ret, num;
85 unsigned char *p; 85 unsigned char *p;
@@ -162,7 +162,7 @@ ASN1_TYPE_set_int_octetstring(ASN1_TYPE *at, long num, unsigned char *data,
162} 162}
163 163
164int 164int
165ASN1_TYPE_get_int_octetstring(ASN1_TYPE *at, long *num, unsigned char *data, 165ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *at, long *num, unsigned char *data,
166 int max_len) 166 int max_len)
167{ 167{
168 ASN1_STRING *sp = at->value.sequence; 168 ASN1_STRING *sp = at->value.sequence;
diff --git a/src/lib/libcrypto/asn1/f_enum.c b/src/lib/libcrypto/asn1/f_enum.c
index 64feb97dc4..cc4b7dfc91 100644
--- a/src/lib/libcrypto/asn1/f_enum.c
+++ b/src/lib/libcrypto/asn1/f_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_enum.c,v 1.15 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: f_enum.c,v 1.16 2018/04/25 11:48:21 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 *
@@ -65,7 +65,7 @@
65/* Based on a_int.c: equivalent ENUMERATED functions */ 65/* Based on a_int.c: equivalent ENUMERATED functions */
66 66
67int 67int
68i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) 68i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a)
69{ 69{
70 int i, n = 0; 70 int i, n = 0;
71 static const char h[] = "0123456789ABCDEF"; 71 static const char h[] = "0123456789ABCDEF";
diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c
index 75168872b3..9849a7c8fc 100644
--- a/src/lib/libcrypto/asn1/f_int.c
+++ b/src/lib/libcrypto/asn1/f_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_int.c,v 1.18 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: f_int.c,v 1.19 2018/04/25 11:48:21 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 *
@@ -63,7 +63,7 @@
63#include <openssl/err.h> 63#include <openssl/err.h>
64 64
65int 65int
66i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) 66i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a)
67{ 67{
68 int i, n = 0; 68 int i, n = 0;
69 static const char h[] = "0123456789ABCDEF"; 69 static const char h[] = "0123456789ABCDEF";
diff --git a/src/lib/libcrypto/asn1/f_string.c b/src/lib/libcrypto/asn1/f_string.c
index 138044e063..af17f43e1d 100644
--- a/src/lib/libcrypto/asn1/f_string.c
+++ b/src/lib/libcrypto/asn1/f_string.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_string.c,v 1.17 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: f_string.c,v 1.18 2018/04/25 11:48:21 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 *
@@ -63,7 +63,7 @@
63#include <openssl/err.h> 63#include <openssl/err.h>
64 64
65int 65int
66i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) 66i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type)
67{ 67{
68 int i, n = 0; 68 int i, n = 0;
69 static const char h[] = "0123456789ABCDEF"; 69 static const char h[] = "0123456789ABCDEF";
diff --git a/src/lib/libcrypto/asn1/t_bitst.c b/src/lib/libcrypto/asn1/t_bitst.c
index ea4138e0fb..51515b88e2 100644
--- a/src/lib/libcrypto/asn1/t_bitst.c
+++ b/src/lib/libcrypto/asn1/t_bitst.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_bitst.c,v 1.7 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: t_bitst.c,v 1.8 2018/04/25 11:48:21 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 */
@@ -83,7 +83,7 @@ ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
83} 83}
84 84
85int 85int
86ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, 86ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
87 BIT_STRING_BITNAME *tbl) 87 BIT_STRING_BITNAME *tbl)
88{ 88{
89 int bitnum; 89 int bitnum;
@@ -99,7 +99,7 @@ ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
99} 99}
100 100
101int 101int
102ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl) 102ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl)
103{ 103{
104 BIT_STRING_BITNAME *bnam; 104 BIT_STRING_BITNAME *bnam;
105 105
diff --git a/src/lib/libcrypto/asn1/tasn_prn.c b/src/lib/libcrypto/asn1/tasn_prn.c
index 7cccd56a16..b8f7dd5294 100644
--- a/src/lib/libcrypto/asn1/tasn_prn.c
+++ b/src/lib/libcrypto/asn1/tasn_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_prn.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: tasn_prn.c,v 1.17 2018/04/25 11:48:21 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 2000. 3 * project 2000.
4 */ 4 */
@@ -105,7 +105,7 @@ ASN1_PCTX_free(ASN1_PCTX *p)
105} 105}
106 106
107unsigned long 107unsigned long
108ASN1_PCTX_get_flags(ASN1_PCTX *p) 108ASN1_PCTX_get_flags(const ASN1_PCTX *p)
109{ 109{
110 return p->flags; 110 return p->flags;
111} 111}
@@ -117,7 +117,7 @@ ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags)
117} 117}
118 118
119unsigned long 119unsigned long
120ASN1_PCTX_get_nm_flags(ASN1_PCTX *p) 120ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p)
121{ 121{
122 return p->nm_flags; 122 return p->nm_flags;
123} 123}
@@ -129,7 +129,7 @@ ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags)
129} 129}
130 130
131unsigned long 131unsigned long
132ASN1_PCTX_get_cert_flags(ASN1_PCTX *p) 132ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p)
133{ 133{
134 return p->cert_flags; 134 return p->cert_flags;
135} 135}
@@ -141,7 +141,7 @@ ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags)
141} 141}
142 142
143unsigned long 143unsigned long
144ASN1_PCTX_get_oid_flags(ASN1_PCTX *p) 144ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p)
145{ 145{
146 return p->oid_flags; 146 return p->oid_flags;
147} 147}
@@ -153,7 +153,7 @@ ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags)
153} 153}
154 154
155unsigned long 155unsigned long
156ASN1_PCTX_get_str_flags(ASN1_PCTX *p) 156ASN1_PCTX_get_str_flags(const ASN1_PCTX *p)
157{ 157{
158 return p->str_flags; 158 return p->str_flags;
159} 159}
diff --git a/src/lib/libcrypto/x509v3/v3_sxnet.c b/src/lib/libcrypto/x509v3/v3_sxnet.c
index 14c6e5c0a4..e113d5f7e2 100644
--- a/src/lib/libcrypto/x509v3/v3_sxnet.c
+++ b/src/lib/libcrypto/x509v3/v3_sxnet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_sxnet.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */ 1/* $OpenBSD: v3_sxnet.c,v 1.20 2018/04/25 11:48:21 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 */
@@ -335,7 +335,7 @@ err:
335} 335}
336 336
337ASN1_OCTET_STRING * 337ASN1_OCTET_STRING *
338SXNET_get_id_asc(SXNET *sx, char *zone) 338SXNET_get_id_asc(SXNET *sx, const char *zone)
339{ 339{
340 ASN1_INTEGER *izone = NULL; 340 ASN1_INTEGER *izone = NULL;
341 ASN1_OCTET_STRING *oct; 341 ASN1_OCTET_STRING *oct;
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c
index 67ecc81a44..ff3b2c3e86 100644
--- a/src/lib/libcrypto/x509v3/v3_utl.c
+++ b/src/lib/libcrypto/x509v3/v3_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_utl.c,v 1.27 2018/03/20 16:16:59 jsing Exp $ */ 1/* $OpenBSD: v3_utl.c,v 1.28 2018/04/25 11:48:21 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. 3 * project.
4 */ 4 */
@@ -180,7 +180,7 @@ i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a)
180} 180}
181 181
182ASN1_INTEGER * 182ASN1_INTEGER *
183s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) 183s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value)
184{ 184{
185 BIGNUM *bn = NULL; 185 BIGNUM *bn = NULL;
186 ASN1_INTEGER *aint; 186 ASN1_INTEGER *aint;
diff --git a/src/lib/libcrypto/x509v3/x509v3.h b/src/lib/libcrypto/x509v3/x509v3.h
index fbafd694ed..abf126996a 100644
--- a/src/lib/libcrypto/x509v3/x509v3.h
+++ b/src/lib/libcrypto/x509v3/x509v3.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509v3.h,v 1.22 2017/06/22 17:28:00 jsing Exp $ */ 1/* $OpenBSD: x509v3.h,v 1.23 2018/04/25 11:48:21 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 */
@@ -528,7 +528,7 @@ int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
528int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); 528int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen);
529int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen); 529int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen);
530 530
531ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone); 531ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, const char *zone);
532ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); 532ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);
533ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); 533ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone);
534 534
@@ -735,7 +735,7 @@ int X509V3_add_value_bool(const char *name, int asn1_bool,
735int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, 735int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
736 STACK_OF(CONF_VALUE) **extlist); 736 STACK_OF(CONF_VALUE) **extlist);
737char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); 737char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
738ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); 738ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const char *value);
739char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); 739char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
740char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); 740char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
741int X509V3_EXT_add(X509V3_EXT_METHOD *ext); 741int X509V3_EXT_add(X509V3_EXT_METHOD *ext);