/external/boringssl/src/crypto/bytestring/ |
H A D | cbb.c | 27 void CBB_zero(CBB *cbb) { argument 28 OPENSSL_memset(cbb, 0, sizeof(CBB)); 31 static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { argument 32 // This assumes that |cbb| has already been zeroed. 46 cbb->base = base; 47 cbb->is_top_level = 1; 51 int CBB_init(CBB *cbb, size_t initial_capacity) { argument 52 CBB_zero(cbb); 59 if (!cbb_init(cbb, buf, initial_capacity)) { 67 int CBB_init_fixed(CBB *cbb, uint8_ argument 78 CBB_cleanup(CBB *cbb) argument 171 CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len) argument 199 CBB_flush(CBB *cbb) argument 285 CBB_data(const CBB *cbb) argument 290 CBB_len(const CBB *cbb) argument 297 cbb_add_length_prefixed(CBB *cbb, CBB *out_contents, uint8_t len_len) argument 321 CBB_add_u8_length_prefixed(CBB *cbb, CBB *out_contents) argument 325 CBB_add_u16_length_prefixed(CBB *cbb, CBB *out_contents) argument 329 CBB_add_u24_length_prefixed(CBB *cbb, CBB *out_contents) argument 336 add_base128_integer(CBB *cbb, uint64_t v) argument 359 CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned tag) argument 392 CBB_add_bytes(CBB *cbb, const uint8_t *data, size_t len) argument 403 CBB_add_space(CBB *cbb, uint8_t **out_data, size_t len) argument 411 CBB_reserve(CBB *cbb, uint8_t **out_data, size_t len) argument 419 CBB_did_write(CBB *cbb, size_t len) argument 430 CBB_add_u8(CBB *cbb, uint8_t value) argument 438 CBB_add_u16(CBB *cbb, uint16_t value) argument 446 CBB_add_u24(CBB *cbb, uint32_t value) argument 454 CBB_add_u32(CBB *cbb, uint32_t value) argument 462 CBB_discard_child(CBB *cbb) argument 473 CBB_add_asn1_uint64(CBB *cbb, uint64_t value) argument 508 CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, size_t data_len) argument 519 CBB_add_asn1_bool(CBB *cbb, int value) argument 561 CBB_add_asn1_oid_from_text(CBB *cbb, const char *text, size_t len) argument 614 CBB_flush_asn1_set_of(CBB *cbb) argument [all...] |
H A D | asn1_compat.c | 28 int CBB_finish_i2d(CBB *cbb, uint8_t **outp) { argument 29 assert(cbb->base->can_resize); 33 if (!CBB_finish(cbb, &der, &der_len)) { 34 CBB_cleanup(cbb);
|
H A D | bytestring_test.cc | 311 CBB cbb; local 312 ASSERT_TRUE(CBB_init(&cbb, 100)); 313 CBB_cleanup(&cbb); 321 bssl::ScopedCBB cbb; local 322 ASSERT_TRUE(CBB_init(cbb.get(), 100)); 323 cbb.Reset(); 325 ASSERT_TRUE(CBB_init(cbb.get(), 0)); 326 ASSERT_TRUE(CBB_add_u8(cbb.get(), 1)); 327 ASSERT_TRUE(CBB_add_u16(cbb.get(), 0x203)); 328 ASSERT_TRUE(CBB_add_u24(cbb 338 bssl::ScopedCBB cbb; local 368 bssl::ScopedCBB cbb; local 385 bssl::ScopedCBB cbb; local 412 bssl::ScopedCBB cbb; local 456 bssl::ScopedCBB cbb; local 497 bssl::ScopedCBB cbb; local 737 bssl::ScopedCBB cbb; local 756 CBB cbb; local 766 bssl::ScopedCBB cbb; local 786 bssl::ScopedCBB cbb; local 953 bssl::ScopedCBB cbb; local 971 bssl::ScopedCBB cbb; local 1020 bssl::ScopedCBB cbb; local 1046 bssl::ScopedCBB cbb; local [all...] |
H A D | internal.h | 61 // CBB_finish_i2d calls |CBB_finish| on |cbb| which must have been initialized 65 // error, it calls |CBB_cleanup| on |cbb|. 68 int CBB_finish_i2d(CBB *cbb, uint8_t **outp);
|
H A D | ber.c | 193 CBB cbb; local 208 if (!CBB_init(&cbb, CBS_len(in)) || 209 !cbs_convert_ber(in, &cbb, 0, 0, 0) || 210 !CBB_finish(&cbb, out, out_len)) { 211 CBB_cleanup(&cbb);
|
H A D | cbs.c | 574 CBB cbb; local 575 if (!CBB_init(&cbb, 32)) { 587 if (!CBB_add_bytes(&cbb, (const uint8_t *)"2.", 2) || 588 !add_decimal(&cbb, v - 80)) { 591 } else if (!add_decimal(&cbb, v / 40) || 592 !CBB_add_u8(&cbb, '.') || 593 !add_decimal(&cbb, v % 40)) { 599 !CBB_add_u8(&cbb, '.') || 600 !add_decimal(&cbb, v)) { 607 if (!CBB_add_u8(&cbb, '\ [all...] |
/external/boringssl/src/crypto/rsa_extra/ |
H A D | rsa_asn1.c | 81 static int marshal_integer(CBB *cbb, BIGNUM *bn) { argument 87 return BN_marshal_asn1(cbb, bn); 127 int RSA_marshal_public_key(CBB *cbb, const RSA *rsa) { argument 129 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || 132 !CBB_flush(cbb)) { 141 CBB cbb; local 142 CBB_zero(&cbb); 143 if (!CBB_init(&cbb, 0) || 144 !RSA_marshal_public_key(&cbb, rsa) || 145 !CBB_finish(&cbb, out_byte 216 RSA_marshal_private_key(CBB *cbb, const RSA *rsa) argument 237 CBB cbb; local 268 CBB cbb; local 296 CBB cbb; local [all...] |
/external/boringssl/src/crypto/dsa/ |
H A D | dsa_asn1.c | 76 static int marshal_integer(CBB *cbb, BIGNUM *bn) { argument 82 return BN_marshal_asn1(cbb, bn); 102 int DSA_SIG_marshal(CBB *cbb, const DSA_SIG *sig) { argument 104 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || 107 !CBB_flush(cbb)) { 133 int DSA_marshal_public_key(CBB *cbb, const DSA *dsa) { argument 135 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || 140 !CBB_flush(cbb)) { 165 int DSA_marshal_parameters(CBB *cbb, const DSA *dsa) { argument 167 if (!CBB_add_asn1(cbb, 213 DSA_marshal_private_key(CBB *cbb, const DSA *dsa) argument 248 CBB cbb; local 276 CBB cbb; local 304 CBB cbb; local 332 CBB cbb; local [all...] |
/external/boringssl/include/openssl/ |
H A D | bytestring.h | 335 // CBB_zero sets an uninitialised |cbb| to the zero state. It must be 339 OPENSSL_EXPORT void CBB_zero(CBB *cbb); 341 // CBB_init initialises |cbb| with |initial_capacity|. Since a |CBB| grows as 344 OPENSSL_EXPORT int CBB_init(CBB *cbb, size_t initial_capacity); 346 // CBB_init_fixed initialises |cbb| to write to |len| bytes at |buf|. Since 349 OPENSSL_EXPORT int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len); 351 // CBB_cleanup frees all resources owned by |cbb| and other |CBB| objects 358 OPENSSL_EXPORT void CBB_cleanup(CBB *cbb); 368 OPENSSL_EXPORT int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len); 371 // |CBB| objects of |cbb| t [all...] |
H A D | dsa.h | 255 // result to |cbb|. It returns one on success and zero on error. 256 OPENSSL_EXPORT int DSA_SIG_marshal(CBB *cbb, const DSA_SIG *sig); 263 // appends the result to |cbb|. It returns one on success and zero on 265 OPENSSL_EXPORT int DSA_marshal_public_key(CBB *cbb, const DSA *dsa); 272 // appends the result to |cbb|. It returns one on success and zero on 274 OPENSSL_EXPORT int DSA_marshal_private_key(CBB *cbb, const DSA *dsa); 282 // (RFC 3447) and appends the result to |cbb|. It returns one on success and 284 OPENSSL_EXPORT int DSA_marshal_parameters(CBB *cbb, const DSA *dsa);
|
/external/boringssl/src/include/openssl/ |
H A D | bytestring.h | 335 // CBB_zero sets an uninitialised |cbb| to the zero state. It must be 339 OPENSSL_EXPORT void CBB_zero(CBB *cbb); 341 // CBB_init initialises |cbb| with |initial_capacity|. Since a |CBB| grows as 344 OPENSSL_EXPORT int CBB_init(CBB *cbb, size_t initial_capacity); 346 // CBB_init_fixed initialises |cbb| to write to |len| bytes at |buf|. Since 349 OPENSSL_EXPORT int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len); 351 // CBB_cleanup frees all resources owned by |cbb| and other |CBB| objects 358 OPENSSL_EXPORT void CBB_cleanup(CBB *cbb); 368 OPENSSL_EXPORT int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len); 371 // |CBB| objects of |cbb| t [all...] |
/external/boringssl/src/crypto/dh/ |
H A D | dh_asn1.c | 77 static int marshal_integer(CBB *cbb, BIGNUM *bn) { argument 83 return BN_marshal_asn1(cbb, bn); 120 int DH_marshal_parameters(CBB *cbb, const DH *dh) { argument 122 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || 127 !CBB_flush(cbb)) { 153 CBB cbb; local 154 if (!CBB_init(&cbb, 0) || 155 !DH_marshal_parameters(&cbb, in)) { 156 CBB_cleanup(&cbb); 159 return CBB_finish_i2d(&cbb, out [all...] |
/external/boringssl/src/crypto/ecdsa_extra/ |
H A D | ecdsa_asn1.c | 91 CBB cbb; local 92 CBB_zero(&cbb); 94 if (!CBB_init_fixed(&cbb, sig, ECDSA_size(eckey)) || 95 !ECDSA_SIG_marshal(&cbb, s) || 96 !CBB_finish(&cbb, NULL, &len)) { 98 CBB_cleanup(&cbb); 189 int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig) { argument 191 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || 194 !CBB_flush(cbb)) { 203 CBB cbb; local 268 CBB cbb; local [all...] |
/external/boringssl/src/crypto/bn_extra/ |
H A D | bn_asn1.c | 45 int BN_marshal_asn1(CBB *cbb, const BIGNUM *bn) { argument 53 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_INTEGER) || 58 !CBB_flush(cbb)) {
|
H A D | convert.c | 249 CBB cbb; local 250 if (!CBB_init(&cbb, 16) || 251 !CBB_add_u8(&cbb, 0 /* trailing NUL */)) { 256 if (!CBB_add_u8(&cbb, '0')) { 273 if (!CBB_add_u8(&cbb, '0' + word % 10)) { 283 !CBB_add_u8(&cbb, '-')) { 289 if (!CBB_finish(&cbb, &data, &len)) { 307 CBB_cleanup(&cbb);
|
/external/libchrome/crypto/ |
H A D | rsa_private_key.cc | 88 bssl::ScopedCBB cbb; local 89 if (!CBB_init(cbb.get(), 0) || 90 !EVP_marshal_private_key(cbb.get(), key_.get()) || 91 !CBB_finish(cbb.get(), &der, &der_len)) { 103 bssl::ScopedCBB cbb; local 104 if (!CBB_init(cbb.get(), 0) || 105 !EVP_marshal_public_key(cbb.get(), key_.get()) || 106 !CBB_finish(cbb.get(), &der, &der_len)) {
|
/external/nos/host/android/hals/keymaster/ |
H A D | export_key.cpp | 69 CBB cbb; local 71 CBB_init_fixed(&cbb, data, 1024); 74 if (!EVP_marshal_public_key(&cbb, pkey.get())) { 81 data), CBB_len(&cbb), true /* Transfer ownership. */); 85 CBB_cleanup(&cbb); 161 CBB cbb; local 163 CBB_init_fixed(&cbb, data, 256); 164 if (!EVP_marshal_public_key(&cbb, pkey.get())) { 171 data), CBB_len(&cbb), true /* Transfer ownership. */); 175 CBB_cleanup(&cbb); [all...] |
/external/boringssl/src/ssl/ |
H A D | tls13_both.cc | 57 ScopedCBB cbb; local 58 if (!CBB_init(cbb.get(), 64 + 33 + 1 + 2 * EVP_MAX_MD_SIZE)) { 64 if (!CBB_add_u8(cbb.get(), 0x20)) { 86 if (!CBB_add_bytes(cbb.get(), 96 !CBB_add_bytes(cbb.get(), context_hash, context_hash_len) || 97 !CBBFinishArray(cbb.get(), out)) { 356 ScopedCBB cbb; local 358 if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CERTIFICATE) || 367 return ssl_add_message_cbb(ssl, cbb.get()); 423 return ssl_add_message_cbb(ssl, cbb 433 ScopedCBB cbb; local 486 ScopedCBB cbb; local 516 ScopedCBB cbb; local [all...] |
H A D | d1_both.cc | 154 ScopedCBB cbb; local 171 if (!CBB_init_fixed(cbb.get(), frag->data, DTLS1_HM_HEADER_LENGTH) || 172 !CBB_add_u8(cbb.get(), msg_hdr->type) || 173 !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || 174 !CBB_add_u16(cbb.get(), msg_hdr->seq) || 175 !CBB_add_u24(cbb.get(), 0 /* frag_off */) || 176 !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || 177 !CBB_finish(cbb.get(), NULL, NULL)) { 511 bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type) { argument 513 if (!CBB_init(cbb, 6 525 dtls1_finish_message(SSL *ssl, CBB *cbb, Array<uint8_t> *out_msg) argument 689 ScopedCBB cbb; local [all...] |
H A D | ssl_asn1.cc | 200 static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, argument 207 if (!CBB_add_asn1(cbb, &session, CBS_ASN1_SEQUENCE) || 398 return CBB_flush(cbb); 759 int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb) { argument 760 return SSL_SESSION_to_bytes_full(in, cbb, 0); 785 ScopedCBB cbb; local 786 if (!CBB_init(cbb.get(), 256) || 787 !SSL_SESSION_to_bytes_full(in, cbb.get(), 0) || 788 !CBB_finish(cbb.get(), out_data, out_len)) { 797 ScopedCBB cbb; local [all...] |
H A D | handshake_server.cc | 730 ScopedCBB cbb; local 732 if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || 741 !ssl_add_message_cbb(ssl, cbb.get())) { 756 ScopedCBB cbb; local 770 if (!ssl->method->init_message(ssl, cbb.get(), &body, 777 !ssl_add_message_cbb(ssl, cbb.get())) { 793 if (!CBB_init(cbb.get(), SSL3_RANDOM_SIZE * 2 + 128) || 794 !CBB_add_bytes(cbb.get(), ssl->s3->client_random, SSL3_RANDOM_SIZE) || 795 !CBB_add_bytes(cbb.get(), ssl->s3->server_random, SSL3_RANDOM_SIZE)) { 803 if (!CBB_add_u16_length_prefixed(cbb 850 ScopedCBB cbb; local 917 ScopedCBB cbb; local 1485 ScopedCBB cbb; local [all...] |
H A D | handshake.cc | 176 bool ssl_add_message_cbb(SSL *ssl, CBB *cbb) { argument 178 if (!ssl->method->finish_message(ssl, cbb, &msg) || 466 ScopedCBB cbb; local 468 if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_FINISHED) || 470 !ssl_add_message_cbb(ssl, cbb.get())) { 479 ScopedCBB cbb; local 481 if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CERTIFICATE) || 483 !ssl_add_message_cbb(ssl, cbb.get())) {
|
/external/boringssl/src/crypto/digest_extra/ |
H A D | digest_test.cc | 222 bssl::ScopedCBB cbb; local 223 ASSERT_TRUE(CBB_init(cbb.get(), 0)); 224 EXPECT_FALSE(EVP_marshal_digest_algorithm(cbb.get(), EVP_md5_sha1())); 237 cbb.Reset(); 238 ASSERT_TRUE(CBB_init(cbb.get(), 0)); 239 ASSERT_TRUE(EVP_marshal_digest_algorithm(cbb.get(), EVP_sha256())); 242 ASSERT_TRUE(CBB_finish(cbb.get(), &der, &der_len));
|
/external/boringssl/src/crypto/ec_extra/ |
H A D | ec_asn1.c | 193 int EC_KEY_marshal_private_key(CBB *cbb, const EC_KEY *key, argument 201 if (!CBB_add_asn1(cbb, &ec_private_key, CBS_ASN1_SEQUENCE) || 237 if (!CBB_flush(cbb)) { 350 int EC_KEY_marshal_curve_name(CBB *cbb, const EC_GROUP *group) { argument 362 return CBB_add_asn1(cbb, &child, CBS_ASN1_OBJECT) && 364 CBB_flush(cbb); 449 CBB cbb; local 450 if (!CBB_init(&cbb, 0) || 451 !EC_KEY_marshal_private_key(&cbb, key, EC_KEY_get_enc_flags(key))) { 452 CBB_cleanup(&cbb); 492 CBB cbb; local [all...] |
/external/boringssl/src/crypto/x509/ |
H A D | x_pubkey.c | 99 CBB cbb; 100 if (!CBB_init(&cbb, 0) || 101 !EVP_marshal_public_key(&cbb, pkey) || 102 !CBB_finish(&cbb, &spki, &spki_len) || 104 CBB_cleanup(&cbb);
|