From 4d47306b29de7e874dd31f871fc35c031f465d6c Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Sun, 7 Feb 2021 13:00:26 +0100 Subject: [PATCH] Opening reverse mode volumes --- app/build.gradle | 2 +- app/libgocryptfs/main.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 630025a..ec6ab60 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,7 +15,7 @@ android { applicationId "sushi.hardcore.droidfs" minSdkVersion 21 targetSdkVersion 29 - versionCode 8 + versionCode 9 versionName "1.4.1" ndk { diff --git a/app/libgocryptfs/main.go b/app/libgocryptfs/main.go index 78d387b..55bdf71 100644 --- a/app/libgocryptfs/main.go +++ b/app/libgocryptfs/main.go @@ -475,7 +475,7 @@ func truncate(sessionID, handleID int, newSize uint64) bool { return true } -func init_new_session(root_cipher_dir string, masterkey []byte) int { +func init_new_session(root_cipher_dir string, masterkey []byte, cf *configfile.ConfFile) int { // Initialize EME for filename encryption. var emeCipher *eme.EMECipher var err error @@ -492,7 +492,9 @@ func init_new_session(root_cipher_dir string, masterkey []byte) int { // Initialize contentEnc cryptoBackend := cryptocore.BackendGoGCM - if stupidgcm.PreferOpenSSL() { + if cf.IsFeatureFlagSet(configfile.FlagAESSIV) { + cryptoBackend = cryptocore.BackendAESSIV + } else if stupidgcm.PreferOpenSSL() { cryptoBackend = cryptocore.BackendOpenSSL } forcedecode := false @@ -535,7 +537,7 @@ func gcf_init(root_cipher_dir string, password, givenScryptHash, returnedScryptH if err == nil { masterkey := cf.GetMasterkey(password, givenScryptHash, returnedScryptHashBuff) if masterkey != nil { - sessionID = init_new_session(root_cipher_dir, masterkey) + sessionID = init_new_session(root_cipher_dir, masterkey, cf) wipe(masterkey) } }