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
a3e15549
Commit
a3e15549
authored
Jan 23, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Added schannel-based netconn_send implementation.
parent
db22753a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
2 deletions
+47
-2
net.c
dlls/winhttp/net.c
+47
-2
No files found.
dlls/winhttp/net.c
View file @
a3e15549
...
...
@@ -909,18 +909,63 @@ fail:
return
TRUE
;
}
#ifndef SONAME_LIBSSL
static
BOOL
send_ssl_chunk
(
netconn_t
*
conn
,
const
void
*
msg
,
size_t
size
)
{
SecBuffer
bufs
[
4
]
=
{
{
conn
->
ssl_sizes
.
cbHeader
,
SECBUFFER_STREAM_HEADER
,
conn
->
ssl_buf
},
{
size
,
SECBUFFER_DATA
,
conn
->
ssl_buf
+
conn
->
ssl_sizes
.
cbHeader
},
{
conn
->
ssl_sizes
.
cbTrailer
,
SECBUFFER_STREAM_TRAILER
,
conn
->
ssl_buf
+
conn
->
ssl_sizes
.
cbHeader
+
size
},
{
0
,
SECBUFFER_EMPTY
,
NULL
}
};
SecBufferDesc
buf_desc
=
{
SECBUFFER_VERSION
,
sizeof
(
bufs
)
/
sizeof
(
*
bufs
),
bufs
};
SECURITY_STATUS
res
;
memcpy
(
bufs
[
1
].
pvBuffer
,
msg
,
size
);
res
=
EncryptMessage
(
&
conn
->
ssl_ctx
,
0
,
&
buf_desc
,
0
);
if
(
res
!=
SEC_E_OK
)
{
WARN
(
"EncryptMessage failed
\n
"
);
return
FALSE
;
}
if
(
send
(
conn
->
socket
,
conn
->
ssl_buf
,
bufs
[
0
].
cbBuffer
+
bufs
[
1
].
cbBuffer
+
bufs
[
2
].
cbBuffer
,
0
)
<
1
)
{
WARN
(
"send failed
\n
"
);
return
FALSE
;
}
return
TRUE
;
}
#endif
BOOL
netconn_send
(
netconn_t
*
conn
,
const
void
*
msg
,
size_t
len
,
int
flags
,
int
*
sent
)
{
if
(
!
netconn_connected
(
conn
))
return
FALSE
;
if
(
conn
->
secure
)
{
#ifdef SONAME_LIBSSL
if
(
flags
)
FIXME
(
"
SSL_write doesn't support any flags (%08x)
\n
"
,
flags
);
if
(
flags
)
FIXME
(
"
flags %08x not supported in SSL
\n
"
,
flags
);
*
sent
=
pSSL_write
(
conn
->
ssl_conn
,
msg
,
len
);
if
(
*
sent
<
1
&&
len
)
return
FALSE
;
return
TRUE
;
#else
return
FALSE
;
const
BYTE
*
ptr
=
msg
;
size_t
chunk_size
;
if
(
flags
)
FIXME
(
"flags %08x not supported in SSL
\n
"
,
flags
);
*
sent
=
0
;
while
(
len
)
{
chunk_size
=
min
(
len
,
conn
->
ssl_sizes
.
cbMaximumMessage
);
if
(
!
send_ssl_chunk
(
conn
,
ptr
,
chunk_size
))
return
FALSE
;
*
sent
+=
chunk_size
;
ptr
+=
chunk_size
;
len
-=
chunk_size
;
}
return
TRUE
;
#endif
}
if
((
*
sent
=
send
(
conn
->
socket
,
msg
,
len
,
flags
))
==
-
1
)
...
...
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