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
abdae539
Commit
abdae539
authored
Dec 03, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Move the memory allocation for get_unique_channel_binding() to the PE side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bcc30639
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
17 deletions
+27
-17
schannel.c
dlls/secur32/schannel.c
+20
-1
schannel_gnutls.c
dlls/secur32/schannel_gnutls.c
+6
-15
secur32_priv.h
dlls/secur32/secur32_priv.h
+1
-1
No files found.
dlls/secur32/schannel.c
View file @
abdae539
...
...
@@ -1057,8 +1057,27 @@ static SECURITY_STATUS SEC_ENTRY schan_QueryContextAttributesW(
}
case
SECPKG_ATTR_UNIQUE_BINDINGS
:
{
static
const
char
prefix
[]
=
"tls-unique:"
;
SecPkgContext_Bindings
*
bindings
=
buffer
;
return
schan_funcs
->
get_unique_channel_binding
(
ctx
->
transport
.
session
,
bindings
);
ULONG
size
;
char
*
p
;
if
(
schan_funcs
->
get_unique_channel_binding
(
ctx
->
transport
.
session
,
NULL
,
&
size
)
!=
SEC_E_BUFFER_TOO_SMALL
)
return
SEC_E_INTERNAL_ERROR
;
bindings
->
BindingsLength
=
sizeof
(
*
bindings
->
Bindings
)
+
sizeof
(
prefix
)
-
1
+
size
;
/* freed with FreeContextBuffer */
bindings
->
Bindings
=
RtlAllocateHeap
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
bindings
->
BindingsLength
);
if
(
!
bindings
->
Bindings
)
return
SEC_E_INSUFFICIENT_MEMORY
;
bindings
->
Bindings
->
cbApplicationDataLength
=
sizeof
(
prefix
)
-
1
+
size
;
bindings
->
Bindings
->
dwApplicationDataOffset
=
sizeof
(
*
bindings
->
Bindings
);
p
=
(
char
*
)(
bindings
->
Bindings
+
1
);
memcpy
(
p
,
prefix
,
sizeof
(
prefix
)
-
1
);
p
+=
sizeof
(
prefix
)
-
1
;
return
schan_funcs
->
get_unique_channel_binding
(
ctx
->
transport
.
session
,
p
,
&
size
);
}
case
SECPKG_ATTR_APPLICATION_PROTOCOL
:
{
...
...
dlls/secur32/schannel_gnutls.c
View file @
abdae539
...
...
@@ -755,13 +755,11 @@ static SECURITY_STATUS CDECL schan_get_connection_info(schan_session session, Se
return
SEC_E_OK
;
}
static
SECURITY_STATUS
CDECL
schan_get_unique_channel_binding
(
schan_session
session
,
SecPkgContext_Bindings
*
bindings
)
static
SECURITY_STATUS
CDECL
schan_get_unique_channel_binding
(
schan_session
session
,
void
*
buffer
,
ULONG
*
bufsize
)
{
static
const
char
prefix
[]
=
"tls-unique:"
;
gnutls_datum_t
datum
;
int
rc
;
SECURITY_STATUS
ret
;
char
*
p
;
gnutls_session_t
s
=
(
gnutls_session_t
)
session
;
rc
=
pgnutls_session_channel_binding
(
s
,
GNUTLS_CB_TLS_UNIQUE
,
&
datum
);
...
...
@@ -770,21 +768,14 @@ static SECURITY_STATUS CDECL schan_get_unique_channel_binding(schan_session sess
pgnutls_perror
(
rc
);
return
SEC_E_INTERNAL_ERROR
;
}
bindings
->
BindingsLength
=
sizeof
(
SEC_CHANNEL_BINDINGS
)
+
sizeof
(
prefix
)
-
1
+
datum
.
size
;
bindings
->
Bindings
=
RtlAllocateHeap
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
bindings
->
BindingsLength
);
if
(
!
bindings
->
Bindings
)
ret
=
SEC_E_INSUFFICIENT_MEMORY
;
else
if
(
buffer
&&
*
bufsize
>=
datum
.
size
)
{
bindings
->
Bindings
->
cbApplicationDataLength
=
sizeof
(
prefix
)
-
1
+
datum
.
size
;
bindings
->
Bindings
->
dwApplicationDataOffset
=
sizeof
(
SEC_CHANNEL_BINDINGS
);
p
=
(
char
*
)(
bindings
->
Bindings
+
1
);
memcpy
(
p
,
prefix
,
sizeof
(
prefix
)
-
1
);
p
+=
sizeof
(
prefix
)
-
1
;
memcpy
(
p
,
datum
.
data
,
datum
.
size
);
memcpy
(
buffer
,
datum
.
data
,
datum
.
size
);
ret
=
SEC_E_OK
;
}
else
ret
=
SEC_E_BUFFER_TOO_SMALL
;
*
bufsize
=
datum
.
size
;
free
(
datum
.
data
);
return
ret
;
}
...
...
dlls/secur32/secur32_priv.h
View file @
abdae539
...
...
@@ -121,7 +121,7 @@ struct schan_funcs
unsigned
int
(
CDECL
*
get_max_message_size
)(
schan_session
);
unsigned
int
(
CDECL
*
get_session_cipher_block_size
)(
schan_session
);
SECURITY_STATUS
(
CDECL
*
get_session_peer_certificate
)(
schan_session
,
CERT_BLOB
*
,
ULONG
*
,
ULONG
*
);
SECURITY_STATUS
(
CDECL
*
get_unique_channel_binding
)(
schan_session
,
SecPkgContext_Bindings
*
);
SECURITY_STATUS
(
CDECL
*
get_unique_channel_binding
)(
schan_session
,
void
*
,
ULONG
*
);
SECURITY_STATUS
(
CDECL
*
handshake
)(
schan_session
,
SecBufferDesc
*
,
SIZE_T
,
SecBufferDesc
*
,
ULONG
);
SECURITY_STATUS
(
CDECL
*
recv
)(
schan_session
,
SecBufferDesc
*
,
SIZE_T
,
void
*
,
SIZE_T
*
);
SECURITY_STATUS
(
CDECL
*
send
)(
schan_session
,
SecBufferDesc
*
,
const
void
*
,
SIZE_T
*
);
...
...
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