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
f8755d84
Commit
f8755d84
authored
Jun 15, 2011
by
David Hedberg
Committed by
Alexandre Julliard
Jun 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Don't fail on signature verification if the signed hash lacks the OID.
parent
74159467
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
rsaenh.c
dlls/rsaenh/rsaenh.c
+10
-5
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+17
-6
No files found.
dlls/rsaenh/rsaenh.c
View file @
f8755d84
...
...
@@ -4472,16 +4472,21 @@ BOOL WINAPI RSAENH_CPVerifySignature(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST B
goto
cleanup
;
}
if
(
!
build_hash_signature
(
pbConstructed
,
dwSigLen
,
aiAlgid
,
abHashValue
,
dwHashLen
,
dwFlags
))
{
if
(
build_hash_signature
(
pbConstructed
,
dwSigLen
,
aiAlgid
,
abHashValue
,
dwHashLen
,
dwFlags
)
&&
!
memcmp
(
pbDecrypted
,
pbConstructed
,
dwSigLen
))
{
res
=
TRUE
;
goto
cleanup
;
}
if
(
memcmp
(
pbDecrypted
,
pbConstructed
,
dwSigLen
))
{
SetLastError
(
NTE_BAD_SIGNATURE
);
if
(
!
(
dwFlags
&
CRYPT_NOHASHOID
)
&&
build_hash_signature
(
pbConstructed
,
dwSigLen
,
aiAlgid
,
abHashValue
,
dwHashLen
,
dwFlags
|
CRYPT_NOHASHOID
)
&&
!
memcmp
(
pbDecrypted
,
pbConstructed
,
dwSigLen
))
{
res
=
TRUE
;
goto
cleanup
;
}
res
=
TRUE
;
SetLastError
(
NTE_BAD_SIGNATURE
);
cleanup:
HeapFree
(
GetProcessHeap
(),
0
,
pbConstructed
);
HeapFree
(
GetProcessHeap
(),
0
,
pbDecrypted
);
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
f8755d84
...
...
@@ -1771,15 +1771,14 @@ static void test_verify_signature(void) {
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
CryptVerifySignature
(
hHash
,
abSignatureMD2NoOID
,
128
,
hPubSignKey
,
NULL
,
CRYPT_NOHASHOID
);
/* It seems that CPVerifySignature doesn't care about the OID at all. */
result
=
CryptVerifySignature
(
hHash
,
abSignatureMD2NoOID
,
128
,
hPubSignKey
,
NULL
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
/* Next test fails on WinXP SP2. It seems that CPVerifySignature doesn't care about
* the OID at all. */
/*result = CryptVerifySignature(hHash, abSignatureMD2NoOID, 128, hPubSignKey, NULL, 0);
ok(!result && GetLastError()==NTE_BAD_SIGNATURE, "%08lx\n", GetLastError());
if (result) return;*/
result
=
CryptVerifySignature
(
hHash
,
abSignatureMD2NoOID
,
128
,
hPubSignKey
,
NULL
,
CRYPT_NOHASHOID
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
CryptDestroyHash
(
hHash
);
...
...
@@ -1795,6 +1794,10 @@ static void test_verify_signature(void) {
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
CryptVerifySignature
(
hHash
,
abSignatureMD4NoOID
,
128
,
hPubSignKey
,
NULL
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
CryptVerifySignature
(
hHash
,
abSignatureMD4NoOID
,
128
,
hPubSignKey
,
NULL
,
CRYPT_NOHASHOID
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
...
...
@@ -1813,6 +1816,10 @@ static void test_verify_signature(void) {
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
CryptVerifySignature
(
hHash
,
abSignatureMD5NoOID
,
128
,
hPubSignKey
,
NULL
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
CryptVerifySignature
(
hHash
,
abSignatureMD5NoOID
,
128
,
hPubSignKey
,
NULL
,
CRYPT_NOHASHOID
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
...
...
@@ -1831,6 +1838,10 @@ static void test_verify_signature(void) {
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
CryptVerifySignature
(
hHash
,
abSignatureSHANoOID
,
128
,
hPubSignKey
,
NULL
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
CryptVerifySignature
(
hHash
,
abSignatureSHANoOID
,
128
,
hPubSignKey
,
NULL
,
CRYPT_NOHASHOID
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
...
...
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