]> source.dussan.org Git - gitea.git/commitdiff
dep: update crypto. info: https://golangtutorial.dev/news/fix-in-crypto-package/...
authortechknowlogick <techknowlogick@gitea.io>
Sun, 20 Dec 2020 15:36:07 +0000 (10:36 -0500)
committerGitHub <noreply@github.com>
Sun, 20 Dec 2020 15:36:07 +0000 (17:36 +0200)
Co-authored-by: zeripath <art27@cantab.net>
36 files changed:
go.mod
go.sum
vendor/golang.org/x/crypto/acme/acme.go
vendor/golang.org/x/crypto/acme/jws.go
vendor/golang.org/x/crypto/acme/rfc8555.go
vendor/golang.org/x/crypto/acme/types.go
vendor/golang.org/x/crypto/argon2/blamka_amd64.go
vendor/golang.org/x/crypto/argon2/blamka_amd64.s
vendor/golang.org/x/crypto/argon2/blamka_ref.go
vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go
vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s
vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go
vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s
vendor/golang.org/x/crypto/blake2b/blake2b_ref.go
vendor/golang.org/x/crypto/chacha20/chacha_arm64.go
vendor/golang.org/x/crypto/chacha20/chacha_arm64.s
vendor/golang.org/x/crypto/chacha20/chacha_noasm.go
vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go
vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s
vendor/golang.org/x/crypto/chacha20/chacha_s390x.go
vendor/golang.org/x/crypto/chacha20/chacha_s390x.s
vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go
vendor/golang.org/x/crypto/curve25519/curve25519_amd64.s
vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go
vendor/golang.org/x/crypto/internal/subtle/aliasing.go
vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go [deleted file]
vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go [new file with mode: 0644]
vendor/golang.org/x/crypto/poly1305/mac_noasm.go
vendor/golang.org/x/crypto/poly1305/sum_amd64.go
vendor/golang.org/x/crypto/poly1305/sum_amd64.s
vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go
vendor/golang.org/x/crypto/poly1305/sum_ppc64le.s
vendor/golang.org/x/crypto/poly1305/sum_s390x.go
vendor/golang.org/x/crypto/poly1305/sum_s390x.s
vendor/golang.org/x/crypto/ssh/server.go
vendor/modules.txt

diff --git a/go.mod b/go.mod
index c3bb1ac75c4e56c92bce579ce8dc318b717217b4..c334f68831a6ab932b44c10377631b8f95e6bd7f 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -107,7 +107,7 @@ require (
        github.com/yuin/goldmark-meta v1.0.0
        go.jolheiser.com/hcaptcha v0.0.4
        go.jolheiser.com/pwn v0.0.3
-       golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
+       golang.org/x/crypto v0.0.0-20201217014255-9d1352758620
        golang.org/x/net v0.0.0-20201031054903-ff519b6c9102
        golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
        golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f
diff --git a/go.sum b/go.sum
index 2d3c29f284fdbb989a95c29bbb56f0b22d0168b2..6ac80e2677c9746567f0ba844a079a27e652c415 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -1178,6 +1178,8 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rB
 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
 golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 h1:3wPMTskHO3+O6jqTEXyFcsnuxMQOqYSaHsDxcbUXpqA=
+golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1348,6 +1350,8 @@ golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPM
 golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f h1:QdHQnPce6K4XQewki9WNbG5KOROuDzqO3NaYjI1cXJ0=
 golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM=
+golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
index 6e6c9d131950dd462675676e9e2dae785610bd9c..174cfe8b41586654052aa732f04f029be0cd8588 100644 (file)
@@ -363,6 +363,10 @@ func AcceptTOS(tosURL string) bool { return true }
 // Also see Error's Instance field for when a CA requires already registered accounts to agree
 // to an updated Terms of Service.
 func (c *Client) Register(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) {
+       if c.Key == nil {
+               return nil, errors.New("acme: client.Key must be set to Register")
+       }
+
        dir, err := c.Discover(ctx)
        if err != nil {
                return nil, err
index 76e3fdacf1889a5528c096a9cd7a3d4182740ae5..04f509f0f0ab0fdbc5de1e6c516310026b5bea7d 100644 (file)
@@ -7,17 +7,31 @@ package acme
 import (
        "crypto"
        "crypto/ecdsa"
+       "crypto/hmac"
        "crypto/rand"
        "crypto/rsa"
        "crypto/sha256"
+       "crypto/sha512"
        _ "crypto/sha512" // need for EC keys
        "encoding/asn1"
        "encoding/base64"
        "encoding/json"
+       "errors"
        "fmt"
+       "hash"
        "math/big"
 )
 
+// MACAlgorithm represents a JWS MAC signature algorithm.
+// See https://tools.ietf.org/html/rfc7518#section-3.1 for more details.
+type MACAlgorithm string
+
+const (
+       MACAlgorithmHS256 = MACAlgorithm("HS256")
+       MACAlgorithmHS384 = MACAlgorithm("HS384")
+       MACAlgorithmHS512 = MACAlgorithm("HS512")
+)
+
 // keyID is the account identity provided by a CA during registration.
 type keyID string
 
@@ -31,6 +45,14 @@ const noKeyID = keyID("")
 // See https://tools.ietf.org/html/rfc8555#section-6.3 for more details.
 const noPayload = ""
 
+// jsonWebSignature can be easily serialized into a JWS following
+// https://tools.ietf.org/html/rfc7515#section-3.2.
+type jsonWebSignature struct {
+       Protected string `json:"protected"`
+       Payload   string `json:"payload"`
+       Sig       string `json:"signature"`
+}
+
 // jwsEncodeJSON signs claimset using provided key and a nonce.
 // The result is serialized in JSON format containing either kid or jwk
 // fields based on the provided keyID value.
@@ -71,12 +93,7 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, ur
        if err != nil {
                return nil, err
        }
-
-       enc := struct {
-               Protected string `json:"protected"`
-               Payload   string `json:"payload"`
-               Sig       string `json:"signature"`
-       }{
+       enc := jsonWebSignature{
                Protected: phead,
                Payload:   payload,
                Sig:       base64.RawURLEncoding.EncodeToString(sig),
@@ -84,6 +101,32 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, ur
        return json.Marshal(&enc)
 }
 
+// jwsWithMAC creates and signs a JWS using the given key and algorithm.
+// "rawProtected" and "rawPayload" should not be base64-URL-encoded.
+func jwsWithMAC(key []byte, alg MACAlgorithm, rawProtected, rawPayload []byte) (*jsonWebSignature, error) {
+       if len(key) == 0 {
+               return nil, errors.New("acme: cannot sign JWS with an empty MAC key")
+       }
+       protected := base64.RawURLEncoding.EncodeToString(rawProtected)
+       payload := base64.RawURLEncoding.EncodeToString(rawPayload)
+
+       // Only HMACs are currently supported.
+       hmac, err := newHMAC(key, alg)
+       if err != nil {
+               return nil, err
+       }
+       if _, err := hmac.Write([]byte(protected + "." + payload)); err != nil {
+               return nil, err
+       }
+       mac := hmac.Sum(nil)
+
+       return &jsonWebSignature{
+               Protected: protected,
+               Payload:   payload,
+               Sig:       base64.RawURLEncoding.EncodeToString(mac),
+       }, nil
+}
+
 // jwkEncode encodes public part of an RSA or ECDSA key into a JWK.
 // The result is also suitable for creating a JWK thumbprint.
 // https://tools.ietf.org/html/rfc7517
@@ -175,6 +218,20 @@ func jwsHasher(pub crypto.PublicKey) (string, crypto.Hash) {
        return "", 0
 }
 
+// newHMAC returns an appropriate HMAC for the given MACAlgorithm.
+func newHMAC(key []byte, alg MACAlgorithm) (hash.Hash, error) {
+       switch alg {
+       case MACAlgorithmHS256:
+               return hmac.New(sha256.New, key), nil
+       case MACAlgorithmHS384:
+               return hmac.New(sha512.New384, key), nil
+       case MACAlgorithmHS512:
+               return hmac.New(sha512.New, key), nil
+       default:
+               return nil, fmt.Errorf("acme: unsupported MAC algorithm: %v", alg)
+       }
+}
+
 // JWKThumbprint creates a JWK thumbprint out of pub
 // as specified in https://tools.ietf.org/html/rfc7638.
 func JWKThumbprint(pub crypto.PublicKey) (string, error) {
index dfb57a66fd4befd4f5f7e5836012aa8167e4fa86..ceb239d72a414c6c36875e99dbbf1237c55d9fda 100644 (file)
@@ -5,6 +5,7 @@
 package acme
 
 import (
+       "bytes"
        "context"
        "crypto"
        "encoding/base64"
@@ -37,22 +38,32 @@ func (c *Client) DeactivateReg(ctx context.Context) error {
        return nil
 }
 
-// registerRFC is quivalent to c.Register but for CAs implementing RFC 8555.
+// registerRFC is equivalent to c.Register but for CAs implementing RFC 8555.
 // It expects c.Discover to have already been called.
-// TODO: Implement externalAccountBinding.
 func (c *Client) registerRFC(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) {
        c.cacheMu.Lock() // guard c.kid access
        defer c.cacheMu.Unlock()
 
        req := struct {
-               TermsAgreed bool     `json:"termsOfServiceAgreed,omitempty"`
-               Contact     []string `json:"contact,omitempty"`
+               TermsAgreed            bool              `json:"termsOfServiceAgreed,omitempty"`
+               Contact                []string          `json:"contact,omitempty"`
+               ExternalAccountBinding *jsonWebSignature `json:"externalAccountBinding,omitempty"`
        }{
                Contact: acct.Contact,
        }
        if c.dir.Terms != "" {
                req.TermsAgreed = prompt(c.dir.Terms)
        }
+
+       // set 'externalAccountBinding' field if requested
+       if acct.ExternalAccountBinding != nil {
+               eabJWS, err := c.encodeExternalAccountBinding(acct.ExternalAccountBinding)
+               if err != nil {
+                       return nil, fmt.Errorf("acme: failed to encode external account binding: %v", err)
+               }
+               req.ExternalAccountBinding = eabJWS
+       }
+
        res, err := c.post(ctx, c.Key, c.dir.RegURL, req, wantStatus(
                http.StatusOK,      // account with this key already registered
                http.StatusCreated, // new account created
@@ -75,7 +86,19 @@ func (c *Client) registerRFC(ctx context.Context, acct *Account, prompt func(tos
        return a, nil
 }
 
-// updateGegRFC is equivalent to c.UpdateReg but for CAs implementing RFC 8555.
+// encodeExternalAccountBinding will encode an external account binding stanza
+// as described in https://tools.ietf.org/html/rfc8555#section-7.3.4.
+func (c *Client) encodeExternalAccountBinding(eab *ExternalAccountBinding) (*jsonWebSignature, error) {
+       jwk, err := jwkEncode(c.Key.Public())
+       if err != nil {
+               return nil, err
+       }
+       var rProtected bytes.Buffer
+       fmt.Fprintf(&rProtected, `{"alg":%q,"kid":%q,"url":%q}`, eab.Algorithm, eab.KID, c.dir.RegURL)
+       return jwsWithMAC(eab.Key, eab.Algorithm, rProtected.Bytes(), []byte(jwk))
+}
+
+// updateRegRFC is equivalent to c.UpdateReg but for CAs implementing RFC 8555.
 // It expects c.Discover to have already been called.
 func (c *Client) updateRegRFC(ctx context.Context, a *Account) (*Account, error) {
        url := string(c.accountKID(ctx))
index e959cafc82b6a692e858c644df7e91f16bb54de1..4d89fed8cb0eb1ed7fbc8f5cb7a680424f9f167b 100644 (file)
@@ -199,6 +199,31 @@ type Account struct {
        //
        // It is non-RFC 8555 compliant and is obsoleted by OrdersURL.
        Certificates string
+
+       // ExternalAccountBinding represents an arbitrary binding to an account of
+       // the CA which the ACME server is tied to.
+       // See https://tools.ietf.org/html/rfc8555#section-7.3.4 for more details.
+       ExternalAccountBinding *ExternalAccountBinding
+}
+
+// ExternalAccountBinding contains the data needed to form a request with
+// an external account binding.
+// See https://tools.ietf.org/html/rfc8555#section-7.3.4 for more details.
+type ExternalAccountBinding struct {
+       // KID is the Key ID of the symmetric MAC key that the CA provides to
+       // identify an external account from ACME.
+       KID string
+
+       // Key is the bytes of the symmetric key that the CA provides to identify
+       // the account. Key must correspond to the KID.
+       Key []byte
+
+       // Algorithm used to sign the JWS.
+       Algorithm MACAlgorithm
+}
+
+func (e *ExternalAccountBinding) String() string {
+       return fmt.Sprintf("&{KID: %q, Key: redacted, Algorithm: %v}", e.KID, e.Algorithm)
 }
 
 // Directory is ACME server discovery data.
index 2fc1ec0312236a8e126d88cd002c300eb7e8052e..1108e114472b7a6285219606e345478e4fe2054e 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build amd64,!gccgo,!appengine
+// +build amd64,gc,!purego
 
 package argon2
 
index 74a6e7332a94a3383074e0e89aa23a8252f961ba..c4c84f07a01e996180ad2bd45bea4fc77ec38455 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build amd64,!gccgo,!appengine
+// +build amd64,gc,!purego
 
 #include "textflag.h"
 
index baf7b551daf7d41a9190268ab7b07cdabb9b18aa..4a963c7808f176572b875c62076e489b9467f02a 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !amd64 appengine gccgo
+// +build !amd64 purego !gc
 
 package argon2
 
index 4d31dd0fdcd5db7bd47845e67a98662b080b6b0e..8a893fdfff5cdbf1554dd129142a778d2fffd62d 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build go1.7,amd64,!gccgo,!appengine
+// +build go1.7,amd64,gc,!purego
 
 package blake2b
 
index 5593b1b3dce267af7eeab923a763cba6ab0428a0..8608a7f7d1c51daf6785c581965d11e7024fd195 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build go1.7,amd64,!gccgo,!appengine
+// +build go1.7,amd64,gc,!purego
 
 #include "textflag.h"
 
index 30e2fcd581fd5e57535ed0d1d275a6a8d19ea37e..a52c887fcb3a71056337b7cbc57141f950ef09a7 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !go1.7,amd64,!gccgo,!appengine
+// +build !go1.7,amd64,gc,!purego
 
 package blake2b
 
index 578e947b3bf9058dc478e453cc10a650ef554737..1f4c6a927915e7dd62837bf6d59e038f7c349864 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build amd64,!gccgo,!appengine
+// +build amd64,gc,!purego
 
 #include "textflag.h"
 
index da156a1ba62cc43f299c41937eb196f8333c9ee1..8597457781197962a8686a1001803892951ff22e 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !amd64 appengine gccgo
+// +build !amd64 purego !gc
 
 package blake2b
 
index b799e440b4a177e0644f5c372dd792140bd5cf99..c474e5a804616707f18ed80a46a6e1ae022e0978 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build go1.11,!gccgo,!purego
+// +build go1.11,gc,!purego
 
 package chacha20
 
index 891481539a114037fe293597531f28e7bdd71cf8..8fb49a13e3bf23167b8f1e4ff48adbb8fd413fe8 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build go1.11,!gccgo,!purego
+// +build go1.11,gc,!purego
 
 #include "textflag.h"
 
index 4635307b8f2990f82e67cfd4e665240948751d39..3e8a609fbd7a93756805f7dd6ad6bb0ecf063dbe 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !arm64,!s390x,!ppc64le arm64,!go1.11 gccgo purego
+// +build !arm64,!s390x,!ppc64le arm64,!go1.11 !gc purego
 
 package chacha20
 
index b7993303415662890c373e62a6fbd1ec411de043..2806c6325d9e7db829a5718004dec4214556db17 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 package chacha20
 
index 23c602164301cc168c8de1b7113fe05b7c5dcdf5..3dad4b2fa27b6a63f22d5eeccb74866df6d8074f 100644 (file)
@@ -19,7 +19,7 @@
 // The differences in this and the original implementation are
 // due to the calling conventions and initialization of constants.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 #include "textflag.h"
 
index a9244bdf4dbfd23dc6a3842a3100bc5d897a1d70..a0774dde1ce3e351501f256187f342ff109a513f 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 package chacha20
 
index 89c658c410bf6b5c05b75ae3d1370dfa3c0fa80d..818161189bc4b10c7edb4a92d7eb63769d9b0bcc 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 #include "go_asm.h"
 #include "textflag.h"
index 5120b779b9b48ba3f1eba27d43091f62b4424cd2..877b6de292629ada5de5991d07ef50f1bdc802ef 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build amd64,!gccgo,!appengine,!purego
+// +build amd64,gc,!purego
 
 package curve25519
 
index 0250c8885929d06f05a236b7aa23dcea574b3f52..6c533809266b113e69fe99cf85323adf9dc4b5c7 100644 (file)
@@ -5,7 +5,7 @@
 // This code was translated into a form compatible with 6a from the public
 // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html
 
-// +build amd64,!gccgo,!appengine,!purego
+// +build amd64,gc,!purego
 
 #define REDMASK51     0x0007FFFFFFFFFFFF
 
index 047d49afc27e3e05e8dad2557a07cf82d097b9bc..80d3300af5d1d00a37ad787d0ea2a0d73d707541 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !amd64 gccgo appengine purego
+// +build !amd64 !gc purego
 
 package curve25519
 
index f38797bfa1bfb1487f01489efa6911d3e1662515..281c27ef02d0eedde26c3fd1907a574b056e987d 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !appengine
+// +build !purego
 
 // Package subtle implements functions that are often useful in cryptographic
 // code but require careful thought to use correctly.
diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go
deleted file mode 100644 (file)
index 0cc4a8a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build appengine
-
-// Package subtle implements functions that are often useful in cryptographic
-// code but require careful thought to use correctly.
-package subtle // import "golang.org/x/crypto/internal/subtle"
-
-// This is the Google App Engine standard variant based on reflect
-// because the unsafe package and cgo are disallowed.
-
-import "reflect"
-
-// AnyOverlap reports whether x and y share memory at any (not necessarily
-// corresponding) index. The memory beyond the slice length is ignored.
-func AnyOverlap(x, y []byte) bool {
-       return len(x) > 0 && len(y) > 0 &&
-               reflect.ValueOf(&x[0]).Pointer() <= reflect.ValueOf(&y[len(y)-1]).Pointer() &&
-               reflect.ValueOf(&y[0]).Pointer() <= reflect.ValueOf(&x[len(x)-1]).Pointer()
-}
-
-// InexactOverlap reports whether x and y share memory at any non-corresponding
-// index. The memory beyond the slice length is ignored. Note that x and y can
-// have different lengths and still not have any inexact overlap.
-//
-// InexactOverlap can be used to implement the requirements of the crypto/cipher
-// AEAD, Block, BlockMode and Stream interfaces.
-func InexactOverlap(x, y []byte) bool {
-       if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] {
-               return false
-       }
-       return AnyOverlap(x, y)
-}
diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go
new file mode 100644 (file)
index 0000000..e20a296
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build purego
+
+// Package subtle implements functions that are often useful in cryptographic
+// code but require careful thought to use correctly.
+package subtle // import "golang.org/x/crypto/internal/subtle"
+
+// This is the Google App Engine standard variant based on reflect
+// because the unsafe package and cgo are disallowed.
+
+import "reflect"
+
+// AnyOverlap reports whether x and y share memory at any (not necessarily
+// corresponding) index. The memory beyond the slice length is ignored.
+func AnyOverlap(x, y []byte) bool {
+       return len(x) > 0 && len(y) > 0 &&
+               reflect.ValueOf(&x[0]).Pointer() <= reflect.ValueOf(&y[len(y)-1]).Pointer() &&
+               reflect.ValueOf(&y[0]).Pointer() <= reflect.ValueOf(&x[len(x)-1]).Pointer()
+}
+
+// InexactOverlap reports whether x and y share memory at any non-corresponding
+// index. The memory beyond the slice length is ignored. Note that x and y can
+// have different lengths and still not have any inexact overlap.
+//
+// InexactOverlap can be used to implement the requirements of the crypto/cipher
+// AEAD, Block, BlockMode and Stream interfaces.
+func InexactOverlap(x, y []byte) bool {
+       if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] {
+               return false
+       }
+       return AnyOverlap(x, y)
+}
index d118f30ed56c0ff1017c7c18e5003f7766f7801f..af6c94f921b774f224125d1747024395c922b489 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !amd64,!ppc64le,!s390x gccgo purego
+// +build !amd64,!ppc64le,!s390x !gc purego
 
 package poly1305
 
index 99e5a1d50efcc7502142be888b6e05cb58c95527..cf3a69ed3b9b1d0608538590e5e6ca9ec92c4e44 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 package poly1305
 
index 8d394a212ee92b4a15ad387e751dc3766b7337bc..2cb03731408c96bfca262d0801b57aee9d2ca85a 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 #include "textflag.h"
 
index 2e7a120b1923ddb07131db975ce1aa8153145264..cb4b7185dcbc40ee69b9a7d09fc5abb11c3d26b0 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 package poly1305
 
index 4e028138796827380d4a237b14f3a1bd91e88091..5cd7494b21a779c5f90c18dbbbb9ad42a4a6f9e6 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 #include "textflag.h"
 
index 958fedc0790b1b7d945a9651bc6c3e7ffaa62a99..188a665e1276e3dd343ce9045a5afbeb2a3495e3 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 package poly1305
 
index 0fa9ee6e0bffc1b396da3f0590f886dfeb17525f..bdd882c606def8a9fdd42aeb774327cb23dac70c 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !gccgo,!purego
+// +build gc,!purego
 
 #include "textflag.h"
 
index 7d42a8c88d26bc6f77c68e38f5b5328a8fa94b5c..b6911e8306d6736e1592ebe2a2e243051d209a35 100644 (file)
@@ -572,6 +572,10 @@ userAuthLoop:
                                perms = candidate.perms
                        }
                case "gssapi-with-mic":
+                       if config.GSSAPIWithMICConfig == nil {
+                               authErr = errors.New("ssh: gssapi-with-mic auth not configured")
+                               break
+                       }
                        gssapiConfig := config.GSSAPIWithMICConfig
                        userAuthRequestGSSAPI, err := parseGSSAPIPayload(userAuthReq.Payload)
                        if err != nil {
index 6faf9069bc9f0592cc9a0a85dfeb3b0a5aaea0a6..a30151bf342bef1565b63b6f1e0713e4ce8f0de5 100644 (file)
@@ -799,7 +799,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-20201016220609-9e8e0b390897
+# golang.org/x/crypto v0.0.0-20201217014255-9d1352758620
 ## explicit
 golang.org/x/crypto/acme
 golang.org/x/crypto/acme/autocert