Reduce code duplication in key handling

This commit is contained in:
Alexander Neumann
2014-12-21 18:16:22 +01:00
parent ef41a77aff
commit 5431b025a3
2 changed files with 15 additions and 70 deletions

View File

@@ -62,7 +62,7 @@ func add_key(s restic.Server) error {
return errors.New("passwords do not match")
}
id, err := s.Key().AddKey(s, pw)
id, err := restic.AddKey(s, pw, s.Key())
if err != nil {
return fmt.Errorf("creating new key failed: %v\n", err)
}
@@ -95,7 +95,7 @@ func change_password(s restic.Server) error {
}
// add new key
id, err := s.Key().AddKey(s, pw)
id, err := restic.AddKey(s, pw, s.Key())
if err != nil {
return fmt.Errorf("creating new key failed: %v\n", err)
}