File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ func initDir(args *argContainer) {
108
108
DeterministicNames : args .deterministic_names ,
109
109
XChaCha20Poly1305 : args .xchacha ,
110
110
LongNameMax : args .longnamemax ,
111
+ Masterkey : handleArgsMasterkey (args ),
111
112
})
112
113
if err != nil {
113
114
tlog .Fatal .Println (err )
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ type CreateArgs struct {
74
74
DeterministicNames bool
75
75
XChaCha20Poly1305 bool
76
76
LongNameMax uint8
77
+ Masterkey []byte
77
78
}
78
79
79
80
// Create - create a new config with a random key encrypted with
@@ -126,8 +127,11 @@ func Create(args *CreateArgs) error {
126
127
return err
127
128
}
128
129
{
129
- // Generate new random master key
130
- key := cryptocore .RandBytes (cryptocore .KeyLen )
130
+ key := args .Masterkey
131
+ if key == nil {
132
+ // Generate new random master key
133
+ key := cryptocore .RandBytes (cryptocore .KeyLen )
134
+ }
131
135
tlog .PrintMasterkeyReminder (key )
132
136
// Encrypt it using the password
133
137
// This sets ScryptObject and EncryptedKey
You can’t perform that action at this time.
0 commit comments