47#if !defined(MBEDTLS_CONFIG_FILE)
50#include MBEDTLS_CONFIG_FILE
53#if defined(MBEDTLS_ASN1_WRITE_C)
59#if defined(MBEDTLS_PLATFORM_C)
63#define mbedtls_calloc calloc
64#define mbedtls_free free
93 *--(*p) = (
len ) & 0xFF;
94 *--(*p) = (
len >> 8 ) & 0xFF;
104 *--(*p) = (
len ) & 0xFF;
105 *--(*p) = (
len >> 8 ) & 0xFF;
106 *--(*p) = (
len >> 16 ) & 0xFF;
111#if SIZE_MAX > 0xFFFFFFFF
112 if(
len <= 0xFFFFFFFF )
118 *--(*p) = (
len ) & 0xFF;
119 *--(*p) = (
len >> 8 ) & 0xFF;
120 *--(*p) = (
len >> 16 ) & 0xFF;
121 *--(*p) = (
len >> 24 ) & 0xFF;
126#if SIZE_MAX > 0xFFFFFFFF
142 const unsigned char *
buf,
size_t size )
156#if defined(MBEDTLS_BIGNUM_C)
175 if(
X->s ==1 && **
p & 0x80 )
208 const char *oid,
size_t oid_len )
214 (
const unsigned char *) oid, oid_len ) );
222 const char *oid,
size_t oid_len,
270 if(
val > 0 && **
p & 0x80 )
286 const char *
text,
size_t text_len )
292 (
const unsigned char *)
text, text_len ) );
301 const char *
text,
size_t text_len )
307 const char *
text,
size_t text_len )
313 const char *
text,
size_t text_len )
319 const unsigned char *
buf,
size_t bits )
323 size_t unused_bits, byte_len;
325 byte_len = (
bits + 7 ) / 8;
326 unused_bits = ( byte_len * 8 ) -
bits;
328 if( *
p <
start || (
size_t)( *
p -
start ) < byte_len + 1 )
337 *--( *p ) =
buf[byte_len] & ~( ( 0x1 << unused_bits ) - 1 );
343 *--( *p ) = (
unsigned char)unused_bits;
352 const unsigned char *
buf,
size_t size )
370 const char *oid,
size_t len )
388 const char *oid,
size_t oid_len,
389 const unsigned char *
val,
403 cur->oid.len = oid_len;
413 cur->val.len = val_len;
425 else if(
cur->val.len < val_len )
438 cur->val.len = val_len;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
struct outqueuenode * head
ASN.1 buffer writing functionality.
int mbedtls_asn1_write_raw_buffer(unsigned char **p, unsigned char *start, const unsigned char *buf, size_t size)
Write raw buffer data.
int mbedtls_asn1_write_tag(unsigned char **p, unsigned char *start, unsigned char tag)
Write an ASN.1 tag in ASN.1 format.
int mbedtls_asn1_write_bitstring(unsigned char **p, unsigned char *start, const unsigned char *buf, size_t bits)
Write a bitstring tag (MBEDTLS_ASN1_BIT_STRING) and value in ASN.1 format.
int mbedtls_asn1_write_printable_string(unsigned char **p, unsigned char *start, const char *text, size_t text_len)
Write a string in ASN.1 format using the PrintableString string encoding tag (MBEDTLS_ASN1_PRINTABLE_...
#define MBEDTLS_ASN1_CHK_ADD(g, f)
int mbedtls_asn1_write_utf8_string(unsigned char **p, unsigned char *start, const char *text, size_t text_len)
Write a UTF8 string in ASN.1 format using the UTF8String string encoding tag (MBEDTLS_ASN1_PRINTABLE_...
int mbedtls_asn1_write_octet_string(unsigned char **p, unsigned char *start, const unsigned char *buf, size_t size)
Write an octet string tag (MBEDTLS_ASN1_OCTET_STRING) and value in ASN.1 format.
mbedtls_asn1_named_data * mbedtls_asn1_store_named_data(mbedtls_asn1_named_data **list, const char *oid, size_t oid_len, const unsigned char *val, size_t val_len)
Create or find a specific named_data entry for writing in a sequence or list based on the OID....
int mbedtls_asn1_write_int(unsigned char **p, unsigned char *start, int val)
Write an int tag (MBEDTLS_ASN1_INTEGER) and value in ASN.1 format.
int mbedtls_asn1_write_len(unsigned char **p, unsigned char *start, size_t len)
Write a length field in ASN.1 format.
int mbedtls_asn1_write_algorithm_identifier(unsigned char **p, unsigned char *start, const char *oid, size_t oid_len, size_t par_len)
Write an AlgorithmIdentifier sequence in ASN.1 format.
int mbedtls_asn1_write_oid(unsigned char **p, unsigned char *start, const char *oid, size_t oid_len)
Write an OID tag (MBEDTLS_ASN1_OID) and data in ASN.1 format.
int mbedtls_asn1_write_mpi(unsigned char **p, unsigned char *start, const mbedtls_mpi *X)
Write a arbitrary-precision number (MBEDTLS_ASN1_INTEGER) in ASN.1 format.
int mbedtls_asn1_write_tagged_string(unsigned char **p, unsigned char *start, int tag, const char *text, size_t text_len)
Write a string in ASN.1 format using a specific string encoding tag.
int mbedtls_asn1_write_null(unsigned char **p, unsigned char *start)
Write a NULL tag (MBEDTLS_ASN1_NULL) with zero data in ASN.1 format.
int mbedtls_asn1_write_bool(unsigned char **p, unsigned char *start, int boolean)
Write a boolean tag (MBEDTLS_ASN1_BOOLEAN) and value in ASN.1 format.
int mbedtls_asn1_write_ia5_string(unsigned char **p, unsigned char *start, const char *text, size_t text_len)
Write a string in ASN.1 format using the IA5String string encoding tag (MBEDTLS_ASN1_IA5_STRING).
size_t mbedtls_mpi_size(const mbedtls_mpi *X)
Return the total size of an MPI value in bytes.
#define MBEDTLS_MPI_CHK(f)
int mbedtls_mpi_write_binary(const mbedtls_mpi *X, unsigned char *buf, size_t buflen)
Export an MPI into unsigned big endian binary data of fixed size.
#define asn1_find_named_data
static void cleanup(void)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
#define MBEDTLS_ASN1_OCTET_STRING
#define MBEDTLS_ERR_ASN1_INVALID_LENGTH
#define MBEDTLS_ASN1_BOOLEAN
#define MBEDTLS_ASN1_IA5_STRING
#define MBEDTLS_ASN1_PRINTABLE_STRING
#define MBEDTLS_ASN1_SEQUENCE
#define MBEDTLS_ASN1_INTEGER
#define MBEDTLS_ASN1_CONSTRUCTED
#define MBEDTLS_ASN1_NULL
#define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
#define MBEDTLS_ASN1_UTF8_STRING
#define MBEDTLS_ASN1_BIT_STRING
#define memcpy(s1, s2, n)
Configuration options (set of defines)