diff options
author | Valient Gough | 2016-10-01 21:14:18 -0700 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-04 23:18:33 +0200 |
commit | b764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch) | |
tree | 22222f3f245d43c1c534a38d7d57b900f50d0e08 /internal/configfile/config_file.go | |
parent | 31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff) |
lint fixes
Diffstat (limited to 'internal/configfile/config_file.go')
-rw-r--r-- | internal/configfile/config_file.go | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/internal/configfile/config_file.go b/internal/configfile/config_file.go index 9152523..79960e4 100644 --- a/internal/configfile/config_file.go +++ b/internal/configfile/config_file.go @@ -14,31 +14,35 @@ import ( import "os" const ( + // ConfDefaultName is the default configuration file name. // The dot "." is not used in base64url (RFC4648), hence // we can never clash with an encrypted file. ConfDefaultName = "gocryptfs.conf" - // In reverse mode, the config file gets stored next to the plain-text - // files. Make it hidden (start with dot) to not annoy the user. + // ConfReverseName is the default configuration file name in reverse mode, + // the config file gets stored next to the plain-text files. Make it hidden + // (start with dot) to not annoy the user. ConfReverseName = ".gocryptfs.reverse.conf" ) +// ConfFile is the content of a config file. type ConfFile struct { - // gocryptfs version string + // Creator is the gocryptfs version string. // This only documents the config file for humans who look at it. The actual // technical info is contained in FeatureFlags. Creator string - // Encrypted AES key, unlocked using a password hashed with scrypt + // EncryptedKey holds an encrypted AES key, unlocked using a password + // hashed with scrypt EncryptedKey []byte - // Stores parameters for scrypt hashing (key derivation) - ScryptObject scryptKdf - // The On-Disk-Format version this filesystem uses + // ScryptObject stores parameters for scrypt hashing (key derivation) + ScryptObject ScryptKDF + // Version is the On-Disk-Format version this filesystem uses Version uint16 - // List of feature flags this filesystem has enabled. + // FeatureFlags is a list of feature flags this filesystem has enabled. // If gocryptfs encounters a feature flag it does not support, it will refuse // mounting. This mechanism is analogous to the ext4 feature flags that are // stored in the superblock. FeatureFlags []string - // File the config is saved to. Not exported to JSON. + // Filename is the name of the config file. Not exported to JSON. filename string } @@ -162,7 +166,7 @@ func LoadConfFile(filename string, password string) ([]byte, *ConfFile, error) { // cf.ScryptObject. func (cf *ConfFile) EncryptKey(key []byte, password string, logN int) { // Generate derived key from password - cf.ScryptObject = NewScryptKdf(logN) + cf.ScryptObject = NewScryptKDF(logN) scryptHash := cf.ScryptObject.DeriveKey(password) // Lock master key using password-based key |