Commit c66972df authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Add structure definition for RPC AUTH3 packet and use the size of this…

rpcrt4: Add structure definition for RPC AUTH3 packet and use the size of this on sending to fix authentication against native servers. Also use the new size to validate incoming AUTH3 packets to be consistent with native.
parent 7222e8b6
......@@ -139,6 +139,13 @@ typedef struct
unsigned short num_data_items;
} RpcPktHttpHdr;
/* AUTH3 packet */
typedef struct
{
RpcPktCommonHdr common;
unsigned int pad; /* ignored */
} RpcPktAuth3Hdr;
/* Union representing all possible packet headers */
typedef union
{
......@@ -150,6 +157,7 @@ typedef union
RpcPktBindAckHdr bind_ack;
RpcPktBindNAckHdr bind_nack;
RpcPktHttpHdr http;
RpcPktAuth3Hdr auth3;
} RpcPktHdr;
typedef struct
......
......@@ -59,7 +59,7 @@ DWORD RPCRT4_GetHeaderSize(const RpcPktHdr *Header)
sizeof(Header->request), 0, sizeof(Header->response),
sizeof(Header->fault), 0, 0, 0, 0, 0, 0, 0, sizeof(Header->bind),
sizeof(Header->bind_ack), sizeof(Header->bind_nack),
0, 0, sizeof(Header->common), 0, 0, 0, sizeof(Header->http)
0, 0, sizeof(Header->auth3), 0, 0, 0, sizeof(Header->http)
};
ULONG ret = 0;
......@@ -217,12 +217,12 @@ static RpcPktHdr *RPCRT4_BuildAuthHeader(ULONG DataRepresentation)
RpcPktHdr *header;
header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(header->common));
sizeof(header->auth3));
if (header == NULL)
return NULL;
RPCRT4_BuildCommonHeader(header, PKT_AUTH3, DataRepresentation);
header->common.frag_len = sizeof(header->common);
header->common.frag_len = sizeof(header->auth3);
return header;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment