diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-26 18:41:13 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-26 18:41:13 +0700 |
| commit | 8d0720f6f9406262868e2efa0d757ec27ef7119d (patch) | |
| tree | c30fed676692f599834c991e69fb200c745d8c0c /lib/ssh/client_test.go | |
| parent | 410ab868afb9bfc8c02cba67ca6e9c436b44061b (diff) | |
| download | pakakeh.go-8d0720f6f9406262868e2efa0d757ec27ef7119d.tar.xz | |
go.mod: remove replace directive for golang.org/x/crypto
Using replace directive does not works well if we install binary using
"go install".
One of the case that we found is when user installing awwan [1] that use
"share" module [2] with replace directive, the binary is not build with
git.sr.ht/~shulhan/go-x-crypto.
/Users/xxx/go/bin/awwan: go1.21.0
path git.sr.ht/~shulhan/awwan/cmd/awwan
mod git.sr.ht/~shulhan/awwan v0.7.1-0.20230925173020-40b9fe9b854c h1:629djcSfqM8ITX+CtgGyrybPnKQPpwJ/EceN967bKps=
dep git.sr.ht/~shulhan/asciidoctor-go v0.5.0 h1:TfcAjv+7EwBZ83ef8OhX9vfQ4vRFcaJh0P1XXgbsJv0=
dep git.sr.ht/~shulhan/ciigo v0.10.0 h1:s1SJ3/NzBcbOLmEZ4z1Cx9Vf7ZdDIvm45b7KMCZKzEY=
dep github.com/evanw/esbuild v0.19.3 h1:foPr0xwQM3lBWKBtscauTN9FrmJzRDVI2+EGOs82H/I=
dep github.com/shuLhan/share v0.49.2-0.20230923081600-77c41ce992e6 h1:REQDC2UKLaWT1WGd/Iw/rfKLkXb7vtKtyObkeZeHZRk=
dep github.com/yuin/goldmark v1.5.6 h1:COmQAWTCcGetChm3Ig7G/t8AFAN00t+o8Mt4cf7JpwA=
dep github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc=
dep golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
dep golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
dep golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
dep golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
dep gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
build -buildmode=exe
build -compiler=gc
build DefaultGODEBUG=panicnil=1
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=arm64
build GOOS=darwin
This changes require use to modify lib/cryto and lib/ssh that depends
on our patches.
[1] https://git.sr.ht/~shulhan/awwan
[2] https://github.com/shuLhan/share/commit/77c41ce992e6
Diffstat (limited to 'lib/ssh/client_test.go')
| -rw-r--r-- | lib/ssh/client_test.go | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/ssh/client_test.go b/lib/ssh/client_test.go index ede94591..062a32cc 100644 --- a/lib/ssh/client_test.go +++ b/lib/ssh/client_test.go @@ -5,11 +5,13 @@ package ssh import ( + "fmt" "os" "path/filepath" "testing" "github.com/shuLhan/share/lib/ssh/config" + "github.com/shuLhan/share/lib/test" ) // TestNewClient_KeyError test SSH to server with host key does not exist in @@ -20,9 +22,8 @@ func TestNewClient_KeyError_notExist(t *testing.T) { var ( section = config.NewSection(`localhost`) - wd string - pathFile string - err error + wd string + err error ) wd, err = os.Getwd() @@ -39,20 +40,26 @@ func TestNewClient_KeyError_notExist(t *testing.T) { t.Fatal(err) } - pathFile = filepath.Join(wd, `testdata/localhost/known_hosts_empty`) - err = section.Set(config.KeyUserKnownHostsFile, pathFile) + var knownHostsFile = filepath.Join(wd, `testdata/localhost/known_hosts_empty`) + err = section.Set(config.KeyUserKnownHostsFile, knownHostsFile) if err != nil { t.Fatal(err) } - pathFile = filepath.Join(wd, `testdata/localhost/client.key`) - err = section.Set(config.KeyIdentityFile, pathFile) + var pkeyFile = filepath.Join(wd, `testdata/localhost/client.key`) + err = section.Set(config.KeyIdentityFile, pkeyFile) if err != nil { t.Fatal(err) } + var ( + expError = fmt.Sprintf(`NewClientInteractive: dialWithSigners: ssh: handshake failed: knownhosts: key is unknown from known_hosts files [%s]`, knownHostsFile) + gotError string + ) + _, err = NewClientInteractive(section) if err != nil { - t.Fatal(err) + gotError = err.Error() } + test.Assert(t, `NewClientInteractive: error`, expError, gotError) } |
