protondrive: fix signature verification logic by accounting for legacy signing scheme (#7278)

This commit is contained in:
Chun-Hung Tseng
2023-09-08 16:00:34 +08:00
committed by GitHub
parent 63ab250817
commit 578c75cb1e
3 changed files with 10 additions and 13 deletions

View File

@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
"log"
"path"
"strings"
"time"
@@ -264,12 +263,12 @@ func clearConfigMap(m configmap.Mapper) {
}
func authHandler(auth proton.Auth) {
// log.Println("authHandler called")
// fs.Debugf("authHandler called")
setConfigMap(_mapper, auth.UID, auth.AccessToken, auth.RefreshToken, _saltedKeyPass)
}
func deAuthHandler() {
// log.Println("deAuthHandler called")
// fs.Debugf("deAuthHandler called")
clearConfigMap(_mapper)
}
@@ -786,9 +785,7 @@ func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) {
return *o.digests, nil
}
// sha1 not cached
log.Println("sha1 not cached")
// we fetch and try to obtain the sha1 of the link
// sha1 not cached: we fetch and try to obtain the sha1 of the link
fileSystemAttrs, err := o.fs.protonDrive.GetActiveRevisionAttrsByID(ctx, o.ID())
if err != nil {
return "", err
@@ -810,7 +807,7 @@ func (o *Object) Size() int64 {
return *o.originalSize
}
fs.Errorf(o, "Original size should exist")
fs.Debugf(o, "Original file size missing")
}
return o.size
}