From: Sebastian Lackner sebastian@fds-team.de
Updated to make the test pass.
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/bcrypt/bcrypt_main.c | 2 +- dlls/bcrypt/tests/bcrypt.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 72b5df2..28cf2d8 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -532,7 +532,7 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, } if (!strcmpW( prop, BCRYPT_CHAINING_MODE )) { - if (size >= sizeof(BCRYPT_CHAIN_MODE_CBC)) + if (size >= sizeof(BCRYPT_CHAIN_MODE_CBC) * sizeof(WCHAR)) { memcpy(buf, BCRYPT_CHAIN_MODE_CBC, sizeof(BCRYPT_CHAIN_MODE_CBC)); *ret_size = sizeof(BCRYPT_CHAIN_MODE_CBC) * sizeof(WCHAR); diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 6fa04b0..b716688 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -452,6 +452,12 @@ static void test_aes(void) ok(size == 64, "got %u\n", size);
size = 0; + ret = pBCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode) - 1, &size, 0); + ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret); + ok(size == 64, "got %u\n", size); + + size = 0; + memset(mode, 0, sizeof(mode)); ret = pBCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_CBC), "got %s\n", mode);
Subject prefix should be bcrypt, not bcrypt/tests.
Signed-off-by: Hans Leidekker hans@codeweavers.com