Opening reverse mode volumes

This commit is contained in:
Matéo Duparc 2021-02-07 13:00:26 +01:00
parent 1dbf94b83f
commit 4d47306b29
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E
2 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ android {
applicationId "sushi.hardcore.droidfs"
minSdkVersion 21
targetSdkVersion 29
versionCode 8
versionCode 9
versionName "1.4.1"
ndk {

View File

@ -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)
}
}