mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 18:54:25 +00:00
[BCRYPT]
* Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62872
This commit is contained in:
parent
f9bca2bec5
commit
94b0b8778e
|
@ -12,5 +12,5 @@ list(APPEND SOURCE
|
||||||
add_library(bcrypt SHARED ${SOURCE})
|
add_library(bcrypt SHARED ${SOURCE})
|
||||||
set_module_type(bcrypt win32dll)
|
set_module_type(bcrypt win32dll)
|
||||||
target_link_libraries(bcrypt wine)
|
target_link_libraries(bcrypt wine)
|
||||||
add_importlibs(bcrypt msvcrt kernel32 ntdll)
|
add_importlibs(bcrypt advapi32 msvcrt kernel32 ntdll)
|
||||||
add_cd_file(TARGET bcrypt DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET bcrypt DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
@ stub BCryptFinalizeKeyPair
|
@ stub BCryptFinalizeKeyPair
|
||||||
@ stub BCryptFinishHash
|
@ stub BCryptFinishHash
|
||||||
@ stub BCryptFreeBuffer
|
@ stub BCryptFreeBuffer
|
||||||
@ stub BCryptGenRandom
|
@ stdcall BCryptGenRandom(ptr ptr long long)
|
||||||
@ stub BCryptGenerateKeyPair
|
@ stub BCryptGenerateKeyPair
|
||||||
@ stub BCryptGenerateSymmetricKey
|
@ stub BCryptGenerateSymmetricKey
|
||||||
@ stub BCryptGetFipsAlgorithmMode
|
@ stub BCryptGetFipsAlgorithmMode
|
||||||
|
|
|
@ -17,17 +17,17 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <wine/config.h>
|
||||||
|
|
||||||
|
#include <ntstatus.h>
|
||||||
#define WIN32_NO_STATUS
|
#define WIN32_NO_STATUS
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
//#include "wine/port.h"
|
|
||||||
#include <wine/debug.h>
|
#include <wine/debug.h>
|
||||||
|
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
|
#include <ntsecapi.h>
|
||||||
#include <bcrypt.h>
|
#include <bcrypt.h>
|
||||||
|
|
||||||
typedef LONG NTSTATUS;
|
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(bcrypt);
|
WINE_DEFAULT_DEBUG_CHANNEL(bcrypt);
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
||||||
|
@ -52,5 +52,41 @@ NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG dwAlgOperations, ULONG *pAlgCount,
|
||||||
*ppAlgList=NULL;
|
*ppAlgList=NULL;
|
||||||
*pAlgCount=0;
|
*pAlgCount=0;
|
||||||
|
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE algorithm, UCHAR *buffer, ULONG count, ULONG flags)
|
||||||
|
{
|
||||||
|
const DWORD supported_flags = BCRYPT_USE_SYSTEM_PREFERRED_RNG;
|
||||||
|
TRACE("%p, %p, %u, %08x - semi-stub\n", algorithm, buffer, count, flags);
|
||||||
|
|
||||||
|
if (!algorithm)
|
||||||
|
{
|
||||||
|
/* It's valid to call without an algorithm if BCRYPT_USE_SYSTEM_PREFERRED_RNG
|
||||||
|
* is set. In this case the preferred system RNG is used.
|
||||||
|
*/
|
||||||
|
if (!(flags & BCRYPT_USE_SYSTEM_PREFERRED_RNG))
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
if (!buffer)
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
if (flags & ~supported_flags)
|
||||||
|
FIXME("unsupported flags %08x\n", flags & ~supported_flags);
|
||||||
|
|
||||||
|
if (algorithm)
|
||||||
|
FIXME("ignoring selected algorithm\n");
|
||||||
|
|
||||||
|
/* When zero bytes are requested the function returns success too. */
|
||||||
|
if (!count)
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
|
if (flags & BCRYPT_USE_SYSTEM_PREFERRED_RNG)
|
||||||
|
{
|
||||||
|
if (RtlGenRandom(buffer, count))
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
FIXME("called with unsupported parameters, returning error\n");
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,10 @@
|
||||||
#define OPTIONAL
|
#define OPTIONAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _NTDEF_
|
||||||
|
typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
|
typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
|
||||||
{
|
{
|
||||||
LPWSTR pszName;
|
LPWSTR pszName;
|
||||||
|
@ -42,4 +46,9 @@ typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
|
||||||
ULONG dwFlags;
|
ULONG dwFlags;
|
||||||
} BCRYPT_ALGORITHM_IDENTIFIER;
|
} BCRYPT_ALGORITHM_IDENTIFIER;
|
||||||
|
|
||||||
|
typedef PVOID BCRYPT_ALG_HANDLE;
|
||||||
|
|
||||||
|
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
|
||||||
|
#define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
|
||||||
|
|
||||||
#endif /* __WINE_BCRYPT_H */
|
#endif /* __WINE_BCRYPT_H */
|
||||||
|
|
|
@ -55,7 +55,7 @@ reactos/dll/win32/atl # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/atl100 # Synced to Wine-1.7.1
|
reactos/dll/win32/atl100 # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/atl80 # Synced to Wine-1.7.1
|
reactos/dll/win32/atl80 # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/avifil32 # Synced to Wine-1.7.17
|
reactos/dll/win32/avifil32 # Synced to Wine-1.7.17
|
||||||
reactos/dll/win32/bcrypt # Synced to Wine-1.7.1
|
reactos/dll/win32/bcrypt # Synced to Wine-1.7.17
|
||||||
reactos/dll/win32/browseui # Out of sync
|
reactos/dll/win32/browseui # Out of sync
|
||||||
reactos/dll/win32/cabinet # Synced to Wine-1.7.1
|
reactos/dll/win32/cabinet # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/clusapi # Synced to Wine-1.7.1
|
reactos/dll/win32/clusapi # Synced to Wine-1.7.1
|
||||||
|
|
Loading…
Reference in a new issue