Actually pass attestation requests through to keystore.
Bug: 22914603
Change-Id: I49f2386943c90cd29a80556fd48087793dd5ca66
diff --git a/keystore/IKeystoreService.cpp b/keystore/IKeystoreService.cpp
index 6dc6147..384e423 100644
--- a/keystore/IKeystoreService.cpp
+++ b/keystore/IKeystoreService.cpp
@@ -269,7 +269,6 @@
out->writeInt32(chain.entry_count);
for (size_t i = 0; i < chain.entry_count; ++i) {
if (chain.entries[i].data) {
- out->writeInt32(1); // Tell Java side that object is not NULL
out->writeInt32(chain.entries[i].data_length);
void* buf = out->writeInplace(chain.entries[i].data_length);
if (buf) {
@@ -1847,6 +1846,22 @@
return NO_ERROR;
}
+ case ATTEST_KEY: {
+ CHECK_INTERFACE(IKeystoreService, data, reply);
+ String16 name = data.readString16();
+ KeymasterArguments params;
+ if (data.readInt32() != 0) {
+ params.readFromParcel(data);
+ }
+ KeymasterCertificateChain chain;
+ int ret = attestKey(name, params, &chain);
+ reply->writeNoException();
+ reply->writeInt32(ret);
+ reply->writeInt32(1);
+ chain.writeToParcel(reply);
+
+ return NO_ERROR;
+ }
default:
return BBinder::onTransact(code, data, reply, flags);
}