summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-11-07 10:42:32 -0700
committerLinux Build Service Account <lnxbuild@localhost>2016-11-07 10:42:32 -0700
commit9e0d088591c891cf4a5c2c25ed46b3a56c89f421 (patch)
tree95257f7528b20bca93fd8d47575e7c2dbb3969ec
parent04c5e5ae37102cdada2cc9ff082a464248058768 (diff)
parent29471e09a0026b4ea5763470dfc0ad59eaf55fb5 (diff)
downloadandroid_system_security-staging/cm-14.1-cafrebase.tar.gz
android_system_security-staging/cm-14.1-cafrebase.tar.bz2
android_system_security-staging/cm-14.1-cafrebase.zip
Merge 29471e09a0026b4ea5763470dfc0ad59eaf55fb5 on remote branchstaging/cm-14.1-cafrebase
Change-Id: I3a4c466a50a9f90e1e163d92407ed502a27d0a1f
-rw-r--r--keystore/key_store_service.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index ba0182c..30faf72 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -607,6 +607,32 @@ int32_t KeyStoreService::generateKey(const String16& name, const KeymasterArgume
const auto* device = mKeyStore->getDevice();
const auto* fallback = mKeyStore->getFallbackDevice();
std::vector<keymaster_key_param_t> opParams(params.params);
+
+ for (auto param: params.params)
+ {
+ switch (param.tag) {
+ case KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY:
+ {
+ uid_t callingUid = IPCThreadState::self()->getCallingUid();
+ Blob keyBlob;
+ String8 name8(reinterpret_cast<const char*>(param.blob.data),
+ param.blob.data_length);
+ ResponseCode responseCode = mKeyStore->getKeyForName(&keyBlob,
+ name8, callingUid, TYPE_KEYMASTER_10);
+ if (responseCode != ::NO_ERROR) {
+ return responseCode;
+ }
+ opParams.push_back(keymaster_param_blob(
+ KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY_BLOB,
+ keyBlob.getValue(),
+ keyBlob.getLength()));
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
const keymaster_key_param_set_t inParams = {opParams.data(), opParams.size()};
if (device == NULL) {
return ::SYSTEM_ERROR;