summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libssl/bs_ber.c16
-rw-r--r--src/lib/libssl/src/ssl/bs_ber.c16
2 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/libssl/bs_ber.c b/src/lib/libssl/bs_ber.c
index 1310d4a94c..3a391fe853 100644
--- a/src/lib/libssl/bs_ber.c
+++ b/src/lib/libssl/bs_ber.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bs_ber.c,v 1.6 2015/06/16 06:37:58 doug Exp $ */ 1/* $OpenBSD: bs_ber.c,v 1.7 2015/06/17 07:20:39 doug Exp $ */
2/* 2/*
3 * Copyright (c) 2014, Google Inc. 3 * Copyright (c) 2014, Google Inc.
4 * 4 *
@@ -25,7 +25,7 @@
25 * of the input being processes always decreases. None the less, a very large 25 * of the input being processes always decreases. None the less, a very large
26 * input could otherwise cause the stack to overflow. 26 * input could otherwise cause the stack to overflow.
27 */ 27 */
28static const unsigned kMaxDepth = 2048; 28static const unsigned int kMaxDepth = 2048;
29 29
30/* Non-strict version that allows a relaxed DER with indefinite form. */ 30/* Non-strict version that allows a relaxed DER with indefinite form. */
31static int 31static int
@@ -56,7 +56,7 @@ cbs_find_indefinite(const CBS *orig_in, char *indefinite_found,
56 56
57 while (CBS_len(&in) > 0) { 57 while (CBS_len(&in) > 0) {
58 CBS contents; 58 CBS contents;
59 unsigned tag; 59 unsigned int tag;
60 size_t header_len; 60 size_t header_len;
61 61
62 if (!cbs_nonstrict_get_any_asn1_element(&in, &contents, &tag, 62 if (!cbs_nonstrict_get_any_asn1_element(&in, &contents, &tag,
@@ -88,7 +88,7 @@ cbs_find_indefinite(const CBS *orig_in, char *indefinite_found,
88 * length. 88 * length.
89 */ 89 */
90static char 90static char
91is_primitive_type(unsigned tag) 91is_primitive_type(unsigned int tag)
92{ 92{
93 return (tag & 0xc0) == 0 && 93 return (tag & 0xc0) == 0 &&
94 (tag & 0x1f) != (CBS_ASN1_SEQUENCE & 0x1f) && 94 (tag & 0x1f) != (CBS_ASN1_SEQUENCE & 0x1f) &&
@@ -117,14 +117,14 @@ is_eoc(size_t header_len, CBS *contents)
117 */ 117 */
118static int 118static int
119cbs_convert_indefinite(CBS *in, CBB *out, char squash_header, 119cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
120 char looking_for_eoc, unsigned depth) 120 char looking_for_eoc, unsigned int depth)
121{ 121{
122 if (depth > kMaxDepth) 122 if (depth > kMaxDepth)
123 return 0; 123 return 0;
124 124
125 while (CBS_len(in) > 0) { 125 while (CBS_len(in) > 0) {
126 CBS contents; 126 CBS contents;
127 unsigned tag; 127 unsigned int tag;
128 size_t header_len; 128 size_t header_len;
129 CBB *out_contents, out_contents_storage; 129 CBB *out_contents, out_contents_storage;
130 130
@@ -167,7 +167,7 @@ cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
167 if (context_specific && 167 if (context_specific &&
168 (tag & CBS_ASN1_CONSTRUCTED)) { 168 (tag & CBS_ASN1_CONSTRUCTED)) {
169 CBS in_copy, inner_contents; 169 CBS in_copy, inner_contents;
170 unsigned inner_tag; 170 unsigned int inner_tag;
171 size_t inner_header_len; 171 size_t inner_header_len;
172 172
173 CBS_init(&in_copy, CBS_data(in), 173 CBS_init(&in_copy, CBS_data(in),
@@ -184,7 +184,7 @@ cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
184 } 184 }
185 185
186 if (!squash_header) { 186 if (!squash_header) {
187 unsigned out_tag = tag; 187 unsigned int out_tag = tag;
188 188
189 if (squash_child_headers) 189 if (squash_child_headers)
190 out_tag &= 190 out_tag &=
diff --git a/src/lib/libssl/src/ssl/bs_ber.c b/src/lib/libssl/src/ssl/bs_ber.c
index 1310d4a94c..3a391fe853 100644
--- a/src/lib/libssl/src/ssl/bs_ber.c
+++ b/src/lib/libssl/src/ssl/bs_ber.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bs_ber.c,v 1.6 2015/06/16 06:37:58 doug Exp $ */ 1/* $OpenBSD: bs_ber.c,v 1.7 2015/06/17 07:20:39 doug Exp $ */
2/* 2/*
3 * Copyright (c) 2014, Google Inc. 3 * Copyright (c) 2014, Google Inc.
4 * 4 *
@@ -25,7 +25,7 @@
25 * of the input being processes always decreases. None the less, a very large 25 * of the input being processes always decreases. None the less, a very large
26 * input could otherwise cause the stack to overflow. 26 * input could otherwise cause the stack to overflow.
27 */ 27 */
28static const unsigned kMaxDepth = 2048; 28static const unsigned int kMaxDepth = 2048;
29 29
30/* Non-strict version that allows a relaxed DER with indefinite form. */ 30/* Non-strict version that allows a relaxed DER with indefinite form. */
31static int 31static int
@@ -56,7 +56,7 @@ cbs_find_indefinite(const CBS *orig_in, char *indefinite_found,
56 56
57 while (CBS_len(&in) > 0) { 57 while (CBS_len(&in) > 0) {
58 CBS contents; 58 CBS contents;
59 unsigned tag; 59 unsigned int tag;
60 size_t header_len; 60 size_t header_len;
61 61
62 if (!cbs_nonstrict_get_any_asn1_element(&in, &contents, &tag, 62 if (!cbs_nonstrict_get_any_asn1_element(&in, &contents, &tag,
@@ -88,7 +88,7 @@ cbs_find_indefinite(const CBS *orig_in, char *indefinite_found,
88 * length. 88 * length.
89 */ 89 */
90static char 90static char
91is_primitive_type(unsigned tag) 91is_primitive_type(unsigned int tag)
92{ 92{
93 return (tag & 0xc0) == 0 && 93 return (tag & 0xc0) == 0 &&
94 (tag & 0x1f) != (CBS_ASN1_SEQUENCE & 0x1f) && 94 (tag & 0x1f) != (CBS_ASN1_SEQUENCE & 0x1f) &&
@@ -117,14 +117,14 @@ is_eoc(size_t header_len, CBS *contents)
117 */ 117 */
118static int 118static int
119cbs_convert_indefinite(CBS *in, CBB *out, char squash_header, 119cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
120 char looking_for_eoc, unsigned depth) 120 char looking_for_eoc, unsigned int depth)
121{ 121{
122 if (depth > kMaxDepth) 122 if (depth > kMaxDepth)
123 return 0; 123 return 0;
124 124
125 while (CBS_len(in) > 0) { 125 while (CBS_len(in) > 0) {
126 CBS contents; 126 CBS contents;
127 unsigned tag; 127 unsigned int tag;
128 size_t header_len; 128 size_t header_len;
129 CBB *out_contents, out_contents_storage; 129 CBB *out_contents, out_contents_storage;
130 130
@@ -167,7 +167,7 @@ cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
167 if (context_specific && 167 if (context_specific &&
168 (tag & CBS_ASN1_CONSTRUCTED)) { 168 (tag & CBS_ASN1_CONSTRUCTED)) {
169 CBS in_copy, inner_contents; 169 CBS in_copy, inner_contents;
170 unsigned inner_tag; 170 unsigned int inner_tag;
171 size_t inner_header_len; 171 size_t inner_header_len;
172 172
173 CBS_init(&in_copy, CBS_data(in), 173 CBS_init(&in_copy, CBS_data(in),
@@ -184,7 +184,7 @@ cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
184 } 184 }
185 185
186 if (!squash_header) { 186 if (!squash_header) {
187 unsigned out_tag = tag; 187 unsigned int out_tag = tag;
188 188
189 if (squash_child_headers) 189 if (squash_child_headers)
190 out_tag &= 190 out_tag &=