From 72b8b82780c062f48350d743c5ee43ced369507d Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Sun, 5 Oct 2014 12:57:37 -0700 Subject: [PATCH] Reset failed decryption count on successful decryptions Bug: 17866359 Change-Id: I1af2ff1ac4f5243afba0cfa2f2d3a1d0b029091b --- cryptfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cryptfs.c b/cryptfs.c index 84f5587..01dfec3 100644 --- a/cryptfs.c +++ b/cryptfs.c @@ -1784,6 +1784,9 @@ static int test_mount_encrypted_fs(struct crypt_mnt_ftr* crypt_ftr, if (rc == 0) { crypt_ftr->failed_decrypt_count = 0; + if (orig_failed_decrypt_count != 0) { + put_crypt_ftr_and_key(crypt_ftr); + } /* Save the name of the crypto block device * so we can mount it when restarting the framework. */