Implement a bit of Encryption

This commit is contained in:
2024-05-15 15:10:38 -05:00
parent c253ca6fdf
commit 65d8a457a3
3 changed files with 38 additions and 10 deletions

View File

@@ -30,10 +30,12 @@ func runRofi(cmd *cobra.Command, args []string) error {
for i := range args {
path = append(path, strings.Split(args[i], "/")...)
}
var db *models.KeePassDB
var havePassword bool
pwFile := fmt.Sprintf("%s%s", ConfigDir, "pw")
pass, err := util.ReadFile(pwFile)
pass, err := util.ReadPWFile(pwFile)
if err != nil {
havePassword = false
// See if we have a password...
@@ -46,6 +48,7 @@ func runRofi(cmd *cobra.Command, args []string) error {
} else {
havePassword = true
}
db, err = models.NewKeePassDB(viper.GetString("database"), pass)
if err != nil {
return err