-/* $OpenBSD: bs_ber.c,v 1.6 2015/06/16 06:37:58 doug Exp $ */
+/* $OpenBSD: bs_ber.c,v 1.7 2015/06/17 07:20:39 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
* of the input being processes always decreases. None the less, a very large
* input could otherwise cause the stack to overflow.
*/
-static const unsigned kMaxDepth = 2048;
+static const unsigned int kMaxDepth = 2048;
/* Non-strict version that allows a relaxed DER with indefinite form. */
static int
while (CBS_len(&in) > 0) {
CBS contents;
- unsigned tag;
+ unsigned int tag;
size_t header_len;
if (!cbs_nonstrict_get_any_asn1_element(&in, &contents, &tag,
* length.
*/
static char
-is_primitive_type(unsigned tag)
+is_primitive_type(unsigned int tag)
{
return (tag & 0xc0) == 0 &&
(tag & 0x1f) != (CBS_ASN1_SEQUENCE & 0x1f) &&
*/
static int
cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
- char looking_for_eoc, unsigned depth)
+ char looking_for_eoc, unsigned int depth)
{
if (depth > kMaxDepth)
return 0;
while (CBS_len(in) > 0) {
CBS contents;
- unsigned tag;
+ unsigned int tag;
size_t header_len;
CBB *out_contents, out_contents_storage;
if (context_specific &&
(tag & CBS_ASN1_CONSTRUCTED)) {
CBS in_copy, inner_contents;
- unsigned inner_tag;
+ unsigned int inner_tag;
size_t inner_header_len;
CBS_init(&in_copy, CBS_data(in),
}
if (!squash_header) {
- unsigned out_tag = tag;
+ unsigned int out_tag = tag;
if (squash_child_headers)
out_tag &=
-/* $OpenBSD: bs_ber.c,v 1.6 2015/06/16 06:37:58 doug Exp $ */
+/* $OpenBSD: bs_ber.c,v 1.7 2015/06/17 07:20:39 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
* of the input being processes always decreases. None the less, a very large
* input could otherwise cause the stack to overflow.
*/
-static const unsigned kMaxDepth = 2048;
+static const unsigned int kMaxDepth = 2048;
/* Non-strict version that allows a relaxed DER with indefinite form. */
static int
while (CBS_len(&in) > 0) {
CBS contents;
- unsigned tag;
+ unsigned int tag;
size_t header_len;
if (!cbs_nonstrict_get_any_asn1_element(&in, &contents, &tag,
* length.
*/
static char
-is_primitive_type(unsigned tag)
+is_primitive_type(unsigned int tag)
{
return (tag & 0xc0) == 0 &&
(tag & 0x1f) != (CBS_ASN1_SEQUENCE & 0x1f) &&
*/
static int
cbs_convert_indefinite(CBS *in, CBB *out, char squash_header,
- char looking_for_eoc, unsigned depth)
+ char looking_for_eoc, unsigned int depth)
{
if (depth > kMaxDepth)
return 0;
while (CBS_len(in) > 0) {
CBS contents;
- unsigned tag;
+ unsigned int tag;
size_t header_len;
CBB *out_contents, out_contents_storage;
if (context_specific &&
(tag & CBS_ASN1_CONSTRUCTED)) {
CBS in_copy, inner_contents;
- unsigned inner_tag;
+ unsigned int inner_tag;
size_t inner_header_len;
CBS_init(&in_copy, CBS_data(in),
}
if (!squash_header) {
- unsigned out_tag = tag;
+ unsigned int out_tag = tag;
if (squash_child_headers)
out_tag &=