Lines Matching refs:buf

165     unsigned char buf[9];  in mbedtls_x509write_crt_set_basic_constraints()  local
166 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_basic_constraints()
169 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_basic_constraints()
177 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_int(&c, buf, in mbedtls_x509write_crt_set_basic_constraints()
180 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_bool(&c, buf, 1)); in mbedtls_x509write_crt_set_basic_constraints()
183 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_basic_constraints()
184 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_set_basic_constraints()
191 is_ca, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_basic_constraints()
200 unsigned char buf[MBEDTLS_MPI_MAX_SIZE * 2 + 20]; /* tag, length + 2xMPI */ in mbedtls_x509write_crt_set_key_identifier() local
201 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_key_identifier()
208 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_key_identifier()
211 buf, in mbedtls_x509write_crt_set_key_identifier()
219 buf + sizeof(buf) - len, in mbedtls_x509write_crt_set_key_identifier()
221 buf + sizeof(buf) - 20, in mbedtls_x509write_crt_set_key_identifier()
229 buf + sizeof(buf) - len, len, in mbedtls_x509write_crt_set_key_identifier()
230 buf + sizeof(buf) - 20); in mbedtls_x509write_crt_set_key_identifier()
236 c = buf + sizeof(buf) - 20; in mbedtls_x509write_crt_set_key_identifier()
239 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_key_identifier()
240 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, tag)); in mbedtls_x509write_crt_set_key_identifier()
243 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_key_identifier()
246 buf, in mbedtls_x509write_crt_set_key_identifier()
256 0, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_key_identifier()
262 0, buf + sizeof(buf) - len, len); in mbedtls_x509write_crt_set_key_identifier()
284 unsigned char buf[5] = { 0 }, ku[2] = { 0 }; in mbedtls_x509write_crt_set_key_usage() local
302 c = buf + 5; in mbedtls_x509write_crt_set_key_usage()
304 ret = mbedtls_asn1_write_named_bitstring(&c, buf, ku, 9); in mbedtls_x509write_crt_set_key_usage()
325 unsigned char buf[256]; in mbedtls_x509write_crt_set_ext_key_usage() local
326 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_ext_key_usage()
332 memset(buf, 0, sizeof(buf)); in mbedtls_x509write_crt_set_ext_key_usage()
343 if (ext->buf.tag != MBEDTLS_ASN1_OID) { in mbedtls_x509write_crt_set_ext_key_usage()
346 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()
347 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, ext->buf.len)); in mbedtls_x509write_crt_set_ext_key_usage()
348 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, MBEDTLS_ASN1_OID)); in mbedtls_x509write_crt_set_ext_key_usage()
352 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_set_ext_key_usage()
354 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_set_ext_key_usage()
366 unsigned char buf[4] = { 0 }; in mbedtls_x509write_crt_set_ns_cert_type() local
370 c = buf + 4; in mbedtls_x509write_crt_set_ns_cert_type()
372 ret = mbedtls_asn1_write_named_bitstring(&c, buf, &ns_cert_type, 8); in mbedtls_x509write_crt_set_ns_cert_type()
416 unsigned char *buf, size_t size, in mbedtls_x509write_crt_der() argument
440 c = buf + size; in mbedtls_x509write_crt_der()
467 buf, ctx->extensions)); in mbedtls_x509write_crt_der()
468 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
470 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
473 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
475 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
485 buf, (size_t) (c - buf))); in mbedtls_x509write_crt_der()
493 mbedtls_x509_write_names(&c, buf, in mbedtls_x509write_crt_der()
504 x509_write_time(&c, buf, ctx->not_after, in mbedtls_x509write_crt_der()
508 x509_write_time(&c, buf, ctx->not_before, in mbedtls_x509write_crt_der()
512 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, sub_len)); in mbedtls_x509write_crt_der()
514 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
521 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_x509_write_names(&c, buf, in mbedtls_x509write_crt_der()
538 mbedtls_asn1_write_algorithm_identifier_ext(&c, buf, in mbedtls_x509write_crt_der()
551 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_raw_buffer(&c, buf, in mbedtls_x509write_crt_der()
554 if (c - buf < 1) { in mbedtls_x509write_crt_der()
559 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, in mbedtls_x509write_crt_der()
562 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, in mbedtls_x509write_crt_der()
565 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
576 mbedtls_asn1_write_int(&c, buf, ctx->version)); in mbedtls_x509write_crt_der()
579 mbedtls_asn1_write_len(&c, buf, sub_len)); in mbedtls_x509write_crt_der()
581 mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
586 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
588 mbedtls_asn1_write_tag(&c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_der()
624 memmove(buf, c, len); in mbedtls_x509write_crt_der()
625 c = buf + len; in mbedtls_x509write_crt_der()
630 c2 = buf + size; in mbedtls_x509write_crt_der()
644 memmove(c, buf, len); in mbedtls_x509write_crt_der()
647 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&c, buf, len)); in mbedtls_x509write_crt_der()
648 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(&c, buf, in mbedtls_x509write_crt_der()
660 unsigned char *buf, size_t size, in mbedtls_x509write_crt_pem() argument
667 if ((ret = mbedtls_x509write_crt_der(crt, buf, size, in mbedtls_x509write_crt_pem()
673 buf + size - ret, ret, in mbedtls_x509write_crt_pem()
674 buf, size, &olen)) != 0) { in mbedtls_x509write_crt_pem()