mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-03 01:33:42 +00:00
bcrypt: Return BCryptSignHash len when only output is NULL.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52426 Signed-off-by: Piotr Kleski <piotr.kleski@mobica.com> Signed-off-by: Michal Janiszewski <michal.janiszewski@mobica.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6a9eaa619c
commit
f32a9d1e20
|
@ -1707,7 +1707,7 @@ static NTSTATUS key_asymmetric_sign( void *args )
|
|||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
if (!params->input)
|
||||
if (!params->output)
|
||||
{
|
||||
*params->ret_len = key->u.a.bitlen / 8;
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -2496,6 +2496,11 @@ static void test_BCryptSignHash(void)
|
|||
ok(!ret, "got %08x\n", ret);
|
||||
ok(len == 256, "got %u\n", len);
|
||||
|
||||
/* test len return when only output is NULL, as described in BCryptSignHash doc */
|
||||
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), NULL, 0, &len, BCRYPT_PAD_PKCS1);
|
||||
ok(!ret, "got %08x\n", ret);
|
||||
ok(len == 256, "got %u\n", len);
|
||||
|
||||
len = 0;
|
||||
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), sig, sizeof(sig), &len, BCRYPT_PAD_PKCS1);
|
||||
ok(ret == STATUS_INVALID_PARAMETER || broken(ret == STATUS_INTERNAL_ERROR) /* < win7 */, "got %08x\n", ret);
|
||||
|
|
Loading…
Reference in a new issue