Lines Matching refs:len
144 size_t len = 0; in mbedtls_x509write_crt_set_basic_constraints() local
155 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_int( &c, buf, max_pathlen ) ); in mbedtls_x509write_crt_set_basic_constraints()
157 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_bool( &c, buf, 1 ) ); in mbedtls_x509write_crt_set_basic_constraints()
160 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_x509write_crt_set_basic_constraints()
161 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_set_basic_constraints()
166 0, buf + sizeof(buf) - len, len ); in mbedtls_x509write_crt_set_basic_constraints()
175 size_t len = 0; in mbedtls_x509write_crt_set_subject_key_identifier() local
178 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_pk_write_pubkey( &c, buf, ctx->subject_key ) ); in mbedtls_x509write_crt_set_subject_key_identifier()
180 mbedtls_sha1( buf + sizeof(buf) - len, len, buf + sizeof(buf) - 20 ); in mbedtls_x509write_crt_set_subject_key_identifier()
182 len = 20; in mbedtls_x509write_crt_set_subject_key_identifier()
184 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_x509write_crt_set_subject_key_identifier()
185 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_OCTET_STRING ) ); in mbedtls_x509write_crt_set_subject_key_identifier()
189 0, buf + sizeof(buf) - len, len ); in mbedtls_x509write_crt_set_subject_key_identifier()
197 size_t len = 0; in mbedtls_x509write_crt_set_authority_key_identifier() local
200 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_pk_write_pubkey( &c, buf, ctx->issuer_key ) ); in mbedtls_x509write_crt_set_authority_key_identifier()
202 mbedtls_sha1( buf + sizeof(buf) - len, len, buf + sizeof(buf) - 20 ); in mbedtls_x509write_crt_set_authority_key_identifier()
204 len = 20; in mbedtls_x509write_crt_set_authority_key_identifier()
206 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_x509write_crt_set_authority_key_identifier()
207 … MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_CONTEXT_SPECIFIC | 0 ) ); in mbedtls_x509write_crt_set_authority_key_identifier()
209 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_x509write_crt_set_authority_key_identifier()
210 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_set_authority_key_identifier()
215 0, buf + sizeof(buf) - len, len ); in mbedtls_x509write_crt_set_authority_key_identifier()
270 size_t len = 0; in x509_write_time() local
277 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, in x509_write_time()
280 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_time()
281 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_UTC_TIME ) ); in x509_write_time()
285 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, in x509_write_time()
288 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_time()
289 … MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_GENERALIZED_TIME ) ); in x509_write_time()
292 return( (int) len ); in x509_write_time()
307 size_t len = 0; in mbedtls_x509write_crt_der() local
329 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_x509_write_extensions( &c, tmp_buf, ctx->extensions ) ); in mbedtls_x509write_crt_der()
330 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, len ) ); in mbedtls_x509write_crt_der()
331 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_der()
333 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, len ) ); in mbedtls_x509write_crt_der()
334 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONTEXT_SPECIFIC | in mbedtls_x509write_crt_der()
343 len += pub_len; in mbedtls_x509write_crt_der()
348 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_x509_write_names( &c, tmp_buf, ctx->subject ) ); in mbedtls_x509write_crt_der()
363 len += sub_len; in mbedtls_x509write_crt_der()
364 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, sub_len ) ); in mbedtls_x509write_crt_der()
365 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_der()
371 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_x509_write_names( &c, tmp_buf, ctx->issuer ) ); in mbedtls_x509write_crt_der()
376 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_algorithm_identifier( &c, tmp_buf, in mbedtls_x509write_crt_der()
382 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, tmp_buf, &ctx->serial ) ); in mbedtls_x509write_crt_der()
389 len += sub_len; in mbedtls_x509write_crt_der()
390 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, sub_len ) ); in mbedtls_x509write_crt_der()
391 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONTEXT_SPECIFIC | in mbedtls_x509write_crt_der()
394 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, len ) ); in mbedtls_x509write_crt_der()
395 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_der()
401 mbedtls_md( mbedtls_md_info_from_type( ctx->md_alg ), c, len, hash ); in mbedtls_x509write_crt_der()
416 if( len > (size_t)( c2 - buf ) ) in mbedtls_x509write_crt_der()
419 c2 -= len; in mbedtls_x509write_crt_der()
420 memcpy( c2, c, len ); in mbedtls_x509write_crt_der()
422 len += sig_and_oid_len; in mbedtls_x509write_crt_der()
423 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c2, buf, len ) ); in mbedtls_x509write_crt_der()
424 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c2, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_der()
427 return( (int) len ); in mbedtls_x509write_crt_der()