• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/hardware/interfaces


Commit MetaInfo

Révision520212559613514b95313488b644b6570a634c35 (tree)
l'heure2017-11-19 17:38:52
Auteurandroid-build-team Robot <android-build-team-robot@goog...>
Commiterandroid-build-team Robot

Message de Log

Snap for 4459973 from 7ebf2fb767add88b679dde17ba730319037b755d to pi-release

Change-Id: Ibe50f3cf1c6115852d76a481d6e21d9b3017e356

Change Summary

Modification

--- a/wifi/keystore/1.0/default/include/wifikeystorehal/keystore.h
+++ b/wifi/keystore/1.0/default/include/wifikeystorehal/keystore.h
@@ -5,7 +5,7 @@
55 #include <hidl/MQDescriptor.h>
66 #include <hidl/Status.h>
77
8-#include <keystore/IKeystoreService.h>
8+#include <android/security/IKeystoreService.h>
99 #include <binder/IServiceManager.h>
1010
1111 namespace android {
--- a/wifi/keystore/1.0/default/keystore.cpp
+++ b/wifi/keystore/1.0/default/keystore.cpp
@@ -1,8 +1,9 @@
11 #include <android-base/logging.h>
2+#include <android/security/IKeystoreService.h>
23 #include <binder/IServiceManager.h>
3-#include <keystore/IKeystoreService.h>
44 #include <private/android_filesystem_config.h>
55
6+#include <vector>
67 #include "include/wifikeystorehal/keystore.h"
78
89 namespace android {
@@ -11,63 +12,61 @@ namespace wifi {
1112 namespace keystore {
1213 namespace V1_0 {
1314 namespace implementation {
15+
16+using security::IKeystoreService;
1417 // Methods from ::android::hardware::wifi::keystore::V1_0::IKeystore follow.
1518 Return<void> Keystore::getBlob(const hidl_string& key, getBlob_cb _hidl_cb) {
16- sp<IKeystoreService> service = interface_cast<IKeystoreService>(
17- defaultServiceManager()->getService(
18- String16("android.security.keystore")));
19- if (service == nullptr) {
20- _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
21- return Void();
22- }
23- hidl_vec<uint8_t> value;
24- // Retrieve the blob as wifi user.
25- auto ret = service->get(String16(key.c_str()), AID_WIFI, &value);
26- if (!ret.isOk()) {
27- _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
19+ sp<IKeystoreService> service = interface_cast<IKeystoreService>(
20+ defaultServiceManager()->getService(String16("android.security.keystore")));
21+ if (service == nullptr) {
22+ _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
23+ return Void();
24+ }
25+ ::std::vector<uint8_t> value;
26+ // Retrieve the blob as wifi user.
27+ auto ret = service->get(String16(key.c_str()), AID_WIFI, &value);
28+ if (!ret.isOk()) {
29+ _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
30+ return Void();
31+ }
32+ _hidl_cb(KeystoreStatusCode::SUCCESS, (hidl_vec<uint8_t>)value);
2833 return Void();
29- }
30- _hidl_cb(KeystoreStatusCode::SUCCESS, value);
31- return Void();
3234 }
3335
34-Return<void> Keystore::getPublicKey(
35- const hidl_string& keyId, getPublicKey_cb _hidl_cb) {
36- sp<IKeystoreService> service = interface_cast<IKeystoreService>(
37- defaultServiceManager()->getService(
38- String16("android.security.keystore")));
39- if (service == nullptr) {
40- _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
41- return Void();
42- }
43- hidl_vec<uint8_t> pubkey;
44- auto ret = service->get_pubkey(String16(keyId.c_str()), &pubkey);
45- if (!ret.isOk()) {
46- _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
36+Return<void> Keystore::getPublicKey(const hidl_string& keyId, getPublicKey_cb _hidl_cb) {
37+ sp<IKeystoreService> service = interface_cast<IKeystoreService>(
38+ defaultServiceManager()->getService(String16("android.security.keystore")));
39+ if (service == nullptr) {
40+ _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
41+ return Void();
42+ }
43+ ::std::vector<uint8_t> pubkey;
44+ auto ret = service->get_pubkey(String16(keyId.c_str()), &pubkey);
45+ if (!ret.isOk()) {
46+ _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
47+ return Void();
48+ }
49+ _hidl_cb(KeystoreStatusCode::SUCCESS, (hidl_vec<uint8_t>)pubkey);
4750 return Void();
48- }
49- _hidl_cb(KeystoreStatusCode::SUCCESS, pubkey);
50- return Void();
5151 }
5252
53-Return<void> Keystore::sign(
54- const hidl_string& keyId, const hidl_vec<uint8_t>& dataToSign,
55- sign_cb _hidl_cb) {
56- sp<IKeystoreService> service = interface_cast<IKeystoreService>(
57- defaultServiceManager()->getService(
58- String16("android.security.keystore")));
59- if (service == nullptr) {
60- _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
61- return Void();
62- }
63- hidl_vec<uint8_t> signedData;
64- auto ret = service->sign(String16(keyId.c_str()), dataToSign, &signedData);
65- if (!ret.isOk()) {
66- _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
53+Return<void> Keystore::sign(const hidl_string& keyId, const hidl_vec<uint8_t>& dataToSign,
54+ sign_cb _hidl_cb) {
55+ sp<IKeystoreService> service = interface_cast<IKeystoreService>(
56+ defaultServiceManager()->getService(String16("android.security.keystore")));
57+ if (service == nullptr) {
58+ _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
59+ return Void();
60+ }
61+ ::std::vector<uint8_t> signedData;
62+
63+ auto ret = service->sign(String16(keyId.c_str()), dataToSign, &signedData);
64+ if (!ret.isOk()) {
65+ _hidl_cb(KeystoreStatusCode::ERROR_UNKNOWN, {});
66+ return Void();
67+ }
68+ _hidl_cb(KeystoreStatusCode::SUCCESS, (hidl_vec<uint8_t>)signedData);
6769 return Void();
68- }
69- _hidl_cb(KeystoreStatusCode::SUCCESS, signedData);
70- return Void();
7170 }
7271
7372 IKeystore* HIDL_FETCH_IKeystore(const char* /* name */) {