2018-04-28 15:35:53 -04:00
|
|
|
From 1a5bbf0ee895bbd66fb3ce66be44b1074bb20324 Mon Sep 17 00:00:00 2001
|
2018-02-12 03:43:26 -05:00
|
|
|
From: Tad <tad@spotco.us>
|
2018-04-28 15:35:53 -04:00
|
|
|
Date: Wed, 28 Feb 2018 08:21:28 -0500
|
|
|
|
Subject: [PATCH] Build time variable for AES-256 encryption
|
2018-02-12 03:43:26 -05:00
|
|
|
|
2018-04-28 15:35:53 -04:00
|
|
|
Change-Id: I25eba5939c965323e4ffa6d95c6736b671c51e09
|
2018-02-12 03:43:26 -05:00
|
|
|
---
|
2018-04-28 15:35:53 -04:00
|
|
|
Android.mk | 4 ++++
|
|
|
|
cryptfs.cpp | 9 ++++++++-
|
|
|
|
2 files changed, 12 insertions(+), 1 deletion(-)
|
2018-02-12 03:43:26 -05:00
|
|
|
|
|
|
|
diff --git a/Android.mk b/Android.mk
|
2018-04-28 15:35:53 -04:00
|
|
|
index 14bf99a..0e9f3e1 100644
|
2018-02-12 03:43:26 -05:00
|
|
|
--- a/Android.mk
|
|
|
|
+++ b/Android.mk
|
2018-04-28 15:35:53 -04:00
|
|
|
@@ -115,6 +115,10 @@ ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
|
2018-02-12 03:43:26 -05:00
|
|
|
vold_cflags += -DCONFIG_HW_DISK_ENCRYPTION
|
|
|
|
endif
|
|
|
|
|
2018-04-28 15:35:53 -04:00
|
|
|
+ifeq ($(TARGET_WANTS_STRONG_ENCRYPTION),true)
|
|
|
|
+LOCAL_CFLAGS += -DCONFIG_STRONG_ENCRYPTION
|
2018-02-12 03:43:26 -05:00
|
|
|
+endif
|
|
|
|
+
|
2018-02-28 08:22:35 -05:00
|
|
|
ifneq ($(TARGET_EXFAT_DRIVER),)
|
|
|
|
vold_cflags += -DCONFIG_EXFAT_DRIVER=\"$(TARGET_EXFAT_DRIVER)\"
|
|
|
|
mini_src_files += fs/Exfat.cpp
|
2018-02-12 03:43:26 -05:00
|
|
|
diff --git a/cryptfs.cpp b/cryptfs.cpp
|
2018-04-28 15:35:53 -04:00
|
|
|
index f01929a..7fb3ffa 100644
|
2018-02-12 03:43:26 -05:00
|
|
|
--- a/cryptfs.cpp
|
|
|
|
+++ b/cryptfs.cpp
|
2018-04-28 15:35:53 -04:00
|
|
|
@@ -75,9 +75,17 @@ extern "C" {
|
2018-02-12 03:43:26 -05:00
|
|
|
|
|
|
|
#define DM_CRYPT_BUF_SIZE 4096
|
|
|
|
|
2018-04-28 15:35:53 -04:00
|
|
|
+#ifdef CONFIG_STRONG_ENCRYPTION
|
2018-02-12 03:43:26 -05:00
|
|
|
+#define HASH_COUNT 6000
|
|
|
|
+#define KEY_LEN_BYTES 32
|
|
|
|
+#define IV_LEN_BYTES 32
|
|
|
|
+#define RSA_KEY_SIZE 4096
|
|
|
|
+#else
|
|
|
|
#define HASH_COUNT 2000
|
|
|
|
#define KEY_LEN_BYTES 16
|
|
|
|
#define IV_LEN_BYTES 16
|
|
|
|
+#define RSA_KEY_SIZE 2048
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#define KEY_IN_FOOTER "footer"
|
|
|
|
|
2018-04-28 15:35:53 -04:00
|
|
|
@@ -93,7 +101,6 @@ extern "C" {
|
2018-02-12 03:43:26 -05:00
|
|
|
|
|
|
|
#define TABLE_LOAD_RETRIES 10
|
|
|
|
|
|
|
|
-#define RSA_KEY_SIZE 2048
|
|
|
|
#define RSA_KEY_SIZE_BYTES (RSA_KEY_SIZE / 8)
|
|
|
|
#define RSA_EXPONENT 0x10001
|
|
|
|
#define KEYMASTER_CRYPTFS_RATE_LIMIT 1 // Maximum one try per second
|
|
|
|
--
|
2018-04-28 15:35:53 -04:00
|
|
|
2.16.2
|
2018-02-12 03:43:26 -05:00
|
|
|
|