aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/config_file.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/configfile/config_file.go')
-rw-r--r--internal/configfile/config_file.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/configfile/config_file.go b/internal/configfile/config_file.go
index 828f034..2d11346 100644
--- a/internal/configfile/config_file.go
+++ b/internal/configfile/config_file.go
@@ -55,6 +55,8 @@ type ConfFile struct {
FeatureFlags []string
// FIDO2 parameters
FIDO2 *FIDO2Params `json:",omitempty"`
+ // LongNameMax corresponds to the -longnamemax flag
+ LongNameMax uint8 `json:",omitempty"`
// Filename is the name of the config file. Not exported to JSON.
filename string
}
@@ -71,6 +73,7 @@ type CreateArgs struct {
Fido2HmacSalt []byte
DeterministicNames bool
XChaCha20Poly1305 bool
+ LongNameMax uint8
}
// Create - create a new config with a random key encrypted with
@@ -97,6 +100,12 @@ func Create(args *CreateArgs) error {
if !args.DeterministicNames {
cf.setFeatureFlag(FlagDirIV)
}
+ // 0 means to *use* the default (which means we don't have to save it), and
+ // 255 *is* the default, which means we don't have to save it either.
+ if args.LongNameMax != 0 && args.LongNameMax != 255 {
+ cf.LongNameMax = args.LongNameMax
+ cf.setFeatureFlag(FlagLongNameMax)
+ }
cf.setFeatureFlag(FlagEMENames)
cf.setFeatureFlag(FlagLongNames)
cf.setFeatureFlag(FlagRaw64)