Rob Shearman : rpcrt4: Add structure definition for RPC AUTH3 packet and use the size of this on sending to fix authentication against native servers .

Alexandre Julliard julliard at winehq.org
Tue Jan 19 11:53:43 CST 2010


Module: wine
Branch: master
Commit: c66972dfbabf5b16705716d595ee198b730f50f0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c66972dfbabf5b16705716d595ee198b730f50f0

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Tue Jan 19 10:30:31 2010 +0000

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.

---

 dlls/rpcrt4/rpc_defs.h    |    8 ++++++++
 dlls/rpcrt4/rpc_message.c |    6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/rpcrt4/rpc_defs.h b/dlls/rpcrt4/rpc_defs.h
index 8514967..434d396 100644
--- a/dlls/rpcrt4/rpc_defs.h
+++ b/dlls/rpcrt4/rpc_defs.h
@@ -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
diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c
index 45a0398..0144f85 100644
--- a/dlls/rpcrt4/rpc_message.c
+++ b/dlls/rpcrt4/rpc_message.c
@@ -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;
 }




More information about the wine-cvs mailing list