Revert "Fix a segfault when password is zero length."

The change intended to fix a segfault when encfs is passed a zero-length
password (https://github.com/vgough/encfs/issues/241).

However, it also changed the CLI ABI which caused breakage in Cryptkeeper
(https://github.com/tomm/cryptkeeper/issues/23) and other third-party
projects that call EncFS.

Fixes https://github.com/vgough/encfs/issues/280 .

This reverts commit c3a7da5eff.
This commit is contained in:
Jakob Unterwurzacher 2017-02-05 13:43:10 +01:00
parent ecc364df0d
commit e9592fade4

View File

@ -956,9 +956,7 @@ RootPtr createV6Config(EncFS_Context *ctx,
const std::string passwordProgram = opts->passwordProgram;
bool useStdin = opts->useStdin;
bool reverseEncryption = opts->reverseEncryption;
ConfigMode configMode = (useStdin &&
opts->configMode == Config_Prompt) ? Config_Standard
: opts->configMode;
ConfigMode configMode = opts->configMode;
bool annotate = opts->annotate;
RootPtr rootInfo;
@ -1171,9 +1169,6 @@ RootPtr createV6Config(EncFS_Context *ctx,
else
userKey = config->getNewUserKey();
if (userKey == nullptr)
return rootInfo;
cipher->writeKey(volumeKey, encodedKey, userKey);
userKey.reset();