forked from TrueCloudLab/rclone
vendor: update all dependencies
* Update all dependencies * Remove all `[[constraint]]` from Gopkg.toml * Add in the minimum number of `[[override]]` to build * Remove go get of github.com/inconshreveable/mousetrap as it is vendored * Update docs with new policy on constraints
This commit is contained in:
parent
21383877df
commit
6427029c4e
4902 changed files with 1443417 additions and 227283 deletions
7
vendor/github.com/t3rm1n4l/go-mega/utils.go
generated
vendored
7
vendor/github.com/t3rm1n4l/go-mega/utils.go
generated
vendored
|
@ -12,6 +12,7 @@ import (
|
|||
"math/big"
|
||||
"net"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
@ -274,6 +275,8 @@ func getChunkSizes(size int64) (chunks []chunkSize) {
|
|||
return chunks
|
||||
}
|
||||
|
||||
var attrMatch = regexp.MustCompile(`{".*"}`)
|
||||
|
||||
func decryptAttr(key []byte, data []byte) (attr FileAttr, err error) {
|
||||
err = EBADATTR
|
||||
block, err := aes.NewCipher(key)
|
||||
|
@ -287,6 +290,10 @@ func decryptAttr(key []byte, data []byte) (attr FileAttr, err error) {
|
|||
|
||||
if string(buf[:4]) == "MEGA" {
|
||||
str := strings.TrimRight(string(buf[4:]), "\x00")
|
||||
trimmed := attrMatch.FindString(str)
|
||||
if trimmed != "" {
|
||||
str = trimmed
|
||||
}
|
||||
err = json.Unmarshal([]byte(str), &attr)
|
||||
}
|
||||
return attr, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue