diff options
Diffstat (limited to 'src/lib/libssl/bs_cbs.c')
-rw-r--r-- | src/lib/libssl/bs_cbs.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/lib/libssl/bs_cbs.c b/src/lib/libssl/bs_cbs.c index b36ba489f3..45c253cc4b 100644 --- a/src/lib/libssl/bs_cbs.c +++ b/src/lib/libssl/bs_cbs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bs_cbs.c,v 1.12 2015/06/17 07:06:22 doug Exp $ */ | 1 | /* $OpenBSD: bs_cbs.c,v 1.13 2015/06/17 07:25:56 doug Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014, Google Inc. | 3 | * Copyright (c) 2014, Google Inc. |
4 | * | 4 | * |
@@ -223,7 +223,7 @@ CBS_get_u24_length_prefixed(CBS *cbs, CBS *out) | |||
223 | } | 223 | } |
224 | 224 | ||
225 | int | 225 | int |
226 | CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, | 226 | CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned int *out_tag, |
227 | size_t *out_header_len) | 227 | size_t *out_header_len) |
228 | { | 228 | { |
229 | return cbs_get_any_asn1_element_internal(cbs, out, out_tag, | 229 | return cbs_get_any_asn1_element_internal(cbs, out, out_tag, |
@@ -240,7 +240,7 @@ CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, | |||
240 | * Sections 8, 10 and 11 for DER encoding | 240 | * Sections 8, 10 and 11 for DER encoding |
241 | */ | 241 | */ |
242 | int | 242 | int |
243 | cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned *out_tag, | 243 | cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned int *out_tag, |
244 | size_t *out_header_len, int strict) | 244 | size_t *out_header_len, int strict) |
245 | { | 245 | { |
246 | uint8_t tag, length_byte; | 246 | uint8_t tag, length_byte; |
@@ -326,10 +326,10 @@ cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned *out_tag, | |||
326 | } | 326 | } |
327 | 327 | ||
328 | static int | 328 | static int |
329 | cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, int skip_header) | 329 | cbs_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value, int skip_header) |
330 | { | 330 | { |
331 | size_t header_len; | 331 | size_t header_len; |
332 | unsigned tag; | 332 | unsigned int tag; |
333 | CBS throwaway; | 333 | CBS throwaway; |
334 | 334 | ||
335 | if (out == NULL) | 335 | if (out == NULL) |
@@ -348,19 +348,19 @@ cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, int skip_header) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | int | 350 | int |
351 | CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value) | 351 | CBS_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value) |
352 | { | 352 | { |
353 | return cbs_get_asn1(cbs, out, tag_value, 1 /* skip header */); | 353 | return cbs_get_asn1(cbs, out, tag_value, 1 /* skip header */); |
354 | } | 354 | } |
355 | 355 | ||
356 | int | 356 | int |
357 | CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value) | 357 | CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned int tag_value) |
358 | { | 358 | { |
359 | return cbs_get_asn1(cbs, out, tag_value, 0 /* include header */); | 359 | return cbs_get_asn1(cbs, out, tag_value, 0 /* include header */); |
360 | } | 360 | } |
361 | 361 | ||
362 | int | 362 | int |
363 | CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value) | 363 | CBS_peek_asn1_tag(const CBS *cbs, unsigned int tag_value) |
364 | { | 364 | { |
365 | if (CBS_len(cbs) < 1) | 365 | if (CBS_len(cbs) < 1) |
366 | return 0; | 366 | return 0; |
@@ -415,7 +415,7 @@ CBS_get_asn1_uint64(CBS *cbs, uint64_t *out) | |||
415 | } | 415 | } |
416 | 416 | ||
417 | int | 417 | int |
418 | CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag) | 418 | CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned int tag) |
419 | { | 419 | { |
420 | if (CBS_peek_asn1_tag(cbs, tag)) { | 420 | if (CBS_peek_asn1_tag(cbs, tag)) { |
421 | if (!CBS_get_asn1(cbs, out, tag)) | 421 | if (!CBS_get_asn1(cbs, out, tag)) |
@@ -430,7 +430,7 @@ CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag) | |||
430 | 430 | ||
431 | int | 431 | int |
432 | CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present, | 432 | CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present, |
433 | unsigned tag) | 433 | unsigned int tag) |
434 | { | 434 | { |
435 | CBS child; | 435 | CBS child; |
436 | int present; | 436 | int present; |
@@ -452,7 +452,7 @@ CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present, | |||
452 | } | 452 | } |
453 | 453 | ||
454 | int | 454 | int |
455 | CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag, | 455 | CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned int tag, |
456 | uint64_t default_value) | 456 | uint64_t default_value) |
457 | { | 457 | { |
458 | CBS child; | 458 | CBS child; |
@@ -472,7 +472,8 @@ CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag, | |||
472 | } | 472 | } |
473 | 473 | ||
474 | int | 474 | int |
475 | CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, int default_value) | 475 | CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned int tag, |
476 | int default_value) | ||
476 | { | 477 | { |
477 | CBS child, child2; | 478 | CBS child, child2; |
478 | int present; | 479 | int present; |