Lines Matching refs:buf
164 unsigned char buf[9]; in mbedtls_x509write_crt_set_basic_constraints() local
165 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_basic_constraints()
168 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_basic_constraints()
176 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_int(&c, buf, in mbedtls_x509write_crt_set_basic_constraints()
179 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_bool(&c, buf, 1)); in mbedtls_x509write_crt_set_basic_constraints()
182 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_basic_constraints()
183 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_set_basic_constraints()
190 is_ca, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_basic_constraints()
199 unsigned char buf[MBEDTLS_MPI_MAX_SIZE * 2 + 20]; /* tag, length + 2xMPI */ in mbedtls_x509write_crt_set_key_identifier() local
200 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_key_identifier()
207 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_key_identifier()
210 buf, in mbedtls_x509write_crt_set_key_identifier()
218 buf + sizeof(buf) - len, in mbedtls_x509write_crt_set_key_identifier()
220 buf + sizeof(buf) - 20, in mbedtls_x509write_crt_set_key_identifier()
228 buf + sizeof(buf) - len, len, in mbedtls_x509write_crt_set_key_identifier()
229 buf + sizeof(buf) - 20); in mbedtls_x509write_crt_set_key_identifier()
235 c = buf + sizeof(buf) - 20; in mbedtls_x509write_crt_set_key_identifier()
238 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_key_identifier()
239 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, tag)); in mbedtls_x509write_crt_set_key_identifier()
242 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_key_identifier()
245 buf, in mbedtls_x509write_crt_set_key_identifier()
255 0, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_key_identifier()
261 0, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_key_identifier()
283 unsigned char buf[5] = { 0 }, ku[2] = { 0 }; in mbedtls_x509write_crt_set_key_usage() local
301 c = buf + 5; in mbedtls_x509write_crt_set_key_usage()
303 ret = mbedtls_asn1_write_named_bitstring(&c, buf, ku, 9); in mbedtls_x509write_crt_set_key_usage()
324 unsigned char buf[256]; in mbedtls_x509write_crt_set_ext_key_usage() local
325 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_ext_key_usage()
331 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_ext_key_usage()
342 if (ext->buf.tag != MBEDTLS_ASN1_OID) { in mbedtls_x509write_crt_set_ext_key_usage()
345 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()
346 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, ext->buf.len)); in mbedtls_x509write_crt_set_ext_key_usage()
347 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, MBEDTLS_ASN1_OID)); in mbedtls_x509write_crt_set_ext_key_usage()
351 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_ext_key_usage()
353 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_set_ext_key_usage()
365 unsigned char buf[4] = { 0 }; in mbedtls_x509write_crt_set_ns_cert_type() local
369 c = buf + 4; in mbedtls_x509write_crt_set_ns_cert_type()
371 ret = mbedtls_asn1_write_named_bitstring(&c, buf, &ns_cert_type, 8); in mbedtls_x509write_crt_set_ns_cert_type()
415 unsigned char *buf, size_t size, in mbedtls_x509write_crt_der() argument
439 c = buf + size; in mbedtls_x509write_crt_der()
466 buf, ctx->extensions)); in mbedtls_x509write_crt_der()
467 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
469 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
472 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
474 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
484 buf, c - buf)); in mbedtls_x509write_crt_der()
492 mbedtls_x509_write_names(&c, buf, in mbedtls_x509write_crt_der()
503 x509_write_time(&c, buf, ctx->not_after, in mbedtls_x509write_crt_der()
507 x509_write_time(&c, buf, ctx->not_before, in mbedtls_x509write_crt_der()
511 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, sub_len)); in mbedtls_x509write_crt_der()
513 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
520 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_x509_write_names(&c, buf, in mbedtls_x509write_crt_der()
537 mbedtls_asn1_write_algorithm_identifier_ext(&c, buf, in mbedtls_x509write_crt_der()
550 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_raw_buffer(&c, buf, in mbedtls_x509write_crt_der()
553 if (c - buf < 1) { in mbedtls_x509write_crt_der()
558 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, in mbedtls_x509write_crt_der()
561 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, in mbedtls_x509write_crt_der()
564 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
575 mbedtls_asn1_write_int(&c, buf, ctx->version)); in mbedtls_x509write_crt_der()
578 mbedtls_asn1_write_len(&c, buf, sub_len)); in mbedtls_x509write_crt_der()
580 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
585 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
587 mbedtls_asn1_write_tag(&c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_der()
623 memmove(buf, c, len); in mbedtls_x509write_crt_der()
624 c = buf + len; in mbedtls_x509write_crt_der()
629 c2 = buf + size; in mbedtls_x509write_crt_der()
643 memmove(c, buf, len); in mbedtls_x509write_crt_der()
646 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
647 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
659 unsigned char *buf, size_t size, in mbedtls_x509write_crt_pem() argument
666 if ((ret = mbedtls_x509write_crt_der(crt, buf, size, in mbedtls_x509write_crt_pem()
672 buf + size - ret, ret, in mbedtls_x509write_crt_pem()
673 buf, size, &olen)) != 0) { in mbedtls_x509write_crt_pem()