Implement a bit of Encryption
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user