Lines Matching refs:start
37 int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ) in mbedtls_asn1_write_len() argument
41 if( *p - start < 1 ) in mbedtls_asn1_write_len()
50 if( *p - start < 2 ) in mbedtls_asn1_write_len()
60 if( *p - start < 3 ) in mbedtls_asn1_write_len()
71 if( *p - start < 4 ) in mbedtls_asn1_write_len()
85 if( *p - start < 5 ) in mbedtls_asn1_write_len()
101 int mbedtls_asn1_write_tag( unsigned char **p, unsigned char *start, unsigned char tag ) in mbedtls_asn1_write_tag() argument
103 if( *p - start < 1 ) in mbedtls_asn1_write_tag()
111 int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_raw_buffer() argument
116 if( *p < start || (size_t)( *p - start ) < size ) in mbedtls_asn1_write_raw_buffer()
127 int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start, const mbedtls_mpi *X ) in mbedtls_asn1_write_mpi() argument
136 if( *p < start || (size_t)( *p - start ) < len ) in mbedtls_asn1_write_mpi()
147 if( *p - start < 1 ) in mbedtls_asn1_write_mpi()
154 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_mpi()
155 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_INTEGER ) ); in mbedtls_asn1_write_mpi()
164 int mbedtls_asn1_write_null( unsigned char **p, unsigned char *start ) in mbedtls_asn1_write_null() argument
171 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, 0) ); in mbedtls_asn1_write_null()
172 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_NULL ) ); in mbedtls_asn1_write_null()
177 int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_oid() argument
183 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, in mbedtls_asn1_write_oid()
185 MBEDTLS_ASN1_CHK_ADD( len , mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_oid()
186 MBEDTLS_ASN1_CHK_ADD( len , mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_OID ) ); in mbedtls_asn1_write_oid()
191 int mbedtls_asn1_write_algorithm_identifier( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_algorithm_identifier() argument
199 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_null( p, start ) ); in mbedtls_asn1_write_algorithm_identifier()
203 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_oid( p, start, oid, oid_len ) ); in mbedtls_asn1_write_algorithm_identifier()
205 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_algorithm_identifier()
206 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, in mbedtls_asn1_write_algorithm_identifier()
212 int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start, int boolean ) in mbedtls_asn1_write_bool() argument
217 if( *p - start < 1 ) in mbedtls_asn1_write_bool()
223 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_bool()
224 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_BOOLEAN ) ); in mbedtls_asn1_write_bool()
229 static int asn1_write_tagged_int( unsigned char **p, unsigned char *start, int val, int tag ) in asn1_write_tagged_int() argument
236 if( *p - start < 1 ) in asn1_write_tagged_int()
246 if( *p - start < 1 ) in asn1_write_tagged_int()
252 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in asn1_write_tagged_int()
253 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, tag ) ); in asn1_write_tagged_int()
258 int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val ) in mbedtls_asn1_write_int() argument
260 return( asn1_write_tagged_int( p, start, val, MBEDTLS_ASN1_INTEGER ) ); in mbedtls_asn1_write_int()
263 int mbedtls_asn1_write_enum( unsigned char **p, unsigned char *start, int val ) in mbedtls_asn1_write_enum() argument
265 return( asn1_write_tagged_int( p, start, val, MBEDTLS_ASN1_ENUMERATED ) ); in mbedtls_asn1_write_enum()
268 int mbedtls_asn1_write_tagged_string( unsigned char **p, unsigned char *start, int tag, in mbedtls_asn1_write_tagged_string() argument
274 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, in mbedtls_asn1_write_tagged_string()
277 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_tagged_string()
278 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, tag ) ); in mbedtls_asn1_write_tagged_string()
283 int mbedtls_asn1_write_utf8_string( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_utf8_string() argument
286 return( mbedtls_asn1_write_tagged_string(p, start, MBEDTLS_ASN1_UTF8_STRING, text, text_len) ); in mbedtls_asn1_write_utf8_string()
289 int mbedtls_asn1_write_printable_string( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_printable_string() argument
292 …return( mbedtls_asn1_write_tagged_string(p, start, MBEDTLS_ASN1_PRINTABLE_STRING, text, text_len) … in mbedtls_asn1_write_printable_string()
295 int mbedtls_asn1_write_ia5_string( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_ia5_string() argument
298 return( mbedtls_asn1_write_tagged_string(p, start, MBEDTLS_ASN1_IA5_STRING, text, text_len) ); in mbedtls_asn1_write_ia5_string()
302 unsigned char *start, in mbedtls_asn1_write_named_bitstring() argument
341 return( mbedtls_asn1_write_bitstring( p, start, buf, bits ) ); in mbedtls_asn1_write_named_bitstring()
344 int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_bitstring() argument
354 if( *p < start || (size_t)( *p - start ) < byte_len + 1 ) in mbedtls_asn1_write_bitstring()
371 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_bitstring()
372 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_BIT_STRING ) ); in mbedtls_asn1_write_bitstring()
377 int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start, in mbedtls_asn1_write_octet_string() argument
383 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, buf, size ) ); in mbedtls_asn1_write_octet_string()
385 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_octet_string()
386 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_OCTET_STRING ) ); in mbedtls_asn1_write_octet_string()