Simplify CreateConfFile: do not allow specification of EMENames
This commit is contained in:
parent
ccf6d00728
commit
b4b9072cc2
@ -33,9 +33,10 @@ type ConfFile struct {
|
|||||||
// CreateConfFile - create a new config with a random key encrypted with
|
// CreateConfFile - create a new config with a random key encrypted with
|
||||||
// "password" and write it to "filename".
|
// "password" and write it to "filename".
|
||||||
// Uses scrypt with cost parameter logN.
|
// Uses scrypt with cost parameter logN.
|
||||||
func CreateConfFile(filename string, password string, plaintextNames bool, logN int, EMENames bool) error {
|
func CreateConfFile(filename string, password string, plaintextNames bool, logN int) error {
|
||||||
var cf ConfFile
|
var cf ConfFile
|
||||||
cf.filename = filename
|
cf.filename = filename
|
||||||
|
cf.Version = HEADER_CURRENT_VERSION
|
||||||
|
|
||||||
// Generate new random master key
|
// Generate new random master key
|
||||||
key := RandBytes(KEY_LEN)
|
key := RandBytes(KEY_LEN)
|
||||||
@ -44,10 +45,7 @@ func CreateConfFile(filename string, password string, plaintextNames bool, logN
|
|||||||
// This sets ScryptObject and EncryptedKey
|
// This sets ScryptObject and EncryptedKey
|
||||||
cf.EncryptKey(key, password, logN)
|
cf.EncryptKey(key, password, logN)
|
||||||
|
|
||||||
// Set defaults
|
// Set feature flags
|
||||||
cf.Version = HEADER_CURRENT_VERSION
|
|
||||||
|
|
||||||
// Set values chosen by the user
|
|
||||||
if plaintextNames {
|
if plaintextNames {
|
||||||
cf.FeatureFlags = append(cf.FeatureFlags, FlagPlaintextNames)
|
cf.FeatureFlags = append(cf.FeatureFlags, FlagPlaintextNames)
|
||||||
} else {
|
} else {
|
||||||
|
@ -59,7 +59,7 @@ func TestLoadV2StrangeFeature(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateConfFile(t *testing.T) {
|
func TestCreateConfFile(t *testing.T) {
|
||||||
err := CreateConfFile("config_test/tmp.conf", "test", false, 10, true)
|
err := CreateConfFile("config_test/tmp.conf", "test", false, 10)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
4
main.go
4
main.go
@ -55,7 +55,7 @@ func initDir(args *argContainer) {
|
|||||||
// Create gocryptfs.conf
|
// Create gocryptfs.conf
|
||||||
cryptfs.Info.Printf("Choose a password for protecting your files.\n")
|
cryptfs.Info.Printf("Choose a password for protecting your files.\n")
|
||||||
password := readPasswordTwice(args.extpass)
|
password := readPasswordTwice(args.extpass)
|
||||||
err = cryptfs.CreateConfFile(args.config, password, args.plaintextnames, args.scryptn, args.emenames)
|
err = cryptfs.CreateConfFile(args.config, password, args.plaintextnames, args.scryptn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(ERREXIT_INIT)
|
os.Exit(ERREXIT_INIT)
|
||||||
@ -267,7 +267,7 @@ func main() {
|
|||||||
// Initialize FUSE server
|
// Initialize FUSE server
|
||||||
cryptfs.Debug.Printf("cli args: %v\n", args)
|
cryptfs.Debug.Printf("cli args: %v\n", args)
|
||||||
srv := pathfsFrontend(masterkey, args, confFile)
|
srv := pathfsFrontend(masterkey, args, confFile)
|
||||||
cryptfs.Info.Println("Filesystem ready.")
|
cryptfs.Info.Println("Filesystem mounted and ready.")
|
||||||
// We are ready - send USR1 signal to our parent
|
// We are ready - send USR1 signal to our parent
|
||||||
if args.notifypid > 0 {
|
if args.notifypid > 0 {
|
||||||
sendUsr1(args.notifypid)
|
sendUsr1(args.notifypid)
|
||||||
|
Loading…
Reference in New Issue
Block a user