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
diff --git a/cryptfs.c b/cryptfs.c
index 493a670..0648231 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -121,6 +121,14 @@
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;
}