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 --- dlls/bcrypt/gnutls.c | 2 +- dlls/bcrypt/tests/bcrypt.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c index c880c9c1d46..488a3605dcd 100644 --- a/dlls/bcrypt/gnutls.c +++ b/dlls/bcrypt/gnutls.c @@ -1707,7 +1707,7 @@ static NTSTATUS key_asymmetric_sign( void *args ) return STATUS_NOT_IMPLEMENTED; }
- if (!params->input) + if (!params->input || !params->output) { *params->ret_len = key->u.a.bitlen / 8; return STATUS_SUCCESS; diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 3b32ea0349b..0f9456fee07 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -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);