Home
last modified time | relevance | path

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

12345678910>>...40

/system/core/base/
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 …]
/system/keymaster/km_openssl/
Dattestation_utils.cpp157 if (!result.get()) return {}; in makeCertChain()
176 if (!oid.get()) in build_attestation_extension()
187 if (!attest_str.get() || in build_attestation_extension()
188 !ASN1_OCTET_STRING_set(attest_str.get(), attest_bytes.get(), attest_bytes_len)) in build_attestation_extension()
192 X509_EXTENSION_create_by_OBJ(nullptr, oid.get(), 0 /* not critical */, attest_str.get())); in build_attestation_extension()
193 if (!extension->get()) in build_attestation_extension()
207 if (!ASN1_BIT_STRING_set_bit(key_usage.get(), i, 0)) { in add_key_usage_extension()
216 if (!ASN1_BIT_STRING_set_bit(key_usage.get(), kDigitalSignatureKeyUsageBit, 1)) { in add_key_usage_extension()
225 if (!ASN1_BIT_STRING_set_bit(key_usage.get(), kKeyEnciphermentKeyUsageBit, 1) || in add_key_usage_extension()
226 !ASN1_BIT_STRING_set_bit(key_usage.get(), kDataEnciphermentKeyUsageBit, 1)) { in add_key_usage_extension()
[all …]
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 …]
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()
Dec_key_factory.cpp96 if (ec_key.get() == nullptr || pkey.get() == nullptr) in GenerateKey()
100 if (group.get() == nullptr) { in GenerateKey()
106 EC_GROUP_set_point_conversion_form(group.get(), POINT_CONVERSION_UNCOMPRESSED); in GenerateKey()
107 EC_GROUP_set_asn1_flag(group.get(), OPENSSL_EC_NAMED_CURVE); in GenerateKey()
110 if (EC_KEY_set_group(ec_key.get(), group.get()) != 1 || in GenerateKey()
111 EC_KEY_generate_key(ec_key.get()) != 1 || EC_KEY_check_key(ec_key.get()) < 0) { in GenerateKey()
115 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get()) != 1) in GenerateKey()
119 error = EvpKeyToKeyMaterial(pkey.get(), &key_material); in GenerateKey()
161 UniquePtr<EC_KEY, EC_KEY_Delete> ec_key(EVP_PKEY_get1_EC_KEY(pkey.get())); in UpdateImportKeyDescription()
162 if (!ec_key.get()) in UpdateImportKeyDescription()
[all …]
Diso18033kdf.cpp43 if (!counter.get() || !digest_result.get()) return false; in GenerateKey()
56 if (!EVP_DigestUpdate(&ctx, secret_key_.get(), secret_key_len_) || in GenerateKey()
57 !Uint32ToBigEndianByteArray(block + start_counter_, counter.get()) || in GenerateKey()
58 !EVP_DigestUpdate(&ctx, counter.get(), 4)) in GenerateKey()
67 if (!EVP_DigestFinal_ex(&ctx, digest_result.get(), &uint32_digest_size_) || in GenerateKey()
73 memcpy(output + block_start, digest_result.get(), block_length); in GenerateKey()
/system/gatekeeper/tests/
Dgatekeeper_messages_test.cpp56 msg.Serialize(serialized_msg.buffer.get(), serialized_msg.buffer.get() + serialized_msg.length); in TEST()
59 deserialized_msg.Deserialize(serialized_msg.buffer.get(), serialized_msg.buffer.get() in TEST()
68 …ASSERT_EQ(0, memcmp(msg.provided_password.buffer.get(), deserialized_password->buffer.get(), passw… in TEST()
70 ASSERT_EQ(NULL, deserialized_msg.enrolled_password.buffer.get()); in TEST()
72 ASSERT_EQ(NULL, deserialized_msg.password_handle.buffer.get()); in TEST()
85 msg.Serialize(serialized_msg.buffer.get(), serialized_msg.buffer.get() + serialized_msg.length); in TEST()
88 deserialized_msg.Deserialize(serialized_msg.buffer.get(), serialized_msg.buffer.get() in TEST()
97 …ASSERT_EQ(0, memcmp(msg.provided_password.buffer.get(), deserialized_password->buffer.get(), passw… in TEST()
99 ASSERT_EQ(NULL, deserialized_msg.enrolled_password.buffer.get()); in TEST()
101 ASSERT_EQ(NULL, deserialized_msg.password_handle.buffer.get()); in TEST()
[all …]
/system/core/libunwindstack/tests/
DRegsTest.cpp97 EXPECT_EQ(4U, arm64.GetPcAdjustment(0x10, elf_.get())); in TEST_F()
98 EXPECT_EQ(4U, arm64.GetPcAdjustment(0x4, elf_.get())); in TEST_F()
99 EXPECT_EQ(0U, arm64.GetPcAdjustment(0x3, elf_.get())); in TEST_F()
100 EXPECT_EQ(0U, arm64.GetPcAdjustment(0x2, elf_.get())); in TEST_F()
101 EXPECT_EQ(0U, arm64.GetPcAdjustment(0x1, elf_.get())); in TEST_F()
102 EXPECT_EQ(0U, arm64.GetPcAdjustment(0x0, elf_.get())); in TEST_F()
105 EXPECT_EQ(1U, x86.GetPcAdjustment(0x100, elf_.get())); in TEST_F()
106 EXPECT_EQ(1U, x86.GetPcAdjustment(0x2, elf_.get())); in TEST_F()
107 EXPECT_EQ(1U, x86.GetPcAdjustment(0x1, elf_.get())); in TEST_F()
108 EXPECT_EQ(0U, x86.GetPcAdjustment(0x0, elf_.get())); in TEST_F()
[all …]
/system/netd/resolv/dns_responder/
Ddns_tls_frontend.cpp84 if (!BN_set_word(e.get(), RSA_F4)) { in make_private_key()
94 if (!RSA_generate_key_ex(rsa.get(), 2048, e.get(), nullptr)) { in make_private_key()
104 if(!EVP_PKEY_assign_RSA(privkey.get(), rsa.get())) { in make_private_key()
121 ASN1_INTEGER_set(X509_get_serialNumber(cert.get()), 1); in make_cert()
124 X509_gmtime_adj(X509_get_notBefore(cert.get()), 0); in make_cert()
125 X509_gmtime_adj(X509_get_notAfter(cert.get()), 60 * 60); in make_cert()
127 X509_set_pubkey(cert.get(), privkey); in make_cert()
129 if (!X509_sign(cert.get(), parent_key, EVP_sha256())) { in make_cert()
155 SSL_CTX_set_ecdh_auto(ctx_.get(), 1); in startServer()
165 certs[i] = make_cert(keys[i].get(), keys[next].get()); in startServer()
[all …]
/system/keymaster/key_blob_utils/
Docb_utils.cpp42 ae_ctx* get() { return ctx_; } in get() function in keymaster::AeCtx
56 if (!derivation_data->get()) in BuildDerivationData()
59 uint8_t* buf = derivation_data->get(); in BuildDerivationData()
60 uint8_t* end = derivation_data->get() + *derivation_data_length; in BuildDerivationData()
82 if (!hash_buf.get()) in InitializeKeyWrappingContext()
84 Eraser hash_eraser(hash_buf.get(), SHA256_DIGEST_LENGTH); in InitializeKeyWrappingContext()
86 if (!derived_key.get()) in InitializeKeyWrappingContext()
88 Eraser derived_key_eraser(derived_key.get(), AES_BLOCK_SIZE); in InitializeKeyWrappingContext()
90 if (!ctx->get() || !hash_buf.get() || !derived_key.get()) in InitializeKeyWrappingContext()
96 SHA256_Update(&sha256_ctx, derivation_data.get(), derivation_data_length); in InitializeKeyWrappingContext()
[all …]
/system/apex/apexd/
Dapexd_loop.cpp59 if (device_fd.get() != -1) { in MaybeCloseBad()
61 if (ioctl(device_fd.get(), LOOP_CLR_FD) == -1) { in MaybeCloseBad()
79 if (sysfs_fd.get() == -1) { in configureReadAhead()
84 write(sysfs_fd.get(), kReadAheadKb, strlen(kReadAheadKb) + 1)); in configureReadAhead()
99 if (ctl_fd.get() == -1) { in preAllocateLoopDevices()
110 int ret = ioctl(ctl_fd.get(), LOOP_CTL_ADD, id); in preAllocateLoopDevices()
132 if (ctl_fd.get() == -1) { in createLoopDevice()
136 int num = ioctl(ctl_fd.get(), LOOP_CTL_GET_FREE); in createLoopDevice()
144 if (target_fd.get() == -1) { in createLoopDevice()
153 if (sysfs_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 …]
Dreal_state.h47 ConfigProvider* config_provider() override { return config_provider_.get(); } in config_provider()
49 return device_policy_provider_.get(); in device_policy_provider()
51 RandomProvider* random_provider() override { return random_provider_.get(); } in random_provider()
52 ShillProvider* shill_provider() override { return shill_provider_.get(); } in shill_provider()
53 SystemProvider* system_provider() override { return system_provider_.get(); } in system_provider()
54 TimeProvider* time_provider() override { return time_provider_.get(); } in time_provider()
56 return updater_provider_.get(); in updater_provider()
/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/netd/resolv/
DDnsTlsSocket.cpp78 if (mSslFd.get() == -1) { in tcpConnect()
84 if (setsockopt(mSslFd.get(), SOL_SOCKET, SO_MARK, &mMark, len) == -1) { in tcpConnect()
90 const Status tfo = enableSockopt(mSslFd.get(), SOL_TCP, TCP_FASTOPEN_CONNECT); in tcpConnect()
96 enableTcpKeepAlives(mSslFd.get(), 15U, 5U, 3U).ignoreError(); in tcpConnect()
98 if (connect(mSslFd.get(), reinterpret_cast<const struct sockaddr *>(&mServer.ss), in tcpConnect()
147 if (SSL_CTX_load_verify_locations(mSslCtx.get(), nullptr, kCaCertDir) != 1) { in initialize()
153 SSL_CTX_set_false_start_allowed_without_alpn(mSslCtx.get(), 1); in initialize()
154 SSL_CTX_set_mode(mSslCtx.get(), SSL_MODE_ENABLE_FALSE_START); in initialize()
157 mCache->prepareSslContext(mSslCtx.get()); in initialize()
164 mSsl = sslConnect(mSslFd.get()); in initialize()
[all …]
/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()
DHandle.h53 const T get() const { return mValue; } in get() function
55 bool operator==(const Handle& that) const { return get() == that.get(); }
56 bool operator!=(const Handle& that) const { return get() != that.get(); }
68 return os << handle.get();
/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/vold/
DLoop.cpp52 if (ctl_fd.get() == -1) { in create()
57 int num = ioctl(ctl_fd.get(), LOOP_CTL_GET_FREE); in create()
68 if (target_fd.get() != -1) { in create()
73 if (target_fd.get() == -1) { in create()
78 if (device_fd.get() == -1) { in create()
83 if (ioctl(device_fd.get(), LOOP_SET_FD, target_fd.get()) == -1) { in create()
91 if (ioctl(device_fd.get(), LOOP_SET_STATUS64, &li) == -1) { in create()
130 while ((de = readdir(dirp.get()))) { in destroyAll()
136 if (fd.get() == -1) { in destroyAll()
144 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 …]

12345678910>>...40