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
37eab1f4
Commit
37eab1f4
authored
Dec 03, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Move the pull/push callbacks to the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3f610208
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
100 deletions
+20
-100
schannel.c
dlls/secur32/schannel.c
+0
-80
schannel_gnutls.c
dlls/secur32/schannel_gnutls.c
+20
-18
secur32_priv.h
dlls/secur32/secur32_priv.h
+0
-2
No files found.
dlls/secur32/schannel.c
View file @
37eab1f4
...
@@ -745,84 +745,6 @@ static char * CDECL schan_get_buffer(const struct schan_transport *t, struct sch
...
@@ -745,84 +745,6 @@ static char * CDECL schan_get_buffer(const struct schan_transport *t, struct sch
return
(
char
*
)
buffer
->
pvBuffer
+
s
->
offset
;
return
(
char
*
)
buffer
->
pvBuffer
+
s
->
offset
;
}
}
/* schan_pull
* Read data from the transport input buffer.
*
* t - The session transport object.
* buff - The buffer into which to store the read data. Must be at least
* *buff_len bytes in length.
* buff_len - On input, *buff_len is the desired length to read. On successful
* return, *buff_len is the number of bytes actually read.
*
* Returns:
* 0 on success, in which case:
* *buff_len == 0 indicates end of file.
* *buff_len > 0 indicates that some data was read. May be less than
* what was requested, in which case the caller should call again if/
* when they want more.
* -1 when no data could be read without blocking
* another errno-style error value on failure
*/
static
int
CDECL
schan_pull
(
struct
schan_transport
*
t
,
void
*
buff
,
size_t
*
buff_len
)
{
char
*
b
;
SIZE_T
local_len
=
*
buff_len
;
TRACE
(
"Pull %lu bytes
\n
"
,
local_len
);
*
buff_len
=
0
;
b
=
schan_get_buffer
(
t
,
&
t
->
in
,
&
local_len
);
if
(
!
b
)
return
-
1
;
memcpy
(
buff
,
b
,
local_len
);
t
->
in
.
offset
+=
local_len
;
TRACE
(
"Read %lu bytes
\n
"
,
local_len
);
*
buff_len
=
local_len
;
return
0
;
}
/* 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.
* -1 when no data could be written without blocking
* another errno-style error value on failure
*/
static
int
CDECL
schan_push
(
struct
schan_transport
*
t
,
const
void
*
buff
,
size_t
*
buff_len
)
{
char
*
b
;
SIZE_T
local_len
=
*
buff_len
;
TRACE
(
"Push %lu bytes
\n
"
,
local_len
);
*
buff_len
=
0
;
b
=
schan_get_buffer
(
t
,
&
t
->
out
,
&
local_len
);
if
(
!
b
)
return
-
1
;
memcpy
(
b
,
buff
,
local_len
);
t
->
out
.
offset
+=
local_len
;
TRACE
(
"Wrote %lu bytes
\n
"
,
local_len
);
*
buff_len
=
local_len
;
return
0
;
}
static
schan_session
CDECL
schan_get_session_for_transport
(
struct
schan_transport
*
t
)
static
schan_session
CDECL
schan_get_session_for_transport
(
struct
schan_transport
*
t
)
{
{
return
t
->
ctx
->
session
;
return
t
->
ctx
->
session
;
...
@@ -1654,8 +1576,6 @@ const struct schan_callbacks schan_callbacks =
...
@@ -1654,8 +1576,6 @@ const struct schan_callbacks schan_callbacks =
{
{
schan_get_buffer
,
schan_get_buffer
,
schan_get_session_for_transport
,
schan_get_session_for_transport
,
schan_pull
,
schan_push
,
};
};
void
SECUR32_initSchannelSP
(
void
)
void
SECUR32_initSchannelSP
(
void
)
...
...
dlls/secur32/schannel_gnutls.c
View file @
37eab1f4
...
@@ -203,40 +203,42 @@ static ssize_t pull_adapter(gnutls_transport_ptr_t transport, void *buff, size_t
...
@@ -203,40 +203,42 @@ static ssize_t pull_adapter(gnutls_transport_ptr_t transport, void *buff, size_t
{
{
struct
schan_transport
*
t
=
(
struct
schan_transport
*
)
transport
;
struct
schan_transport
*
t
=
(
struct
schan_transport
*
)
transport
;
gnutls_session_t
s
=
(
gnutls_session_t
)
callbacks
->
get_session_for_transport
(
t
);
gnutls_session_t
s
=
(
gnutls_session_t
)
callbacks
->
get_session_for_transport
(
t
);
SIZE_T
len
=
buff_len
;
char
*
b
;
int
ret
=
callbacks
->
pull
(
transport
,
buff
,
&
buff_len
);
TRACE
(
"Push %lu bytes
\n
"
,
len
);
if
(
ret
==
-
1
)
b
=
callbacks
->
get_buffer
(
t
,
&
t
->
in
,
&
len
);
if
(
!
b
)
{
{
pgnutls_transport_set_errno
(
s
,
EAGAIN
);
pgnutls_transport_set_errno
(
s
,
EAGAIN
);
return
-
1
;
return
-
1
;
}
}
if
(
ret
<
0
)
memcpy
(
buff
,
b
,
len
);
{
t
->
in
.
offset
+=
len
;
FIXME
(
"unhandled error from pull callback %d
\n
"
,
ret
);
TRACE
(
"Wrote %lu bytes
\n
"
,
len
);
return
-
1
;
return
len
;
}
return
buff_len
;
}
}
static
ssize_t
push_adapter
(
gnutls_transport_ptr_t
transport
,
const
void
*
buff
,
size_t
buff_len
)
static
ssize_t
push_adapter
(
gnutls_transport_ptr_t
transport
,
const
void
*
buff
,
size_t
buff_len
)
{
{
struct
schan_transport
*
t
=
(
struct
schan_transport
*
)
transport
;
struct
schan_transport
*
t
=
(
struct
schan_transport
*
)
transport
;
gnutls_session_t
s
=
(
gnutls_session_t
)
callbacks
->
get_session_for_transport
(
t
);
gnutls_session_t
s
=
(
gnutls_session_t
)
callbacks
->
get_session_for_transport
(
t
);
SIZE_T
len
=
buff_len
;
char
*
b
;
int
ret
=
callbacks
->
push
(
transport
,
buff
,
&
buff_len
);
TRACE
(
"Push %lu bytes
\n
"
,
len
);
if
(
ret
==
-
1
)
b
=
callbacks
->
get_buffer
(
t
,
&
t
->
out
,
&
len
);
if
(
!
b
)
{
{
pgnutls_transport_set_errno
(
s
,
EAGAIN
);
pgnutls_transport_set_errno
(
s
,
EAGAIN
);
return
-
1
;
return
-
1
;
}
}
if
(
ret
<
0
)
memcpy
(
b
,
buff
,
len
);
{
t
->
out
.
offset
+=
len
;
FIXME
(
"unhandled error from push callback %d
\n
"
,
ret
);
TRACE
(
"Wrote %lu bytes
\n
"
,
len
);
return
-
1
;
return
len
;
}
return
buff_len
;
}
}
static
const
struct
{
static
const
struct
{
...
...
dlls/secur32/secur32_priv.h
View file @
37eab1f4
...
@@ -140,8 +140,6 @@ struct schan_callbacks
...
@@ -140,8 +140,6 @@ struct schan_callbacks
{
{
char
*
(
CDECL
*
get_buffer
)(
const
struct
schan_transport
*
,
struct
schan_buffers
*
,
SIZE_T
*
);
char
*
(
CDECL
*
get_buffer
)(
const
struct
schan_transport
*
,
struct
schan_buffers
*
,
SIZE_T
*
);
schan_session
(
CDECL
*
get_session_for_transport
)(
struct
schan_transport
*
);
schan_session
(
CDECL
*
get_session_for_transport
)(
struct
schan_transport
*
);
int
CDECL
(
CDECL
*
pull
)(
struct
schan_transport
*
,
void
*
,
size_t
*
);
int
CDECL
(
CDECL
*
push
)(
struct
schan_transport
*
,
const
void
*
,
size_t
*
);
};
};
extern
const
struct
schan_funcs
*
schan_funcs
;
extern
const
struct
schan_funcs
*
schan_funcs
;
...
...
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