Skip to content

Commit

Permalink
writeV6Config: cast booleans to int
Browse files Browse the repository at this point in the history
The tinyxml2 library used by Arch Linux represents
booleans as "true" and "false" instead of "0" and "1".

These fail to load when read back later and will always be
interpreted as false, as seen in
#343 .

Cast the booleans to int to force representation
as "0" and "1" in all tinyxml2 variants.
  • Loading branch information
rfjakob committed Jul 19, 2017
1 parent 64b01a0 commit 3bfaf79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions encfs/FileUtils.cpp
Expand Up @@ -536,12 +536,12 @@ bool writeV6Config(const char *configFile, const EncFSConfig *cfg) {
addEl(doc, config, "nameAlg", cfg->nameIface);
addEl(doc, config, "keySize", cfg->keySize);
addEl(doc, config, "blockSize", cfg->blockSize);
addEl(doc, config, "uniqueIV", cfg->uniqueIV);
addEl(doc, config, "chainedNameIV", cfg->chainedNameIV);
addEl(doc, config, "externalIVChaining", cfg->externalIVChaining);
addEl(doc, config, "uniqueIV", (int)cfg->uniqueIV);
addEl(doc, config, "chainedNameIV", (int)cfg->chainedNameIV);
addEl(doc, config, "externalIVChaining", (int)cfg->externalIVChaining);
addEl(doc, config, "blockMACBytes", cfg->blockMACBytes);
addEl(doc, config, "blockMACRandBytes", cfg->blockMACRandBytes);
addEl(doc, config, "allowHoles", cfg->allowHoles);
addEl(doc, config, "allowHoles", (int)cfg->allowHoles);
addEl(doc, config, "encodedKeySize", (int)cfg->keyData.size());
addEl(doc, config, "encodedKeyData", cfg->keyData);
addEl(doc, config, "saltLen", (int)cfg->salt.size());
Expand Down

0 comments on commit 3bfaf79

Please sign in to comment.