From 1364b44ae356da31e24e5605fe73a307e9d6fb03 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 27 Dec 2019 22:27:57 +0100 Subject: remove Trezor support --- internal/configfile/config_file.go | 10 +--------- internal/configfile/config_test.go | 8 ++++---- internal/configfile/feature_flags.go | 4 ---- 3 files changed, 5 insertions(+), 17 deletions(-) (limited to 'internal/configfile') diff --git a/internal/configfile/config_file.go b/internal/configfile/config_file.go index e93affd..c27ecd4 100644 --- a/internal/configfile/config_file.go +++ b/internal/configfile/config_file.go @@ -46,10 +46,6 @@ type ConfFile struct { // mounting. This mechanism is analogous to the ext4 feature flags that are // stored in the superblock. FeatureFlags []string - // TrezorPayload stores 32 random bytes used for unlocking the master key using - // a Trezor security module. The randomness makes sure that a unique unlock - // value is used for each gocryptfs filesystem. - TrezorPayload []byte `json:",omitempty"` // Filename is the name of the config file. Not exported to JSON. filename string } @@ -73,7 +69,7 @@ func randBytesDevRandom(n int) []byte { // "password" and write it to "filename". // Uses scrypt with cost parameter logN. func Create(filename string, password []byte, plaintextNames bool, - logN int, creator string, aessiv bool, devrandom bool, trezorPayload []byte) error { + logN int, creator string, aessiv bool, devrandom bool) error { var cf ConfFile cf.filename = filename cf.Creator = creator @@ -93,10 +89,6 @@ func Create(filename string, password []byte, plaintextNames bool, if aessiv { cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagAESSIV]) } - if len(trezorPayload) > 0 { - cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagTrezor]) - cf.TrezorPayload = trezorPayload - } { // Generate new random master key var key []byte diff --git a/internal/configfile/config_test.go b/internal/configfile/config_test.go index 0dd081c..832867c 100644 --- a/internal/configfile/config_test.go +++ b/internal/configfile/config_test.go @@ -62,7 +62,7 @@ func TestLoadV2StrangeFeature(t *testing.T) { } func TestCreateConfDefault(t *testing.T) { - err := Create("config_test/tmp.conf", testPw, false, 10, "test", false, false, nil) + err := Create("config_test/tmp.conf", testPw, false, 10, "test", false, false) if err != nil { t.Fatal(err) } @@ -83,14 +83,14 @@ func TestCreateConfDefault(t *testing.T) { } func TestCreateConfDevRandom(t *testing.T) { - err := Create("config_test/tmp.conf", testPw, false, 10, "test", false, true, nil) + err := Create("config_test/tmp.conf", testPw, false, 10, "test", false, true) if err != nil { t.Fatal(err) } } func TestCreateConfPlaintextnames(t *testing.T) { - err := Create("config_test/tmp.conf", testPw, true, 10, "test", false, false, nil) + err := Create("config_test/tmp.conf", testPw, true, 10, "test", false, false) if err != nil { t.Fatal(err) } @@ -111,7 +111,7 @@ func TestCreateConfPlaintextnames(t *testing.T) { // Reverse mode uses AESSIV func TestCreateConfFileAESSIV(t *testing.T) { - err := Create("config_test/tmp.conf", testPw, false, 10, "test", true, false, nil) + err := Create("config_test/tmp.conf", testPw, false, 10, "test", true, false) if err != nil { t.Fatal(err) } diff --git a/internal/configfile/feature_flags.go b/internal/configfile/feature_flags.go index 141b007..2d609f2 100644 --- a/internal/configfile/feature_flags.go +++ b/internal/configfile/feature_flags.go @@ -25,9 +25,6 @@ const ( // Note that this flag does not change the password hashing algorithm // which always is scrypt. FlagHKDF - // FlagTrezor means that "-trezor" was used when creating the filesystem. - // The masterkey is protected using a Trezor device instead of a password. - FlagTrezor ) // knownFlags stores the known feature flags and their string representation @@ -40,7 +37,6 @@ var knownFlags = map[flagIota]string{ FlagAESSIV: "AESSIV", FlagRaw64: "Raw64", FlagHKDF: "HKDF", - FlagTrezor: "Trezor", } // Filesystems that do not have these feature flags set are deprecated. -- cgit v1.2.3