Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5f266c54
Commit
5f266c54
authored
May 19, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
May 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Add the correct amount of auth padding to messages.
parent
4fb62955
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
rpc_message.c
dlls/rpcrt4/rpc_message.c
+22
-7
No files found.
dlls/rpcrt4/rpc_message.c
View file @
5f266c54
...
...
@@ -42,6 +42,14 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
rpc
);
/* note: the DCE/RPC spec says the alignment amount should be 4, but
* MS/RPC servers seem to always use 16 */
#define AUTH_ALIGNMENT 16
/* gets the amount needed to round a value up to the specified alignment */
#define ROUND_UP_AMOUNT(value, alignment) \
(((alignment) - (((value) % (alignment)))) % (alignment))
static
DWORD
RPCRT4_GetHeaderSize
(
RpcPktHdr
*
Header
)
{
static
const
DWORD
header_sizes
[]
=
{
...
...
@@ -273,12 +281,19 @@ static RPC_STATUS RPCRT4_SendAuth(RpcConnection *Connection, RpcPktHdr *Header,
Header
->
common
.
flags
|=
RPC_FLG_FIRST
;
Header
->
common
.
flags
&=
~
RPC_FLG_LAST
;
while
(
!
(
Header
->
common
.
flags
&
RPC_FLG_LAST
))
{
unsigned
char
auth_pad_len
=
ROUND_UP_AMOUNT
(
BufferLength
,
AUTH_ALIGNMENT
);
unsigned
short
pkt_size
=
BufferLength
+
hdr_size
+
alen
+
auth_pad_len
;
/* decide if we need to split the packet into fragments */
if
((
BufferLength
+
hdr_size
+
alen
)
<=
Connection
->
MaxTransmissionSize
)
{
Header
->
common
.
flags
|=
RPC_FLG_LAST
;
Header
->
common
.
frag_len
=
BufferLength
+
hdr_size
+
alen
;
if
(
pkt_size
<=
Connection
->
MaxTransmissionSize
)
{
Header
->
common
.
flags
|=
RPC_FLG_LAST
;
Header
->
common
.
frag_len
=
pkt_size
;
}
else
{
Header
->
common
.
frag_len
=
Connection
->
MaxTransmissionSize
;
auth_pad_len
=
0
;
/* make sure packet payload will be a multiple of 16 */
Header
->
common
.
frag_len
=
((
Connection
->
MaxTransmissionSize
-
hdr_size
-
alen
)
&
~
(
AUTH_ALIGNMENT
-
1
))
+
hdr_size
+
alen
;
}
pkt
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
Header
->
common
.
frag_len
);
...
...
@@ -298,7 +313,7 @@ static RPC_STATUS RPCRT4_SendAuth(RpcConnection *Connection, RpcPktHdr *Header,
auth_hdr
[
0
]
=
Connection
->
AuthInfo
->
AuthnSvc
;
auth_hdr
[
1
]
=
Connection
->
AuthInfo
->
AuthnLevel
;
auth_hdr
[
2
]
=
0x00
;
/* FIXME: add padding */
auth_hdr
[
2
]
=
auth_pad_len
;
auth_hdr
[
3
]
=
0x00
;
/* a unique number... */
...
...
@@ -314,8 +329,8 @@ write:
return
RPC_S_PROTOCOL_ERROR
;
}
buffer_pos
+=
Header
->
common
.
frag_len
-
hdr_size
-
alen
;
BufferLength
-=
Header
->
common
.
frag_len
-
hdr_size
-
alen
;
buffer_pos
+=
Header
->
common
.
frag_len
-
hdr_size
-
alen
-
auth_pad_len
;
BufferLength
-=
Header
->
common
.
frag_len
-
hdr_size
-
alen
-
auth_pad_len
;
Header
->
common
.
flags
&=
~
RPC_FLG_FIRST
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment