Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmd/cryptcheck/cryptcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down