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
39ba0bbe
Commit
39ba0bbe
authored
Feb 01, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Always set returned size in CRYPT_CopySignerInfo.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2a2ecdd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
msg.c
dlls/crypt32/msg.c
+1
-2
msg.c
dlls/crypt32/tests/msg.c
+4
-1
No files found.
dlls/crypt32/msg.c
View file @
39ba0bbe
...
@@ -2727,12 +2727,10 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData,
...
@@ -2727,12 +2727,10 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData,
size
+=
CRYPT_SizeOfAttributes
(
&
in
->
UnauthAttrs
);
size
+=
CRYPT_SizeOfAttributes
(
&
in
->
UnauthAttrs
);
if
(
!
pvData
)
if
(
!
pvData
)
{
{
*
pcbData
=
size
;
ret
=
TRUE
;
ret
=
TRUE
;
}
}
else
if
(
*
pcbData
<
size
)
else
if
(
*
pcbData
<
size
)
{
{
*
pcbData
=
size
;
SetLastError
(
ERROR_MORE_DATA
);
SetLastError
(
ERROR_MORE_DATA
);
ret
=
FALSE
;
ret
=
FALSE
;
}
}
...
@@ -2765,6 +2763,7 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData,
...
@@ -2765,6 +2763,7 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData,
CRYPT_CopyAttributes
(
&
out
->
UnauthAttrs
,
&
in
->
UnauthAttrs
,
&
nextData
);
CRYPT_CopyAttributes
(
&
out
->
UnauthAttrs
,
&
in
->
UnauthAttrs
,
&
nextData
);
}
}
}
}
*
pcbData
=
size
;
TRACE
(
"returning %d
\n
"
,
ret
);
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
return
ret
;
}
}
...
...
dlls/crypt32/tests/msg.c
View file @
39ba0bbe
...
@@ -2857,7 +2857,7 @@ static void test_decode_msg_get_param(void)
...
@@ -2857,7 +2857,7 @@ static void test_decode_msg_get_param(void)
HCRYPTPROV
hCryptProv
;
HCRYPTPROV
hCryptProv
;
HCRYPTKEY
key
=
0
;
HCRYPTKEY
key
=
0
;
BOOL
ret
;
BOOL
ret
;
DWORD
size
=
0
,
value
;
DWORD
size
=
0
,
value
,
req_size
;
LPBYTE
buf
;
LPBYTE
buf
;
CMSG_CTRL_DECRYPT_PARA
decryptPara
=
{
sizeof
(
decryptPara
),
0
};
CMSG_CTRL_DECRYPT_PARA
decryptPara
=
{
sizeof
(
decryptPara
),
0
};
...
@@ -2947,7 +2947,10 @@ static void test_decode_msg_get_param(void)
...
@@ -2947,7 +2947,10 @@ static void test_decode_msg_get_param(void)
signer
.
SerialNumber
.
cbData
=
sizeof
(
serialNum
);
signer
.
SerialNumber
.
cbData
=
sizeof
(
serialNum
);
signer
.
SerialNumber
.
pbData
=
serialNum
;
signer
.
SerialNumber
.
pbData
=
serialNum
;
signer
.
HashAlgorithm
.
pszObjId
=
oid_rsa_md5
;
signer
.
HashAlgorithm
.
pszObjId
=
oid_rsa_md5
;
req_size
=
size
;
size
+=
10
;
CryptMsgGetParam
(
msg
,
CMSG_SIGNER_INFO_PARAM
,
0
,
buf
,
&
size
);
CryptMsgGetParam
(
msg
,
CMSG_SIGNER_INFO_PARAM
,
0
,
buf
,
&
size
);
ok
(
size
==
req_size
,
"size = %u, expected %u
\n
"
,
size
,
req_size
);
compare_signer_info
((
CMSG_SIGNER_INFO
*
)
buf
,
&
signer
);
compare_signer_info
((
CMSG_SIGNER_INFO
*
)
buf
,
&
signer
);
CryptMemFree
(
buf
);
CryptMemFree
(
buf
);
}
}
...
...
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