From 82bc509d1c9b4428def44a0e3b9a2452438fdb39 Mon Sep 17 00:00:00 2001 From: Arash Payan Date: Wed, 11 Mar 2026 11:00:32 -0700 Subject: [PATCH 1/3] Use Go 1.26 in CI and switch to staticcheck for linting --- .github/workflows/go.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8c41079..d94eb05 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,7 +3,7 @@ jobs: test_linux: strategy: matrix: - go: [1.23.3] + go: [1.26.1] runs-on: ubuntu-22.04 steps: - uses: actions/setup-go@v5 @@ -30,15 +30,13 @@ jobs: - run: | cp ./.github/client_conf.json ./ go test -v -race ./... - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.63.4 - skip-cache: true - args: --timeout=8m + - run: | + go install honnef.co/go/tools/cmd/staticcheck@latest + staticcheck ./... test_windows: strategy: matrix: - go: [1.23.3] + go: [1.26.1] runs-on: windows-2022 steps: - uses: actions/setup-go@v5 @@ -62,9 +60,7 @@ jobs: - run: | cp ./.github/client_conf.json ./ go test -v -race ./... - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.63.4 - skip-cache: true - args: --timeout=8m + - run: | + go install honnef.co/go/tools/cmd/staticcheck@latest + staticcheck ./... From 340f243ff811594d7215b759ceb5bd7a673983cf Mon Sep 17 00:00:00 2001 From: Arash Payan Date: Wed, 11 Mar 2026 11:20:11 -0700 Subject: [PATCH 2/3] Update lint directives and delete unused types --- conn.go | 2 +- initiator.go | 2 +- internal/ntlm/client.go | 3 +-- internal/ntlm/ntlm.go | 17 +---------------- krb5.go | 4 ++-- 5 files changed, 6 insertions(+), 22 deletions(-) diff --git a/conn.go b/conn.go index 50c7b08..b0f8921 100644 --- a/conn.go +++ b/conn.go @@ -321,7 +321,7 @@ func (conn *conn) enableSession() { atomic.StoreInt32(&conn._useSession, 1) } -//nolint:unused // appears to be legacy, unsure, so leaving for now +//lint:ignore U1000 appears to be legacy, unsure, so leaving for now func (conn *conn) sendRecv(cmd uint16, req smb2.Packet, ctx context.Context) (res []byte, err error) { rr, err := conn.send(req, ctx) if err != nil { diff --git a/initiator.go b/initiator.go index 25237e0..7c32ee3 100644 --- a/initiator.go +++ b/initiator.go @@ -66,7 +66,7 @@ func (i *NTLMInitiator) SessionKey() []byte { return i.ntlm.Session().SessionKey() } -//nolint:unused // appears to be legacy, unsure, so leaving for now +//lint:ignore U1000 appears to be legacy, unsure, so leaving for now func (i *NTLMInitiator) infoMap() *ntlm.InfoMap { return i.ntlm.Session().InfoMap() } diff --git a/internal/ntlm/client.go b/internal/ntlm/client.go index 313c303..58b99ae 100644 --- a/internal/ntlm/client.go +++ b/internal/ntlm/client.go @@ -20,8 +20,7 @@ type Client struct { Domain string // e.g "WORKGROUP", "MicrosoftAccount" Workstation string // e.g "localhost", "HOME-PC" - TargetSPN string // SPN ::= "service/hostname[:port]"; e.g "cifs/remotehost:1020" - channelBindings *channelBindings //nolint:unused // reserved for future implementation + TargetSPN string // SPN ::= "service/hostname[:port]"; e.g "cifs/remotehost:1020" nmsg []byte session *Session diff --git a/internal/ntlm/ntlm.go b/internal/ntlm/ntlm.go index 129ee37..b919869 100644 --- a/internal/ntlm/ntlm.go +++ b/internal/ntlm/ntlm.go @@ -8,7 +8,7 @@ import ( "hash" "hash/crc32" - "golang.org/x/crypto/md4" //nolint:staticcheck // md4 may be deprecated, but SMB still uses it + "golang.org/x/crypto/md4" //lint:ignore SA1019 md4 may be deprecated, but SMB still uses it ) var zero [16]byte @@ -78,21 +78,6 @@ const ( MsvAvChannelBindings ) -//nolint:unused -type addr struct { - typ uint32 - val []byte -} - -// channelBindings represents gss_channel_bindings_struct -// -//nolint:unused -type channelBindings struct { - InitiatorAddress addr - AcceptorAddress addr - AppData []byte -} - var signature = []byte("NTLMSSP\x00") // Version diff --git a/krb5.go b/krb5.go index 6b05f57..2ed0804 100644 --- a/krb5.go +++ b/krb5.go @@ -34,11 +34,11 @@ func (ki *Krb5Initiator) OID() asn1.ObjectIdentifier { // InitSecContext initiates the security context. func (ki *Krb5Initiator) InitSecContext() ([]byte, error) { if ki.Client == nil { - return nil, errors.New("Kerberos client is not set") + return nil, errors.New("Kerberos client is not set") //lint:ignore ST1005 Kerberos is a proper noun } if ki.TargetSPN == "" { - return nil, errors.New("Kerberos target SPN is not set") + return nil, errors.New("Kerberos target SPN is not set") //lint:ignore ST1005 Kerberos is a proper noun } tkt, key, err := ki.Client.GetServiceTicket(ki.TargetSPN) From 8f7a89d94ce1fe2f8a3621c4d8036947de01a53f Mon Sep 17 00:00:00 2001 From: Arash Payan Date: Wed, 11 Mar 2026 11:24:02 -0700 Subject: [PATCH 3/3] Try Ubuntu 24 --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d94eb05..0c2ecc5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -4,7 +4,7 @@ jobs: strategy: matrix: go: [1.26.1] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/setup-go@v5 with: