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
c1f055d8
Commit
c1f055d8
authored
Jan 13, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Don't change input buffer in InitializeSecurityContext.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
81861ddd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
schannel.c
dlls/secur32/schannel.c
+10
-3
schannel.c
dlls/secur32/tests/schannel.c
+31
-0
No files found.
dlls/secur32/schannel.c
View file @
c1f055d8
...
...
@@ -732,7 +732,14 @@ schan_imp_session schan_session_for_transport(struct schan_transport* t)
return
t
->
ctx
->
session
;
}
static
int
schan_init_sec_ctx_get_next_buffer
(
const
struct
schan_transport
*
t
,
struct
schan_buffers
*
s
)
static
int
schan_init_sec_ctx_get_next_input_buffer
(
const
struct
schan_transport
*
t
,
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
schan_init_sec_ctx_get_next_output_buffer
(
const
struct
schan_transport
*
t
,
struct
schan_buffers
*
s
)
{
if
(
s
->
current_buffer_idx
==
-
1
)
{
...
...
@@ -884,9 +891,9 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
ctx
->
req_ctx_attr
=
fContextReq
;
transport
.
ctx
=
ctx
;
init_schan_buffers
(
&
transport
.
in
,
pInput
,
schan_init_sec_ctx_get_next_buffer
);
init_schan_buffers
(
&
transport
.
in
,
pInput
,
schan_init_sec_ctx_get_next_
input_
buffer
);
transport
.
in
.
limit
=
expected_size
;
init_schan_buffers
(
&
transport
.
out
,
pOutput
,
schan_init_sec_ctx_get_next_buffer
);
init_schan_buffers
(
&
transport
.
out
,
pOutput
,
schan_init_sec_ctx_get_next_
output_
buffer
);
schan_imp_set_session_transport
(
ctx
->
session
,
&
transport
);
/* Perform the TLS handshake */
...
...
dlls/secur32/tests/schannel.c
View file @
c1f055d8
...
...
@@ -636,6 +636,36 @@ static int receive_data(SOCKET sock, SecBuffer *buf)
return
received
;
}
static
void
test_InitializeSecurityContext
(
void
)
{
SCHANNEL_CRED
cred
;
CredHandle
cred_handle
;
CtxtHandle
context
;
SECURITY_STATUS
status
;
SecBuffer
out_buffer
=
{
1000
,
SECBUFFER_TOKEN
,
NULL
};
SecBuffer
in_buffer
=
{
0
,
SECBUFFER_EMPTY
,
NULL
};
SecBufferDesc
out_buffers
=
{
SECBUFFER_VERSION
,
1
,
&
out_buffer
};
SecBufferDesc
in_buffers
=
{
SECBUFFER_VERSION
,
1
,
&
in_buffer
};
ULONG
attrs
;
init_cred
(
&
cred
);
cred
.
grbitEnabledProtocols
=
SP_PROT_TLS1_CLIENT
;
cred
.
dwFlags
=
SCH_CRED_NO_DEFAULT_CREDS
|
SCH_CRED_MANUAL_CRED_VALIDATION
;
status
=
AcquireCredentialsHandleA
(
NULL
,
(
SEC_CHAR
*
)
UNISP_NAME_A
,
SECPKG_CRED_OUTBOUND
,
NULL
,
&
cred
,
NULL
,
NULL
,
&
cred_handle
,
NULL
);
ok
(
status
==
SEC_E_OK
,
"AcquireCredentialsHandleA failed: %08x
\n
"
,
status
);
if
(
status
!=
SEC_E_OK
)
return
;
status
=
InitializeSecurityContextA
(
&
cred_handle
,
NULL
,
(
SEC_CHAR
*
)
"localhost"
,
ISC_REQ_CONFIDENTIALITY
|
ISC_REQ_STREAM
|
ISC_REQ_ALLOCATE_MEMORY
,
0
,
0
,
&
in_buffers
,
0
,
&
context
,
&
out_buffers
,
&
attrs
,
NULL
);
ok
(
status
==
SEC_I_CONTINUE_NEEDED
,
"Expected SEC_I_CONTINUE_NEEDED, got %08x
\n
"
,
status
);
FreeContextBuffer
(
out_buffer
.
pvBuffer
);
DeleteSecurityContext
(
&
context
);
FreeCredentialsHandle
(
&
cred_handle
);
}
static
void
test_communication
(
void
)
{
int
ret
;
...
...
@@ -940,5 +970,6 @@ START_TEST(schannel)
test_cread_attrs
();
testAcquireSecurityContext
();
test_InitializeSecurityContext
();
test_communication
();
}
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