mbedtls_asn1_get_len() function
Get the length of an ASN.1 element. Updates the pointer to immediately behind the length.
Syntax
int mbedtls_asn1_get_len(unsigned char **p,
const unsigned char *end,
size_t *len);
Arguments
p
On entry, \c *p points to the first byte of the length, i.e. immediately after the tag. On successful completion, \c *p points to the first byte after the length, i.e. the first byte of the content. On error, the value of \c *p is undefined.
len
On successful completion, \c *len contains the length read from the ASN.1 input.
Return value
0 if successful. #MBEDTLS_ERR_ASN1_OUT_OF_DATA if the ASN.1 element would end beyond \p end. #MBEDTLS_ERR_ASN1_INVALID_LENGTH if the length is unparsable.
![]()
int mbedtls_asn1_get_len(unsigned char **p,![]()
int mbedtls_asn1_get_len(unsigned char **p,![]()
return mbedtls_asn1_get_len(p, end, len);![]()
if ((ret = mbedtls_asn1_get_len(p, end, &len)) != 0) {![]()
if ((ret = mbedtls_asn1_get_len(p, end, &val->len)) != 0) {![]()
ret = mbedtls_asn1_get_len(p, end, &len);![]()
if ((ret = mbedtls_asn1_get_len(p, end, &tag_len)) != 0) {![]()
if (mbedtls_asn1_get_len(&p, der + der_length, data_len) != 0) {
mbedtls_asn1_get_len() is called by 8 functions:
![]()
mbedtls_asn1_get_len()
mbedtls_asn1_get_len():
![]()
mbedtls_asn1_get_len()