From a8014507b02912468375a50089286e332bf04502 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Tue, 6 May 2014 14:02:48 -0700 Subject: [PATCH] Fix encryption on Nakasi We need to make sure we don't try to read the flags on keymaster version 2 or below, or we get random junk. Requires https://googleplex-android-review.git.corp.google.com/#/c/460689/ Bug: 14384714 Change-Id: I5a4ede1bec0347b8319cedaae6535201c122cf48 --- cryptfs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cryptfs.c b/cryptfs.c index 493a670..0648231 100644 --- a/cryptfs.c +++ b/cryptfs.c @@ -121,6 +121,14 @@ static int keymaster_check_compatibility() goto out; } + SLOGI("keymaster version is %d", keymaster_dev->common.module->module_api_version); + + if (keymaster_dev->common.module->module_api_version + < KEYMASTER_MODULE_API_VERSION_0_3) { + rc = 0; + goto out; + } + if (keymaster_dev->flags & KEYMASTER_BLOBS_ARE_STANDALONE) { rc = 1; }