Lines Matching refs:buf
142 unsigned char buf[9]; in mbedtls_x509write_crt_set_basic_constraints() local
143 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_basic_constraints()
146 memset( buf, 0, sizeof(buf) ); in mbedtls_x509write_crt_set_basic_constraints()
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()
173 unsigned char buf[MBEDTLS_MPI_MAX_SIZE * 2 + 20]; /* tag, length + 2xMPI */ in mbedtls_x509write_crt_set_subject_key_identifier() local
174 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_subject_key_identifier()
177 memset( buf, 0, sizeof(buf) ); in mbedtls_x509write_crt_set_subject_key_identifier()
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()
181 c = buf + sizeof(buf) - 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()
195 unsigned char buf[MBEDTLS_MPI_MAX_SIZE * 2 + 20]; /* tag, length + 2xMPI */ in mbedtls_x509write_crt_set_authority_key_identifier() local
196 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_authority_key_identifier()
199 memset( buf, 0, sizeof(buf) ); in mbedtls_x509write_crt_set_authority_key_identifier()
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()
203 c = buf + sizeof(buf) - 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()
222 unsigned char buf[4], ku; in mbedtls_x509write_crt_set_key_usage() local
230 c = buf + 4; in mbedtls_x509write_crt_set_key_usage()
233 if( ( ret = mbedtls_asn1_write_bitstring( &c, buf, &ku, 7 ) ) != 4 ) in mbedtls_x509write_crt_set_key_usage()
238 1, buf, 4 ); in mbedtls_x509write_crt_set_key_usage()
248 unsigned char buf[4]; in mbedtls_x509write_crt_set_ns_cert_type() local
252 c = buf + 4; in mbedtls_x509write_crt_set_ns_cert_type()
254 if( ( ret = mbedtls_asn1_write_bitstring( &c, buf, &ns_cert_type, 8 ) ) != 4 ) in mbedtls_x509write_crt_set_ns_cert_type()
259 0, buf, 4 ); in mbedtls_x509write_crt_set_ns_cert_type()
295 int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size, in mbedtls_x509write_crt_der() argument
412 c2 = buf + size; in mbedtls_x509write_crt_der()
413 MBEDTLS_ASN1_CHK_ADD( sig_and_oid_len, mbedtls_x509_write_sig( &c2, buf, in mbedtls_x509write_crt_der()
416 if( len > (size_t)( c2 - buf ) ) 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()
434 int mbedtls_x509write_crt_pem( mbedtls_x509write_cert *crt, unsigned char *buf, size_t size, in mbedtls_x509write_crt_pem() argument
450 ret, buf, size, &olen ) ) != 0 ) in mbedtls_x509write_crt_pem()