aboutsummaryrefslogtreecommitdiff
path: root/modules/crypto/ssh/kex_test.go
diff options
context:
space:
mode:
authorEmrah URHAN <raxetul@gmail.com>2015-11-22 19:40:18 +0200
committerEmrah URHAN <raxetul@gmail.com>2015-11-22 19:40:18 +0200
commit737da1a3748d7c82af771d3ba4aa4c76ba219eee (patch)
treeb59104944ba28771752adcc1231a847b6704ac4d /modules/crypto/ssh/kex_test.go
parentf63a468dfce812423b78a47cfa2583c5ad2faa49 (diff)
parentefaf60ba5a4a7c0954dbaf57203859db3258281f (diff)
Latest develop updates is merged with my RaspberryPi Dockerfile version.
Merge branch 'develop' of https://github.com/gogits/gogs into develop
Diffstat (limited to 'modules/crypto/ssh/kex_test.go')
-rwxr-xr-xmodules/crypto/ssh/kex_test.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/modules/crypto/ssh/kex_test.go b/modules/crypto/ssh/kex_test.go
deleted file mode 100755
index 12ca0acd..00000000
--- a/modules/crypto/ssh/kex_test.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2013 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.
-
-package ssh
-
-// Key exchange tests.
-
-import (
- "crypto/rand"
- "reflect"
- "testing"
-)
-
-func TestKexes(t *testing.T) {
- type kexResultErr struct {
- result *kexResult
- err error
- }
-
- for name, kex := range kexAlgoMap {
- a, b := memPipe()
-
- s := make(chan kexResultErr, 1)
- c := make(chan kexResultErr, 1)
- var magics handshakeMagics
- go func() {
- r, e := kex.Client(a, rand.Reader, &magics)
- a.Close()
- c <- kexResultErr{r, e}
- }()
- go func() {
- r, e := kex.Server(b, rand.Reader, &magics, testSigners["ecdsa"])
- b.Close()
- s <- kexResultErr{r, e}
- }()
-
- clientRes := <-c
- serverRes := <-s
- if clientRes.err != nil {
- t.Errorf("client: %v", clientRes.err)
- }
- if serverRes.err != nil {
- t.Errorf("server: %v", serverRes.err)
- }
- if !reflect.DeepEqual(clientRes.result, serverRes.result) {
- t.Errorf("kex %q: mismatch %#v, %#v", name, clientRes.result, serverRes.result)
- }
- }
-}