Skip to content

Commit

Permalink
network level auth for RPC still not working. Got it giving a consist…
Browse files Browse the repository at this point in the history
…ent access denied, so feeling that a key calculation is going wrong somewhere
  • Loading branch information
Etienne Stalmans committed Nov 29, 2016
1 parent d094fc5 commit 8b8c985
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpc-http/rpctransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ func RPCBind() {
//parse out and setup security
if AuthSession.RPCNetworkAuthLevel == RPC_C_AUTHN_LEVEL_PKT_PRIVACY {
resp, err := RPCRead(1)
//fmt.Printf("Security setup: %x\n\n%x\n", resp.PDU, resp.SecTrailer)

sec := RTSSec{}
sec.Unmarshal(resp.SecTrailer, int(resp.Header.AuthLen))
//fmt.Printf("Security setup: %x\nPad: %d\n", sec.Data, sec.AuthPadLen)

challengeBytes := append(sec.Data[:len(sec.Data)-1], []byte{0x00}...)

rpcntlmsession.SetUserInfo(AuthSession.User, AuthSession.Pass, AuthSession.Domain)
Expand Down Expand Up @@ -320,7 +320,7 @@ func DoConnectExRequest(MAPI []byte, auxlen uint32) ([]byte, error) {

data := pdu.Marshal()
//pad if necessary
pad := 0 //(4-(len(data)%4)) % 4
pad := (4 - (len(data) % 4)) % 4
data = append(data, bytes.Repeat([]byte{0x00}, pad)...)

sealed, sign, _ := rpcntlmsession.Seal(data)
Expand Down

0 comments on commit 8b8c985

Please sign in to comment.