Home | History | Annotate | Download | only in openssl

Lines Matching refs:cbs

27  * A "CBS" (CRYPTO ByteString) represents a string of bytes in memory and
42 /* CBS_init sets |cbs| to point to |data|. It does not take ownership of
44 OPENSSL_EXPORT void CBS_init(CBS *cbs, const uint8_t *data, size_t len);
46 /* CBS_skip advances |cbs| by |len| bytes. It returns one on success and zero
48 OPENSSL_EXPORT int CBS_skip(CBS *cbs, size_t len);
50 /* CBS_data returns a pointer to the contents of |cbs|. */
51 OPENSSL_EXPORT const uint8_t *CBS_data(const CBS *cbs);
53 /* CBS_len returns the number of bytes remaining in |cbs|. */
54 OPENSSL_EXPORT size_t CBS_len(const CBS *cbs);
56 /* CBS_stow copies the current contents of |cbs| into |*out_ptr| and
59 * success, |*out_ptr| should be freed with OPENSSL_free. If |cbs| is empty,
61 OPENSSL_EXPORT int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len);
63 /* CBS_strdup copies the current contents of |cbs| into |*out_ptr| as a
68 * NOTE: If |cbs| contains NUL bytes, the string will be truncated. Call
69 * |CBS_contains_zero_byte(cbs)| to check for NUL bytes. */
70 OPENSSL_EXPORT int CBS_strdup(const CBS *cbs, char **out_ptr);
72 /* CBS_contains_zero_byte returns one if the current contents of |cbs| contains
74 OPENSSL_EXPORT int CBS_contains_zero_byte(const CBS *cbs);
76 /* CBS_mem_equal compares the current contents of |cbs| with the |len| bytes
79 OPENSSL_EXPORT int CBS_mem_equal(const CBS *cbs, const uint8_t *data,
82 /* CBS_get_u8 sets |*out| to the next uint8_t from |cbs| and advances |cbs|. It
84 OPENSSL_EXPORT int CBS_get_u8(CBS *cbs, uint8_t *out);
86 /* CBS_get_u16 sets |*out| to the next, big-endian uint16_t from |cbs| and
87 * advances |cbs|. It returns one on success and zero on error. */
88 OPENSSL_EXPORT int CBS_get_u16(CBS *cbs, uint16_t *out);
90 /* CBS_get_u24 sets |*out| to the next, big-endian 24-bit value from |cbs| and
91 * advances |cbs|. It returns one on success and zero on error. */
92 OPENSSL_EXPORT int CBS_get_u24(CBS *cbs, uint32_t *out);
94 /* CBS_get_u32 sets |*out| to the next, big-endian uint32_t value from |cbs|
95 * and advances |cbs|. It returns one on success and zero on error. */
96 OPENSSL_EXPORT int CBS_get_u32(CBS *cbs, uint32_t *out);
98 /* CBS_get_last_u8 sets |*out| to the last uint8_t from |cbs| and shortens
99 * |cbs|. It returns one on success and zero on error. */
100 OPENSSL_EXPORT int CBS_get_last_u8(CBS *cbs, uint8_t *out);
102 /* CBS_get_bytes sets |*out| to the next |len| bytes from |cbs| and advances
103 * |cbs|. It returns one on success and zero on error. */
104 OPENSSL_EXPORT int CBS_get_bytes(CBS *cbs, CBS *out, size_t len);
106 /* CBS_copy_bytes copies the next |len| bytes from |cbs| to |out| and advances
107 * |cbs|. It returns one on success and zero on error. */
108 OPENSSL_EXPORT int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len);
111 * length-prefixed value from |cbs| and advances |cbs| over it. It returns one
113 OPENSSL_EXPORT int CBS_get_u8_length_prefixed(CBS *cbs, CBS *out);
116 * big-endian, length-prefixed value from |cbs| and advances |cbs| over it. It
118 OPENSSL_EXPORT int CBS_get_u16_length_prefixed(CBS *cbs, CBS *out);
121 * big-endian, length-prefixed value from |cbs| and advances |cbs| over it. It
123 OPENSSL_EXPORT int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out);
153 * bit. |CBS| and |CBB| APIs consider the constructed bit to be part of the
175 * including tag and length bytes) and advances |cbs| over it. The ASN.1
180 OPENSSL_EXPORT int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value);
184 OPENSSL_EXPORT int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value);
187 * if the next ASN.1 element on |cbs| would have tag |tag_value|. If
188 * |cbs| is empty or the tag does not match, it returns zero. Note: if
191 OPENSSL_EXPORT int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value);
193 /* CBS_get_any_asn1 sets |*out| to contain the next ASN.1 element from |*cbs|
195 * advances |*cbs|. It returns one on success and zero on error. Either of |out|
199 OPENSSL_EXPORT int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag);
202 * |*cbs| (including header bytes) and advances |*cbs|. It sets |*out_tag| to
207 OPENSSL_EXPORT int CBS_get_any_asn1_element(CBS *cbs, CBS *out,
215 OPENSSL_EXPORT int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out,
219 /* CBS_get_asn1_uint64 gets an ASN.1 INTEGER from |cbs| using |CBS_get_asn1|
223 OPENSSL_EXPORT int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out);
225 /* CBS_get_optional_asn1 gets an optional explicitly-tagged element from |cbs|
230 OPENSSL_EXPORT int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present,
234 * explicitly-tagged OCTET STRING from |cbs|. If present, it sets
239 OPENSSL_EXPORT int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out,
244 * INTEGER from |cbs|. If present, it sets |*out| to the
248 OPENSSL_EXPORT int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out,
253 * |cbs|. If present, it sets |*out| to either zero or one, based on the
257 OPENSSL_EXPORT int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag,
260 /* CBS_is_valid_asn1_bitstring returns one if |cbs| is a valid ASN.1 BIT STRING
262 OPENSSL_EXPORT int CBS_is_valid_asn1_bitstring(const CBS *cbs);
264 /* CBS_asn1_bitstring_has_bit returns one if |cbs| is a valid ASN.1 BIT STRING
267 OPENSSL_EXPORT int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit);