mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-01 19:28:29 +00:00
bcrypt: Return correct error from key_asymmetric_encrypt() if key is missing.
This commit is contained in:
parent
a7efc770f7
commit
6f455e10af
|
@ -2205,6 +2205,8 @@ static NTSTATUS key_asymmetric_encrypt( void *args )
|
|||
NTSTATUS status = STATUS_SUCCESS;
|
||||
int ret;
|
||||
|
||||
if (!key_data(params->key)->a.pubkey) return STATUS_INVALID_HANDLE;
|
||||
|
||||
d.data = params->input;
|
||||
d.size = params->input_len;
|
||||
if ((ret = pgnutls_pubkey_encrypt_data(key_data(params->key)->a.pubkey, 0, &d, &e)))
|
||||
|
|
|
@ -2284,12 +2284,12 @@ static void test_rsa_encrypt(void)
|
|||
ret = BCryptGenerateKeyPair(rsa, &key, 512, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
|
||||
|
||||
todo_wine {
|
||||
/* Not finalized key */
|
||||
ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, NULL, 0, &encrypted_size, 0);
|
||||
ok(ret == STATUS_INVALID_HANDLE, "got %lx\n", ret);
|
||||
BCryptFinalizeKeyPair(key, 0);
|
||||
|
||||
todo_wine {
|
||||
/* No padding */
|
||||
memset(input_no_padding, 0, sizeof(input_no_padding));
|
||||
strcpy((char *)input_no_padding, "Hello World");
|
||||
|
|
Loading…
Reference in a new issue