wine-staging/patches/bcrypt-BCryptSecretAgreement/0002-bcrypt-Add-BCryptDeriveKey-stub.patch
2019-02-05 10:34:01 +11:00

79 lines
3.0 KiB
Diff

From 315b52406fbddcaf9289b2a47e8498fba49f8278 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 5 Feb 2019 10:09:59 +1100
Subject: [PATCH] bcrypt: Add BCryptDeriveKey stub
---
dlls/bcrypt/bcrypt.spec | 2 +-
dlls/bcrypt/bcrypt_main.c | 7 +++++++
include/bcrypt.h | 15 +++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index dfe08e7..4946ee5 100644
--- a/dlls/bcrypt/bcrypt.spec
+++ b/dlls/bcrypt/bcrypt.spec
@@ -7,7 +7,7 @@
@ stdcall BCryptCreateHash(ptr ptr ptr long ptr long long)
@ stdcall BCryptDecrypt(ptr ptr long ptr ptr long ptr long ptr long)
@ stub BCryptDeleteContext
-@ stub BCryptDeriveKey
+@ stdcall BCryptDeriveKey(ptr wstr ptr ptr long ptr long)
@ stdcall BCryptDeriveKeyPBKDF2(ptr ptr long ptr long int64 ptr long long)
@ stdcall BCryptDestroyHash(ptr)
@ stdcall BCryptDestroyKey(ptr)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 36451c9..ca2f274 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1572,6 +1572,13 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE secret)
return STATUS_SUCCESS;
}
+NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE secret, LPCWSTR kdf, BCryptBufferDesc *parameter,
+ PUCHAR derived, ULONG derived_size, ULONG *result, ULONG flags)
+{
+ FIXME( "%p, %s, %p, %p, %d, %p, %08x\n", secret, debugstr_w(kdf), parameter, derived, derived_size, result, flags );
+ return STATUS_INTERNAL_ERROR;
+}
+
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
switch (reason)
diff --git a/include/bcrypt.h b/include/bcrypt.h
index 866914c..a5abf23 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -204,6 +204,20 @@ typedef struct _BCRYPT_KEY_DATA_BLOB_HEADER
ULONG cbKeyData;
} BCRYPT_KEY_DATA_BLOB_HEADER, *PBCRYPT_KEY_DATA_BLOB_HEADER;
+typedef struct _BCryptBuffer
+{
+ ULONG cbBuffer;
+ ULONG BufferType;
+ void *pvBuffer;
+} BCryptBuffer, *PBCryptBuffer;
+
+typedef struct _BCryptBufferDesc
+{
+ ULONG ulVersion;
+ ULONG cBuffers;
+ PBCryptBuffer pBuffers;
+} BCryptBufferDesc, *PBCryptBufferDesc;
+
#define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b
#define BCRYPT_KEY_DATA_BLOB_VERSION1 1
@@ -226,6 +240,7 @@ typedef PVOID BCRYPT_SECRET_HANDLE;
NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG);
NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);
+NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE, LPCWSTR, BCryptBufferDesc*, PUCHAR, ULONG, ULONG *, ULONG);
NTSTATUS WINAPI BCryptDeriveKeyPBKDF2(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, ULONGLONG, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE);
--
1.9.1