mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-25 23:49:32 -05:00
9a6c3f99ed
- No patches were found with incorrect authorship/From: lines - The older AndroidHardening patch repos are no longer available to verify CID. - New GrapheneOS patches do not include a CID. - *Signature_Spoofing.patch CID could not be found. - Fixed CID of *Harden_Sig_Spoofing.patch to match 14.1 - Fixed CID of *LGE_Fixes.patch to match 14.1 - Fixed CID of *Harden.patch to match 14.1 - Added edit note to *Harden.patch - Fixed CID of *PREREQ_Handle_All_Modes.patch to match 14.1 - Fixed CID of *More_Preferred_Network_Modes.patch to match 14.1 - Fixed CID of *AES256.patch to match 14.1 - Fixed CID of *0001-OTA_Keys.patch to match 18.1 - Fixed CID of *Camera_Fix.patch to match 15.1 - Fixed CID of *Connectivity.patch to match 14.1 - Fixed CID of *Fix_Calling.patch to match 14.1 - Fixed CID of *Remove_Analytics.patch to match 14.1 - Fixed CID of Unused-*.patch/audio_extn to match original Signed-off-by: Tad <tad@spotco.us>
57 lines
1.5 KiB
Diff
57 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Tad <tad@spotco.us>
|
|
Date: Wed, 28 Feb 2018 08:21:28 -0500
|
|
Subject: [PATCH] Build time variable for AES-256 encryption
|
|
|
|
Change-Id: Ib2d53a1d22e935ef0fa5f0f91e3bf5308d9c6459
|
|
---
|
|
Android.mk | 4 ++++
|
|
cryptfs.cpp | 9 ++++++++-
|
|
2 files changed, 12 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/Android.mk b/Android.mk
|
|
index 2beae28..25fd823 100644
|
|
--- a/Android.mk
|
|
+++ b/Android.mk
|
|
@@ -115,6 +115,10 @@ ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
|
|
vold_cflags += -DCONFIG_HW_DISK_ENCRYPTION
|
|
endif
|
|
|
|
+ifeq ($(TARGET_WANTS_STRONG_ENCRYPTION),true)
|
|
+LOCAL_CFLAGS += -DCONFIG_STRONG_ENCRYPTION
|
|
+endif
|
|
+
|
|
ifneq ($(TARGET_EXFAT_DRIVER),)
|
|
vold_cflags += -DCONFIG_EXFAT_DRIVER=\"$(TARGET_EXFAT_DRIVER)\"
|
|
mini_src_files += fs/Exfat.cpp
|
|
diff --git a/cryptfs.cpp b/cryptfs.cpp
|
|
index e33afdd..5102f12 100644
|
|
--- a/cryptfs.cpp
|
|
+++ b/cryptfs.cpp
|
|
@@ -75,9 +75,17 @@ extern "C" {
|
|
|
|
#define DM_CRYPT_BUF_SIZE 4096
|
|
|
|
+#ifdef CONFIG_STRONG_ENCRYPTION
|
|
+#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"
|
|
|
|
@@ -93,7 +101,6 @@ extern "C" {
|
|
|
|
#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
|