aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/feature_flags.go
diff options
context:
space:
mode:
authorValient Gough2016-10-01 21:14:18 -0700
committerJakob Unterwurzacher2016-10-04 23:18:33 +0200
commitb764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch)
tree22222f3f245d43c1c534a38d7d57b900f50d0e08 /internal/configfile/feature_flags.go
parent31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff)
lint fixes
Diffstat (limited to 'internal/configfile/feature_flags.go')
-rw-r--r--internal/configfile/feature_flags.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/internal/configfile/feature_flags.go b/internal/configfile/feature_flags.go
index ad7bec1..d3601b1 100644
--- a/internal/configfile/feature_flags.go
+++ b/internal/configfile/feature_flags.go
@@ -3,16 +3,24 @@ package configfile
type flagIota int
const (
+ // FlagPlaintextNames indicates that filenames are unencrypted.
FlagPlaintextNames flagIota = iota
+ // FlagDirIV indicates that a per-directory IV file is used.
FlagDirIV
+ // FlagEMENames indicates EME (ECB-Mix-ECB) filename encryption.
+ // This flag is mandatory since gocryptfs v1.0.
FlagEMENames
+ // FlagGCMIV128 indicates 128-bit GCM IVs.
+ // This flag is mandatory since gocryptfs v1.0.
FlagGCMIV128
+ // FlagLongNames allows file names longer than 176 bytes.
FlagLongNames
+ // FlagAESSIV selects an AES-SIV based crypto backend.
FlagAESSIV
)
// knownFlags stores the known feature flags and their string representation
-var knownFlags map[flagIota]string = map[flagIota]string{
+var knownFlags = map[flagIota]string{
FlagPlaintextNames: "PlaintextNames",
FlagDirIV: "DirIV",
FlagEMENames: "EMENames",
@@ -22,7 +30,7 @@ var knownFlags map[flagIota]string = map[flagIota]string{
}
// Filesystems that do not have these feature flags set are deprecated.
-var requiredFlagsNormal []flagIota = []flagIota{
+var requiredFlagsNormal = []flagIota{
FlagDirIV,
FlagEMENames,
FlagGCMIV128,
@@ -30,11 +38,11 @@ var requiredFlagsNormal []flagIota = []flagIota{
// Filesystems without filename encryption obviously don't have or need the
// filename related feature flags.
-var requiredFlagsPlaintextNames []flagIota = []flagIota{
+var requiredFlagsPlaintextNames = []flagIota{
FlagGCMIV128,
}
-// isFeatureFlagKnown verifies that we understand a feature flag
+// isFeatureFlagKnown verifies that we understand a feature flag.
func (cf *ConfFile) isFeatureFlagKnown(flag string) bool {
for _, knownFlag := range knownFlags {
if knownFlag == flag {
@@ -44,7 +52,7 @@ func (cf *ConfFile) isFeatureFlagKnown(flag string) bool {
return false
}
-// isFeatureFlagSet - is the feature flag "flagWant" enabled?
+// IsFeatureFlagSet returns true if the feature flag "flagWant" is enabled.
func (cf *ConfFile) IsFeatureFlagSet(flagWant flagIota) bool {
flagString := knownFlags[flagWant]
for _, flag := range cf.FeatureFlags {