Home
last modified time | relevance | path

Searched refs:get (Results 1 – 25 of 1207) sorted by relevance

12345678910>>...49

/system/libbase/
Dcmsg_test.cpp71 ASSERT_EQ(1, SendFileDescriptors(send.get(), "x", 1, fd1.get())); in TEST_P()
75 ASSERT_EQ(1, ReceiveFileDescriptors(recv.get(), buf, 2, &received)); in TEST_P()
77 ASSERT_NE(-1, received.get()); in TEST_P()
79 ASSERT_EQ(ino1, GetInode(received.get())); in TEST_P()
83 ASSERT_EQ(2, SendFileDescriptors(send.get(), "ab", 2, fd1.get(), fd2.get())); in TEST_P()
88 ssize_t rc = ReceiveFileDescriptors(recv.get(), buf, 1, &received1, &received2); in TEST_P()
92 ASSERT_EQ(-1, received1.get()); in TEST_P()
93 ASSERT_EQ(-1, received2.get()); in TEST_P()
96 ASSERT_NE(-1, received1.get()); in TEST_P()
97 ASSERT_NE(-1, received2.get()); in TEST_P()
[all …]
Dno_destructor_test.cpp26 int get() const { return magic_; } in get() function
37 if (b.get() != 123) exit(1); in TEST()
49 if (b->get() != 123) exit(1); in TEST()
60 ASSERT_EQ(123, b.get()->get()); in TEST()
61 ASSERT_EQ(123, b->get()); in TEST()
62 ASSERT_EQ(123, (*b).get()); in TEST()
63 ASSERT_EQ(123, c.get()->get()); in TEST()
64 ASSERT_EQ(123, c->get()); in TEST()
65 ASSERT_EQ(123, (*c).get()); in TEST()
/system/core/libunwindstack/tests/
DRegsTest.cpp96 EXPECT_EQ(4U, GetPcAdjustment(0x10, elf_.get(), ARCH_ARM64)); in TEST_F()
97 EXPECT_EQ(4U, GetPcAdjustment(0x4, elf_.get(), ARCH_ARM64)); in TEST_F()
98 EXPECT_EQ(0U, GetPcAdjustment(0x3, elf_.get(), ARCH_ARM64)); in TEST_F()
99 EXPECT_EQ(0U, GetPcAdjustment(0x2, elf_.get(), ARCH_ARM64)); in TEST_F()
100 EXPECT_EQ(0U, GetPcAdjustment(0x1, elf_.get(), ARCH_ARM64)); in TEST_F()
101 EXPECT_EQ(0U, GetPcAdjustment(0x0, elf_.get(), ARCH_ARM64)); in TEST_F()
103 EXPECT_EQ(1U, GetPcAdjustment(0x100, elf_.get(), ARCH_X86)); in TEST_F()
104 EXPECT_EQ(1U, GetPcAdjustment(0x2, elf_.get(), ARCH_X86)); in TEST_F()
105 EXPECT_EQ(1U, GetPcAdjustment(0x1, elf_.get(), ARCH_X86)); in TEST_F()
106 EXPECT_EQ(0U, GetPcAdjustment(0x0, elf_.get(), ARCH_X86)); in TEST_F()
[all …]
/system/keymaster/km_openssl/
Dhkdf.cpp35 if (salt_.get() != nullptr && salt_len_ > 0) { in GenerateKey()
36 result = prk_hmac.Init(salt_.get(), salt_len_); in GenerateKey()
39 if (zeros.get() == nullptr) in GenerateKey()
42 memset(zeros.get(), 0, digest_size_); in GenerateKey()
43 result = prk_hmac.Init(zeros.get(), digest_size_); in GenerateKey()
49 if (pseudo_random_key.get() == nullptr || digest_size_ != prk_hmac.DigestLength()) in GenerateKey()
52 prk_hmac.Sign(secret_key_.get(), secret_key_len_, pseudo_random_key.get(), digest_size_); in GenerateKey()
66 if (buf.get() == nullptr || digest.get() == nullptr) in GenerateKey()
69 result = hmac.Init(pseudo_random_key.get(), digest_size_); in GenerateKey()
76 memcpy(buf.get(), digest.get(), digest_size_); in GenerateKey()
[all …]
Dnist_curve_key_exchange.cpp30 if (!private_key_.get() || !EC_KEY_check_key(private_key_.get())) { in NistCurveKeyExchange()
59 if (!key.get() || !EC_KEY_generate_key(key.get())) { in GenerateKeyExchange()
64 NistCurveKeyExchange(key.get(), &error)); in GenerateKeyExchange()
65 if (!key_exchange.get()) error = KM_ERROR_MEMORY_ALLOCATION_FAILED; in GenerateKeyExchange()
73 const EC_GROUP* group = EC_KEY_get0_group(private_key_.get()); in ExtractPublicKey()
81 if (!public_key_.get()) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in ExtractPublicKey()
82 if (EC_POINT_point2oct(group, EC_KEY_get0_public_key(private_key_.get()), in ExtractPublicKey()
83 POINT_CONVERSION_UNCOMPRESSED, public_key_.get(), public_key_len_, in ExtractPublicKey()
100 const EC_GROUP* group = EC_KEY_get0_group(private_key_.get()); in CalculateSharedKey()
102 if (!point.get() || in CalculateSharedKey()
[all …]
Dattestation_utils.cpp157 if (!result.get()) return {}; in makeCertChain()
176 if (!oid.get()) in build_attestation_extension()
188 if (!attest_str.get() || in build_attestation_extension()
189 !ASN1_OCTET_STRING_set(attest_str.get(), attest_bytes.get(), attest_bytes_len)) in build_attestation_extension()
193 X509_EXTENSION_create_by_OBJ(nullptr, oid.get(), 0 /* not critical */, attest_str.get())); in build_attestation_extension()
194 if (!extension->get()) in build_attestation_extension()
208 if (!ASN1_BIT_STRING_set_bit(key_usage.get(), i, 0)) { in add_key_usage_extension()
217 if (!ASN1_BIT_STRING_set_bit(key_usage.get(), kDigitalSignatureKeyUsageBit, 1)) { in add_key_usage_extension()
226 if (!ASN1_BIT_STRING_set_bit(key_usage.get(), kKeyEnciphermentKeyUsageBit, 1) || in add_key_usage_extension()
227 !ASN1_BIT_STRING_set_bit(key_usage.get(), kDataEnciphermentKeyUsageBit, 1)) { in add_key_usage_extension()
[all …]
Dckdf.cpp51 if (!ctx.get()) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in DEFINE_OPENSSL_OBJECT_POINTER()
65 if (!CMAC_Init(ctx.get(), key.key_material, key.key_material_size, algo, in DEFINE_OPENSSL_OBJECT_POINTER()
78 if (!CMAC_Update(ctx.get(), reinterpret_cast<uint8_t*>(&net_order_i), in DEFINE_OPENSSL_OBJECT_POINTER()
84 if (!CMAC_Update(ctx.get(), label.data, label.data_length)) { in DEFINE_OPENSSL_OBJECT_POINTER()
90 if (!CMAC_Update(ctx.get(), &zero, sizeof(zero))) return TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
94 if (!CMAC_Update(ctx.get(), context_chunks[chunk].data, in DEFINE_OPENSSL_OBJECT_POINTER()
103 if (!CMAC_Update(ctx.get(), buf, sizeof(buf))) TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
107 if (!CMAC_Final(ctx.get(), output_pos, &out_len)) return TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
111 if (!CMAC_Final(ctx.get(), cmac, &out_len)) return TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
117 CMAC_Reset(ctx.get()); in DEFINE_OPENSSL_OBJECT_POINTER()
Drsa_key_factory.cpp84 if (exponent.get() == nullptr || rsa_key.get() == nullptr || pkey.get() == nullptr) in GenerateKey()
87 if (!BN_set_word(exponent.get(), public_exponent) || in GenerateKey()
88 !RSA_generate_key_ex(rsa_key.get(), key_size, exponent.get(), nullptr /* callback */)) in GenerateKey()
91 if (EVP_PKEY_set1_RSA(pkey.get(), rsa_key.get()) != 1) in GenerateKey()
95 keymaster_error_t error = EvpKeyToKeyMaterial(pkey.get(), &key_material); in GenerateKey()
139 UniquePtr<RSA, RsaKey::RSA_Delete> rsa_key(EVP_PKEY_get1_RSA(pkey.get())); in UpdateImportKeyDescription()
140 if (!rsa_key.get()) in UpdateImportKeyDescription()
156 *key_size = RSA_size(rsa_key.get()) * 8; in UpdateImportKeyDescription()
159 if (RSA_size(rsa_key.get()) * 8 != *key_size) { in UpdateImportKeyDescription()
161 RSA_size(rsa_key.get()) * 8, *key_size); in UpdateImportKeyDescription()
/system/core/adb/pairing_auth/tests/
Dpairing_auth_test.cpp84 size_t msg_size = pairing_auth_msg_size(client.get()); in TEST_F()
87 pairing_auth_get_spake2_msg(client.get(), buf.data()); in TEST_F()
90 size_t msg_size = pairing_auth_msg_size(server.get()); in TEST_F()
93 pairing_auth_get_spake2_msg(server.get(), buf.data()); in TEST_F()
110 pairing_auth_init_cipher(server.get(), nullptr, 0); in TEST_F()
116 pairing_auth_encrypt(server.get(), data.data(), data.size(), outbuf, &outsize); in TEST_F()
122 pairing_auth_decrypt(server.get(), data.data(), data.size(), outbuf, &outsize); in TEST_F()
128 pairing_auth_safe_decrypted_size(server.get(), data.data(), data.size()); in TEST_F()
134 pairing_auth_safe_encrypted_size(server.get(), data.size()); in TEST_F()
144 std::vector<uint8_t> client_msg(pairing_auth_msg_size(client.get())); in TEST_F()
[all …]
/system/keymaster/key_blob_utils/
Docb_utils.cpp41 ae_ctx* get() { return ctx_; } in get() function in keymaster::AeCtx
55 if (!derivation_data->get()) in BuildDerivationData()
58 uint8_t* buf = derivation_data->get(); in BuildDerivationData()
59 uint8_t* end = derivation_data->get() + *derivation_data_length; in BuildDerivationData()
81 if (!hash_buf.get()) in InitializeKeyWrappingContext()
83 Eraser hash_eraser(hash_buf.get(), SHA256_DIGEST_LENGTH); in InitializeKeyWrappingContext()
85 if (!derived_key.get()) in InitializeKeyWrappingContext()
87 Eraser derived_key_eraser(derived_key.get(), AES_BLOCK_SIZE); in InitializeKeyWrappingContext()
89 if (!ctx->get() || !hash_buf.get() || !derived_key.get()) in InitializeKeyWrappingContext()
95 SHA256_Update(&sha256_ctx, derivation_data.get(), derivation_data_length); in InitializeKeyWrappingContext()
[all …]
/system/apex/apexd/
Dapexd_loop.cpp62 if (device_fd.get() != -1) { in MaybeCloseBad()
64 if (ioctl(device_fd.get(), LOOP_CLR_FD) == -1) { in MaybeCloseBad()
81 if (sysfs_fd.get() == -1) { in configureReadAhead()
86 write(sysfs_fd.get(), kReadAheadKb, strlen(kReadAheadKb) + 1)); in configureReadAhead()
101 if (ctl_fd.get() == -1) { in preAllocateLoopDevices()
112 int ret = ioctl(ctl_fd.get(), LOOP_CTL_ADD, id); in preAllocateLoopDevices()
133 if (ctl_fd.get() == -1) { in createLoopDevice()
137 int num = ioctl(ctl_fd.get(), LOOP_CTL_GET_FREE); in createLoopDevice()
154 if (target_fd.get() == -1) { in createLoopDevice()
164 if (target_fd.get() == -1) { in createLoopDevice()
[all …]
/system/update_engine/update_manager/
Dreal_updater_provider.h48 return var_last_checked_time_.get(); in var_last_checked_time()
52 return var_update_completed_time_.get(); in var_update_completed_time()
55 Variable<double>* var_progress() override { return var_progress_.get(); } in var_progress()
57 Variable<Stage>* var_stage() override { return var_stage_.get(); } in var_stage()
60 return var_new_version_.get(); in var_new_version()
64 return var_payload_size_.get(); in var_payload_size()
68 return var_curr_channel_.get(); in var_curr_channel()
72 return var_new_channel_.get(); in var_new_channel()
75 Variable<bool>* var_p2p_enabled() override { return var_p2p_enabled_.get(); } in var_p2p_enabled()
78 return var_cellular_enabled_.get(); in var_cellular_enabled()
[all …]
Dweekly_time_unittest.cc49 int start_day_of_week() { return std::get<0>(GetParam()); } in start_day_of_week()
50 TimeDelta start_time() { return std::get<1>(GetParam()); } in start_time()
51 int end_day_of_week() { return std::get<2>(GetParam()); } in end_day_of_week()
52 TimeDelta end_time() { return std::get<3>(GetParam()); } in end_time()
53 TimeDelta result() { return std::get<4>(GetParam()); } in result()
107 int day_of_week() { return std::get<0>(GetParam()); } in day_of_week()
108 TimeDelta time() { return std::get<1>(GetParam()); } in time()
109 TimeDelta offset() { return std::get<2>(GetParam()); } in offset()
110 WeeklyTime result() { return std::get<3>(GetParam()); } in result()
152 int day_of_week() { return std::get<0>(GetParam()); } in day_of_week()
[all …]
/system/core/adb/crypto/
Dx509_generator.cpp64 X509_set_version(x509.get(), 2); in GenerateX509Certificate()
66 ASN1_INTEGER_set(X509_get_serialNumber(x509.get()), 1); in GenerateX509Certificate()
67 X509_gmtime_adj(X509_get_notBefore(x509.get()), 0); in GenerateX509Certificate()
68 X509_gmtime_adj(X509_get_notAfter(x509.get()), kCertLifetimeSeconds); in GenerateX509Certificate()
70 if (!X509_set_pubkey(x509.get(), pkey)) { in GenerateX509Certificate()
75 X509_NAME* name = X509_get_subject_name(x509.get()); in GenerateX509Certificate()
86 if (!X509_set_issuer_name(x509.get(), name)) { in GenerateX509Certificate()
91 add_ext(x509.get(), NID_basic_constraints, kBasicConstraints); in GenerateX509Certificate()
92 add_ext(x509.get(), NID_key_usage, kKeyUsage); in GenerateX509Certificate()
93 add_ext(x509.get(), NID_subject_key_identifier, kSubjectKeyIdentifier); in GenerateX509Certificate()
[all …]
/system/core/adb/daemon/
Drestart_service.cpp33 WriteFdExactly(fd.get(), "adbd is already running as root\n"); in restart_root_service()
37 WriteFdExactly(fd.get(), "adbd cannot run as root in production builds\n"); in restart_root_service()
43 WriteFdExactly(fd.get(), "restarting adbd as root\n"); in restart_root_service()
48 WriteFdExactly(fd.get(), "adbd not running as root\n"); in restart_unroot_service()
54 WriteFdExactly(fd.get(), "restarting adbd as non root\n"); in restart_unroot_service()
59 WriteFdFmt(fd.get(), "invalid port %d\n", port); in restart_tcp_service()
65 WriteFdFmt(fd.get(), "restarting in TCP mode port: %d\n", port); in restart_tcp_service()
71 WriteFdExactly(fd.get(), "restarting in USB mode\n"); in restart_usb_service()
/system/core/adb/libs/adbconnection/
Dadbconnection_server.cpp54 if (bind(s.get(), reinterpret_cast<sockaddr*>(&addr), addrlen) < 0) { in adbconnection_listen()
59 if (listen(s.get(), 4) < 0) { in adbconnection_listen()
71 if (epoll_ctl(epfd.get(), EPOLL_CTL_ADD, s.get(), &events[0]) != 0) { in adbconnection_listen()
76 int epoll_rc = TEMP_FAILURE_RETRY(epoll_wait(epfd.get(), events.data(), events.size(), -1)); in adbconnection_listen()
85 TEMP_FAILURE_RETRY(accept4(s.get(), nullptr, nullptr, SOCK_NONBLOCK | SOCK_CLOEXEC))); in adbconnection_listen()
94 register_event.data.fd = client.get(); in adbconnection_listen()
96 if (epoll_ctl(epfd.get(), EPOLL_CTL_ADD, client.get(), &register_event) != 0) { in adbconnection_listen()
104 [&](const unique_fd& fd) { return fd.get() == event.data.fd; }); in adbconnection_listen()
112 int rc = TEMP_FAILURE_RETRY(recv(it->get(), &process, sizeof(process), MSG_DONTWAIT)); in adbconnection_listen()
120 if (epoll_ctl(epfd.get(), EPOLL_CTL_DEL, event.data.fd, nullptr) != 0) { in adbconnection_listen()
/system/netd/libnetdutils/
DMemBlockTest.cpp37 for (Slice slice = result.get(); !slice.empty(); slice = drop(slice, 1)) { in makeArbitraryMemBlock()
50 Slice slice = block.get(); in checkArbitraryMemBlock()
73 EXPECT_TRUE(empty.get().empty()); in TEST()
74 EXPECT_EQ(nullptr, empty.get().base()); in TEST()
79 EXPECT_TRUE(zero.get().empty()); in TEST()
80 EXPECT_EQ(nullptr, zero.get().base()); in TEST()
85 Slice slice = dnsPacket.get(); in TEST()
106 EXPECT_TRUE(block.get().empty()); in TEST()
107 EXPECT_EQ(nullptr, block.get().base()); in TEST()
111 EXPECT_EQ(SIZE, block2.get().size()); in TEST()
[all …]
/system/netd/libnetdutils/include/netdutils/
DFd.h35 int get() const { return mFd; } in get() function
37 bool operator==(const Fd& other) const { return get() == other.get(); }
38 bool operator!=(const Fd& other) const { return get() != other.get(); }
46 return fd.get() >= 0; in isWellFormed()
/system/update_engine/
Dreal_system_state.h70 CHECK(update_attempter_.get()); in service_observers()
85 return boot_control_.get(); in boot_control()
91 return connection_manager_.get(); in connection_manager()
94 inline HardwareInterface* hardware() override { return hardware_.get(); } in hardware()
100 inline PrefsInterface* prefs() override { return prefs_.get(); } in prefs()
103 return powerwash_safe_prefs_.get(); in powerwash_safe_prefs()
111 return update_attempter_.get(); in update_attempter()
118 inline P2PManager* p2p_manager() override { return p2p_manager_.get(); } in p2p_manager()
121 return update_manager_.get(); in update_manager()
125 return power_manager_.get(); in power_manager()
[all …]
/system/bt/gd/security/
Dpairing_handler_le.cc65 i.OnPairingFinished(std::get<PairingFailure>(phase_1_result)); in PairingMain()
69 auto [pairing_request, pairing_response] = std::get<Phase1Result>(phase_1_result); in PairingMain()
92 i.OnPairingFinished(std::get<PairingFailure>(key_exchange_result)); in PairingMain()
95 auto [PKa, PKb, dhkey] = std::get<KeyExchangeResult>(key_exchange_result); in PairingMain()
101 i.OnPairingFinished(std::get<PairingFailure>(stage1result)); in PairingMain()
106 … std::get<Stage1Result>(stage1result), dhkey); in PairingMain()
108 i.OnPairingFinished(std::get<PairingFailure>(stage_2_result)); in PairingMain()
112 Octet16 ltk = std::get<Octet16>(stage_2_result); in PairingMain()
125 i.OnPairingFinished(std::get<PairingFailure>(stage1result)); in PairingMain()
129 Octet16 tk = std::get<Octet16>(stage1result); in PairingMain()
[all …]
/system/core/adb/tls/
Dtls_connection.cpp97 SSL_shutdown(ssl_.get()); in ~TlsConnectionImpl()
110 return bssl::UniquePtr<EVP_PKEY>(PEM_read_bio_PrivateKey(bio.get(), nullptr, nullptr, nullptr)); in EvpPkeyFromPEM()
121 if (!PEM_read_bio(bio.get(), &name, &header, &data, &data_len)) { in BufferFromPEM()
138 return bssl::UniquePtr<X509>(X509_parse_from_buffer(buffer.get())); in X509FromBuffer()
178 if (ssl_.get() == nullptr) { in ExportKeyingMaterial()
183 if (SSL_export_keying_material(ssl_.get(), out.data(), out.size(), kExportedKeyLabel, in ExportKeyingMaterial()
218 if (ssl_ctx_.get() == nullptr || in DoHandshake()
219 !SSL_CTX_set_min_proto_version(ssl_ctx_.get(), TLS1_3_VERSION) || in DoHandshake()
220 !SSL_CTX_set_max_proto_version(ssl_ctx_.get(), TLS1_3_VERSION)) { in DoHandshake()
227 if (X509_STORE_add_cert(SSL_CTX_get_cert_store(ssl_ctx_.get()), cert.get()) == 0) { in DoHandshake()
[all …]
/system/vold/
DLoop.cpp56 if (ctl_fd.get() == -1) { in create()
61 int num = ioctl(ctl_fd.get(), LOOP_CTL_GET_FREE); in create()
72 if (target_fd.get() != -1) { in create()
77 if (target_fd.get() == -1) { in create()
86 if (device_fd.get() == -1) { in create()
91 if (ioctl(device_fd.get(), LOOP_SET_FD, target_fd.get()) == -1) { in create()
99 if (ioctl(device_fd.get(), LOOP_SET_STATUS64, &li) == -1) { in create()
138 while ((de = readdir(dirp.get()))) { in destroyAll()
144 if (fd.get() == -1) { in destroyAll()
152 if (ioctl(fd.get(), LOOP_GET_STATUS64, &li) < 0) { in destroyAll()
[all …]
/system/chre/util/tests/
Dsingleton_test.cc28 ASSERT_NE(Singleton<int>::get(), nullptr); in TEST()
30 EXPECT_EQ(*Singleton<int>::get(), 0x1337); in TEST()
32 ASSERT_NE(Singleton<int>::get(), nullptr); in TEST()
34 EXPECT_EQ(*Singleton<int>::get(), 0x1337); in TEST()
41 ASSERT_NE(Singleton<int>::get(), nullptr); in TEST()
43 EXPECT_EQ(*Singleton<int>::get(), 0xface); in TEST()
Dunique_ptr_test.cc34 EXPECT_EQ(myInt.get()->value, 0xcafe); in TEST()
52 EXPECT_EQ(std::memcmp(&baseline, myArray.get(), sizeof(baseline)), 0); in TEST()
58 Value *value = myInt.get(); in TEST()
61 EXPECT_EQ(moved.get(), value); in TEST()
62 EXPECT_EQ(myInt.get(), nullptr); in TEST()
79 EXPECT_EQ(myMovedInt.get()->value, 0xcafe); in TEST()
93 value1 = myInt.get(); in TEST()
97 EXPECT_EQ(myInt.get(), nullptr); in TEST()
112 EXPECT_EQ(myInt.get()->value, 0xcafe); in TEST()
115 EXPECT_EQ(myInt.get(), nullptr); in TEST()
[all …]
/system/core/fs_mgr/libsnapshot/
Dsnapuserd.cpp61 struct dm_user_message* msg = (struct dm_user_message*)buf.get(); in daemon_main()
63 memset(buf.get(), 0, buf_size); in daemon_main()
65 ssize_t readed = read(ctrl_fd.get(), buf.get(), buf_size); in daemon_main()
91 memcpy(buf.get(), old_buf.get(), sizeof(*msg)); in daemon_main()
92 msg = (struct dm_user_message*)buf.get(); in daemon_main()
95 if (lseek(block_fd.get(), msg->sector * 512, SEEK_SET) < 0) { in daemon_main()
99 if (!android::base::ReadFully(block_fd.get(), msg->buf, msg->len)) { in daemon_main()
104 if (!android::base::WriteFully(ctrl_fd.get(), buf.get(), sizeof(*msg) + msg->len)) { in daemon_main()

12345678910>>...49