Browse Source

upgrade golang.org/x/crypto

tags/v2.1.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
b1bab67e83

+ 1
- 1
go.mod View File

@@ -18,7 +18,7 @@ require (
18 18
 	github.com/oragono/go-ident v0.0.0-20170110123031-337fed0fd21a
19 19
 	github.com/stretchr/testify v1.4.0 // indirect
20 20
 	github.com/tidwall/buntdb v1.1.2
21
-	golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
21
+	golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
22 22
 	golang.org/x/text v0.3.2
23 23
 	gopkg.in/yaml.v2 v2.2.8
24 24
 )

+ 2
- 0
go.sum View File

@@ -61,6 +61,8 @@ github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563/go.mod h1:mLqSmt
61 61
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
62 62
 golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4=
63 63
 golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
64
+golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
65
+golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
64 66
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
65 67
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
66 68
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=

+ 1
- 1
vendor/golang.org/x/crypto/sha3/sha3_s390x.go View File

@@ -112,7 +112,7 @@ func (s *asmState) Write(b []byte) (int, error) {
112 112
 		if len(s.buf) == 0 && len(b) >= cap(s.buf) {
113 113
 			// Hash the data directly and push any remaining bytes
114 114
 			// into the buffer.
115
-			remainder := len(s.buf) % s.rate
115
+			remainder := len(b) % s.rate
116 116
 			kimd(s.function, &s.a, b[:len(b)-remainder])
117 117
 			if remainder != 0 {
118 118
 				s.copyIntoBuf(b[len(b)-remainder:])

+ 15
- 2
vendor/golang.org/x/crypto/ssh/terminal/terminal.go View File

@@ -7,6 +7,7 @@ package terminal
7 7
 import (
8 8
 	"bytes"
9 9
 	"io"
10
+	"runtime"
10 11
 	"strconv"
11 12
 	"sync"
12 13
 	"unicode/utf8"
@@ -939,6 +940,8 @@ func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) {
939 940
 // readPasswordLine reads from reader until it finds \n or io.EOF.
940 941
 // The slice returned does not include the \n.
941 942
 // readPasswordLine also ignores any \r it finds.
943
+// Windows uses \r as end of line. So, on Windows, readPasswordLine
944
+// reads until it finds \r and ignores any \n it finds during processing.
942 945
 func readPasswordLine(reader io.Reader) ([]byte, error) {
943 946
 	var buf [1]byte
944 947
 	var ret []byte
@@ -947,10 +950,20 @@ func readPasswordLine(reader io.Reader) ([]byte, error) {
947 950
 		n, err := reader.Read(buf[:])
948 951
 		if n > 0 {
949 952
 			switch buf[0] {
953
+			case '\b':
954
+				if len(ret) > 0 {
955
+					ret = ret[:len(ret)-1]
956
+				}
950 957
 			case '\n':
951
-				return ret, nil
958
+				if runtime.GOOS != "windows" {
959
+					return ret, nil
960
+				}
961
+				// otherwise ignore \n
952 962
 			case '\r':
953
-				// remove \r from passwords on Windows
963
+				if runtime.GOOS == "windows" {
964
+					return ret, nil
965
+				}
966
+				// otherwise ignore \r
954 967
 			default:
955 968
 				ret = append(ret, buf[0])
956 969
 			}

+ 2
- 2
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go View File

@@ -85,8 +85,8 @@ func ReadPassword(fd int) ([]byte, error) {
85 85
 	}
86 86
 	old := st
87 87
 
88
-	st &^= (windows.ENABLE_ECHO_INPUT)
89
-	st |= (windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)
88
+	st &^= (windows.ENABLE_ECHO_INPUT | windows.ENABLE_LINE_INPUT)
89
+	st |= (windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_PROCESSED_INPUT)
90 90
 	if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil {
91 91
 		return nil, err
92 92
 	}

+ 1
- 1
vendor/modules.txt View File

@@ -59,7 +59,7 @@ github.com/tidwall/rtree
59 59
 github.com/tidwall/rtree/base
60 60
 # github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563
61 61
 github.com/tidwall/tinyqueue
62
-# golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
62
+# golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
63 63
 ## explicit
64 64
 golang.org/x/crypto/bcrypt
65 65
 golang.org/x/crypto/blowfish

Loading…
Cancel
Save