Lines Matching refs:buf
171 unsigned char buf[9]; in mbedtls_x509write_crt_set_basic_constraints() local
172 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_basic_constraints()
175 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_basic_constraints()
183 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_int(&c, buf, in mbedtls_x509write_crt_set_basic_constraints()
186 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_bool(&c, buf, 1)); in mbedtls_x509write_crt_set_basic_constraints()
189 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_basic_constraints()
190 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_set_basic_constraints()
197 is_ca, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_basic_constraints()
206 unsigned char buf[MBEDTLS_MPI_MAX_SIZE * 2 + 20]; /* tag, length + 2xMPI */ in mbedtls_x509write_crt_set_key_identifier() local
207 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_key_identifier()
214 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_key_identifier()
217 buf, in mbedtls_x509write_crt_set_key_identifier()
225 buf + sizeof(buf) - len, in mbedtls_x509write_crt_set_key_identifier()
227 buf + sizeof(buf) - 20, in mbedtls_x509write_crt_set_key_identifier()
235 buf + sizeof(buf) - len, len, in mbedtls_x509write_crt_set_key_identifier()
236 buf + sizeof(buf) - 20); in mbedtls_x509write_crt_set_key_identifier()
242 c = buf + sizeof(buf) - 20; in mbedtls_x509write_crt_set_key_identifier()
245 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_key_identifier()
246 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, tag)); in mbedtls_x509write_crt_set_key_identifier()
249 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_key_identifier()
252 buf, in mbedtls_x509write_crt_set_key_identifier()
262 0, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_key_identifier()
268 0, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_key_identifier()
290 unsigned char buf[5] = { 0 }, ku[2] = { 0 }; in mbedtls_x509write_crt_set_key_usage() local
308 c = buf + 5; in mbedtls_x509write_crt_set_key_usage()
310 ret = mbedtls_asn1_write_named_bitstring(&c, buf, ku, 9); in mbedtls_x509write_crt_set_key_usage()
331 unsigned char buf[256]; in mbedtls_x509write_crt_set_ext_key_usage() local
332 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_ext_key_usage()
338 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_ext_key_usage()
349 if (ext->buf.tag != MBEDTLS_ASN1_OID) { in mbedtls_x509write_crt_set_ext_key_usage()
352 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_raw_buffer(&c, buf, ext->buf.p, ext->buf.len)); in mbedtls_x509write_crt_set_ext_key_usage()
353 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, ext->buf.len)); in mbedtls_x509write_crt_set_ext_key_usage()
354 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, MBEDTLS_ASN1_OID)); in mbedtls_x509write_crt_set_ext_key_usage()
358 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_ext_key_usage()
360 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_set_ext_key_usage()
372 unsigned char buf[4] = { 0 }; in mbedtls_x509write_crt_set_ns_cert_type() local
376 c = buf + 4; in mbedtls_x509write_crt_set_ns_cert_type()
378 ret = mbedtls_asn1_write_named_bitstring(&c, buf, &ns_cert_type, 8); in mbedtls_x509write_crt_set_ns_cert_type()
422 unsigned char *buf, size_t size, in mbedtls_x509write_crt_der() argument
446 c = buf + size; in mbedtls_x509write_crt_der()
473 buf, ctx->extensions)); in mbedtls_x509write_crt_der()
474 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
476 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
479 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
481 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
491 buf, (size_t) (c - buf))); in mbedtls_x509write_crt_der()
499 mbedtls_x509_write_names(&c, buf, in mbedtls_x509write_crt_der()
510 x509_write_time(&c, buf, ctx->not_after, in mbedtls_x509write_crt_der()
514 x509_write_time(&c, buf, ctx->not_before, in mbedtls_x509write_crt_der()
518 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, sub_len)); in mbedtls_x509write_crt_der()
520 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
527 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_x509_write_names(&c, buf, in mbedtls_x509write_crt_der()
544 mbedtls_asn1_write_algorithm_identifier_ext(&c, buf, in mbedtls_x509write_crt_der()
557 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_raw_buffer(&c, buf, in mbedtls_x509write_crt_der()
560 if (c - buf < 1) { in mbedtls_x509write_crt_der()
565 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, in mbedtls_x509write_crt_der()
568 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, in mbedtls_x509write_crt_der()
571 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
582 mbedtls_asn1_write_int(&c, buf, ctx->version)); in mbedtls_x509write_crt_der()
585 mbedtls_asn1_write_len(&c, buf, sub_len)); in mbedtls_x509write_crt_der()
587 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
592 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
594 mbedtls_asn1_write_tag(&c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_der()
630 memmove(buf, c, len); in mbedtls_x509write_crt_der()
631 c = buf + len; in mbedtls_x509write_crt_der()
636 c2 = buf + size; in mbedtls_x509write_crt_der()
650 memmove(c, buf, len); in mbedtls_x509write_crt_der()
653 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
654 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
666 unsigned char *buf, size_t size, in mbedtls_x509write_crt_pem() argument
673 if ((ret = mbedtls_x509write_crt_der(crt, buf, size, in mbedtls_x509write_crt_pem()
679 buf + size - ret, ret, in mbedtls_x509write_crt_pem()
680 buf, size, &olen)) != 0) { in mbedtls_x509write_crt_pem()