From 8561b5c9f5d2f9c5e3f8e2963bdffe9ff3706b04 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Mon, 17 Mar 2014 14:10:51 -0700 Subject: [PATCH] Fix setfield/getfield Check for versions >= feature version, not equal Bug: 13526708 Change-Id: Ie07f6334e6b7c5ca0d7f83ba00827a508e2c2963 --- cryptfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cryptfs.c b/cryptfs.c index f8d14cf..afa168e 100644 --- a/cryptfs.c +++ b/cryptfs.c @@ -516,7 +516,8 @@ static int load_persistent_data(void) return -1; } - if ((crypt_ftr.major_version != 1) || (crypt_ftr.minor_version != 1)) { + if ((crypt_ftr.major_version < 1) + || (crypt_ftr.major_version == 1 && crypt_ftr.minor_version < 1)) { SLOGE("Crypt_ftr version doesn't support persistent data"); return -1; } @@ -597,7 +598,8 @@ static int save_persistent_data(void) return -1; } - if ((crypt_ftr.major_version != 1) || (crypt_ftr.minor_version != 1)) { + if ((crypt_ftr.major_version < 1) + || (crypt_ftr.major_version == 1 && crypt_ftr.minor_version < 1)) { SLOGE("Crypt_ftr version doesn't support persistent data"); return -1; }