init: pass proper context to master key generation

This is no change in behavior as a canceled context did later on cause
the config file creation to fail. Therefore this change just lets the
repository initialization fail a bit earlier.
This commit is contained in:
Michael Eischer
2020-04-10 11:37:39 +02:00
parent 603bb0e309
commit a449450021
2 changed files with 3 additions and 3 deletions

View File

@@ -638,7 +638,7 @@ func (r *Repository) Init(ctx context.Context, password string, chunkerPolynomia
// init creates a new master key with the supplied password and uses it to save
// the config into the repo.
func (r *Repository) init(ctx context.Context, password string, cfg restic.Config) error {
key, err := createMasterKey(r, password)
key, err := createMasterKey(ctx, r, password)
if err != nil {
return err
}