diff --git a/cmd/cryptcheck/cryptcheck.go b/cmd/cryptcheck/cryptcheck.go index b803beb5dbd43..c577fb437ca60 100644 --- a/cmd/cryptcheck/cryptcheck.go +++ b/cmd/cryptcheck/cryptcheck.go @@ -57,11 +57,17 @@ After it has run it will log the status of the encryptedremote:. // cryptCheck checks the integrity of a crypted remote func cryptCheck(ctx context.Context, fdst, fsrc fs.Fs) error { - // Check to see fcrypt is a crypt + // Check to see fdst is crypted. If not, check fsrc. fcrypt, ok := fdst.(*crypt.Fs) if !ok { - return errors.Errorf("%s:%s is not a crypt remote", fdst.Name(), fdst.Root()) + fcrypt, ok = fsrc.(*crypt.Fs) + if !ok { + return errors.Errorf("Both %s:%s and %s:%s are not crypt remote", fdst.Name(), fdst.Root(), fsrc.Name(), fsrc.Root()) + } + fs.Logf(nil, "%s:%s is not a crypt remote, using %s:%s as dst", fdst.Name(), fdst.Root(), fsrc.Name(), fsrc.Root()) + fdst, fsrc = fsrc, fdst } + // Find a hash to use funderlying := fcrypt.UnWrap() hashType := funderlying.Hashes().GetOne()