#include #include "csp.h" #include "wincrypt.h" #include "cspdk.h" HINSTANCE g_hModule = NULL; BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) { DisableThreadLibraryCalls(hinstDLL); g_hModule = hinstDLL; } return TRUE; } BOOL WINAPI CPAcquireContext( OUT HCRYPTPROV *phProv, IN LPCSTR szContainer, IN DWORD dwFlags, IN PVTableProvStruc pVTable) { *phProv = (HCRYPTPROV)NULL; return TRUE; } BOOL WINAPI CPCreateHash( IN HCRYPTPROV hProv, IN ALG_ID Algid, IN HCRYPTKEY hKey, IN DWORD dwFlags, OUT HCRYPTHASH *phHash) { *phHash = (HCRYPTHASH)NULL; return TRUE; } BOOL WINAPI CPDecrypt( IN HCRYPTPROV hProv, IN HCRYPTKEY hKey, IN HCRYPTHASH hHash, IN BOOL fFinal, IN DWORD dwFlags, IN OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen) { *pcbDataLen = 0; return TRUE; } BOOL WINAPI CPDeriveKey( IN HCRYPTPROV hProv, IN ALG_ID Algid, IN HCRYPTHASH hHash, IN DWORD dwFlags, OUT HCRYPTKEY *phKey) { *phKey = (HCRYPTKEY)NULL; return TRUE; } BOOL WINAPI CPDestroyHash( IN HCRYPTPROV hProv, IN HCRYPTHASH hHash) { return TRUE; } BOOL WINAPI CPDestroyKey( IN HCRYPTPROV hProv, IN HCRYPTKEY hKey) { return TRUE; } BOOL WINAPI CPEncrypt( IN HCRYPTPROV hProv, IN HCRYPTKEY hKey, IN HCRYPTHASH hHash, IN BOOL fFinal, IN DWORD dwFlags, IN OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen, IN DWORD cbBufLen) { *pcbDataLen = 0; return TRUE; } BOOL WINAPI CPExportKey( IN HCRYPTPROV hProv, IN HCRYPTKEY hKey, IN HCRYPTKEY hPubKey, IN DWORD dwBlobType, IN DWORD dwFlags, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen) { *pcbDataLen = 0; return TRUE; } BOOL WINAPI CPGenKey( IN HCRYPTPROV hProv, IN ALG_ID Algid, IN DWORD dwFlags, OUT HCRYPTKEY *phKey) { *phKey = (HCRYPTKEY)NULL; return TRUE; } BOOL WINAPI CPGenRandom( IN HCRYPTPROV hProv, IN DWORD cbLen, OUT LPBYTE pbBuffer) { return TRUE; } BOOL WINAPI CPGetHashParam( IN HCRYPTPROV hProv, IN HCRYPTHASH hHash, IN DWORD dwParam, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen, IN DWORD dwFlags) { *pcbDataLen = 0; return TRUE; } BOOL WINAPI CPGetKeyParam( IN HCRYPTPROV hProv, IN HCRYPTKEY hKey, IN DWORD dwParam, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen, IN DWORD dwFlags) { *pcbDataLen = 0; return TRUE; } BOOL WINAPI CPGetProvParam( IN HCRYPTPROV hProv, IN DWORD dwParam, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen, IN DWORD dwFlags) { *pcbDataLen = 0; return TRUE; } BOOL WINAPI CPGetUserKey( IN HCRYPTPROV hProv, IN DWORD dwKeySpec, OUT HCRYPTKEY *phUserKey) { *phUserKey = 0; return TRUE; } BOOL WINAPI CPHashData( IN HCRYPTPROV hProv, IN HCRYPTHASH hHash, IN CONST BYTE *pbData, IN DWORD cbDataLen, IN DWORD dwFlags) { return TRUE; } BOOL WINAPI CPHashSessionKey( IN HCRYPTPROV hProv, IN HCRYPTHASH hHash, IN HCRYPTKEY hKey, IN DWORD dwFlags) { return TRUE; } BOOL WINAPI CPImportKey( IN HCRYPTPROV hProv, IN CONST BYTE *pbData, IN DWORD cbDataLen, IN HCRYPTKEY hPubKey, IN DWORD dwFlags, OUT HCRYPTKEY *phKey) { *phKey = (HCRYPTKEY)NULL; return TRUE; } BOOL WINAPI CPReleaseContext( IN HCRYPTPROV hProv, IN DWORD dwFlags) { return TRUE; } BOOL WINAPI CPSetHashParam( IN HCRYPTPROV hProv, IN HCRYPTHASH hHash, IN DWORD dwParam, IN CONST BYTE *pbData, IN DWORD dwFlags) { return TRUE; } BOOL WINAPI CPSetKeyParam( IN HCRYPTPROV hProv, IN HCRYPTKEY hKey, IN DWORD dwParam, IN CONST BYTE *pbData, IN DWORD dwFlags) { return TRUE; } BOOL WINAPI CPSetProvParam( IN HCRYPTPROV hProv, IN DWORD dwParam, IN CONST BYTE *pbData, IN DWORD dwFlags) { return TRUE; } BOOL WINAPI CPSignHash( IN HCRYPTPROV hProv, IN HCRYPTHASH hHash, IN DWORD dwKeySpec, IN LPCWSTR szDescription, IN DWORD dwFlags, OUT LPBYTE pbSignature, IN OUT LPDWORD pcbSigLen) { *pcbSigLen = 0; return TRUE; } BOOL WINAPI CPVerifySignature( IN HCRYPTPROV hProv, IN HCRYPTHASH hHash, IN CONST BYTE *pbSignature, IN DWORD cbSigLen, IN HCRYPTKEY hPubKey, IN LPCWSTR szDescription, IN DWORD dwFlags) { return TRUE; } //==========================================