Skip to content

x/crypto: No working with go1.13 #34734

@cchantep

Description

@cchantep

What version of Go are you using (go version)?

go version go1.13.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/cchantep/Library/Caches/go-build"
GOENV="/Users/cchantep/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/cchantep/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/local/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/local/lib/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="/usr/bin/clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/72/yly7jbm160gfc2yxtr2mllzw0000gn/T/go-build029258679=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Try to build (gb build):

package main

import (
	"flag"
	"io/ioutil"
	"log"
	"golang.org/x/crypto/ssh"
)

var (
	sftpAddr = flag.String("sftp-addr", "sftp-host:22", "Address to sFTP server")
	sftpKey = flag.String("sftp-key", "/path/to/private.key", "Path to private SSH key")
)

func main() {
	flag.Usage = func() {
		flag.PrintDefaults()
	}

	flag.Parse()

	// Load private key
	key, err := ioutil.ReadFile(*sftpKey)

	if err != nil {
		log.Fatalf("Unable to read private key: %v", err)
	}

	// Create the Signer for this private key.
	signer, err := ssh.ParsePrivateKey(key)

	if err != nil {
		log.Fatalf("Unable to parse private key: %v", err)
	}

	var hostKey ssh.PublicKey

	config := &ssh.ClientConfig{
		User: "user",
		Auth: []ssh.AuthMethod{
			// Use the PublicKeys method for remote authentication.
			ssh.PublicKeys(signer),
		},
		HostKeyCallback: ssh.FixedHostKey(hostKey),
	}

	// Connect to the remote server and perform the SSH handshake.
	client, err := ssh.Dial("tcp", *sftpAddr, config)

	if err != nil {
		log.Fatalf("Unable to connect: %v", err)
	}

	defer client.Close()

	// ---

	log.Printf("OK: %s", *sftpAddr)
}

What did you expect to see?

Successful build

What did you see instead?

golang.org/x/crypto/ed25519
# golang.org/x/crypto/ssh
cipher.go:21:2: can't find import: "golang.org/x/crypto/internal/chacha20"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions