-/* $OpenBSD: bs_cbs.c,v 1.12 2015/06/17 07:06:22 doug Exp $ */
+/* $OpenBSD: bs_cbs.c,v 1.13 2015/06/17 07:25:56 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
}
int
-CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
+CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len)
{
return cbs_get_any_asn1_element_internal(cbs, out, out_tag,
* Sections 8, 10 and 11 for DER encoding
*/
int
-cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned *out_tag,
+cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len, int strict)
{
uint8_t tag, length_byte;
}
static int
-cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, int skip_header)
+cbs_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value, int skip_header)
{
size_t header_len;
- unsigned tag;
+ unsigned int tag;
CBS throwaway;
if (out == NULL)
}
int
-CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value)
+CBS_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value)
{
return cbs_get_asn1(cbs, out, tag_value, 1 /* skip header */);
}
int
-CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value)
+CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned int tag_value)
{
return cbs_get_asn1(cbs, out, tag_value, 0 /* include header */);
}
int
-CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value)
+CBS_peek_asn1_tag(const CBS *cbs, unsigned int tag_value)
{
if (CBS_len(cbs) < 1)
return 0;
}
int
-CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag)
+CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned int tag)
{
if (CBS_peek_asn1_tag(cbs, tag)) {
if (!CBS_get_asn1(cbs, out, tag))
int
CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present,
- unsigned tag)
+ unsigned int tag)
{
CBS child;
int present;
}
int
-CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag,
+CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned int tag,
uint64_t default_value)
{
CBS child;
}
int
-CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, int default_value)
+CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned int tag,
+ int default_value)
{
CBS child, child2;
int present;
-/* $OpenBSD: bytestring.h,v 1.11 2015/06/17 07:06:22 doug Exp $ */
+/* $OpenBSD: bytestring.h,v 1.12 2015/06/17 07:25:56 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
*
* Tag numbers greater than 30 are not supported (i.e. short form only).
*/
-int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value);
+int CBS_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value);
/*
* CBS_get_asn1_element acts like |CBS_get_asn1| but |out| will include the
* ASN.1 header bytes too.
*/
-int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value);
+int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned int tag_value);
/*
* CBS_peek_asn1_tag looks ahead at the next ASN.1 tag and returns one
* it returns one, CBS_get_asn1 may still fail if the rest of the
* element is malformed.
*/
-int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value);
+int CBS_peek_asn1_tag(const CBS *cbs, unsigned int tag_value);
/*
* CBS_get_any_asn1_element sets |*out| to contain the next ASN.1 element from
*
* Tag numbers greater than 30 are not supported (i.e. short form only).
*/
-int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
+int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len);
/*
* one on success, whether or not the element was present, and zero on
* decode failure.
*/
-int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag);
+int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present,
+ unsigned int tag);
/*
* CBS_get_optional_asn1_octet_string gets an optional
* present, and zero on decode failure.
*/
int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present,
- unsigned tag);
+ unsigned int tag);
/*
* CBS_get_optional_asn1_uint64 gets an optional explicitly-tagged
* on success, whether or not the element was present, and zero on
* decode failure.
*/
-int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag,
+int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned int tag,
uint64_t default_value);
/*
* success, whether or not the element was present, and zero on decode
* failure.
*/
-int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag,
+int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned int tag,
int default_value);
*
* Tag numbers greater than 30 are not supported (i.e. short form only).
*/
-int cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned *out_tag,
+int cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len, int strict);
/*
-/* $OpenBSD: bs_cbs.c,v 1.12 2015/06/17 07:06:22 doug Exp $ */
+/* $OpenBSD: bs_cbs.c,v 1.13 2015/06/17 07:25:56 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
}
int
-CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
+CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len)
{
return cbs_get_any_asn1_element_internal(cbs, out, out_tag,
* Sections 8, 10 and 11 for DER encoding
*/
int
-cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned *out_tag,
+cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len, int strict)
{
uint8_t tag, length_byte;
}
static int
-cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, int skip_header)
+cbs_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value, int skip_header)
{
size_t header_len;
- unsigned tag;
+ unsigned int tag;
CBS throwaway;
if (out == NULL)
}
int
-CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value)
+CBS_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value)
{
return cbs_get_asn1(cbs, out, tag_value, 1 /* skip header */);
}
int
-CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value)
+CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned int tag_value)
{
return cbs_get_asn1(cbs, out, tag_value, 0 /* include header */);
}
int
-CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value)
+CBS_peek_asn1_tag(const CBS *cbs, unsigned int tag_value)
{
if (CBS_len(cbs) < 1)
return 0;
}
int
-CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag)
+CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned int tag)
{
if (CBS_peek_asn1_tag(cbs, tag)) {
if (!CBS_get_asn1(cbs, out, tag))
int
CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present,
- unsigned tag)
+ unsigned int tag)
{
CBS child;
int present;
}
int
-CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag,
+CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned int tag,
uint64_t default_value)
{
CBS child;
}
int
-CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, int default_value)
+CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned int tag,
+ int default_value)
{
CBS child, child2;
int present;
-/* $OpenBSD: bytestring.h,v 1.11 2015/06/17 07:06:22 doug Exp $ */
+/* $OpenBSD: bytestring.h,v 1.12 2015/06/17 07:25:56 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
*
* Tag numbers greater than 30 are not supported (i.e. short form only).
*/
-int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value);
+int CBS_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value);
/*
* CBS_get_asn1_element acts like |CBS_get_asn1| but |out| will include the
* ASN.1 header bytes too.
*/
-int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value);
+int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned int tag_value);
/*
* CBS_peek_asn1_tag looks ahead at the next ASN.1 tag and returns one
* it returns one, CBS_get_asn1 may still fail if the rest of the
* element is malformed.
*/
-int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value);
+int CBS_peek_asn1_tag(const CBS *cbs, unsigned int tag_value);
/*
* CBS_get_any_asn1_element sets |*out| to contain the next ASN.1 element from
*
* Tag numbers greater than 30 are not supported (i.e. short form only).
*/
-int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
+int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len);
/*
* one on success, whether or not the element was present, and zero on
* decode failure.
*/
-int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag);
+int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present,
+ unsigned int tag);
/*
* CBS_get_optional_asn1_octet_string gets an optional
* present, and zero on decode failure.
*/
int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present,
- unsigned tag);
+ unsigned int tag);
/*
* CBS_get_optional_asn1_uint64 gets an optional explicitly-tagged
* on success, whether or not the element was present, and zero on
* decode failure.
*/
-int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag,
+int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned int tag,
uint64_t default_value);
/*
* success, whether or not the element was present, and zero on decode
* failure.
*/
-int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag,
+int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned int tag,
int default_value);
*
* Tag numbers greater than 30 are not supported (i.e. short form only).
*/
-int cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned *out_tag,
+int cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned int *out_tag,
size_t *out_header_len, int strict);
/*