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
c86dafe5
Commit
c86dafe5
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 GnuTLS-isms from schan_push to schan_push_adapter.
parent
194aaef7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
13 deletions
+47
-13
schannel.c
dlls/secur32/schannel.c
+47
-13
No files found.
dlls/secur32/schannel.c
View file @
c86dafe5
...
...
@@ -76,6 +76,7 @@ struct schan_transport;
static
int
schan_pull
(
struct
schan_transport
*
t
,
void
*
buff
,
size_t
*
buff_len
);
static
int
schan_push
(
struct
schan_transport
*
t
,
const
void
*
buff
,
size_t
*
buff_len
);
static
gnutls_session_t
schan_session_for_transport
(
struct
schan_transport
*
t
);
...
...
@@ -96,6 +97,22 @@ static ssize_t schan_pull_adapter(gnutls_transport_ptr_t transport,
return
buff_len
;
}
static
ssize_t
schan_push_adapter
(
gnutls_transport_ptr_t
transport
,
const
void
*
buff
,
size_t
buff_len
)
{
struct
schan_transport
*
t
=
(
struct
schan_transport
*
)
transport
;
gnutls_session_t
s
=
schan_session_for_transport
(
t
);
int
ret
=
schan_push
(
transport
,
buff
,
&
buff_len
);
if
(
ret
)
{
pgnutls_transport_set_errno
(
s
,
ret
);
return
-
1
;
}
return
buff_len
;
}
static
BOOL
schan_imp_create_session
(
gnutls_session_t
*
s
,
BOOL
is_server
)
{
int
err
=
pgnutls_init
(
s
,
is_server
?
GNUTLS_SERVER
:
GNUTLS_CLIENT
);
...
...
@@ -896,26 +913,43 @@ static int schan_pull(struct schan_transport *t, void *buff, size_t *buff_len)
return
0
;
}
static
ssize_t
schan_push
(
gnutls_transport_ptr_t
transport
,
const
void
*
buff
,
size_t
buff_len
)
/* schan_push
* Write data to the transport output buffer.
*
* t - The session transport object.
* buff - The buffer of data to write. Must be at least *buff_len bytes in length.
* buff_len - On input, *buff_len is the desired length to write. On successful
* return, *buff_len is the number of bytes actually written.
*
* Returns:
* 0 on success
* *buff_len will be > 0 indicating how much data was written. May be less
* than what was requested, in which case the caller should call again
if/when they want to write more.
* EAGAIN when no data could be written without blocking
* another errno-style error value on failure
*
*/
static
int
schan_push
(
struct
schan_transport
*
t
,
const
void
*
buff
,
size_t
*
buff_len
)
{
struct
schan_transport
*
t
=
transport
;
char
*
b
;
size_t
local_len
=
*
buff_len
;
TRACE
(
"Push %zu bytes
\n
"
,
buff_len
);
TRACE
(
"Push %zu bytes
\n
"
,
local_len
);
*
buff_len
=
0
;
b
=
schan_get_buffer
(
t
,
&
t
->
out
,
&
buff
_len
);
b
=
schan_get_buffer
(
t
,
&
t
->
out
,
&
local
_len
);
if
(
!
b
)
{
pgnutls_transport_set_errno
(
t
->
ctx
->
session
,
EAGAIN
);
return
-
1
;
}
return
EAGAIN
;
memcpy
(
b
,
buff
,
buff
_len
);
t
->
out
.
offset
+=
buff
_len
;
memcpy
(
b
,
buff
,
local
_len
);
t
->
out
.
offset
+=
local
_len
;
TRACE
(
"Wrote %zu bytes
\n
"
,
buff
_len
);
TRACE
(
"Wrote %zu bytes
\n
"
,
local
_len
);
return
buff_len
;
*
buff_len
=
local_len
;
return
0
;
}
static
gnutls_session_t
schan_session_for_transport
(
struct
schan_transport
*
t
)
...
...
@@ -1025,7 +1059,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
}
pgnutls_transport_set_pull_function
(
ctx
->
session
,
schan_pull_adapter
);
pgnutls_transport_set_push_function
(
ctx
->
session
,
schan_push
);
pgnutls_transport_set_push_function
(
ctx
->
session
,
schan_push
_adapter
);
phNewContext
->
dwLower
=
handle
;
phNewContext
->
dwUpper
=
0
;
...
...
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