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
ebe83d56
Commit
ebe83d56
authored
May 14, 2007
by
Mounir IDRASSI
Committed by
Alexandre Julliard
May 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix crash in CertGetCertificateContextProperty when querying length of a hash property.
parent
ed79ddab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
cert.c
dlls/crypt32/cert.c
+1
-1
cert.c
dlls/crypt32/tests/cert.c
+7
-0
No files found.
dlls/crypt32/cert.c
View file @
ebe83d56
...
...
@@ -158,7 +158,7 @@ static BOOL CertContext_GetHashProp(void *context, DWORD dwPropId,
{
BOOL
ret
=
CryptHashCertificate
(
0
,
algID
,
0
,
toHash
,
toHashLen
,
pvData
,
pcbData
);
if
(
ret
)
if
(
ret
&&
pvData
)
{
CRYPT_DATA_BLOB
blob
=
{
*
pcbData
,
pvData
};
...
...
dlls/crypt32/tests/cert.c
View file @
ebe83d56
...
...
@@ -294,18 +294,25 @@ static void checkHash(const BYTE *data, DWORD dataLen, ALG_ID algID,
BYTE
hash
[
20
]
=
{
0
},
hashProperty
[
20
];
BOOL
ret
;
DWORD
size
;
DWORD
dwSizeWithNull
;
memset
(
hash
,
0
,
sizeof
(
hash
));
memset
(
hashProperty
,
0
,
sizeof
(
hashProperty
));
size
=
sizeof
(
hash
);
ret
=
CryptHashCertificate
(
0
,
algID
,
0
,
data
,
dataLen
,
hash
,
&
size
);
ok
(
ret
,
"CryptHashCertificate failed: %08x
\n
"
,
GetLastError
());
ret
=
CertGetCertificateContextProperty
(
context
,
propID
,
NULL
,
&
dwSizeWithNull
);
ok
(
ret
,
"CertGetCertificateContextProperty failed: %08x
\n
"
,
GetLastError
());
ret
=
CertGetCertificateContextProperty
(
context
,
propID
,
hashProperty
,
&
size
);
ok
(
ret
,
"CertGetCertificateContextProperty failed: %08x
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
hash
,
hashProperty
,
size
),
"Unexpected hash for property %d
\n
"
,
propID
);
ok
(
size
==
dwSizeWithNull
,
"Unexpected length of hash for property: received %d instead of %d
\n
"
,
dwSizeWithNull
,
size
);
}
static
WCHAR
cspNameW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'C'
,
'r'
,
'y'
,
'p'
,
't'
,
'T'
,
'e'
,
'm'
,
'p'
,
0
};
...
...
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