Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
fee52bd4
Commit
fee52bd4
authored
May 30, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Pass single input and output buffers for handshake call.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
c1d9d6e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
31 deletions
+31
-31
schannel.c
dlls/secur32/schannel.c
+29
-6
schannel_gnutls.c
dlls/secur32/schannel_gnutls.c
+2
-24
secur32_priv.h
dlls/secur32/secur32_priv.h
+0
-1
No files found.
dlls/secur32/schannel.c
View file @
fee52bd4
...
...
@@ -767,6 +767,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
int
output_buffer_idx
=
-
1
;
int
idx
,
i
;
ULONG
input_offset
=
0
,
output_offset
=
0
;
SecBufferDesc
input_desc
,
output_desc
;
TRACE
(
"%p %p %s 0x%08lx %ld %ld %p %ld %p %p %p %p
\n
"
,
phCredential
,
phContext
,
debugstr_w
(
pszTargetName
),
fContextReq
,
Reserved1
,
TargetDataRep
,
pInput
,
...
...
@@ -917,11 +918,30 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
alloc_buffer
.
BufferType
=
SECBUFFER_TOKEN
;
alloc_buffer
.
pvBuffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
extra_size
);
}
memset
(
&
input_desc
,
0
,
sizeof
(
input_desc
));
if
(
pInput
&&
(
idx
=
schan_find_sec_buffer_idx
(
pInput
,
0
,
SECBUFFER_TOKEN
))
!=
-
1
)
{
input_desc
.
cBuffers
=
1
;
input_desc
.
pBuffers
=
&
pInput
->
pBuffers
[
idx
];
}
memset
(
&
output_desc
,
0
,
sizeof
(
output_desc
));
idx
=
schan_find_sec_buffer_idx
(
pOutput
,
0
,
SECBUFFER_TOKEN
);
if
(
idx
==
-
1
)
idx
=
schan_find_sec_buffer_idx
(
pOutput
,
0
,
SECBUFFER_EMPTY
);
if
(
idx
!=
-
1
)
{
output_desc
.
cBuffers
=
1
;
output_desc
.
pBuffers
=
&
pOutput
->
pBuffers
[
idx
];
if
(
!
output_desc
.
pBuffers
->
pvBuffer
)
output_desc
.
pBuffers
=
&
alloc_buffer
;
}
params
.
session
=
ctx
->
session
;
params
.
input
=
pInput
;
params
.
input
=
pInput
?
&
input_desc
:
NULL
;
params
.
input_size
=
expected_size
;
params
.
output
=
pOutput
;
params
.
alloc_buffer
=
&
alloc_buffer
;
params
.
output
=
&
output_desc
;
params
.
input_offset
=
&
input_offset
;
params
.
output_buffer_idx
=
&
output_buffer_idx
;
params
.
output_offset
=
&
output_offset
;
...
...
@@ -929,12 +949,15 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
if
(
output_buffer_idx
!=
-
1
)
{
SecBuffer
*
buffer
=
&
pOutput
->
pBuffers
[
output_buffer_idx
];
SecBuffer
*
buffer
=
&
pOutput
->
pBuffers
[
idx
];
buffer
->
BufferType
=
SECBUFFER_TOKEN
;
buffer
->
cbBuffer
=
output_offset
;
if
(
buffer
->
pvBuffer
==
alloc_buffer
.
pvB
uffer
)
if
(
output_desc
.
pBuffers
==
&
alloc_b
uffer
)
{
RtlReAllocateHeap
(
GetProcessHeap
(),
HEAP_REALLOC_IN_PLACE_ONLY
,
buffer
->
pvBuffer
,
buffer
->
cbBuffer
);
alloc_buffer
.
pvBuffer
,
buffer
->
cbBuffer
);
buffer
->
pvBuffer
=
alloc_buffer
.
pvBuffer
;
alloc_buffer
.
pvBuffer
=
NULL
;
}
}
...
...
dlls/secur32/schannel_gnutls.c
View file @
fee52bd4
...
...
@@ -146,7 +146,6 @@ struct schan_buffers
SIZE_T
offset
;
SIZE_T
limit
;
const
SecBufferDesc
*
desc
;
SecBuffer
*
alloc_buffer
;
int
current_buffer_idx
;
int
(
*
get_next_buffer
)(
struct
schan_buffers
*
);
};
...
...
@@ -234,7 +233,6 @@ static void init_schan_buffers(struct schan_buffers *s, const PSecBufferDesc des
s
->
limit
=
~
0UL
;
s
->
desc
=
desc
;
s
->
current_buffer_idx
=
-
1
;
s
->
alloc_buffer
=
NULL
;
s
->
get_next_buffer
=
get_next_buffer
;
}
...
...
@@ -257,26 +255,7 @@ static int handshake_get_next_buffer(struct schan_buffers *s)
{
if
(
s
->
current_buffer_idx
!=
-
1
)
return
-
1
;
return
schan_find_sec_buffer_idx
(
s
->
desc
,
0
,
SECBUFFER_TOKEN
);
}
static
int
handshake_get_next_buffer_alloc
(
struct
schan_buffers
*
s
)
{
if
(
s
->
current_buffer_idx
==
-
1
)
{
int
idx
=
schan_find_sec_buffer_idx
(
s
->
desc
,
0
,
SECBUFFER_TOKEN
);
if
(
idx
==
-
1
)
{
idx
=
schan_find_sec_buffer_idx
(
s
->
desc
,
0
,
SECBUFFER_EMPTY
);
if
(
idx
!=
-
1
)
s
->
desc
->
pBuffers
[
idx
].
BufferType
=
SECBUFFER_TOKEN
;
}
if
(
idx
!=
-
1
&&
!
s
->
desc
->
pBuffers
[
idx
].
pvBuffer
&&
s
->
alloc_buffer
)
{
s
->
desc
->
pBuffers
[
idx
]
=
*
s
->
alloc_buffer
;
}
return
idx
;
}
return
-
1
;
return
s
->
desc
->
cBuffers
?
0
:
-
1
;
}
static
int
send_message_get_next_buffer
(
struct
schan_buffers
*
s
)
...
...
@@ -606,8 +585,7 @@ static NTSTATUS schan_handshake( void *args )
init_schan_buffers
(
&
t
->
in
,
params
->
input
,
handshake_get_next_buffer
);
t
->
in
.
limit
=
params
->
input_size
;
init_schan_buffers
(
&
t
->
out
,
params
->
output
,
handshake_get_next_buffer_alloc
);
t
->
out
.
alloc_buffer
=
params
->
alloc_buffer
;
init_schan_buffers
(
&
t
->
out
,
params
->
output
,
handshake_get_next_buffer
);
while
(
1
)
{
...
...
dlls/secur32/secur32_priv.h
View file @
fee52bd4
...
...
@@ -147,7 +147,6 @@ struct handshake_params
SecBufferDesc
*
input
;
SIZE_T
input_size
;
SecBufferDesc
*
output
;
SecBuffer
*
alloc_buffer
;
ULONG
*
input_offset
;
int
*
output_buffer_idx
;
ULONG
*
output_offset
;
...
...
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