mirror of
https://github.com/vgough/encfs.git
synced 2025-02-06 21:10:08 +01:00
Add comments documenting the filesystem config options
This commit is contained in:
parent
00811625cf
commit
7565fb149a
@ -601,6 +601,9 @@ static Cipher::CipherAlgorithm findCipherAlgorithm(const char *name,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user which cipher to use
|
||||||
|
*/
|
||||||
static Cipher::CipherAlgorithm selectCipherAlgorithm() {
|
static Cipher::CipherAlgorithm selectCipherAlgorithm() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// figure out what cipher they want to use..
|
// figure out what cipher they want to use..
|
||||||
@ -664,6 +667,9 @@ static Cipher::CipherAlgorithm selectCipherAlgorithm() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user which encoding to use for file names
|
||||||
|
*/
|
||||||
static Interface selectNameCoding() {
|
static Interface selectNameCoding() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// figure out what cipher they want to use..
|
// figure out what cipher they want to use..
|
||||||
@ -701,6 +707,9 @@ static Interface selectNameCoding() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user which key size to use
|
||||||
|
*/
|
||||||
static int selectKeySize(const Cipher::CipherAlgorithm &alg) {
|
static int selectKeySize(const Cipher::CipherAlgorithm &alg) {
|
||||||
if (alg.keyLength.min() == alg.keyLength.max()) {
|
if (alg.keyLength.min() == alg.keyLength.max()) {
|
||||||
cout << autosprintf(_("Using key size of %i bits"), alg.keyLength.min())
|
cout << autosprintf(_("Using key size of %i bits"), alg.keyLength.min())
|
||||||
@ -751,6 +760,9 @@ static int selectKeySize(const Cipher::CipherAlgorithm &alg) {
|
|||||||
return keySize;
|
return keySize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user which block size to use
|
||||||
|
*/
|
||||||
static int selectBlockSize(const Cipher::CipherAlgorithm &alg) {
|
static int selectBlockSize(const Cipher::CipherAlgorithm &alg) {
|
||||||
if (alg.blockSize.min() == alg.blockSize.max()) {
|
if (alg.blockSize.min() == alg.blockSize.max()) {
|
||||||
cout << autosprintf(
|
cout << autosprintf(
|
||||||
@ -802,6 +814,9 @@ static bool boolDefaultNo(const char *prompt) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user whether to enable block MAC and random header bytes
|
||||||
|
*/
|
||||||
static void selectBlockMAC(int *macBytes, int *macRandBytes) {
|
static void selectBlockMAC(int *macBytes, int *macRandBytes) {
|
||||||
// xgroup(setup)
|
// xgroup(setup)
|
||||||
bool addMAC = boolDefaultNo(
|
bool addMAC = boolDefaultNo(
|
||||||
@ -852,6 +867,9 @@ static bool boolDefaultYes(const char *prompt) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user if per-file unique IVs should be used
|
||||||
|
*/
|
||||||
static bool selectUniqueIV() {
|
static bool selectUniqueIV() {
|
||||||
// xgroup(setup)
|
// xgroup(setup)
|
||||||
return boolDefaultYes(
|
return boolDefaultYes(
|
||||||
@ -861,6 +879,9 @@ static bool selectUniqueIV() {
|
|||||||
"which rely on block-aligned file io for performance."));
|
"which rely on block-aligned file io for performance."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user if the filename IV should depend on the complete path
|
||||||
|
*/
|
||||||
static bool selectChainedIV() {
|
static bool selectChainedIV() {
|
||||||
// xgroup(setup)
|
// xgroup(setup)
|
||||||
return boolDefaultYes(
|
return boolDefaultYes(
|
||||||
@ -869,6 +890,9 @@ static bool selectChainedIV() {
|
|||||||
"rather then encoding each path element individually."));
|
"rather then encoding each path element individually."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user if the file IV should depend on the file path
|
||||||
|
*/
|
||||||
static bool selectExternalChainedIV() {
|
static bool selectExternalChainedIV() {
|
||||||
// xgroup(setup)
|
// xgroup(setup)
|
||||||
return boolDefaultNo(
|
return boolDefaultNo(
|
||||||
@ -880,6 +904,9 @@ static bool selectExternalChainedIV() {
|
|||||||
"in the filesystem."));
|
"in the filesystem."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask the user if file holes should be passed through
|
||||||
|
*/
|
||||||
static bool selectZeroBlockPassThrough() {
|
static bool selectZeroBlockPassThrough() {
|
||||||
// xgroup(setup)
|
// xgroup(setup)
|
||||||
return boolDefaultYes(
|
return boolDefaultYes(
|
||||||
@ -920,16 +947,17 @@ RootPtr createV6Config(EncFS_Context *ctx, const shared_ptr<EncFS_Opts> &opts) {
|
|||||||
cout << "\n";
|
cout << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int keySize = 0;
|
// documented in ...
|
||||||
int blockSize = 0;
|
int keySize = 0; // selectKeySize()
|
||||||
Cipher::CipherAlgorithm alg;
|
int blockSize = 0; // selectBlockSize()
|
||||||
Interface nameIOIface;
|
Cipher::CipherAlgorithm alg; // selectCipherAlgorithm()
|
||||||
int blockMACBytes = 0;
|
Interface nameIOIface; // selectNameCoding()
|
||||||
int blockMACRandBytes = 0;
|
int blockMACBytes = 0; // selectBlockMAC()
|
||||||
bool uniqueIV = false;
|
int blockMACRandBytes = 0; // selectBlockMAC()
|
||||||
bool chainedIV = false;
|
bool uniqueIV = false; // selectUniqueIV()
|
||||||
bool externalIV = false;
|
bool chainedIV = false; // selectChainedIV()
|
||||||
bool allowHoles = true;
|
bool externalIV = false; // selectExternalChainedIV()
|
||||||
|
bool allowHoles = true; // selectZeroBlockPassThrough()
|
||||||
long desiredKDFDuration = NormalKDFDuration;
|
long desiredKDFDuration = NormalKDFDuration;
|
||||||
|
|
||||||
if (reverseEncryption) {
|
if (reverseEncryption) {
|
||||||
|
Loading…
Reference in New Issue
Block a user