Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsdmike committed Jun 14, 2024
1 parent 475254a commit e02d81d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/apf/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func ProcessGlobalRequest(data []byte) interface{} {
if tcpForwardRequest.Port == 16992 || tcpForwardRequest.Port == 16993 {
reply = TcpForwardReplySuccess(tcpForwardRequest.Port)
} else {
reply = int16(APF_REQUEST_FAILURE)
reply = APF_REQUEST_FAILURE
}
} else if genericHeader.String == APF_GLOBAL_REQUEST_STR_TCP_FORWARD_CANCEL_REQUEST {
reply = APF_REQUEST_SUCCESS
Expand Down
12 changes: 6 additions & 6 deletions pkg/wsman/client/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (c *AuthChallenge) response(method, uri, cnonce string) (string, error) {
return "", fmt.Errorf("%w: %w", errRandRead, err)
}

c.CNonce = fmt.Sprintf("%x", b)[:16]
c.CNonce = fmt.Sprintf("%x", b)[:6]
}

c.Qop = "auth"
Expand Down Expand Up @@ -125,11 +125,11 @@ func (c *AuthChallenge) authorize(method, uri string) (string, error) {
sb.WriteString(response)
sb.WriteString(`"`)

if c.Algorithm != "" {
sb.WriteString(`, algorithm="`)
sb.WriteString(c.Algorithm)
sb.WriteString(`"`)
}
// if c.Algorithm != "" {
// sb.WriteString(`, algorithm="`)
// sb.WriteString(c.Algorithm)
// sb.WriteString(`"`)
// }

if c.Opaque != "" {
sb.WriteString(`, opaque="`)
Expand Down
7 changes: 4 additions & 3 deletions pkg/wsman/client/wsman.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (t *Target) Post(msg string) (response []byte, err error) {
if err != nil {
return nil, err
}

req.Header.Set("Host", "4c4c4544-004d-4d10-8050-b2c04f325133:16992")
if t.username != "" && t.password != "" {
if t.useDigest {
auth, err = t.challenge.authorize("POST", "/wsman")
Expand All @@ -121,7 +121,7 @@ func (t *Target) Post(msg string) (response []byte, err error) {
}
}

req.Header.Add("content-type", ContentType)
// req.Header.Add("content-type", ContentType)

if t.logAMTMessages {
logrus.Trace(msg)
Expand Down Expand Up @@ -150,7 +150,8 @@ func (t *Target) Post(msg string) (response []byte, err error) {
}

req.Header.Set("Authorization", auth)
req.Header.Add("content-type", ContentType)
// req.Header.Add("content-type", ContentType)
req.Header.Set("Host", "4c4c4544-004d-4d10-8050-b2c04f325133:16992")

res, err = t.Do(req)
if err != nil && err.Error() != io.EOF.Error() {
Expand Down

0 comments on commit e02d81d

Please sign in to comment.