mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 06:22:53 +00:00
Merge changes Ided4e9bb,I2808441c
* changes: Make libkeymint_remote_prov_support a static dep Add ro.serialno sysprop to JSON output
This commit is contained in:
@@ -84,6 +84,7 @@ cc_test {
|
||||
"android.hardware.security.rkp-V3-ndk",
|
||||
"libgmock",
|
||||
"libgtest_main",
|
||||
"libkeymint_remote_prov_support",
|
||||
],
|
||||
defaults: [
|
||||
"keymint_use_latest_hal_aidl_ndk_shared",
|
||||
@@ -95,6 +96,5 @@ cc_test {
|
||||
"libcrypto",
|
||||
"libjsoncpp",
|
||||
"libkeymaster_portable",
|
||||
"libkeymint_remote_prov_support",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -417,6 +417,7 @@ ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc) {
|
||||
|
||||
JsonOutput jsonEncodeCsrWithBuild(const std::string instance_name, const cppbor::Array& csr) {
|
||||
const std::string kFingerprintProp = "ro.build.fingerprint";
|
||||
const std::string kSerialNoProp = "ro.serialno";
|
||||
|
||||
if (!::android::base::WaitForPropertyCreation(kFingerprintProp)) {
|
||||
return JsonOutput::Error("Unable to read build fingerprint");
|
||||
@@ -441,6 +442,7 @@ JsonOutput jsonEncodeCsrWithBuild(const std::string instance_name, const cppbor:
|
||||
Json::Value json(Json::objectValue);
|
||||
json["name"] = instance_name;
|
||||
json["build_fingerprint"] = ::android::base::GetProperty(kFingerprintProp, /*default=*/"");
|
||||
json["serialno"] = ::android::base::GetProperty(kSerialNoProp, /*default=*/"");
|
||||
json["csr"] = base64.data(); // Boring writes a NUL-terminated c-string
|
||||
|
||||
Json::StreamWriterBuilder factory;
|
||||
|
||||
@@ -191,7 +191,8 @@ TEST(RemoteProvUtilsTest, JsonEncodeCsr) {
|
||||
|
||||
std::string expected = R"({"build_fingerprint":")" +
|
||||
::android::base::GetProperty("ro.build.fingerprint", /*default=*/"") +
|
||||
R"(","csr":"gQE=","name":"test"})";
|
||||
R"(","csr":"gQE=","name":"test","serialno":")" +
|
||||
::android::base::GetProperty("ro.serialno", /*default=*/"") + R"("})";
|
||||
|
||||
ASSERT_EQ(json, expected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user