From 3d30e064baeed895a02477682cce07fb55a16dd2 Mon Sep 17 00:00:00 2001 From: Charles Munson Date: Tue, 22 Mar 2016 14:42:24 +0100 Subject: [PATCH] Choose Block32 by default for Apple and Windows (Issue #8) Default to Block32 when choosing standard or paranoid mode on case-insensitive systems (Apple and Windows) --- encfs/FileUtils.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/encfs/FileUtils.cpp b/encfs/FileUtils.cpp index 8b94d34..9e08397 100644 --- a/encfs/FileUtils.cpp +++ b/encfs/FileUtils.cpp @@ -1016,7 +1016,14 @@ RootPtr createV6Config(EncFS_Context *ctx, const shared_ptr &opts) { keySize = 256; blockSize = DefaultBlockSize; alg = findCipherAlgorithm("AES", keySize); - nameIOIface = BlockNameIO::CurrentInterface(); + + // If case-insensitive system, opt for Block32 filename encoding +#if defined(__APPLE__) || defined(WIN32) + nameIOIface = BlockNameIO::CurrentInterface(true); +#else + nameIOIface = BlockNameIO::CurrentInterface(); +#endif + blockMACBytes = 8; blockMACRandBytes = 0; // using uniqueIV, so this isn't necessary externalIV = true; @@ -1029,7 +1036,13 @@ RootPtr createV6Config(EncFS_Context *ctx, const shared_ptr &opts) { keySize = 192; blockSize = DefaultBlockSize; alg = findCipherAlgorithm("AES", keySize); - nameIOIface = BlockNameIO::CurrentInterface(); + + // If case-insensitive system, opt for Block32 filename encoding +#if defined(__APPLE__) || defined(WIN32) + nameIOIface = BlockNameIO::CurrentInterface(true); +#else + nameIOIface = BlockNameIO::CurrentInterface(); +#endif if (opts->requireMac) { blockMACBytes = 8;