From: Santino Mazza mazzasantino1206@gmail.com
v2: Formatting. Clarify subject.
Signed-off-by: Santino Mazza mazzasantino1206@gmail.com Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/bcrypt/bcrypt_main.c | 1 + dlls/bcrypt/tests/bcrypt.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 0fb78ce39a5..072b7915b1e 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -1413,6 +1413,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP return STATUS_NOT_SUPPORTED;
size = sizeof(*rsa_blob) + rsa_blob->cbPublicExp + rsa_blob->cbModulus; + if (size != input_len) return NTE_BAD_DATA; return key_asymmetric_create( (struct key **)ret_key, alg, rsa_blob->BitLength, (BYTE *)rsa_blob, size ); } else if (!wcscmp( type, BCRYPT_RSAPRIVATE_BLOB ) || !wcscmp( type, BCRYPT_RSAFULLPRIVATE_BLOB )) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 5fb29a0e0ff..4d7516a55ac 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -2122,11 +2122,9 @@ static void test_RSA(void) ret = BCryptDestroyKey(key); ok(!ret, "got %#lx\n", ret);
- todo_wine - { - ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsaPublicBlobWithInvalidPublicExpSize, sizeof(rsaPublicBlobWithInvalidPublicExpSize), 0); + ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsaPublicBlobWithInvalidPublicExpSize, + sizeof(rsaPublicBlobWithInvalidPublicExpSize), 0); ok(ret == NTE_BAD_DATA, "got %#lx\n", ret); - }
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, buf, size, 0); ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);