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
b424b343
Commit
b424b343
authored
Sep 15, 2010
by
Mikko Rasa
Committed by
Alexandre Julliard
Sep 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Validate buffers passed to schan_DecryptMessage.
parent
0df8892d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
5 deletions
+45
-5
schannel.c
dlls/secur32/schannel.c
+45
-5
No files found.
dlls/secur32/schannel.c
View file @
b424b343
...
...
@@ -1144,6 +1144,49 @@ static int schan_decrypt_message_get_next_buffer(const struct schan_transport *t
return
-
1
;
}
static
int
schan_validate_decrypt_buffer_desc
(
PSecBufferDesc
message
)
{
int
data_idx
=
-
1
;
unsigned
int
empty_count
=
0
;
unsigned
int
i
;
if
(
message
->
cBuffers
<
4
)
{
WARN
(
"Less than four buffers passed
\n
"
);
return
-
1
;
}
for
(
i
=
0
;
i
<
message
->
cBuffers
;
++
i
)
{
SecBuffer
*
b
=
&
message
->
pBuffers
[
i
];
if
(
b
->
BufferType
==
SECBUFFER_DATA
)
{
if
(
data_idx
!=
-
1
)
{
WARN
(
"More than one data buffer passed
\n
"
);
return
-
1
;
}
data_idx
=
i
;
}
else
if
(
b
->
BufferType
==
SECBUFFER_EMPTY
)
++
empty_count
;
}
if
(
data_idx
==
-
1
)
{
WARN
(
"No data buffer passed
\n
"
);
return
-
1
;
}
if
(
empty_count
<
3
)
{
WARN
(
"Less than three empty buffers passed
\n
"
);
return
-
1
;
}
return
data_idx
;
}
static
SECURITY_STATUS
SEC_ENTRY
schan_DecryptMessage
(
PCtxtHandle
context_handle
,
PSecBufferDesc
message
,
ULONG
message_seq_no
,
PULONG
quality
)
{
...
...
@@ -1164,12 +1207,9 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
dump_buffer_desc
(
message
);
idx
=
schan_
find_sec_buffer_idx
(
message
,
0
,
SECBUFFER_DATA
);
idx
=
schan_
validate_decrypt_buffer_desc
(
message
);
if
(
idx
==
-
1
)
{
WARN
(
"No data buffer passed
\n
"
);
return
SEC_E_INTERNAL_ERROR
;
}
return
SEC_E_INVALID_TOKEN
;
buffer
=
&
message
->
pBuffers
[
idx
];
data_size
=
buffer
->
cbBuffer
;
...
...
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