From f3652d0682f500a84191b34cd58e37e6fd684c36 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 19 Feb 2020 12:47:59 +0100 Subject: [PATCH] vendor: golang.org/x/crypto 1d94cc7ab1c630336ab82ccb9c9cda72a875c382 full diff: https://github.com/golang/crypto/compare/69ecbb4d6d5dab05e49161c6e77ea40a030884e1...1d94cc7ab1c630336ab82ccb9c9cda72a875c382 Signed-off-by: Sebastiaan van Stijn --- vendor.conf | 2 +- vendor/golang.org/x/crypto/ssh/terminal/terminal.go | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/vendor.conf b/vendor.conf index 004dc9c99..f0f86a821 100644 --- a/vendor.conf +++ b/vendor.conf @@ -70,7 +70,7 @@ github.com/opencontainers/selinux 5215b1806f52b1fcc2070a8826c5 github.com/seccomp/libseccomp-golang 689e3c1541a84461afc49c1c87352a6cedf72e9c # v0.9.1 github.com/stretchr/testify 221dbe5ed46703ee255b1da0dec05086f5035f62 # v1.4.0 github.com/tchap/go-patricia 666120de432aea38ab06bd5c818f04f4129882c9 # v2.2.6 -golang.org/x/crypto 69ecbb4d6d5dab05e49161c6e77ea40a030884e1 +golang.org/x/crypto 1d94cc7ab1c630336ab82ccb9c9cda72a875c382 golang.org/x/oauth2 0f29369cfe4552d0e4bcddc57cc75f4d7e672a33 golang.org/x/time 9d24e82272b4f38b78bc8cff74fa936d31ccd8ef gopkg.in/inf.v0 d2d2541c53f18d2a059457998ce2876cc8e67cbf # v0.9.1 diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go index dd7378c8a..d1b4fca3a 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go @@ -7,6 +7,7 @@ package terminal import ( "bytes" "io" + "runtime" "strconv" "sync" "unicode/utf8" @@ -939,6 +940,8 @@ func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) { // readPasswordLine reads from reader until it finds \n or io.EOF. // The slice returned does not include the \n. // readPasswordLine also ignores any \r it finds. +// Windows uses \r as end of line. So, on Windows, readPasswordLine +// reads until it finds \r and ignores any \n it finds during processing. func readPasswordLine(reader io.Reader) ([]byte, error) { var buf [1]byte var ret []byte @@ -952,9 +955,15 @@ func readPasswordLine(reader io.Reader) ([]byte, error) { ret = ret[:len(ret)-1] } case '\n': - return ret, nil + if runtime.GOOS != "windows" { + return ret, nil + } + // otherwise ignore \n case '\r': - // remove \r from passwords on Windows + if runtime.GOOS == "windows" { + return ret, nil + } + // otherwise ignore \r default: ret = append(ret, buf[0]) }