Skip to content

Commit

Permalink
Ignore Snyk Code issues
Browse files Browse the repository at this point in the history
  • Loading branch information
szh committed Nov 4, 2024
1 parent 1a872cf commit ea132d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ntlm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package mssql
Expand Down Expand Up @@ -188,6 +189,7 @@ func clientChallenge() (nonce [8]byte) {

func ntlmSessionResponse(clientNonce [8]byte, serverChallenge [8]byte, password string) [24]byte {
var sessionHash [16]byte
// deepcode ignore InsecureHash: This is necessary for legacy support
h := md5.New()
h.Write(serverChallenge[:])
h.Write(clientNonce[:])
Expand Down
2 changes: 2 additions & 0 deletions tds.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,11 @@ initiate_connection:
config.RootCAs = certs
}
if p.trustServerCertificate {
// deepcode ignore TooPermissiveTrustManager: This is disabled by default
config.InsecureSkipVerify = true // #nosec
}
if p.disableVerifyHostname {
// deepcode ignore TooPermissiveTrustManager: This is disabled by default
config.InsecureSkipVerify = true // #nosec
}
config.ServerName = p.hostInCertificate
Expand Down
2 changes: 2 additions & 0 deletions tds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestSendLogin(t *testing.T) {
OptionFlags3: 8,
HostName: "subdev1",
UserName: "test",
// file deepcode ignore HardcodedPassword/test: This is a test file
Password: "testpwd",
AppName: "appname",
ServerName: "servername",
Expand Down Expand Up @@ -72,6 +73,7 @@ func TestSendLogin(t *testing.T) {

func TestReadLogin(t *testing.T) {
fail := func (name string, expected, actual interface{}) {
// file deepcode ignore ClearTextLogging/test: This is a test file
fmt.Println("Expected:", expected)
fmt.Println("Returned:", actual)
t.Errorf("input output don't match for %s", name)
Expand Down

0 comments on commit ea132d3

Please sign in to comment.