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:
Nick Craig-Wood 2018-05-02 17:09:45 +01:00
parent 21383877df
commit 6427029c4e
4902 changed files with 1443417 additions and 227283 deletions

View file

@ -8,7 +8,7 @@ test:
build_dep:
go get -u github.com/kisielk/errcheck
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/golang/lint/golint
-#go get -u github.com/golang/lint/golint
# Do source code quality checks
check:

View file

@ -774,7 +774,9 @@ func (m *Mega) NewDownload(src *Node) (*Download, error) {
}
mac_enc := cipher.NewCBCEncrypter(aes_block, zero_iv)
m.FS.mutex.Lock()
t := bytes_to_a32(src.meta.iv)
m.FS.mutex.Unlock()
iv := a32_to_bytes([]uint32{t[0], t[1], t[0], t[1]})
d := &Download{

View file

@ -35,7 +35,14 @@ func retry(t *testing.T, what string, fn func() error) {
t.Fatalf("%s failed: %v", what, err)
}
func skipIfNoCredentials(t *testing.T) {
if USER == "" || PASSWORD == "" {
t.Skip("MEGA_USER and MEGA_PASSWD not set - skipping integration tests")
}
}
func initSession(t *testing.T) *Mega {
skipIfNoCredentials(t)
m := New()
// m.SetDebugger(log.Printf)
retry(t, "Login", func() error {
@ -113,6 +120,8 @@ func fileMD5(t *testing.T, name string) string {
}
func TestLogin(t *testing.T) {
skipIfNoCredentials(t)
m := New()
retry(t, "Login", func() error {
return m.Login(USER, PASSWORD)
@ -233,6 +242,8 @@ func TestCreateDir(t *testing.T) {
}
func TestConfig(t *testing.T) {
skipIfNoCredentials(t)
m := New()
m.SetAPIUrl("http://invalid.domain")
err := m.Login(USER, PASSWORD)

View file

@ -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