aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/crypto/ssh/test/cert_test.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2019-10-29 16:51:07 +0100
committerStefan Majewsky <majewsky@gmx.net>2019-10-29 16:51:07 +0100
commitafe18e86a7aa2248c69997ed941bcbe3e6b2a655 (patch)
tree7aaef5752ba8ad3465e9638c7adca71e1a103ee3 /vendor/golang.org/x/crypto/ssh/test/cert_test.go
parentef84ca3e82f422118c69a0c562433c185e1dcb9b (diff)
downloadgofu-afe18e86a7aa2248c69997ed941bcbe3e6b2a655.tar.gz
switch to go.mod
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh/test/cert_test.go')
-rw-r--r--vendor/golang.org/x/crypto/ssh/test/cert_test.go48
1 files changed, 0 insertions, 48 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/test/cert_test.go b/vendor/golang.org/x/crypto/ssh/test/cert_test.go
deleted file mode 100644
index bc83e4f..0000000
--- a/vendor/golang.org/x/crypto/ssh/test/cert_test.go
+++ /dev/null
@@ -1,48 +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(),
- HostKeyCallback: ssh.InsecureIgnoreHostKey(),
- }
- conf.Auth = append(conf.Auth, ssh.PublicKeys(certSigner))
- client, err := s.TryDial(conf)
- if err != nil {
- t.Fatalf("TryDial: %v", err)
- }
- client.Close()
-}