diff options
author | tb <> | 2018-04-25 11:48:21 +0000 |
---|---|---|
committer | tb <> | 2018-04-25 11:48:21 +0000 |
commit | b32b7334e82988558a84760f424f8dd93d902393 (patch) | |
tree | 2706fdfa25b0fa2dc71fc06b437d687057013dcc /src | |
parent | 2225014e9e21b521735cd7db7cea4d899863d67b (diff) | |
download | openbsd-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.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_enum.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_object.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_strex.c | 11 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_time_tm.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_type.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 74 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_gen.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_lib.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn_pack.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/evp_asn1.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/f_enum.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/f_int.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/f_string.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/t_bitst.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_prn.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_sxnet.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_utl.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/x509v3/x509v3.h | 6 |
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 | ||
224 | int | 224 | int |
225 | ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) | 225 | ASN1_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 | */ |
242 | int | 242 | int |
243 | ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, unsigned char *flags, int flags_len) | 243 | ASN1_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 | ||
106 | long | 106 | long |
107 | ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) | 107 | ASN1_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 | ||
136 | ASN1_ENUMERATED * | 136 | ASN1_ENUMERATED * |
137 | BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) | 137 | BN_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 | ||
179 | BIGNUM * | 179 | BIGNUM * |
180 | ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) | 180 | ASN1_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 | ||
69 | int | 69 | int |
70 | i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) | 70 | i2d_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 | ||
215 | int | 215 | int |
216 | i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a) | 216 | i2t_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 | ||
221 | int | 221 | int |
222 | i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a) | 222 | i2a_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 | ||
291 | static int | 291 | static int |
292 | do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str) | 292 | do_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 | ||
348 | static int | 348 | static int |
349 | do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, ASN1_STRING *str) | 349 | do_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 | ||
607 | int | 608 | int |
608 | ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags) | 609 | ASN1_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 | ||
613 | int | 614 | int |
614 | ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags) | 615 | ASN1_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 | ||
339 | int | 339 | int |
340 | ASN1_TIME_check(ASN1_TIME *t) | 340 | ASN1_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 | ||
347 | ASN1_GENERALIZEDTIME * | 347 | ASN1_GENERALIZEDTIME * |
348 | ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out) | 348 | ASN1_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 | ||
388 | int | 388 | int |
389 | ASN1_UTCTIME_check(ASN1_UTCTIME *d) | 389 | ASN1_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 | ||
444 | int | 444 | int |
445 | ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) | 445 | ASN1_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 | ||
64 | int | 64 | int |
65 | ASN1_TYPE_get(ASN1_TYPE *a) | 65 | ASN1_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. */ |
110 | int | 110 | int |
111 | ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b) | 111 | ASN1_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); | |||
754 | int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out); | 754 | int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out); |
755 | extern const ASN1_ITEM ASN1_ANY_it; | 755 | extern const ASN1_ITEM ASN1_ANY_it; |
756 | 756 | ||
757 | int ASN1_TYPE_get(ASN1_TYPE *a); | 757 | int ASN1_TYPE_get(const ASN1_TYPE *a); |
758 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); | 758 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); |
759 | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); | 759 | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); |
760 | int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); | 760 | int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); |
761 | 761 | ||
762 | ASN1_OBJECT *ASN1_OBJECT_new(void ); | 762 | ASN1_OBJECT *ASN1_OBJECT_new(void ); |
763 | void ASN1_OBJECT_free(ASN1_OBJECT *a); | 763 | void ASN1_OBJECT_free(ASN1_OBJECT *a); |
764 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); | 764 | int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp); |
765 | ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, | 765 | ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, |
766 | long length); | 766 | long length); |
767 | ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, | 767 | ASN1_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); | |||
783 | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); | 783 | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); |
784 | int ASN1_STRING_length(const ASN1_STRING *x); | 784 | int ASN1_STRING_length(const ASN1_STRING *x); |
785 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); | 785 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); |
786 | int ASN1_STRING_type(ASN1_STRING *x); | 786 | int ASN1_STRING_type(const ASN1_STRING *x); |
787 | unsigned char *ASN1_STRING_data(ASN1_STRING *x); | 787 | unsigned char *ASN1_STRING_data(ASN1_STRING *x); |
788 | const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); | 788 | const 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); |
798 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); | 798 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); |
799 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); | 799 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); |
800 | int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); | 800 | int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); |
801 | int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, | 801 | int 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 |
805 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, | 805 | int 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 |
808 | int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); | 808 | int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl); |
809 | int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, | 809 | int 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 | ||
812 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); | 812 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); |
@@ -831,7 +831,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char ** | |||
831 | int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out); | 831 | int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out); |
832 | extern const ASN1_ITEM ASN1_ENUMERATED_it; | 832 | extern const ASN1_ITEM ASN1_ENUMERATED_it; |
833 | 833 | ||
834 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); | 834 | int ASN1_UTCTIME_check(const ASN1_UTCTIME *a); |
835 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); | 835 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); |
836 | ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | 836 | ASN1_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); | |||
841 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); | 841 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); |
842 | #endif /* !LIBRESSL_INTERNAL */ | 842 | #endif /* !LIBRESSL_INTERNAL */ |
843 | 843 | ||
844 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); | 844 | int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); |
845 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, | 845 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, |
846 | time_t t); | 846 | time_t t); |
847 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, | 847 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, |
@@ -943,8 +943,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); | |||
943 | ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); | 943 | ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); |
944 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, | 944 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, |
945 | long offset_sec); | 945 | long offset_sec); |
946 | int ASN1_TIME_check(ASN1_TIME *t); | 946 | int ASN1_TIME_check(const ASN1_TIME *t); |
947 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, | 947 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, |
948 | ASN1_GENERALIZEDTIME **out); | 948 | ASN1_GENERALIZEDTIME **out); |
949 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); | 949 | int 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 |
958 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); | 958 | int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); |
959 | int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); | 959 | int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); |
960 | int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); | 960 | int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a); |
961 | int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); | 961 | int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); |
962 | int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a); | 962 | int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a); |
963 | int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); | 963 | int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); |
964 | int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); | 964 | int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type); |
965 | #endif | 965 | #endif |
966 | int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a); | 966 | int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a); |
967 | 967 | ||
968 | int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); | 968 | int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); |
969 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, | 969 | ASN1_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); | |||
975 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); | 975 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); |
976 | 976 | ||
977 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); | 977 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); |
978 | long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); | 978 | long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); |
979 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); | 979 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); |
980 | BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn); | 980 | BIGNUM *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 | ||
1054 | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); | 1054 | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); |
1055 | int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); | 1055 | int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, |
1056 | unsigned long flags); | ||
1056 | 1057 | ||
1057 | int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); | 1058 | int 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); | |||
1083 | int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); | 1084 | int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); |
1084 | int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); | 1085 | int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); |
1085 | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); | 1086 | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); |
1086 | int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); | 1087 | int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags); |
1087 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | 1088 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, |
1088 | unsigned char *buf, int off); | 1089 | unsigned char *buf, int off); |
1089 | int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); | 1090 | int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); |
@@ -1102,18 +1103,19 @@ extern const ASN1_ITEM NETSCAPE_X509_it; | |||
1102 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); | 1103 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); |
1103 | 1104 | ||
1104 | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); | 1105 | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); |
1105 | int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len); | 1106 | int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, |
1107 | int max_len); | ||
1106 | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, | 1108 | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, |
1107 | int len); | 1109 | int len); |
1108 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, | 1110 | int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num, |
1109 | int max_len); | 1111 | unsigned char *data, int max_len); |
1110 | 1112 | ||
1111 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, | 1113 | STACK_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)); |
1113 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, | 1115 | unsigned 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 ); |
1115 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); | 1117 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); |
1116 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); | 1118 | void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it); |
1117 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, | 1119 | ASN1_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 */ |
1140 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); | 1142 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); |
1141 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); | 1143 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); |
1142 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, | 1144 | ASN1_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); |
1144 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); | 1146 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); |
1145 | int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); | 1147 | int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); |
1146 | 1148 | ||
1147 | void ASN1_add_oid_module(void); | 1149 | void ASN1_add_oid_module(void); |
1148 | 1150 | ||
1149 | ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); | 1151 | ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); |
1150 | ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); | 1152 | ASN1_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); |
1175 | ASN1_PCTX *ASN1_PCTX_new(void); | 1177 | ASN1_PCTX *ASN1_PCTX_new(void); |
1176 | void ASN1_PCTX_free(ASN1_PCTX *p); | 1178 | void ASN1_PCTX_free(ASN1_PCTX *p); |
1177 | unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); | 1179 | unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p); |
1178 | void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); | 1180 | void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); |
1179 | unsigned long ASN1_PCTX_get_nm_flags(ASN1_PCTX *p); | 1181 | unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p); |
1180 | void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); | 1182 | void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); |
1181 | unsigned long ASN1_PCTX_get_cert_flags(ASN1_PCTX *p); | 1183 | unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p); |
1182 | void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); | 1184 | void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); |
1183 | unsigned long ASN1_PCTX_get_oid_flags(ASN1_PCTX *p); | 1185 | unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p); |
1184 | void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); | 1186 | void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); |
1185 | unsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p); | 1187 | unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p); |
1186 | void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); | 1188 | void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); |
1187 | 1189 | ||
1188 | BIO_METHOD *BIO_f_asn1(void); | 1190 | BIO_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); | |||
121 | static int asn1_str2tag(const char *tagstr, int len); | 121 | static int asn1_str2tag(const char *tagstr, int len); |
122 | 122 | ||
123 | ASN1_TYPE * | 123 | ASN1_TYPE * |
124 | ASN1_generate_nconf(char *str, CONF *nconf) | 124 | ASN1_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 | ||
135 | ASN1_TYPE * | 135 | ASN1_TYPE * |
136 | ASN1_generate_v3(char *str, X509V3_CTX *cnf) | 136 | ASN1_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 | ||
476 | int | 476 | int |
477 | ASN1_STRING_type(ASN1_STRING *x) | 477 | ASN1_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 | ||
205 | void * | 205 | void * |
206 | ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it) | 206 | ASN1_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 | ||
81 | int | 81 | int |
82 | ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len) | 82 | ASN1_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 | ||
164 | int | 164 | int |
165 | ASN1_TYPE_get_int_octetstring(ASN1_TYPE *at, long *num, unsigned char *data, | 165 | ASN1_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 | ||
67 | int | 67 | int |
68 | i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) | 68 | i2a_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 | ||
65 | int | 65 | int |
66 | i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) | 66 | i2a_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 | ||
65 | int | 65 | int |
66 | i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) | 66 | i2a_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 | ||
85 | int | 85 | int |
86 | ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, | 86 | ASN1_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 | ||
101 | int | 101 | int |
102 | ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl) | 102 | ASN1_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 | ||
107 | unsigned long | 107 | unsigned long |
108 | ASN1_PCTX_get_flags(ASN1_PCTX *p) | 108 | ASN1_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 | ||
119 | unsigned long | 119 | unsigned long |
120 | ASN1_PCTX_get_nm_flags(ASN1_PCTX *p) | 120 | ASN1_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 | ||
131 | unsigned long | 131 | unsigned long |
132 | ASN1_PCTX_get_cert_flags(ASN1_PCTX *p) | 132 | ASN1_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 | ||
143 | unsigned long | 143 | unsigned long |
144 | ASN1_PCTX_get_oid_flags(ASN1_PCTX *p) | 144 | ASN1_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 | ||
155 | unsigned long | 155 | unsigned long |
156 | ASN1_PCTX_get_str_flags(ASN1_PCTX *p) | 156 | ASN1_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 | ||
337 | ASN1_OCTET_STRING * | 337 | ASN1_OCTET_STRING * |
338 | SXNET_get_id_asc(SXNET *sx, char *zone) | 338 | SXNET_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 | ||
182 | ASN1_INTEGER * | 182 | ASN1_INTEGER * |
183 | s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) | 183 | s2i_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); | |||
528 | int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); | 528 | int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); |
529 | int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen); | 529 | int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen); |
530 | 530 | ||
531 | ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone); | 531 | ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, const char *zone); |
532 | ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); | 532 | ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); |
533 | ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); | 533 | ASN1_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, | |||
735 | int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, | 735 | int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, |
736 | STACK_OF(CONF_VALUE) **extlist); | 736 | STACK_OF(CONF_VALUE) **extlist); |
737 | char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); | 737 | char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); |
738 | ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); | 738 | ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const char *value); |
739 | char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); | 739 | char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); |
740 | char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); | 740 | char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); |
741 | int X509V3_EXT_add(X509V3_EXT_METHOD *ext); | 741 | int X509V3_EXT_add(X509V3_EXT_METHOD *ext); |