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
9894e109
Commit
9894e109
authored
Dec 03, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Move the decrypt message receive loop to the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
97ea9ee4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
47 deletions
+34
-47
schannel.c
dlls/secur32/schannel.c
+8
-25
schannel_gnutls.c
dlls/secur32/schannel_gnutls.c
+26
-22
No files found.
dlls/secur32/schannel.c
View file @
9894e109
...
@@ -1319,7 +1319,7 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
...
@@ -1319,7 +1319,7 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
SIZE_T
data_size
;
SIZE_T
data_size
;
char
*
data
;
char
*
data
;
unsigned
expected_size
;
unsigned
expected_size
;
S
S
IZE_T
received
=
0
;
SIZE_T
received
=
0
;
int
idx
;
int
idx
;
unsigned
char
*
buf_ptr
;
unsigned
char
*
buf_ptr
;
...
@@ -1360,31 +1360,14 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
...
@@ -1360,31 +1360,14 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
init_schan_buffers
(
&
ctx
->
transport
.
in
,
message
,
schan_decrypt_message_get_next_buffer
);
init_schan_buffers
(
&
ctx
->
transport
.
in
,
message
,
schan_decrypt_message_get_next_buffer
);
ctx
->
transport
.
in
.
limit
=
expected_size
;
ctx
->
transport
.
in
.
limit
=
expected_size
;
while
(
received
<
data_size
)
received
=
data_size
;
{
status
=
schan_funcs
->
recv
(
ctx
->
transport
.
session
,
data
,
&
received
);
SIZE_T
length
=
data_size
-
received
;
status
=
schan_funcs
->
recv
(
ctx
->
transport
.
session
,
data
+
received
,
&
length
);
if
(
status
==
SEC_I_RENEGOTIATE
)
break
;
if
(
status
==
SEC_I_CONTINUE_NEEDED
)
{
status
=
SEC_E_OK
;
break
;
}
if
(
status
!=
SEC_E_OK
)
if
(
status
!=
SEC_E_OK
&&
status
!=
SEC_I_RENEGOTIATE
)
{
{
free
(
data
);
free
(
data
);
ERR
(
"Returning %x
\n
"
,
status
);
ERR
(
"Returning %x
\n
"
,
status
);
return
status
;
return
status
;
}
if
(
!
length
)
break
;
received
+=
length
;
}
}
TRACE
(
"Received %ld bytes
\n
"
,
received
);
TRACE
(
"Received %ld bytes
\n
"
,
received
);
...
...
dlls/secur32/schannel_gnutls.c
View file @
9894e109
...
@@ -756,35 +756,39 @@ static SECURITY_STATUS CDECL schan_send(schan_session session, const void *buffe
...
@@ -756,35 +756,39 @@ static SECURITY_STATUS CDECL schan_send(schan_session session, const void *buffe
static
SECURITY_STATUS
CDECL
schan_recv
(
schan_session
session
,
void
*
buffer
,
SIZE_T
*
length
)
static
SECURITY_STATUS
CDECL
schan_recv
(
schan_session
session
,
void
*
buffer
,
SIZE_T
*
length
)
{
{
gnutls_session_t
s
=
(
gnutls_session_t
)
session
;
gnutls_session_t
s
=
(
gnutls_session_t
)
session
;
size_t
data_size
=
*
length
;
size_t
received
=
0
;
ssize_t
ret
;
ssize_t
ret
;
SECURITY_STATUS
status
=
SEC_E_OK
;
again:
while
(
received
<
data_size
)
ret
=
pgnutls_record_recv
(
s
,
buffer
,
*
length
);
if
(
ret
>=
0
)
*
length
=
ret
;
else
if
(
ret
==
GNUTLS_E_AGAIN
)
{
{
struct
schan_transport
*
t
=
(
struct
schan_transport
*
)
pgnutls_transport_get_ptr
(
s
);
ret
=
pgnutls_record_recv
(
s
,
(
char
*
)
buffer
+
received
,
data_size
-
received
);
SIZE_T
count
=
0
;
if
(
get_buffer
(
t
,
&
t
->
in
,
&
count
))
if
(
ret
>
0
)
received
+=
ret
;
goto
again
;
else
if
(
!
ret
)
break
;
else
if
(
ret
==
GNUTLS_E_AGAIN
)
{
struct
schan_transport
*
t
=
(
struct
schan_transport
*
)
pgnutls_transport_get_ptr
(
s
);
SIZE_T
count
=
0
;
return
SEC_I_CONTINUE_NEEDED
;
if
(
!
get_buffer
(
t
,
&
t
->
in
,
&
count
))
break
;
}
}
else
if
(
ret
==
GNUTLS_E_REHANDSHAKE
)
else
if
(
ret
==
GNUTLS_E_REHANDSHAKE
)
{
{
TRACE
(
"Rehandshake requested
\n
"
);
TRACE
(
"Rehandshake requested
\n
"
);
return
SEC_I_RENEGOTIATE
;
status
=
SEC_I_RENEGOTIATE
;
}
break
;
else
}
{
else
pgnutls_perror
(
ret
);
{
return
SEC_E_INTERNAL_ERROR
;
pgnutls_perror
(
ret
);
return
SEC_E_INTERNAL_ERROR
;
}
}
}
return
SEC_E_OK
;
*
length
=
received
;
return
status
;
}
}
static
unsigned
int
parse_alpn_protocol_list
(
unsigned
char
*
buffer
,
unsigned
int
buflen
,
gnutls_datum_t
*
list
)
static
unsigned
int
parse_alpn_protocol_list
(
unsigned
char
*
buffer
,
unsigned
int
buflen
,
gnutls_datum_t
*
list
)
...
...
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