]> Cypherpunks repositories - gostls13.git/commitdiff
std,cmd: update golang.org/x/crypto to v0.0.0-20200414155820-4f8f47aa7992
authorHana (Hyang-Ah) Kim <hyangah@gmail.com>
Tue, 14 Apr 2020 16:15:52 +0000 (12:15 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Tue, 14 Apr 2020 17:35:47 +0000 (17:35 +0000)
That includes https://golang.org/cl/228223

Also, update src/vendor/golang.org/x/crypto to match vendored
golang.org/x/crypto version.
Otherwise cmd/internal/goobj.TestDependencyVersionsConsistent
fails.

Fixes #27147

Change-Id: I4a3f1502fdee887762b10348811a08850a15a47a
Reviewed-on: https://go-review.googlesource.com/c/go/+/228226
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
27 files changed:
src/cmd/go.mod
src/cmd/go.sum
src/cmd/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
src/cmd/vendor/modules.txt
src/go.mod
src/go.sum
src/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go
src/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s
src/vendor/golang.org/x/crypto/chacha20/chacha_generic.go
src/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go
src/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go
src/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s
src/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go
src/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s
src/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go
src/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
src/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go
src/vendor/golang.org/x/crypto/poly1305/mac_noasm.go
src/vendor/golang.org/x/crypto/poly1305/sum_amd64.go
src/vendor/golang.org/x/crypto/poly1305/sum_amd64.s
src/vendor/golang.org/x/crypto/poly1305/sum_noasm.go
src/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go
src/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.s
src/vendor/golang.org/x/crypto/poly1305/sum_s390x.go
src/vendor/golang.org/x/crypto/poly1305/sum_s390x.s
src/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s
src/vendor/modules.txt

index e1e5b34e6ee47ec88205b9eaf27e61a586d56ed9..db9daa524272d5ceb4384669af7e8c36f174534d 100644 (file)
@@ -5,7 +5,7 @@ go 1.14
 require (
        github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3
        golang.org/x/arch v0.0.0-20191126211547-368ea8f32fff
-       golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6
+       golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992
        golang.org/x/mod v0.2.0
        golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c // indirect
        golang.org/x/tools v0.0.0-20200309180859-aa4048aca1ca
index 73eff83010bfa2e5cb7ed5ce47a2795581a83f36..69da57df4f4d9e488a9e8560dbc62884902805aa 100644 (file)
@@ -11,8 +11,8 @@ golang.org/x/arch v0.0.0-20191126211547-368ea8f32fff/go.mod h1:flIaEI6LNU6xOCD5P
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 h1:Sy5bstxEqwwbYs6n0/pBuxKENqOeZUgD45Gp3Q3pqLg=
-golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992 h1:B4Wjn2mWOWzjcWfyRYlf00lQ1/9h5vRKmQnhIKhMFR0=
+golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
 golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
index d1b4fca3a9493563cd4c2f247693ffe4ef1e6771..2ffb97bfb8a76b28617f1d27876c87b4dfb89fd9 100644 (file)
@@ -113,6 +113,7 @@ func NewTerminal(c io.ReadWriter, prompt string) *Terminal {
 }
 
 const (
+       keyCtrlC     = 3
        keyCtrlD     = 4
        keyCtrlU     = 21
        keyEnter     = '\r'
@@ -151,8 +152,12 @@ func bytesToKey(b []byte, pasteActive bool) (rune, []byte) {
                switch b[0] {
                case 1: // ^A
                        return keyHome, b[1:]
+               case 2: // ^B
+                       return keyLeft, b[1:]
                case 5: // ^E
                        return keyEnd, b[1:]
+               case 6: // ^F
+                       return keyRight, b[1:]
                case 8: // ^H
                        return keyBackspace, b[1:]
                case 11: // ^K
@@ -738,6 +743,9 @@ func (t *Terminal) readLine() (line string, err error) {
                                                return "", io.EOF
                                        }
                                }
+                               if key == keyCtrlC {
+                                       return "", io.EOF
+                               }
                                if key == keyPasteStart {
                                        t.pasteActive = true
                                        if len(t.line) == 0 {
index 9f4c9985c6cf84466a369f3f150aad3a62499a5e..3b2e6485e60a6d4c42a4227ab4fca181df13ed2a 100644 (file)
@@ -23,7 +23,7 @@ golang.org/x/arch/arm/armasm
 golang.org/x/arch/arm64/arm64asm
 golang.org/x/arch/ppc64/ppc64asm
 golang.org/x/arch/x86/x86asm
-# golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6
+# golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992
 ## explicit
 golang.org/x/crypto/ed25519
 golang.org/x/crypto/ed25519/internal/edwards25519
index ab7916427886534ada2a1fc8095fc8d589f90d90..7ec8941743c72095107f16fa3f6c92fcbbde9802 100644 (file)
@@ -3,7 +3,7 @@ module std
 go 1.14
 
 require (
-       golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6
+       golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992
        golang.org/x/net v0.0.0-20200301022130-244492dfa37a
        golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c // indirect
        golang.org/x/text v0.3.3-0.20191031172631-4b67af870c6f // indirect
index 3f8e5d40b9f0c19e48ee46d4b34bc2ed58097187..0e256193f5df53269dae423d0f3727c8697d128d 100644 (file)
@@ -1,6 +1,6 @@
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 h1:Sy5bstxEqwwbYs6n0/pBuxKENqOeZUgD45Gp3Q3pqLg=
-golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992 h1:B4Wjn2mWOWzjcWfyRYlf00lQ1/9h5vRKmQnhIKhMFR0=
+golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
 golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
index 87f1e369cc27ac92853790abad0439cfe862fdd5..b799e440b4a177e0644f5c372dd792140bd5cf99 100644 (file)
@@ -2,8 +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
-// +build !gccgo,!appengine
+// +build go1.11,!gccgo,!purego
 
 package chacha20
 
index b3a16ef751a677842c0f26b5121ecb4c351b4950..891481539a114037fe293597531f28e7bdd71cf8 100644 (file)
@@ -2,8 +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
-// +build !gccgo,!appengine
+// +build go1.11,!gccgo,!purego
 
 #include "textflag.h"
 
index 098ec9f6be06c3ec33aed7330f6881adc55e4d89..7c498e90d93790666caff35539e8158d5dd0a02b 100644 (file)
@@ -136,6 +136,33 @@ func quarterRound(a, b, c, d uint32) (uint32, uint32, uint32, uint32) {
        return a, b, c, d
 }
 
+// SetCounter sets the Cipher counter. The next invocation of XORKeyStream will
+// behave as if (64 * counter) bytes had been encrypted so far.
+//
+// To prevent accidental counter reuse, SetCounter panics if counter is
+// less than the current value.
+func (s *Cipher) SetCounter(counter uint32) {
+       // Internally, s may buffer multiple blocks, which complicates this
+       // implementation slightly. When checking whether the counter has rolled
+       // back, we must use both s.counter and s.len to determine how many blocks
+       // we have already output.
+       outputCounter := s.counter - uint32(s.len)/blockSize
+       if counter < outputCounter {
+               panic("chacha20: SetCounter attempted to rollback counter")
+       }
+
+       // In the general case, we set the new counter value and reset s.len to 0,
+       // causing the next call to XORKeyStream to refill the buffer. However, if
+       // we're advancing within the existing buffer, we can save work by simply
+       // setting s.len.
+       if counter < s.counter {
+               s.len = int(s.counter-counter) * blockSize
+       } else {
+               s.counter = counter
+               s.len = 0
+       }
+}
+
 // XORKeyStream XORs each byte in the given slice with a byte from the
 // cipher's key stream. Dst and src must overlap entirely or not at all.
 //
index ec609ed868b857eb31d4def6d6687b37940bf5cd..4635307b8f2990f82e67cfd4e665240948751d39 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 appengine
+// +build !arm64,!s390x,!ppc64le arm64,!go1.11 gccgo purego
 
 package chacha20
 
index d0ec61f08d918181e8313b6ca980c4ee37248d5e..b7993303415662890c373e62a6fbd1ec411de043 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,!appengine
+// +build !gccgo,!purego
 
 package chacha20
 
index 533014ea3e8d4d9816e2790cab277455387091e5..23c602164301cc168c8de1b7113fe05b7c5dcdf5 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,!appengine
+// +build !gccgo,!purego
 
 #include "textflag.h"
 
index cd55f45a3337dc6b45c71f5c65997b24657b1ebb..a9244bdf4dbfd23dc6a3842a3100bc5d897a1d70 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,!appengine
+// +build !gccgo,!purego
 
 package chacha20
 
index de52a2ea8d1b3c93fd3f43803e6206eb204ee777..89c658c410bf6b5c05b75ae3d1370dfa3c0fa80d 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,!appengine
+// +build !gccgo,!purego
 
 #include "go_asm.h"
 #include "textflag.h"
index 737e46aa5a4eef607a29f322406df13e77425953..cda77819b84a1ecf9b9bf5210f3fb01168ace767 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 !gccgo,!purego
 
 package chacha20poly1305
 
index 9dd5d7a979ad1e5d5b12c45255b0eb2afa200eda..3469c87288ee689839d2e10bfe27d92b9bc5a87a 100644 (file)
@@ -4,7 +4,7 @@
 
 // This file was originally from https://golang.org/cl/24717 by Vlad Krasnov of CloudFlare.
 
-// +build go1.7,amd64,!gccgo,!appengine
+// +build !gccgo,!purego
 
 #include "textflag.h"
 // General register allocation
index 4c2eb703c327cddc1a3caea33cfc85e9b8dd59c1..9ce4aa9fe65f51b0bfe85d187db2dd80315937b7 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 !go1.7 gccgo appengine
+// +build !amd64 gccgo purego
 
 package chacha20poly1305
 
index a8dd589ae3906e68f55c20f767f9ca9c84561305..b0c2cd05614a69ca8e48ee3bbb087bacdfca312a 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 gccgo appengine
+// +build !amd64,!ppc64le gccgo purego
 
 package poly1305
 
index df56a652ff0854876ad7671abb4f45d0f8b325fa..35b9e38c9039ea5714db7743526d83c211f2a9ec 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 !gccgo,!purego
 
 package poly1305
 
index 8c0cefbb3cb7a959573cc0352667a4a31d02ec06..8d394a212ee92b4a15ad387e751dc3766b7337bc 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 !gccgo,!purego
 
 #include "textflag.h"
 
index 32a9cef6bbfff6f8d390417afa7c0c145284e15d..2e3ae34c7dc511de078ae4441bc581c70f15a52e 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 s390x,!go1.11 !amd64,!s390x,!ppc64le gccgo appengine nacl
+// +build s390x,!go1.11 !amd64,!s390x,!ppc64le gccgo purego
 
 package poly1305
 
index 3233616935bd8f35369771f97cd61d17eb825e86..92597bb8c26ca383fb3f55e25ceda42a9592fe04 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 ppc64le,!gccgo,!appengine
+// +build !gccgo,!purego
 
 package poly1305
 
index 4e20bf299a5ea11ac89f520ae2d896268d2b686e..4e028138796827380d4a237b14f3a1bd91e88091 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 ppc64le,!gccgo,!appengine
+// +build !gccgo,!purego
 
 #include "textflag.h"
 
index a8920ee9d21d9cee5f3f5e26ff9b32f979d514f3..5f91ff84a9e584bab35982fd733710adf55fe02c 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 s390x,go1.11,!gccgo,!appengine
+// +build go1.11,!gccgo,!purego
 
 package poly1305
 
index ca5a309d8672ceb31e43bc2236505fb257acdbff..806d1694b041a42724dbe23b3b931bfd6ef1c8c7 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 s390x,go1.11,!gccgo,!appengine
+// +build go1.11,!gccgo,!purego
 
 #include "textflag.h"
 
index e60bbc1d7f89f88a298f9ffcd271288017f68a77..b439af9369344ad389394af0fe4811fc4a5bc430 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 s390x,go1.11,!gccgo,!appengine
+// +build go1.11,!gccgo,!purego
 
 #include "textflag.h"
 
index 6feb23d65d1ac172c030378d848e6678ffe25c64..f2697872040229c2286e1a9ea3d12727e61cf91d 100644 (file)
@@ -1,4 +1,4 @@
-# golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6
+# golang.org/x/crypto v0.0.0-20200414155820-4f8f47aa7992
 ## explicit
 golang.org/x/crypto/chacha20
 golang.org/x/crypto/chacha20poly1305