From aa0f5b40812c405df7480c8a69e7f0160363a94b Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Mon, 10 Jun 2013 10:57:00 -0400 Subject: [PATCH] go.crypto: revert 7f5a59ff6b43. This change reverts https://golang.org/cl/10113043/ because some folks are stuck on 1.0 till 1.1.1 comes out. R=golang-dev CC=golang-dev https://golang.org/cl/10151043 --- openpgp/keys.go | 2 ++ openpgp/packet/packet.go | 2 ++ openpgp/packet/public_key.go | 1 + ssh/channel.go | 2 ++ ssh/client_auth.go | 2 ++ ssh/server.go | 2 ++ ssh/server_terminal.go | 1 + ssh/session_test.go | 1 + ssh/transport.go | 1 + 9 files changed, 14 insertions(+) diff --git a/openpgp/keys.go b/openpgp/keys.go index 13c48804..08e6c711 100644 --- a/openpgp/keys.go +++ b/openpgp/keys.go @@ -250,6 +250,8 @@ func readToNextPublicKey(packets *packet.Reader) (err error) { return } } + + panic("unreachable") } // ReadEntity reads an entity (public key, identities, subkeys etc) from the diff --git a/openpgp/packet/packet.go b/openpgp/packet/packet.go index ea3ee26e..9b5cd88a 100644 --- a/openpgp/packet/packet.go +++ b/openpgp/packet/packet.go @@ -272,6 +272,8 @@ func consumeAll(r io.Reader) (n int64, err error) { return } } + + panic("unreachable") } // packetType represents the numeric ids of the different OpenPGP packet types. See diff --git a/openpgp/packet/public_key.go b/openpgp/packet/public_key.go index 72f84801..fc9012d1 100644 --- a/openpgp/packet/public_key.go +++ b/openpgp/packet/public_key.go @@ -318,6 +318,7 @@ func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err erro default: panic("shouldn't happen") } + panic("unreachable") } // keySignatureHash returns a Hash of the message that needs to be signed for diff --git a/ssh/channel.go b/ssh/channel.go index 2819e1a0..be7b19f9 100644 --- a/ssh/channel.go +++ b/ssh/channel.go @@ -340,6 +340,8 @@ func (c *serverChan) read(data []byte) (n int, err error, windowAdjustment uint3 c.cond.Wait() } + + panic("unreachable") } // getWindowSpace takes, at most, max bytes of space from the peer's window. It diff --git a/ssh/client_auth.go b/ssh/client_auth.go index 53c7b115..ebb74a23 100644 --- a/ssh/client_auth.go +++ b/ssh/client_auth.go @@ -286,6 +286,7 @@ func (p *publickeyAuth) confirmKeyAck(key interface{}, t *transport) (bool, erro return false, UnexpectedMessageError{msgUserAuthSuccess, packet[0]} } } + panic("unreachable") } func (p *publickeyAuth) method() string { @@ -324,6 +325,7 @@ func handleAuthResponse(t *transport) (bool, []string, error) { return false, nil, UnexpectedMessageError{msgUserAuthSuccess, packet[0]} } } + panic("unreachable") } // ClientAuthKeyring returns a ClientAuth using public key authentication via diff --git a/ssh/server.go b/ssh/server.go index 06b276f3..7ecc6946 100644 --- a/ssh/server.go +++ b/ssh/server.go @@ -730,6 +730,8 @@ func (s *ServerConn) Accept() (Channel, error) { } } } + + panic("unreachable") } // A Listener implements a network listener (net.Listener) for SSH connections. diff --git a/ssh/server_terminal.go b/ssh/server_terminal.go index 7840030e..708a9159 100644 --- a/ssh/server_terminal.go +++ b/ssh/server_terminal.go @@ -77,4 +77,5 @@ func (ss *ServerTerminal) ReadLine() (line string, err error) { ss.Channel.AckRequest(ok) } } + panic("unreachable") } diff --git a/ssh/session_test.go b/ssh/session_test.go index 96830e26..d168ce80 100644 --- a/ssh/session_test.go +++ b/ssh/session_test.go @@ -62,6 +62,7 @@ func dial(handler serverType, t *testing.T) *ClientConn { handler(ch.(*serverChan), t) }() } + <-done }() config := &ClientConfig{ diff --git a/ssh/transport.go b/ssh/transport.go index 536f7e48..c222caf3 100644 --- a/ssh/transport.go +++ b/ssh/transport.go @@ -139,6 +139,7 @@ func (t *transport) readPacket() ([]byte, error) { return packet, nil } } + panic("unreachable") } // Encrypt and send a packet of data to the remote peer.