diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8c41079..0c2ecc5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,8 +3,8 @@ jobs: test_linux: strategy: matrix: - go: [1.23.3] - runs-on: ubuntu-22.04 + go: [1.26.1] + runs-on: ubuntu-24.04 steps: - uses: actions/setup-go@v5 with: @@ -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 ./... 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)