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)
This commit is contained in:
Charles Munson 2016-03-22 14:42:24 +01:00
parent b015f0c294
commit 3d30e064ba

View File

@ -1016,7 +1016,14 @@ RootPtr createV6Config(EncFS_Context *ctx, const shared_ptr<EncFS_Opts> &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<EncFS_Opts> &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;