webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Macros | Functions
bytestring.h File Reference
#include <openssl/base.h>

Go to the source code of this file.

Classes

struct  cbs_st
 
struct  cbb_buffer_st
 
struct  cbb_st
 

Macros

#define CBS_ASN1_BOOLEAN   0x1
 
#define CBS_ASN1_INTEGER   0x2
 
#define CBS_ASN1_BITSTRING   0x3
 
#define CBS_ASN1_OCTETSTRING   0x4
 
#define CBS_ASN1_NULL   0x5
 
#define CBS_ASN1_OBJECT   0x6
 
#define CBS_ASN1_ENUMERATED   0xa
 
#define CBS_ASN1_UTF8STRING   0xc
 
#define CBS_ASN1_SEQUENCE   (0x10 | CBS_ASN1_CONSTRUCTED)
 
#define CBS_ASN1_SET   (0x11 | CBS_ASN1_CONSTRUCTED)
 
#define CBS_ASN1_NUMERICSTRING   0x12
 
#define CBS_ASN1_PRINTABLESTRING   0x13
 
#define CBS_ASN1_T16STRING   0x14
 
#define CBS_ASN1_VIDEOTEXSTRING   0x15
 
#define CBS_ASN1_IA5STRING   0x16
 
#define CBS_ASN1_UTCTIME   0x17
 
#define CBS_ASN1_GENERALIZEDTIME   0x18
 
#define CBS_ASN1_GRAPHICSTRING   0x19
 
#define CBS_ASN1_VISIBLESTRING   0x1a
 
#define CBS_ASN1_GENERALSTRING   0x1b
 
#define CBS_ASN1_UNIVERSALSTRING   0x1c
 
#define CBS_ASN1_BMPSTRING   0x1e
 
#define CBS_ASN1_CONSTRUCTED   0x20
 
#define CBS_ASN1_APPLICATION   0x40
 
#define CBS_ASN1_CONTEXT_SPECIFIC   0x80
 
#define CBS_ASN1_PRIVATE   0xc0
 
#define CBS_ASN1_CLASS_MASK   0xc0
 
#define CBS_ASN1_TAG_NUMBER_MASK   0x1f
 

Functions

OPENSSL_EXPORT void CBS_init (CBS *cbs, const uint8_t *data, size_t len)
 
OPENSSL_EXPORT int CBS_skip (CBS *cbs, size_t len)
 
OPENSSL_EXPORT const uint8_tCBS_data (const CBS *cbs)
 
OPENSSL_EXPORT size_t CBS_len (const CBS *cbs)
 
OPENSSL_EXPORT int CBS_stow (const CBS *cbs, uint8_t **out_ptr, size_t *out_len)
 
OPENSSL_EXPORT int CBS_strdup (const CBS *cbs, char **out_ptr)
 
OPENSSL_EXPORT int CBS_contains_zero_byte (const CBS *cbs)
 
OPENSSL_EXPORT int CBS_mem_equal (const CBS *cbs, const uint8_t *data, size_t len)
 
OPENSSL_EXPORT int CBS_get_u8 (CBS *cbs, uint8_t *out)
 
OPENSSL_EXPORT int CBS_get_u16 (CBS *cbs, uint16_t *out)
 
OPENSSL_EXPORT int CBS_get_u24 (CBS *cbs, uint32_t *out)
 
OPENSSL_EXPORT int CBS_get_u32 (CBS *cbs, uint32_t *out)
 
OPENSSL_EXPORT int CBS_get_last_u8 (CBS *cbs, uint8_t *out)
 
OPENSSL_EXPORT int CBS_get_bytes (CBS *cbs, CBS *out, size_t len)
 
OPENSSL_EXPORT int CBS_copy_bytes (CBS *cbs, uint8_t *out, size_t len)
 
OPENSSL_EXPORT int CBS_get_u8_length_prefixed (CBS *cbs, CBS *out)
 
OPENSSL_EXPORT int CBS_get_u16_length_prefixed (CBS *cbs, CBS *out)
 
OPENSSL_EXPORT int CBS_get_u24_length_prefixed (CBS *cbs, CBS *out)
 
OPENSSL_EXPORT int CBS_get_asn1 (CBS *cbs, CBS *out, unsigned tag_value)
 
OPENSSL_EXPORT int CBS_get_asn1_element (CBS *cbs, CBS *out, unsigned tag_value)
 
OPENSSL_EXPORT int CBS_peek_asn1_tag (const CBS *cbs, unsigned tag_value)
 
OPENSSL_EXPORT int CBS_get_any_asn1 (CBS *cbs, CBS *out, unsigned *out_tag)
 
OPENSSL_EXPORT int CBS_get_any_asn1_element (CBS *cbs, CBS *out, unsigned *out_tag, size_t *out_header_len)
 
OPENSSL_EXPORT int CBS_get_any_ber_asn1_element (CBS *cbs, CBS *out, unsigned *out_tag, size_t *out_header_len)
 
OPENSSL_EXPORT int CBS_get_asn1_uint64 (CBS *cbs, uint64_t *out)
 
OPENSSL_EXPORT int CBS_get_optional_asn1 (CBS *cbs, CBS *out, int *out_present, unsigned tag)
 
OPENSSL_EXPORT int CBS_get_optional_asn1_octet_string (CBS *cbs, CBS *out, int *out_present, unsigned tag)
 
OPENSSL_EXPORT int CBS_get_optional_asn1_uint64 (CBS *cbs, uint64_t *out, unsigned tag, uint64_t default_value)
 
OPENSSL_EXPORT int CBS_get_optional_asn1_bool (CBS *cbs, int *out, unsigned tag, int default_value)
 
OPENSSL_EXPORT void CBB_zero (CBB *cbb)
 
OPENSSL_EXPORT int CBB_init (CBB *cbb, size_t initial_capacity)
 
OPENSSL_EXPORT int CBB_init_fixed (CBB *cbb, uint8_t *buf, size_t len)
 
OPENSSL_EXPORT void CBB_cleanup (CBB *cbb)
 
OPENSSL_EXPORT int CBB_finish (CBB *cbb, uint8_t **out_data, size_t *out_len)
 
OPENSSL_EXPORT int CBB_flush (CBB *cbb)
 
OPENSSL_EXPORT const uint8_tCBB_data (const CBB *cbb)
 
OPENSSL_EXPORT size_t CBB_len (const CBB *cbb)
 
OPENSSL_EXPORT int CBB_add_u8_length_prefixed (CBB *cbb, CBB *out_contents)
 
OPENSSL_EXPORT int CBB_add_u16_length_prefixed (CBB *cbb, CBB *out_contents)
 
OPENSSL_EXPORT int CBB_add_u24_length_prefixed (CBB *cbb, CBB *out_contents)
 
OPENSSL_EXPORT int CBB_add_asn1 (CBB *cbb, CBB *out_contents, unsigned tag)
 
OPENSSL_EXPORT int CBB_add_bytes (CBB *cbb, const uint8_t *data, size_t len)
 
OPENSSL_EXPORT int CBB_add_space (CBB *cbb, uint8_t **out_data, size_t len)
 
OPENSSL_EXPORT int CBB_reserve (CBB *cbb, uint8_t **out_data, size_t len)
 
OPENSSL_EXPORT int CBB_did_write (CBB *cbb, size_t len)
 
OPENSSL_EXPORT int CBB_add_u8 (CBB *cbb, uint8_t value)
 
OPENSSL_EXPORT int CBB_add_u16 (CBB *cbb, uint16_t value)
 
OPENSSL_EXPORT int CBB_add_u24 (CBB *cbb, uint32_t value)
 
OPENSSL_EXPORT int CBB_add_u32 (CBB *cbb, uint32_t value)
 
OPENSSL_EXPORT void CBB_discard_child (CBB *cbb)
 
OPENSSL_EXPORT int CBB_add_asn1_uint64 (CBB *cbb, uint64_t value)
 

Macro Definition Documentation

◆ CBS_ASN1_APPLICATION

#define CBS_ASN1_APPLICATION   0x40

◆ CBS_ASN1_BITSTRING

#define CBS_ASN1_BITSTRING   0x3

◆ CBS_ASN1_BMPSTRING

#define CBS_ASN1_BMPSTRING   0x1e

◆ CBS_ASN1_BOOLEAN

#define CBS_ASN1_BOOLEAN   0x1

◆ CBS_ASN1_CLASS_MASK

#define CBS_ASN1_CLASS_MASK   0xc0

◆ CBS_ASN1_CONSTRUCTED

#define CBS_ASN1_CONSTRUCTED   0x20

◆ CBS_ASN1_CONTEXT_SPECIFIC

#define CBS_ASN1_CONTEXT_SPECIFIC   0x80

◆ CBS_ASN1_ENUMERATED

#define CBS_ASN1_ENUMERATED   0xa

◆ CBS_ASN1_GENERALIZEDTIME

#define CBS_ASN1_GENERALIZEDTIME   0x18

◆ CBS_ASN1_GENERALSTRING

#define CBS_ASN1_GENERALSTRING   0x1b

◆ CBS_ASN1_GRAPHICSTRING

#define CBS_ASN1_GRAPHICSTRING   0x19

◆ CBS_ASN1_IA5STRING

#define CBS_ASN1_IA5STRING   0x16

◆ CBS_ASN1_INTEGER

#define CBS_ASN1_INTEGER   0x2

◆ CBS_ASN1_NULL

#define CBS_ASN1_NULL   0x5

◆ CBS_ASN1_NUMERICSTRING

#define CBS_ASN1_NUMERICSTRING   0x12

◆ CBS_ASN1_OBJECT

#define CBS_ASN1_OBJECT   0x6

◆ CBS_ASN1_OCTETSTRING

#define CBS_ASN1_OCTETSTRING   0x4

◆ CBS_ASN1_PRINTABLESTRING

#define CBS_ASN1_PRINTABLESTRING   0x13

◆ CBS_ASN1_PRIVATE

#define CBS_ASN1_PRIVATE   0xc0

◆ CBS_ASN1_SEQUENCE

#define CBS_ASN1_SEQUENCE   (0x10 | CBS_ASN1_CONSTRUCTED)

◆ CBS_ASN1_SET

#define CBS_ASN1_SET   (0x11 | CBS_ASN1_CONSTRUCTED)

◆ CBS_ASN1_T16STRING

#define CBS_ASN1_T16STRING   0x14

◆ CBS_ASN1_TAG_NUMBER_MASK

#define CBS_ASN1_TAG_NUMBER_MASK   0x1f

◆ CBS_ASN1_UNIVERSALSTRING

#define CBS_ASN1_UNIVERSALSTRING   0x1c

◆ CBS_ASN1_UTCTIME

#define CBS_ASN1_UTCTIME   0x17

◆ CBS_ASN1_UTF8STRING

#define CBS_ASN1_UTF8STRING   0xc

◆ CBS_ASN1_VIDEOTEXSTRING

#define CBS_ASN1_VIDEOTEXSTRING   0x15

◆ CBS_ASN1_VISIBLESTRING

#define CBS_ASN1_VISIBLESTRING   0x1a

Function Documentation

◆ CBB_add_asn1()

OPENSSL_EXPORT int CBB_add_asn1 ( CBB cbb,
CBB out_contents,
unsigned  tag 
)

◆ CBB_add_asn1_uint64()

OPENSSL_EXPORT int CBB_add_asn1_uint64 ( CBB cbb,
uint64_t  value 
)

◆ CBB_add_bytes()

OPENSSL_EXPORT int CBB_add_bytes ( CBB cbb,
const uint8_t data,
size_t  len 
)

◆ CBB_add_space()

OPENSSL_EXPORT int CBB_add_space ( CBB cbb,
uint8_t **  out_data,
size_t  len 
)

◆ CBB_add_u16()

OPENSSL_EXPORT int CBB_add_u16 ( CBB cbb,
uint16_t  value 
)

◆ CBB_add_u16_length_prefixed()

OPENSSL_EXPORT int CBB_add_u16_length_prefixed ( CBB cbb,
CBB out_contents 
)

◆ CBB_add_u24()

OPENSSL_EXPORT int CBB_add_u24 ( CBB cbb,
uint32_t  value 
)

◆ CBB_add_u24_length_prefixed()

OPENSSL_EXPORT int CBB_add_u24_length_prefixed ( CBB cbb,
CBB out_contents 
)

◆ CBB_add_u32()

OPENSSL_EXPORT int CBB_add_u32 ( CBB cbb,
uint32_t  value 
)

◆ CBB_add_u8()

OPENSSL_EXPORT int CBB_add_u8 ( CBB cbb,
uint8_t  value 
)

◆ CBB_add_u8_length_prefixed()

OPENSSL_EXPORT int CBB_add_u8_length_prefixed ( CBB cbb,
CBB out_contents 
)

◆ CBB_cleanup()

OPENSSL_EXPORT void CBB_cleanup ( CBB cbb)

◆ CBB_data()

OPENSSL_EXPORT const uint8_t* CBB_data ( const CBB cbb)

◆ CBB_did_write()

OPENSSL_EXPORT int CBB_did_write ( CBB cbb,
size_t  len 
)

◆ CBB_discard_child()

OPENSSL_EXPORT void CBB_discard_child ( CBB cbb)

◆ CBB_finish()

OPENSSL_EXPORT int CBB_finish ( CBB cbb,
uint8_t **  out_data,
size_t out_len 
)

◆ CBB_flush()

OPENSSL_EXPORT int CBB_flush ( CBB cbb)

◆ CBB_init()

OPENSSL_EXPORT int CBB_init ( CBB cbb,
size_t  initial_capacity 
)

◆ CBB_init_fixed()

OPENSSL_EXPORT int CBB_init_fixed ( CBB cbb,
uint8_t buf,
size_t  len 
)

◆ CBB_len()

OPENSSL_EXPORT size_t CBB_len ( const CBB cbb)

◆ CBB_reserve()

OPENSSL_EXPORT int CBB_reserve ( CBB cbb,
uint8_t **  out_data,
size_t  len 
)

◆ CBB_zero()

OPENSSL_EXPORT void CBB_zero ( CBB cbb)

◆ CBS_contains_zero_byte()

OPENSSL_EXPORT int CBS_contains_zero_byte ( const CBS cbs)

◆ CBS_copy_bytes()

OPENSSL_EXPORT int CBS_copy_bytes ( CBS cbs,
uint8_t out,
size_t  len 
)

◆ CBS_data()

OPENSSL_EXPORT const uint8_t* CBS_data ( const CBS cbs)

◆ CBS_get_any_asn1()

OPENSSL_EXPORT int CBS_get_any_asn1 ( CBS cbs,
CBS out,
unsigned *  out_tag 
)

◆ CBS_get_any_asn1_element()

OPENSSL_EXPORT int CBS_get_any_asn1_element ( CBS cbs,
CBS out,
unsigned *  out_tag,
size_t out_header_len 
)

◆ CBS_get_any_ber_asn1_element()

OPENSSL_EXPORT int CBS_get_any_ber_asn1_element ( CBS cbs,
CBS out,
unsigned *  out_tag,
size_t out_header_len 
)

◆ CBS_get_asn1()

OPENSSL_EXPORT int CBS_get_asn1 ( CBS cbs,
CBS out,
unsigned  tag_value 
)

◆ CBS_get_asn1_element()

OPENSSL_EXPORT int CBS_get_asn1_element ( CBS cbs,
CBS out,
unsigned  tag_value 
)

◆ CBS_get_asn1_uint64()

OPENSSL_EXPORT int CBS_get_asn1_uint64 ( CBS cbs,
uint64_t out 
)

◆ CBS_get_bytes()

OPENSSL_EXPORT int CBS_get_bytes ( CBS cbs,
CBS out,
size_t  len 
)

◆ CBS_get_last_u8()

OPENSSL_EXPORT int CBS_get_last_u8 ( CBS cbs,
uint8_t out 
)

◆ CBS_get_optional_asn1()

OPENSSL_EXPORT int CBS_get_optional_asn1 ( CBS cbs,
CBS out,
int *  out_present,
unsigned  tag 
)

◆ CBS_get_optional_asn1_bool()

OPENSSL_EXPORT int CBS_get_optional_asn1_bool ( CBS cbs,
int *  out,
unsigned  tag,
int  default_value 
)

◆ CBS_get_optional_asn1_octet_string()

OPENSSL_EXPORT int CBS_get_optional_asn1_octet_string ( CBS cbs,
CBS out,
int *  out_present,
unsigned  tag 
)

◆ CBS_get_optional_asn1_uint64()

OPENSSL_EXPORT int CBS_get_optional_asn1_uint64 ( CBS cbs,
uint64_t out,
unsigned  tag,
uint64_t  default_value 
)

◆ CBS_get_u16()

OPENSSL_EXPORT int CBS_get_u16 ( CBS cbs,
uint16_t out 
)

◆ CBS_get_u16_length_prefixed()

OPENSSL_EXPORT int CBS_get_u16_length_prefixed ( CBS cbs,
CBS out 
)

◆ CBS_get_u24()

OPENSSL_EXPORT int CBS_get_u24 ( CBS cbs,
uint32_t out 
)

◆ CBS_get_u24_length_prefixed()

OPENSSL_EXPORT int CBS_get_u24_length_prefixed ( CBS cbs,
CBS out 
)

◆ CBS_get_u32()

OPENSSL_EXPORT int CBS_get_u32 ( CBS cbs,
uint32_t out 
)

◆ CBS_get_u8()

OPENSSL_EXPORT int CBS_get_u8 ( CBS cbs,
uint8_t out 
)

◆ CBS_get_u8_length_prefixed()

OPENSSL_EXPORT int CBS_get_u8_length_prefixed ( CBS cbs,
CBS out 
)

◆ CBS_init()

OPENSSL_EXPORT void CBS_init ( CBS cbs,
const uint8_t data,
size_t  len 
)

◆ CBS_len()

OPENSSL_EXPORT size_t CBS_len ( const CBS cbs)

◆ CBS_mem_equal()

OPENSSL_EXPORT int CBS_mem_equal ( const CBS cbs,
const uint8_t data,
size_t  len 
)

◆ CBS_peek_asn1_tag()

OPENSSL_EXPORT int CBS_peek_asn1_tag ( const CBS cbs,
unsigned  tag_value 
)

◆ CBS_skip()

OPENSSL_EXPORT int CBS_skip ( CBS cbs,
size_t  len 
)

◆ CBS_stow()

OPENSSL_EXPORT int CBS_stow ( const CBS cbs,
uint8_t **  out_ptr,
size_t out_len 
)

◆ CBS_strdup()

OPENSSL_EXPORT int CBS_strdup ( const CBS cbs,
char **  out_ptr 
)