• Home
  • Raw
  • Download

Lines Matching refs:cbb

319   CBB cbb;  in TEST()  local
320 ASSERT_TRUE(CBB_init(&cbb, 100)); in TEST()
321 CBB_cleanup(&cbb); in TEST()
333 bssl::ScopedCBB cbb; in TEST() local
334 ASSERT_TRUE(CBB_init(cbb.get(), 100)); in TEST()
335 cbb.Reset(); in TEST()
337 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
338 ASSERT_TRUE(CBB_add_u8(cbb.get(), 1)); in TEST()
339 ASSERT_TRUE(CBB_add_u16(cbb.get(), 0x203)); in TEST()
340 ASSERT_TRUE(CBB_add_u24(cbb.get(), 0x40506)); in TEST()
341 ASSERT_TRUE(CBB_add_u32(cbb.get(), 0x708090a)); in TEST()
342 ASSERT_TRUE(CBB_add_u64(cbb.get(), 0xb0c0d0e0f101112)); in TEST()
343 ASSERT_TRUE(CBB_add_bytes(cbb.get(), (const uint8_t *)"\x13\x14", 2)); in TEST()
344 ASSERT_TRUE(CBB_add_u16le(cbb.get(), 0x203)); in TEST()
345 ASSERT_TRUE(CBB_add_u32le(cbb.get(), 0x708090a)); in TEST()
346 ASSERT_TRUE(CBB_add_u64le(cbb.get(), 0xb0c0d0e0f101112)); in TEST()
347 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
354 bssl::ScopedCBB cbb; in TEST() local
359 ASSERT_TRUE(CBB_init_fixed(cbb.get(), NULL, 0)); in TEST()
360 ASSERT_TRUE(CBB_finish(cbb.get(), &out_buf, &out_size)); in TEST()
364 cbb.Reset(); in TEST()
365 ASSERT_TRUE(CBB_init_fixed(cbb.get(), buf, 1)); in TEST()
366 ASSERT_TRUE(CBB_add_u8(cbb.get(), 1)); in TEST()
367 ASSERT_TRUE(CBB_finish(cbb.get(), &out_buf, &out_size)); in TEST()
372 cbb.Reset(); in TEST()
373 ASSERT_TRUE(CBB_init_fixed(cbb.get(), buf, 1)); in TEST()
374 ASSERT_TRUE(CBB_add_u8(cbb.get(), 1)); in TEST()
375 EXPECT_FALSE(CBB_add_u8(cbb.get(), 2)); in TEST()
384 bssl::ScopedCBB cbb; in TEST() local
385 ASSERT_TRUE(CBB_init(cbb.get(), 16)); in TEST()
386 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &child)); in TEST()
390 ASSERT_TRUE(CBB_finish(cbb.get(), &out_buf, &out_size)); in TEST()
401 bssl::ScopedCBB cbb; in TEST() local
403 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
404 EXPECT_EQ(0u, CBB_len(cbb.get())); in TEST()
405 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
406 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
409 ASSERT_TRUE(CBB_flush(cbb.get())); in TEST()
410 EXPECT_EQ(3u, CBB_len(cbb.get())); in TEST()
411 ASSERT_TRUE(CBB_add_u16_length_prefixed(cbb.get(), &contents)); in TEST()
413 ASSERT_TRUE(CBB_add_u24_length_prefixed(cbb.get(), &contents)); in TEST()
415 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
421 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
428 bssl::ScopedCBB cbb; in TEST() local
431 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
432 ASSERT_TRUE(CBB_add_u8(cbb.get(), 0xaa)); in TEST()
435 CBB_discard_child(cbb.get()); in TEST()
437 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
438 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
440 ASSERT_TRUE(CBB_add_u16_length_prefixed(cbb.get(), &contents)); in TEST()
442 ASSERT_TRUE(CBB_add_u24_length_prefixed(cbb.get(), &contents)); in TEST()
444 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
457 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
472 bssl::ScopedCBB cbb; in TEST() local
477 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
478 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &child)); in TEST()
480 ASSERT_TRUE(CBB_add_u8(cbb.get(), 2)); in TEST()
492 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
513 bssl::ScopedCBB cbb; in TEST() local
516 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
517 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
520 CBB_add_asn1(cbb.get(), &contents, in TEST()
524 CBB_add_asn1(cbb.get(), &contents, in TEST()
528 CBB_add_asn1(cbb.get(), &contents, in TEST()
532 CBB_add_asn1(cbb.get(), &contents, in TEST()
535 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
541 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
542 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
544 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
551 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
552 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
554 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
561 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
562 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
565 ASSERT_TRUE(CBB_finish(cbb.get(), &buf, &buf_len)); in TEST()
824 bssl::ScopedCBB cbb; in TEST() local
825 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
826 ASSERT_TRUE(CBB_add_asn1_uint64(cbb.get(), test.value)); in TEST()
827 ASSERT_TRUE(CBB_finish(cbb.get(), &out, &len)); in TEST()
914 bssl::ScopedCBB cbb; in TEST() local
915 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
916 ASSERT_TRUE(CBB_add_asn1_int64(cbb.get(), test.value)); in TEST()
917 ASSERT_TRUE(CBB_finish(cbb.get(), &out, &len)); in TEST()
939 CBB cbb; in TEST() local
940 CBB_zero(&cbb); in TEST()
942 CBB_cleanup(&cbb); in TEST()
949 bssl::ScopedCBB cbb; in TEST() local
950 ASSERT_TRUE(CBB_init_fixed(cbb.get(), buf, sizeof(buf))); in TEST()
952 EXPECT_FALSE(CBB_reserve(cbb.get(), &ptr, 11)); in TEST()
954 cbb.Reset(); in TEST()
955 ASSERT_TRUE(CBB_init_fixed(cbb.get(), buf, sizeof(buf))); in TEST()
957 ASSERT_TRUE(CBB_reserve(cbb.get(), &ptr, 10)); in TEST()
960 ASSERT_TRUE(CBB_did_write(cbb.get(), 5)); in TEST()
961 ASSERT_TRUE(CBB_finish(cbb.get(), NULL, &len)); in TEST()
969 bssl::ScopedCBB cbb; in TEST() local
972 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
973 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &child)); in TEST()
975 ASSERT_FALSE(CBB_flush(cbb.get())); in TEST()
980 EXPECT_FALSE(CBB_add_u8(cbb.get(), 0)); in TEST()
981 EXPECT_FALSE(CBB_finish(cbb.get(), &ptr, &len)); in TEST()
984 cbb.Reset(); in TEST()
986 ASSERT_TRUE(CBB_init_fixed(cbb.get(), &buf, 1)); in TEST()
987 ASSERT_FALSE(CBB_add_bytes(cbb.get(), kZeros, sizeof(kZeros))); in TEST()
990 EXPECT_FALSE(CBB_add_u8(cbb.get(), 0)); in TEST()
991 EXPECT_FALSE(CBB_finish(cbb.get(), &ptr, &len)); in TEST()
994 cbb.Reset(); in TEST()
995 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
996 ASSERT_FALSE(CBB_add_u24(cbb.get(), 1u << 24)); in TEST()
999 EXPECT_FALSE(CBB_add_u8(cbb.get(), 0)); in TEST()
1000 EXPECT_FALSE(CBB_finish(cbb.get(), &ptr, &len)); in TEST()
1136 bssl::ScopedCBB cbb; in TEST() local
1137 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
1138 ASSERT_TRUE(CBB_add_asn1_oid_from_text(cbb.get(), t.text, strlen(t.text))); in TEST()
1141 ASSERT_TRUE(CBB_finish(cbb.get(), &out, &len)); in TEST()
1154 bssl::ScopedCBB cbb; in TEST() local
1155 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
1156 EXPECT_FALSE(CBB_add_asn1_oid_from_text(cbb.get(), t, strlen(t))); in TEST()
1203 bssl::ScopedCBB cbb; in TEST() local
1205 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
1206 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &child, CBS_ASN1_SET)); in TEST()
1216 ASSERT_TRUE(CBB_flush(cbb.get())); in TEST()
1217 EXPECT_EQ(0x31, CBB_data(cbb.get())[0]); in TEST()
1229 bssl::ScopedCBB cbb; in TEST() local
1231 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
1232 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &child, CBS_ASN1_SET)); in TEST()
1410 bssl::ScopedCBB cbb; in TEST() local
1411 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
1413 ASSERT_TRUE(t.encode(cbb.get(), u)); in TEST()
1415 EXPECT_EQ(Bytes(t.in), Bytes(CBB_data(cbb.get()), CBB_len(cbb.get()))); in TEST()
1432 bssl::ScopedCBB cbb; in TEST() local
1433 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
1436 EXPECT_FALSE(cbb_add_utf8(cbb.get(), v)); in TEST()
1437 EXPECT_FALSE(cbb_add_latin1(cbb.get(), v)); in TEST()
1438 EXPECT_FALSE(cbb_add_ucs2_be(cbb.get(), v)); in TEST()
1439 EXPECT_FALSE(cbb_add_utf32_be(cbb.get(), v)); in TEST()
1443 EXPECT_FALSE(cbb_add_latin1(cbb.get(), 0x100)); in TEST()
1444 EXPECT_FALSE(cbb_add_ucs2_be(cbb.get(), 0x10000)); in TEST()