Add/correct a couple definitions, allow hashing nothing.
This commit is contained in:
parent
18f3fcb1c2
commit
8c9b330cce
|
@ -1455,7 +1455,7 @@ BOOL WINAPI CryptGetUserKey (HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *phUse
|
|||
* Success: TRUE
|
||||
* Failure: FALSE
|
||||
*/
|
||||
BOOL WINAPI CryptHashData (HCRYPTHASH hHash, BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
|
||||
BOOL WINAPI CryptHashData (HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
|
||||
{
|
||||
PCRYPTHASH hash = (PCRYPTHASH)hHash;
|
||||
PCRYPTPROV prov;
|
||||
|
@ -1464,7 +1464,7 @@ BOOL WINAPI CryptHashData (HCRYPTHASH hHash, BYTE *pbData, DWORD dwDataLen, DWOR
|
|||
|
||||
if (!hash)
|
||||
CRYPT_ReturnLastError(ERROR_INVALID_HANDLE);
|
||||
if (!pbData || !dwDataLen || !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV)
|
||||
if (!hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV)
|
||||
CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER);
|
||||
|
||||
prov = hash->pProvider;
|
||||
|
|
|
@ -708,6 +708,7 @@ typedef struct _CRYPT_DECODE_PARA {
|
|||
#define ALG_SID_MD4 2
|
||||
#define ALG_SID_MD5 3
|
||||
#define ALG_SID_SHA 4
|
||||
#define ALG_SID_SHA1 CALG_SHA
|
||||
#define ALG_SID_MAC 5
|
||||
#define ALG_SID_RIPEMD 6
|
||||
#define ALG_SID_RIPEMD160 7
|
||||
|
@ -728,6 +729,7 @@ typedef struct _CRYPT_DECODE_PARA {
|
|||
#define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
|
||||
#define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
|
||||
#define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
|
||||
#define CALG_SHA1 CALG_SHA
|
||||
#define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
|
||||
#define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
|
||||
#define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
|
||||
|
@ -1812,7 +1814,7 @@ BOOL WINAPI CryptGetDefaultProviderW (DWORD dwProvType, DWORD *pdwReserved,
|
|||
DWORD dwFlags, LPWSTR pszProvName, DWORD *pcbProvName);
|
||||
#define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
|
||||
BOOL WINAPI CryptGetUserKey (HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *phUserKey);
|
||||
BOOL WINAPI CryptHashData (HCRYPTHASH hHash, BYTE *pbData, DWORD dwDataLen, DWORD dwFlags);
|
||||
BOOL WINAPI CryptHashData (HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags);
|
||||
BOOL WINAPI CryptHashSessionKey (HCRYPTHASH hHash, HCRYPTKEY hKey, DWORD dwFlags);
|
||||
BOOL WINAPI CryptImportKey (HCRYPTPROV hProv, BYTE *pbData, DWORD dwDataLen,
|
||||
HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey);
|
||||
|
|
Loading…
Reference in New Issue