diff options
author | 6543 <6543@obermui.de> | 2020-08-13 17:57:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 11:57:08 -0400 |
commit | e266ba30cca17bdb5c50fd0cd30d2e429e58ac26 (patch) | |
tree | f8f17bb98e035855cd9929eaf170f0c51890b564 /vendor | |
parent | c9d1e40dfc9831f44be27ef98c0b9fb28fcfec63 (diff) | |
download | gitea-e266ba30cca17bdb5c50fd0cd30d2e429e58ac26.tar.gz gitea-e266ba30cca17bdb5c50fd0cd30d2e429e58ac26.zip |
update (#12481)
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/golang.org/x/crypto/ssh/client_auth.go | 22 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
2 files changed, 13 insertions, 11 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/client_auth.go b/vendor/golang.org/x/crypto/ssh/client_auth.go index 0590070e22..f3265655ee 100644 --- a/vendor/golang.org/x/crypto/ssh/client_auth.go +++ b/vendor/golang.org/x/crypto/ssh/client_auth.go @@ -36,7 +36,7 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { // during the authentication phase the client first attempts the "none" method // then any untried methods suggested by the server. - tried := make(map[string]bool) + var tried []string var lastMethods []string sessionID := c.transport.getSessionID() @@ -49,7 +49,9 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { // success return nil } else if ok == authFailure { - tried[auth.method()] = true + if m := auth.method(); !contains(tried, m) { + tried = append(tried, m) + } } if methods == nil { methods = lastMethods @@ -61,7 +63,7 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { findNext: for _, a := range config.Auth { candidateMethod := a.method() - if tried[candidateMethod] { + if contains(tried, candidateMethod) { continue } for _, meth := range methods { @@ -72,16 +74,16 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { } } } - return fmt.Errorf("ssh: unable to authenticate, attempted methods %v, no supported methods remain", keys(tried)) + return fmt.Errorf("ssh: unable to authenticate, attempted methods %v, no supported methods remain", tried) } -func keys(m map[string]bool) []string { - s := make([]string, 0, len(m)) - - for key := range m { - s = append(s, key) +func contains(list []string, e string) bool { + for _, s := range list { + if s == e { + return true + } } - return s + return false } // An AuthMethod represents an instance of an RFC 4252 authentication method. diff --git a/vendor/modules.txt b/vendor/modules.txt index 0075992d74..c7729846e0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -741,7 +741,7 @@ go.mongodb.org/mongo-driver/bson/bsonrw go.mongodb.org/mongo-driver/bson/bsontype go.mongodb.org/mongo-driver/bson/primitive go.mongodb.org/mongo-driver/x/bsonx/bsoncore -# golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 +# golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de ## explicit golang.org/x/crypto/acme golang.org/x/crypto/acme/autocert |