From 76bc8d01c0461d12cc6f7ee96ad632145d1a64bf Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 13 Dec 2017 12:45:42 +0800 Subject: [PATCH] bcrypt: Add some crypto-provider related stubs. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/bcrypt/bcrypt.spec | 12 ++++++------ dlls/bcrypt/bcrypt_main.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/ncrypt/ncrypt.spec | 12 ++++++------ include/bcrypt.h | 23 +++++++++++++++++++++++ 4 files changed, 71 insertions(+), 12 deletions(-) diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec index 9ecd21d767c..f00f55c306a 100644 --- a/dlls/bcrypt/bcrypt.spec +++ b/dlls/bcrypt/bcrypt.spec @@ -1,5 +1,5 @@ -@ stub BCryptAddContextFunction -@ stub BCryptAddContextFunctionProvider +@ stdcall BCryptAddContextFunction(long wstr long wstr long) +@ stdcall BCryptAddContextFunctionProvider(long wstr long wstr wstr long) @ stdcall BCryptCloseAlgorithmProvider(ptr long) @ stub BCryptConfigureContext @ stub BCryptConfigureContextFunction @@ -39,9 +39,9 @@ @ stub BCryptQueryContextFunctionProperty @ stub BCryptQueryProviderRegistration @ stub BCryptRegisterConfigChangeNotify -@ stub BCryptRegisterProvider -@ stub BCryptRemoveContextFunction -@ stub BCryptRemoveContextFunctionProvider +@ stdcall BCryptRegisterProvider(wstr long ptr) +@ stdcall BCryptRemoveContextFunction(long wstr long wstr) +@ stdcall BCryptRemoveContextFunctionProvider(long wstr long wstr wstr) @ stub BCryptResolveProviders @ stub BCryptSecretAgreement @ stub BCryptSetAuditingInterface @@ -49,7 +49,7 @@ @ stdcall BCryptSetProperty(ptr wstr ptr long long) @ stub BCryptSignHash @ stub BCryptUnregisterConfigChangeNotify -@ stub BCryptUnregisterProvider +@ stdcall BCryptUnregisterProvider(wstr) @ stub BCryptVerifySignature @ stub GetAsymmetricEncryptionInterface @ stub GetCipherInterface diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 765f7589bee..3bdc463904e 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -122,6 +122,42 @@ static void gnutls_uninitialize(void) } #endif /* HAVE_GNUTLS_CIPHER_INIT && !HAVE_COMMONCRYPTO_COMMONCRYPTOR_H */ +NTSTATUS WINAPI BCryptAddContextFunction(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function, ULONG pos) +{ + FIXME("%08x, %s, %08x, %s, %u: stub\n", table, debugstr_w(context), iface, debugstr_w(function), pos); + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI BCryptAddContextFunctionProvider(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function, LPCWSTR provider, ULONG pos) +{ + FIXME("%08x, %s, %08x, %s, %s, %u: stub\n", table, debugstr_w(context), iface, debugstr_w(function), debugstr_w(provider), pos); + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI BCryptRemoveContextFunction(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function) +{ + FIXME("%08x, %s, %08x, %s: stub\n", table, debugstr_w(context), iface, debugstr_w(function)); + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS WINAPI BCryptRemoveContextFunctionProvider(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function, LPCWSTR provider) +{ + FIXME("%08x, %s, %08x, %s, %s: stub\n", table, debugstr_w(context), iface, debugstr_w(function), debugstr_w(provider)); + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS WINAPI BCryptRegisterProvider(LPCWSTR provider, ULONG flags, PCRYPT_PROVIDER_REG reg) +{ + FIXME("%s, %08x, %p: stub\n", debugstr_w(provider), flags, reg); + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI BCryptUnregisterProvider(LPCWSTR provider) +{ + FIXME("%s: stub\n", debugstr_w(provider)); + return STATUS_NOT_IMPLEMENTED; +} + NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG dwAlgOperations, ULONG *pAlgCount, BCRYPT_ALGORITHM_IDENTIFIER **ppAlgList, ULONG dwFlags) { diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec index 1a78853bf49..5d371210d9e 100644 --- a/dlls/ncrypt/ncrypt.spec +++ b/dlls/ncrypt/ncrypt.spec @@ -1,5 +1,5 @@ -@ stub BCryptAddContextFunction -@ stub BCryptAddContextFunctionProvider +@ stdcall BCryptAddContextFunction(long wstr long wstr long) bcrypt.BCryptAddContextFunction +@ stdcall BCryptAddContextFunctionProvider(long wstr long wstr wstr long) bcrypt.BCryptAddContextFunctionProvider @ stdcall BCryptCloseAlgorithmProvider(ptr long) bcrypt.BCryptCloseAlgorithmProvider @ stub BCryptConfigureContext @ stub BCryptConfigureContextFunction @@ -42,9 +42,9 @@ @ stub BCryptQueryContextFunctionProperty @ stub BCryptQueryProviderRegistration @ stub BCryptRegisterConfigChangeNotify -@ stub BCryptRegisterProvider -@ stub BCryptRemoveContextFunction -@ stub BCryptRemoveContextFunctionProvider +@ stdcall BCryptRegisterProvider(wstr long ptr) bcrypt.BCryptRegisterProvider +@ stdcall BCryptRemoveContextFunction(long wstr long wstr) bcrypt.BCryptRemoveContextFunction +@ stdcall BCryptRemoveContextFunctionProvider(long wstr long wstr wstr) bcrypt.BCryptRemoveContextFunctionProvider @ stub BCryptResolveProviders @ stub BCryptSecretAgreement @ stub BCryptSetAuditingInterface @@ -52,7 +52,7 @@ @ stdcall BCryptSetProperty(ptr wstr ptr long long) bcrypt.BCryptSetProperty @ stub BCryptSignHash @ stub BCryptUnregisterConfigChangeNotify -@ stub BCryptUnregisterProvider +@ stdcall BCryptUnregisterProvider(wstr) bcrypt.BCryptUnregisterProvider @ stub BCryptVerifySignature @ stub GetIsolationServerInterface @ stub GetKeyStorageInterface diff --git a/include/bcrypt.h b/include/bcrypt.h index 7c3c8d0744d..1f7093c25a3 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -94,6 +94,29 @@ typedef struct __BCRYPT_KEY_LENGTHS_STRUCT ULONG dwIncrement; } BCRYPT_KEY_LENGTHS_STRUCT; +typedef struct _CRYPT_INTERFACE_REG +{ + ULONG dwInterface; + ULONG dwFlags; + ULONG cFunctions; + PWSTR *rgpszFunctions; +} CRYPT_INTERFACE_REG, *PCRYPT_INTERFACE_REG; + +typedef struct _CRYPT_IMAGE_REG +{ + PWSTR pszImage; + ULONG cInterfaces; + PCRYPT_INTERFACE_REG *rgpInterfaces; +} CRYPT_IMAGE_REG, *PCRYPT_IMAGE_REG; + +typedef struct _CRYPT_PROVIDER_REG +{ + ULONG cAliases; + PWSTR *rgpszAliases; + PCRYPT_IMAGE_REG pUM; + PCRYPT_IMAGE_REG pKM; +} CRYPT_PROVIDER_REG, *PCRYPT_PROVIDER_REG; + typedef PVOID BCRYPT_ALG_HANDLE; typedef PVOID BCRYPT_KEY_HANDLE; typedef PVOID BCRYPT_HANDLE; -- 2.11.4.GIT