Signed-off-by: Zhang Shuai wxsxsdz@gmail.com --- dlls/dssenh/tests/dssenh.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c index d16e936a31..f11c854781 100644 --- a/dlls/dssenh/tests/dssenh.c +++ b/dlls/dssenh/tests/dssenh.c @@ -901,6 +901,14 @@ static void test_signhash_array(HCRYPTPROV hProv, const struct signature_test *t ok(result, "Failed to get signature length, got %x\n", GetLastError()); ok(signLen1 == 40, "Expected a 40-byte signature, got %d\n", signLen1);
+ /* Error 0xEA if input signLen is less than 40 (weird) */ + signLen1 = 39; + result = CryptSignHashA(hHash1, AT_SIGNATURE, NULL, 0, signValue1, &signLen1); + ok(!result && GetLastError() == 0xEA, + "Singing hash with signLen set to 39, expecting error code 0xEA," + "got %x\n", GetLastError()); + + signLen1 = 40; result = CryptSignHashA(hHash1, AT_SIGNATURE, NULL, 0, signValue1, &signLen1); ok(result, "Failed to sign hash, got %x\n", GetLastError());
@@ -909,6 +917,8 @@ static void test_signhash_array(HCRYPTPROV hProv, const struct signature_test *t ok(result, "Failed to get signature length, got %x\n", GetLastError()); ok(signLen2 == 40, "Expected a 40-byte signature, got %d\n", signLen2);
+ /* No error if input signLen is not 40 */ + signLen2 = 41; result = CryptSignHashA(hHash2, AT_SIGNATURE, NULL, 0, signValue2, &signLen2); ok(result, "Failed to sign hash2, got %x\n", GetLastError());
Signed-off-by: Zhang Shuai wxsxsdz@gmail.com --- dlls/dssenh/tests/dssenh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c index f11c854781..086847f180 100644 --- a/dlls/dssenh/tests/dssenh.c +++ b/dlls/dssenh/tests/dssenh.c @@ -763,7 +763,7 @@ static void test_cipher_modes(const struct ciphermode_test *tests, int testLen) } else { /* Expected error */ - ok(!result && GetLastError() == tests[i].expectedError, "Expected %d, got %x.\n", + ok(!result && GetLastError() == tests[i].expectedError, "Expected %x, got %x.\n", tests[i].expectedError, GetLastError()); } }