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
9b85662f
Commit
9b85662f
authored
Mar 13, 2011
by
Ken Thomases
Committed by
Alexandre Julliard
Mar 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Extract schan_imp_recv function.
parent
a5715ed6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
20 deletions
+32
-20
schannel.c
dlls/secur32/schannel.c
+32
-20
No files found.
dlls/secur32/schannel.c
View file @
9b85662f
...
...
@@ -89,6 +89,23 @@ static SECURITY_STATUS schan_imp_send(gnutls_session_t s, const void *buffer,
return
SEC_E_OK
;
}
static
SECURITY_STATUS
schan_imp_recv
(
gnutls_session_t
s
,
void
*
buffer
,
size_t
*
length
)
{
ssize_t
ret
=
pgnutls_record_recv
(
s
,
buffer
,
*
length
);
if
(
ret
>=
0
)
*
length
=
ret
;
else
if
(
ret
==
GNUTLS_E_AGAIN
)
return
SEC_I_CONTINUE_NEEDED
;
else
{
pgnutls_perror
(
ret
);
return
SEC_E_INTERNAL_ERROR
;
}
return
SEC_E_OK
;
}
#define SCHAN_INVALID_HANDLE ~0UL
...
...
@@ -1245,7 +1262,6 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
char
*
data
;
unsigned
expected_size
;
ssize_t
received
=
0
;
ssize_t
ret
;
int
idx
;
unsigned
char
*
buf_ptr
;
...
...
@@ -1291,32 +1307,28 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
while
(
received
<
data_size
)
{
ret
=
pgnutls_record_recv
(
ctx
->
session
,
data
+
received
,
data_size
-
received
);
if
(
ret
<
0
)
size_t
length
=
data_size
-
received
;
SECURITY_STATUS
status
=
schan_imp_recv
(
ctx
->
session
,
data
+
received
,
&
length
);
if
(
status
==
SEC_I_CONTINUE_NEEDED
)
{
if
(
ret
==
GNUTLS_E_AGAIN
)
if
(
!
received
)
{
if
(
!
received
)
{
pgnutls_perror
(
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
TRACE
(
"Returning SEC_E_INCOMPLETE_MESSAGE
\n
"
);
return
SEC_E_INCOMPLETE_MESSAGE
;
}
break
;
}
else
{
pgnutls_perror
(
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
ERR
(
"Returning SEC_E_INTERNAL_ERROR
\n
"
);
return
SEC_E_IN
TERNAL_ERROR
;
TRACE
(
"Returning SEC_E_INCOMPLETE_MESSAGE
\n
"
);
return
SEC_E_IN
COMPLETE_MESSAGE
;
}
break
;
}
else
if
(
status
!=
SEC_E_OK
)
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
ERR
(
"Returning %d
\n
"
,
status
);
return
status
;
}
else
if
(
!
ret
)
else
if
(
!
length
)
break
;
received
+=
ret
;
received
+=
length
;
}
TRACE
(
"Received %zd bytes
\n
"
,
received
);
...
...
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