Home
last modified time | relevance | path

Searched refs:cbs (Results 1 – 25 of 92) sorted by relevance

1234

/external/boringssl/src/crypto/bytestring/
Dcbs.c31 void CBS_init(CBS *cbs, const uint8_t *data, size_t len) { in CBS_init() argument
32 cbs->data = data; in CBS_init()
33 cbs->len = len; in CBS_init()
36 static int cbs_get(CBS *cbs, const uint8_t **p, size_t n) { in cbs_get() argument
37 if (cbs->len < n) { in cbs_get()
41 *p = cbs->data; in cbs_get()
42 cbs->data += n; in cbs_get()
43 cbs->len -= n; in cbs_get()
47 int CBS_skip(CBS *cbs, size_t len) { in CBS_skip() argument
49 return cbs_get(cbs, &dummy, len); in CBS_skip()
[all …]
Dbytestring_test.cc262 CBS cbs, child; in TEST() local
263 CBS_init(&cbs, t.in.data(), t.in.size()); in TEST()
264 ASSERT_EQ(t.ok, !!CBS_get_any_asn1(&cbs, &child, &tag)); in TEST()
268 EXPECT_EQ(0u, CBS_len(&cbs)); in TEST()
270 CBS_init(&cbs, t.in.data(), t.in.size()); in TEST()
271 EXPECT_TRUE(CBS_peek_asn1_tag(&cbs, t.tag)); in TEST()
272 EXPECT_FALSE(CBS_peek_asn1_tag(&cbs, t.tag + 1)); in TEST()
274 EXPECT_TRUE(CBS_get_asn1(&cbs, &child, t.tag)); in TEST()
276 EXPECT_EQ(0u, CBS_len(&cbs)); in TEST()
278 CBS_init(&cbs, t.in.data(), t.in.size()); in TEST()
[all …]
Dcbb.c534 static int parse_dotted_decimal(CBS *cbs, uint64_t *out) { in parse_dotted_decimal() argument
542 if (!CBS_get_u8(cbs, &u) || in parse_dotted_decimal()
543 (u == '.' && CBS_len(cbs) > 0)) { in parse_dotted_decimal()
566 CBS cbs; in CBB_add_asn1_oid_from_text() local
567 CBS_init(&cbs, (const uint8_t *)text, len); in CBB_add_asn1_oid_from_text()
571 if (!parse_dotted_decimal(&cbs, &a) || in CBB_add_asn1_oid_from_text()
572 !parse_dotted_decimal(&cbs, &b)) { in CBB_add_asn1_oid_from_text()
586 while (CBS_len(&cbs) > 0) { in CBB_add_asn1_oid_from_text()
587 if (!parse_dotted_decimal(&cbs, &a) || in CBB_add_asn1_oid_from_text()
619 CBS cbs; in CBB_flush_asn1_set_of() local
[all …]
/external/boringssl/src/include/openssl/
Dbytestring.h59 OPENSSL_EXPORT void CBS_init(CBS *cbs, const uint8_t *data, size_t len);
63 OPENSSL_EXPORT int CBS_skip(CBS *cbs, size_t len);
66 OPENSSL_EXPORT const uint8_t *CBS_data(const CBS *cbs);
69 OPENSSL_EXPORT size_t CBS_len(const CBS *cbs);
76 OPENSSL_EXPORT int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len);
85 OPENSSL_EXPORT int CBS_strdup(const CBS *cbs, char **out_ptr);
89 OPENSSL_EXPORT int CBS_contains_zero_byte(const CBS *cbs);
94 OPENSSL_EXPORT int CBS_mem_equal(const CBS *cbs, const uint8_t *data,
99 OPENSSL_EXPORT int CBS_get_u8(CBS *cbs, uint8_t *out);
103 OPENSSL_EXPORT int CBS_get_u16(CBS *cbs, uint16_t *out);
[all …]
Dpkcs7.h40 STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool);
44 OPENSSL_EXPORT int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs);
54 OPENSSL_EXPORT int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs);
/external/libevent/
Devthread.c93 evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs) in evthread_set_lock_callbacks() argument
105 if (!cbs) { in evthread_set_lock_callbacks()
114 if (target->lock_api_version == cbs->lock_api_version && in evthread_set_lock_callbacks()
115 target->supported_locktypes == cbs->supported_locktypes && in evthread_set_lock_callbacks()
116 target->alloc == cbs->alloc && in evthread_set_lock_callbacks()
117 target->free == cbs->free && in evthread_set_lock_callbacks()
118 target->lock == cbs->lock && in evthread_set_lock_callbacks()
119 target->unlock == cbs->unlock) { in evthread_set_lock_callbacks()
127 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) { in evthread_set_lock_callbacks()
128 memcpy(target, cbs, sizeof(evthread_lock_fns_)); in evthread_set_lock_callbacks()
[all …]
/external/boringssl/src/crypto/dsa/
Ddsa_asn1.c67 static int parse_integer(CBS *cbs, BIGNUM **out) { in parse_integer() argument
73 return BN_parse_asn1_unsigned(cbs, *out); in parse_integer()
85 DSA_SIG *DSA_SIG_parse(CBS *cbs) { in DSA_SIG_parse() argument
91 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in DSA_SIG_parse()
114 DSA *DSA_parse_public_key(CBS *cbs) { in DSA_parse_public_key() argument
120 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in DSA_parse_public_key()
147 DSA *DSA_parse_parameters(CBS *cbs) { in DSA_parse_parameters() argument
153 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in DSA_parse_parameters()
178 DSA *DSA_parse_private_key(CBS *cbs) { in DSA_parse_private_key() argument
186 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in DSA_parse_private_key()
[all …]
/external/boringssl/src/crypto/evp/
Devp_asn1.c78 static int parse_key_type(CBS *cbs, int *out_type) { in parse_key_type() argument
80 if (!CBS_get_asn1(cbs, &oid, CBS_ASN1_OBJECT)) { in parse_key_type()
96 EVP_PKEY *EVP_parse_public_key(CBS *cbs) { in EVP_parse_public_key() argument
101 if (!CBS_get_asn1(cbs, &spki, CBS_ASN1_SEQUENCE) || in EVP_parse_public_key()
146 EVP_PKEY *EVP_parse_private_key(CBS *cbs) { in EVP_parse_private_key() argument
151 if (!CBS_get_asn1(cbs, &pkcs8, CBS_ASN1_SEQUENCE) || in EVP_parse_private_key()
195 static EVP_PKEY *old_priv_decode(CBS *cbs, int type) { in old_priv_decode() argument
203 EC_KEY *ec_key = EC_KEY_parse_private_key(cbs, NULL); in old_priv_decode()
211 DSA *dsa = DSA_parse_private_key(cbs); in old_priv_decode()
219 RSA *rsa = RSA_parse_private_key(cbs); in old_priv_decode()
[all …]
/external/boringssl/src/crypto/rsa_extra/
Drsa_asn1.c72 static int parse_integer(CBS *cbs, BIGNUM **out) { in parse_integer() argument
78 return BN_parse_asn1_unsigned(cbs, *out); in parse_integer()
90 RSA *RSA_parse_public_key(CBS *cbs) { in RSA_parse_public_key() argument
96 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in RSA_parse_public_key()
116 CBS cbs; in RSA_public_key_from_bytes() local
117 CBS_init(&cbs, in, in_len); in RSA_public_key_from_bytes()
118 RSA *ret = RSA_parse_public_key(&cbs); in RSA_public_key_from_bytes()
119 if (ret == NULL || CBS_len(&cbs) != 0) { in RSA_public_key_from_bytes()
157 RSA *RSA_parse_private_key(CBS *cbs) { in RSA_parse_private_key() argument
165 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in RSA_parse_private_key()
[all …]
/external/boringssl/src/ssl/test/
Dfuzzer.h282 CBS cbs; in TestOneInput() local
283 CBS_init(&cbs, buf, len); in TestOneInput()
284 bssl::UniquePtr<SSL> ssl = SetupTest(&cbs); in TestOneInput()
297 SSL_set0_rbio(ssl.get(), MakeBIO(CBS_data(&cbs), CBS_len(&cbs)).release()); in TestOneInput()
374 CBS cbs; in Init() local
375 CBS_init(&cbs, kP256KeyPKCS8, sizeof(kP256KeyPKCS8)); in Init()
376 pkey.reset(EVP_parse_private_key(&cbs)); in Init()
388 bssl::UniquePtr<SSL> SetupTest(CBS *cbs) { in SetupTest() argument
402 if (!CBS_get_u16(cbs, &tag)) { in SetupTest()
411 if (!CBS_get_u24_length_prefixed(cbs, &data)) { in SetupTest()
[all …]
/external/boringssl/src/crypto/ec_extra/
Dec_asn1.c75 EC_KEY *EC_KEY_parse_private_key(CBS *cbs, const EC_GROUP *group) { in EC_KEY_parse_private_key() argument
78 if (!CBS_get_asn1(cbs, &ec_private_key, CBS_ASN1_SEQUENCE) || in EC_KEY_parse_private_key()
247 static int is_unsigned_integer(const CBS *cbs) { in is_unsigned_integer() argument
248 if (CBS_len(cbs) == 0) { in is_unsigned_integer()
251 uint8_t byte = CBS_data(cbs)[0]; in is_unsigned_integer()
253 (byte == 0 && CBS_len(cbs) > 1 && (CBS_data(cbs)[1] & 0x80) == 0)) { in is_unsigned_integer()
328 EC_GROUP *EC_KEY_parse_curve_name(CBS *cbs) { in EC_KEY_parse_curve_name() argument
330 if (!CBS_get_asn1(cbs, &named_curve, CBS_ASN1_OBJECT)) { in EC_KEY_parse_curve_name()
372 EC_GROUP *EC_KEY_parse_parameters(CBS *cbs) { in EC_KEY_parse_parameters() argument
373 if (!CBS_peek_asn1_tag(cbs, CBS_ASN1_SEQUENCE)) { in EC_KEY_parse_parameters()
[all …]
/external/boringssl/src/crypto/dh/
Ddh_asn1.c68 static int parse_integer(CBS *cbs, BIGNUM **out) { in parse_integer() argument
74 return BN_parse_asn1_unsigned(cbs, *out); in parse_integer()
86 DH *DH_parse_parameters(CBS *cbs) { in DH_parse_parameters() argument
93 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in DH_parse_parameters()
138 CBS cbs; in d2i_DHparams() local
139 CBS_init(&cbs, *inp, (size_t)len); in d2i_DHparams()
140 DH *ret = DH_parse_parameters(&cbs); in d2i_DHparams()
148 *inp = CBS_data(&cbs); in d2i_DHparams()
Ddh_test.cc340 CBS cbs; in TestASN1() local
341 CBS_init(&cbs, kParams, sizeof(kParams)); in TestASN1()
342 bssl::UniquePtr<DH> dh(DH_parse_parameters(&cbs)); in TestASN1()
343 if (!dh || CBS_len(&cbs) != 0 || in TestASN1()
382 CBS_init(&cbs, kParamsDSA, sizeof(kParamsDSA)); in TestASN1()
383 dh.reset(DH_parse_parameters(&cbs)); in TestASN1()
384 if (!dh || CBS_len(&cbs) != 0 || in TestASN1()
/external/boringssl/src/crypto/pkcs7/
Dpkcs7_x509.c31 int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs) { in PKCS7_get_certificates() argument
36 !PKCS7_get_raw_certificates(raw, cbs, NULL)) { in PKCS7_get_certificates()
64 int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs) { in PKCS7_get_CRLs() argument
70 if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs)) { in PKCS7_get_CRLs()
146 CBS cbs; in PKCS7_get_PEM_certificates() local
147 CBS_init(&cbs, data, len); in PKCS7_get_PEM_certificates()
148 ret = PKCS7_get_certificates(out_certs, &cbs); in PKCS7_get_PEM_certificates()
168 CBS cbs; in PKCS7_get_PEM_CRLs() local
169 CBS_init(&cbs, data, len); in PKCS7_get_PEM_CRLs()
170 ret = PKCS7_get_CRLs(out_crls, &cbs); in PKCS7_get_PEM_CRLs()
Dpkcs7.c43 int pkcs7_parse_header(uint8_t **der_bytes, CBS *out, CBS *cbs) { in pkcs7_parse_header() argument
50 if (!CBS_asn1_ber_to_der(cbs, der_bytes, &der_len)) { in pkcs7_parse_header()
56 CBS_init(&in, CBS_data(cbs), CBS_len(cbs)); in pkcs7_parse_header()
95 int PKCS7_get_raw_certificates(STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, in PKCS7_get_raw_certificates() argument
102 if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs)) { in PKCS7_get_raw_certificates()
/external/boringssl/src/crypto/ecdsa_extra/
Decdsa_asn1.c160 ECDSA_SIG *ECDSA_SIG_parse(CBS *cbs) { in ECDSA_SIG_parse() argument
166 if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || in ECDSA_SIG_parse()
178 CBS cbs; in ECDSA_SIG_from_bytes() local
179 CBS_init(&cbs, in, in_len); in ECDSA_SIG_from_bytes()
180 ECDSA_SIG *ret = ECDSA_SIG_parse(&cbs); in ECDSA_SIG_from_bytes()
181 if (ret == NULL || CBS_len(&cbs) != 0) { in ECDSA_SIG_from_bytes()
253 CBS cbs; in d2i_ECDSA_SIG() local
254 CBS_init(&cbs, *inp, (size_t)len); in d2i_ECDSA_SIG()
255 ECDSA_SIG *ret = ECDSA_SIG_parse(&cbs); in d2i_ECDSA_SIG()
263 *inp = CBS_data(&cbs); in d2i_ECDSA_SIG()
/external/boringssl/src/ssl/
Dssl_asn1.cc407 static int SSL_SESSION_parse_string(CBS *cbs, char **out, unsigned tag) { in SSL_SESSION_parse_string() argument
410 if (!CBS_get_optional_asn1_octet_string(cbs, &value, &present, tag)) { in SSL_SESSION_parse_string()
436 static int SSL_SESSION_parse_octet_string(CBS *cbs, uint8_t **out_ptr, in SSL_SESSION_parse_octet_string() argument
439 if (!CBS_get_optional_asn1_octet_string(cbs, &value, NULL, tag)) { in SSL_SESSION_parse_octet_string()
450 static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, CRYPTO_BUFFER **out, in SSL_SESSION_parse_crypto_buffer() argument
453 if (!CBS_peek_asn1_tag(cbs, tag)) { in SSL_SESSION_parse_crypto_buffer()
458 if (!CBS_get_asn1(cbs, &child, tag) || in SSL_SESSION_parse_crypto_buffer()
476 CBS *cbs, uint8_t *out, uint8_t *out_len, uint8_t max_out, unsigned tag) { in SSL_SESSION_parse_bounded_octet_string() argument
478 if (!CBS_get_optional_asn1_octet_string(cbs, &value, NULL, tag) || in SSL_SESSION_parse_bounded_octet_string()
488 static int SSL_SESSION_parse_long(CBS *cbs, long *out, unsigned tag, in SSL_SESSION_parse_long() argument
[all …]
Ddtls_record.cc190 CBS cbs = CBS(in); in dtls_open_record() local
197 if (!CBS_get_u8(&cbs, &type) || in dtls_open_record()
198 !CBS_get_u16(&cbs, &version) || in dtls_open_record()
199 !CBS_copy_bytes(&cbs, sequence, 8) || in dtls_open_record()
200 !CBS_get_u16_length_prefixed(&cbs, &body) || in dtls_open_record()
232 *out_consumed = in.size() - CBS_len(&cbs); in dtls_open_record()
247 *out_consumed = in.size() - CBS_len(&cbs); in dtls_open_record()
250 *out_consumed = in.size() - CBS_len(&cbs); in dtls_open_record()
Dd1_both.cc350 CBS cbs; in dtls1_open_handshake() local
351 CBS_init(&cbs, record.data(), record.size()); in dtls1_open_handshake()
352 while (CBS_len(&cbs) > 0) { in dtls1_open_handshake()
356 if (!dtls1_parse_fragment(&cbs, &msg_hdr, &body)) { in dtls1_open_handshake()
459 bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr, in dtls1_parse_fragment() argument
463 if (!CBS_get_u8(cbs, &out_hdr->type) || in dtls1_parse_fragment()
464 !CBS_get_u24(cbs, &out_hdr->msg_len) || in dtls1_parse_fragment()
465 !CBS_get_u16(cbs, &out_hdr->seq) || in dtls1_parse_fragment()
466 !CBS_get_u24(cbs, &out_hdr->frag_off) || in dtls1_parse_fragment()
467 !CBS_get_u24(cbs, &out_hdr->frag_len) || in dtls1_parse_fragment()
[all …]
/external/boringssl/src/crypto/digest_extra/
Ddigest_extra.c140 static const EVP_MD *cbs_to_md(const CBS *cbs) { in cbs_to_md() argument
142 if (CBS_len(cbs) == kMDOIDs[i].oid_len && in cbs_to_md()
143 OPENSSL_memcmp(CBS_data(cbs), kMDOIDs[i].oid, kMDOIDs[i].oid_len) == in cbs_to_md()
158 CBS cbs; in EVP_get_digestbyobj() local
159 CBS_init(&cbs, obj->data, obj->length); in EVP_get_digestbyobj()
160 return cbs_to_md(&cbs); in EVP_get_digestbyobj()
163 const EVP_MD *EVP_parse_digest_algorithm(CBS *cbs) { in EVP_parse_digest_algorithm() argument
165 if (!CBS_get_asn1(cbs, &algorithm, CBS_ASN1_SEQUENCE) || in EVP_parse_digest_algorithm()
Ddigest_test.cc247 CBS cbs; in TEST() local
248 CBS_init(&cbs, kSHA256, sizeof(kSHA256)); in TEST()
249 EXPECT_EQ(EVP_sha256(), EVP_parse_digest_algorithm(&cbs)); in TEST()
250 EXPECT_EQ(0u, CBS_len(&cbs)); in TEST()
253 CBS_init(&cbs, kSHA256NoParam, sizeof(kSHA256NoParam)); in TEST()
254 EXPECT_EQ(EVP_sha256(), EVP_parse_digest_algorithm(&cbs)); in TEST()
255 EXPECT_EQ(0u, CBS_len(&cbs)); in TEST()
258 CBS_init(&cbs, kSHA256GarbageParam, sizeof(kSHA256GarbageParam)); in TEST()
259 EXPECT_FALSE(EVP_parse_digest_algorithm(&cbs)); in TEST()
/external/glide/library/src/main/java/com/bumptech/glide/load/engine/
DEngineJob.java28 private final List<ResourceCallback> cbs = new ArrayList<ResourceCallback>(); field in EngineJob
82 cbs.add(cb); in addCallback()
91 cbs.remove(cb); in removeCallback()
92 if (cbs.isEmpty()) { in removeCallback()
143 } else if (cbs.isEmpty()) { in handleResultOnMainThread()
154 for (ResourceCallback cb : cbs) { in handleResultOnMainThread()
173 } else if (cbs.isEmpty()) { in handleExceptionOnMainThread()
180 for (ResourceCallback cb : cbs) { in handleExceptionOnMainThread()
/external/boringssl/src/crypto/obj/
Dobj_test.cc34 CBS cbs; in TEST() local
35 CBS_init(&cbs, kDER, sizeof(kDER)); in TEST()
36 ASSERT_EQ(kNID, OBJ_cbs2nid(&cbs)); in TEST()
50 CBS_init(&cbs, NULL, 0); in TEST()
51 ASSERT_EQ(NID_undef, OBJ_cbs2nid(&cbs)); in TEST()
57 CBS_init(&cbs, kUnknownDER, sizeof(kUnknownDER)); in TEST()
58 ASSERT_EQ(NID_undef, OBJ_cbs2nid(&cbs)); in TEST()
/external/glide/library/src/main/java/com/bumptech/glide/request/target/
DViewTarget.java115 private final List<SizeReadyCallback> cbs = new ArrayList<SizeReadyCallback>(); field in ViewTarget.SizeDeterminer
123 for (SizeReadyCallback cb : cbs) { in notifyCbs()
126 cbs.clear(); in notifyCbs()
130 if (cbs.isEmpty()) { in checkCurrentDimens()
179 if (!cbs.contains(cb)) { in getSize()
180 cbs.add(cb); in getSize()
/external/nos/host/android/hals/keymaster/
Dimport_wrapped_key.cpp53 using parse_asn1_fn = function<ErrorCode(CBS *cbs, Tag tag,
63 static int CBS_get_optional_asn1_set(CBS *cbs, CBS *out, int *out_present, in CBS_get_optional_asn1_set() argument
67 if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { in CBS_get_optional_asn1_set()
84 static int CBS_get_optional_asn1_null(CBS *cbs, CBS *out, int *out_present, in CBS_get_optional_asn1_null() argument
88 if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { in CBS_get_optional_asn1_null()
345 CBS cbs; in import_wrapped_key_request() local
351 CBS_init(&cbs, wrappedKeyData.data(), wrappedKeyData.size()); in import_wrapped_key_request()
352 if (!CBS_get_asn1(&cbs, &child, CBS_ASN1_SEQUENCE) || in import_wrapped_key_request()

1234