mirror of
https://github.com/mitchell/selfpass.git
synced 2025-12-13 21:07:22 +00:00
Major refactor of config encryption strategy
This commit is contained in:
parent
e404a7ab31
commit
cde1d118fc
10 changed files with 91 additions and 101 deletions
|
|
@ -16,5 +16,3 @@ func check(err error) {
|
|||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
const KeyPrivateKey = "private_key"
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ password.`,
|
|||
check(survey.Ask(mdqs, &ci.MetadataInput))
|
||||
check(survey.Ask(cqs, &ci))
|
||||
|
||||
key, err := hex.DecodeString(cfg.GetString(KeyPrivateKey))
|
||||
key, err := hex.DecodeString(cfg.GetString(clitypes.KeyPrivateKey))
|
||||
check(err)
|
||||
|
||||
keypass, err := crypto.CombinePasswordAndKey([]byte(masterpass), []byte(key))
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ decrypting password.`,
|
|||
|
||||
fmt.Println("Wrote primary user key to clipboard.")
|
||||
|
||||
key, err := hex.DecodeString(cfg.GetString(KeyPrivateKey))
|
||||
key, err := hex.DecodeString(cfg.GetString(clitypes.KeyPrivateKey))
|
||||
check(err)
|
||||
|
||||
passkey, err := crypto.CombinePasswordAndKey([]byte(masterpass), key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue