From 97d8340bd81ddd60baac598d3e25ebfb4decb50c Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 21 Aug 2021 21:43:26 +0200 Subject: configfile: add Validate() function, support FlagXChaCha20Poly1305 We used to do validation using lists of mandatory feature flags. With the introduction of XChaCha20Poly1305, this became too simplistic, as it uses a different IV length, hence disabling GCMIV128. Add a dedicated function, Validate(), with open-coded validation logic. The validation and creation logic also gets XChaCha20Poly1305 support, and gocryptfs -init -xchacha now writes the flag into gocryptfs.conf. --- init_dir.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'init_dir.go') diff --git a/init_dir.go b/init_dir.go index 8f11351..c6539c8 100644 --- a/init_dir.go +++ b/init_dir.go @@ -96,7 +96,8 @@ func initDir(args *argContainer) { Devrandom: args.devrandom, Fido2CredentialID: fido2CredentialID, Fido2HmacSalt: fido2HmacSalt, - DeterministicNames: args.deterministic_names}) + DeterministicNames: args.deterministic_names, + XChaCha20Poly1305: args.xchacha}) if err != nil { tlog.Fatal.Println(err) os.Exit(exitcodes.WriteConf) -- cgit v1.2.3