diff options
author | Unknwon <u@gogs.io> | 2015-11-08 16:59:56 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-08 16:59:56 -0500 |
commit | 18c841050b4c843ef723e788d4c0a4c29c67ffe3 (patch) | |
tree | 05fa3bde8473045add17f4efe9a0ba141b178bf7 /modules/crypto/ssh/test/cert_test.go | |
parent | b55499d039c5e35130057b8af16401c558e79e79 (diff) | |
download | gitea-18c841050b4c843ef723e788d4c0a4c29c67ffe3.tar.gz gitea-18c841050b4c843ef723e788d4c0a4c29c67ffe3.zip |
fix 1540 and experimental SSH server support
Diffstat (limited to 'modules/crypto/ssh/test/cert_test.go')
-rwxr-xr-x | modules/crypto/ssh/test/cert_test.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/modules/crypto/ssh/test/cert_test.go b/modules/crypto/ssh/test/cert_test.go deleted file mode 100755 index 364790f17d..0000000000 --- a/modules/crypto/ssh/test/cert_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2014 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. - -// +build darwin dragonfly freebsd linux netbsd openbsd - -package test - -import ( - "crypto/rand" - "testing" - - "golang.org/x/crypto/ssh" -) - -func TestCertLogin(t *testing.T) { - s := newServer(t) - defer s.Shutdown() - - // Use a key different from the default. - clientKey := testSigners["dsa"] - caAuthKey := testSigners["ecdsa"] - cert := &ssh.Certificate{ - Key: clientKey.PublicKey(), - ValidPrincipals: []string{username()}, - CertType: ssh.UserCert, - ValidBefore: ssh.CertTimeInfinity, - } - if err := cert.SignCert(rand.Reader, caAuthKey); err != nil { - t.Fatalf("SetSignature: %v", err) - } - - certSigner, err := ssh.NewCertSigner(cert, clientKey) - if err != nil { - t.Fatalf("NewCertSigner: %v", err) - } - - conf := &ssh.ClientConfig{ - User: username(), - } - conf.Auth = append(conf.Auth, ssh.PublicKeys(certSigner)) - client, err := s.TryDial(conf) - if err != nil { - t.Fatalf("TryDial: %v", err) - } - client.Close() -} |