Skip to content

Commit eab4a26

Browse files
committed
bump version to v0.1.6 and enforce minimum version
1 parent 350f4dd commit eab4a26

File tree

7 files changed

+63
-15
lines changed

7 files changed

+63
-15
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
tsshd (0.1.6) trusty; urgency=medium
2+
3+
* tsshd v0.1.6
4+
5+
-- Lonny Wong <lonnywong@qq.com> Sat, 17 Jan 2026 20:55:39 +0800
6+
17
tsshd (0.1.5) trusty; urgency=medium
28

39
* tsshd v0.1.5

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ require (
1212
github.com/trzsz/shellescape v1.6.0
1313
github.com/trzsz/smux v1.6.0
1414
github.com/xtaci/kcp-go/v5 v5.6.61
15-
golang.org/x/crypto v0.46.0
16-
golang.org/x/net v0.48.0
15+
golang.org/x/crypto v0.47.0
16+
golang.org/x/net v0.49.0
1717
golang.org/x/sys v0.40.0
1818
)
1919

2020
require (
2121
github.com/davecgh/go-spew v1.1.1 // indirect
2222
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
23-
github.com/klauspost/reedsolomon v1.12.6 // indirect
23+
github.com/klauspost/reedsolomon v1.13.0 // indirect
2424
github.com/kr/text v0.2.0 // indirect
2525
github.com/pkg/errors v0.9.1 // indirect
2626
github.com/pmezard/go-difflib v1.0.0 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
3434
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
3535
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
3636
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
37-
github.com/klauspost/reedsolomon v1.12.6 h1:8pqE9aECQG/ZFitiUD1xK/E83zwosBAZtE3UbuZM8TQ=
38-
github.com/klauspost/reedsolomon v1.12.6/go.mod h1:ggJT9lc71Vu+cSOPBlxGvBN6TfAS77qB4fp8vJ05NSA=
37+
github.com/klauspost/reedsolomon v1.13.0 h1:E0Cmgf2kMuhZTj6eefnvpKC4/Q4jhCi9YIjcZjK4arc=
38+
github.com/klauspost/reedsolomon v1.13.0/go.mod h1:ggJT9lc71Vu+cSOPBlxGvBN6TfAS77qB4fp8vJ05NSA=
3939
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
4040
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
4141
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -66,8 +66,8 @@ go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
6666
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
6767
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
6868
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
69-
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
70-
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
69+
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
70+
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
7171
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
7272
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
7373
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
@@ -78,8 +78,8 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
7878
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
7979
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
8080
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
81-
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
82-
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
81+
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
82+
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
8383
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
8484
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
8585
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -91,8 +91,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
9191
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
9292
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
9393
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
94-
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
95-
golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
94+
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
95+
golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww=
9696
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
9797
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
9898
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=

tsshd/bus.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ func handleBusEvent(stream Stream) {
8181
return
8282
}
8383

84-
if msg.ClientVer == "" {
84+
ver, err := parseTsshdVersion(msg.ClientVer)
85+
if err != nil {
86+
sendError(stream, fmt.Errorf("tsshd version invalid: %v", err))
87+
return
88+
}
89+
if ver.compare(&tsshdVersion{0, 1, 6}) < 0 {
8590
sendError(stream, fmt.Errorf("please upgrade tssh to continue"))
8691
return
8792
}

tsshd/client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ func NewSshUdpClient(opts *UdpClientOptions) (*SshUdpClient, error) {
108108
enableDebugLogging, clientDebug = opts.EnableDebugging, opts.DebugFunc
109109
enableWarningLogging, clientWarningFunc = opts.EnableWarning, opts.WarningFunc
110110

111-
if opts.ServerInfo.ServerVer == "" {
111+
ver, err := parseTsshdVersion(opts.ServerInfo.ServerVer)
112+
if err != nil {
113+
return nil, fmt.Errorf("tsshd version invalid: %v", err)
114+
}
115+
if ver.compare(&tsshdVersion{0, 1, 6}) < 0 {
112116
return nil, fmt.Errorf("please upgrade tsshd to continue")
113117
}
114118

@@ -126,7 +130,6 @@ func NewSshUdpClient(opts *UdpClientOptions) (*SshUdpClient, error) {
126130
clientWarningFn: opts.WarningFunc,
127131
}
128132

129-
var err error
130133
var tsshdAddr string
131134
tsshdAddr, udpClient.networkProxy, err = startClientProxy(udpClient, opts)
132135
if err != nil {

tsshd/comm.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"fmt"
3131
"io"
3232
"net"
33+
"strconv"
3334
"strings"
3435
"sync"
3536
"sync/atomic"
@@ -182,6 +183,39 @@ func isClosedError(err error) bool {
182183
return false
183184
}
184185

186+
type tsshdVersion [3]uint32
187+
188+
func parseTsshdVersion(ver string) (*tsshdVersion, error) {
189+
if ver == "" {
190+
return &tsshdVersion{}, nil
191+
}
192+
tokens := strings.Split(ver, ".")
193+
if len(tokens) != 3 {
194+
return nil, fmt.Errorf("invalid version format [%s]", ver)
195+
}
196+
var version tsshdVersion
197+
for i := range 3 {
198+
v, err := strconv.ParseUint(tokens[i], 10, 32)
199+
if err != nil {
200+
return nil, fmt.Errorf("invalid numeric part [%s] in version [%s]", tokens[i], ver)
201+
}
202+
version[i] = uint32(v)
203+
}
204+
return &version, nil
205+
}
206+
207+
func (v *tsshdVersion) compare(ver *tsshdVersion) int {
208+
for i := range 3 {
209+
if v[i] < ver[i] {
210+
return -1
211+
}
212+
if v[i] > ver[i] {
213+
return 1
214+
}
215+
}
216+
return 0
217+
}
218+
185219
type timeoutChecker struct {
186220
mutex sync.Mutex
187221
closed atomic.Bool

tsshd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"strings"
3434
)
3535

36-
const kTsshdVersion = "0.1.5"
36+
const kTsshdVersion = "0.1.6"
3737

3838
// buildTag stores the version tag injected at build time via -ldflags.
3939
var buildTag = ""

0 commit comments

Comments
 (0)