Lines Matching refs:p
219 cur->val.p[0] = critical; in mbedtls_x509_set_extension()
220 memcpy( cur->val.p + 1, val, val_len ); in mbedtls_x509_set_extension()
237 static int x509_write_name( unsigned char **p, unsigned char *start, mbedtls_asn1_named_data* cur_n… in x509_write_name() argument
241 const char *oid = (const char*)cur_name->oid.p; in x509_write_name()
243 const unsigned char *name = cur_name->val.p; in x509_write_name()
247 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tagged_string( p, start, in x509_write_name()
253 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_oid( p, start, oid, in x509_write_name()
256 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_name()
257 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, in x509_write_name()
261 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_name()
262 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, in x509_write_name()
269 int mbedtls_x509_write_names( unsigned char **p, unsigned char *start, in mbedtls_x509_write_names() argument
278 MBEDTLS_ASN1_CHK_ADD( len, x509_write_name( p, start, cur ) ); in mbedtls_x509_write_names()
282 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_x509_write_names()
283 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509_write_names()
289 int mbedtls_x509_write_sig( unsigned char **p, unsigned char *start, in mbedtls_x509_write_sig() argument
296 if( *p < start || (size_t)( *p - start ) < size ) in mbedtls_x509_write_sig()
300 (*p) -= len; in mbedtls_x509_write_sig()
301 memcpy( *p, sig, len ); in mbedtls_x509_write_sig()
303 if( *p - start < 1 ) in mbedtls_x509_write_sig()
306 *--(*p) = 0; in mbedtls_x509_write_sig()
309 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_x509_write_sig()
310 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_BIT_STRING ) ); in mbedtls_x509_write_sig()
314 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_algorithm_identifier( p, start, oid, in mbedtls_x509_write_sig()
320 static int x509_write_extension( unsigned char **p, unsigned char *start, in x509_write_extension() argument
326 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, ext->val.p + 1, in x509_write_extension()
328 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, ext->val.len - 1 ) ); in x509_write_extension()
329 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_OCTET_STRING ) ); in x509_write_extension()
331 if( ext->val.p[0] != 0 ) in x509_write_extension()
333 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_bool( p, start, 1 ) ); in x509_write_extension()
336 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, ext->oid.p, in x509_write_extension()
338 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, ext->oid.len ) ); in x509_write_extension()
339 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_OID ) ); in x509_write_extension()
341 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_extension()
342 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_CONSTRUCTED | in x509_write_extension()
358 int mbedtls_x509_write_extensions( unsigned char **p, unsigned char *start, in mbedtls_x509_write_extensions() argument
367 MBEDTLS_ASN1_CHK_ADD( len, x509_write_extension( p, start, cur_ext ) ); in mbedtls_x509_write_extensions()