2006-09-14 00:11:24 +00:00
|
|
|
/*
|
|
|
|
* WinTrust Cryptography functions
|
|
|
|
*
|
|
|
|
* Copyright 2006 James Hawkins
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wintrust.h"
|
2006-09-14 00:12:39 +00:00
|
|
|
#include "mscat.h"
|
2006-09-27 12:36:42 +00:00
|
|
|
#include "mssip.h"
|
2006-09-14 00:11:24 +00:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
|
|
|
|
|
2006-09-14 00:12:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATAdminAcquireContext (WINTRUST.@)
|
|
|
|
*
|
|
|
|
* Get a catalog administrator context handle.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* catAdmin [O] Pointer to the context handle.
|
|
|
|
* sysSystem [I] Pointer to a GUID for the needed subsystem.
|
|
|
|
* dwFlags [I] Reserved.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE. catAdmin contains the context handle.
|
2007-04-05 14:16:56 +00:00
|
|
|
* Failure: FALSE.
|
2006-09-14 00:12:39 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin,
|
|
|
|
const GUID *sysSystem, DWORD dwFlags )
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("%p %s %x\n", catAdmin, debugstr_guid(sysSystem), dwFlags);
|
2007-04-05 14:16:56 +00:00
|
|
|
|
|
|
|
if (catAdmin) *catAdmin = (HCATADMIN)0xdeadbeef;
|
|
|
|
return TRUE;
|
2006-09-14 00:12:39 +00:00
|
|
|
}
|
|
|
|
|
2007-05-30 22:44:43 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATAdminAddCatalog (WINTRUST.@)
|
|
|
|
*/
|
2007-08-08 08:49:27 +00:00
|
|
|
BOOL WINAPI CryptCATAdminAddCatalog(HCATADMIN catAdmin, PWSTR catalogFile,
|
|
|
|
PWSTR selectBaseName, DWORD flags)
|
2007-05-30 22:44:43 +00:00
|
|
|
{
|
|
|
|
FIXME("%p %s %s %d\n", catAdmin, debugstr_w(catalogFile),
|
|
|
|
debugstr_w(selectBaseName), flags);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-09-14 00:12:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATAdminCalcHashFromFileHandle (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash,
|
|
|
|
BYTE* pbHash, DWORD dwFlags )
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("%p %p %p %x\n", hFile, pcbHash, pbHash, dwFlags);
|
2007-04-05 14:16:56 +00:00
|
|
|
|
|
|
|
if (pbHash && pcbHash) memset(pbHash, 0, *pcbHash);
|
|
|
|
return TRUE;
|
2006-09-14 00:12:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATAdminEnumCatalogFromHash (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin,
|
|
|
|
BYTE* pbHash,
|
|
|
|
DWORD cbHash,
|
|
|
|
DWORD dwFlags,
|
|
|
|
HCATINFO* phPrevCatInfo )
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("%p %p %d %d %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo);
|
2006-09-14 00:12:39 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-05-30 22:44:43 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATAdminReleaseCatalogContext (WINTRUST.@)
|
|
|
|
*
|
|
|
|
* Release a catalog context handle.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* hCatAdmin [I] Context handle.
|
|
|
|
* hCatInfo [I] Catalog handle.
|
|
|
|
* dwFlags [I] Reserved.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE.
|
|
|
|
* Failure: FAIL.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN hCatAdmin,
|
2007-08-08 08:49:27 +00:00
|
|
|
HCATINFO hCatInfo,
|
2007-05-30 22:44:43 +00:00
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
FIXME("%p %p %x\n", hCatAdmin, hCatInfo, dwFlags);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-09-14 00:12:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATAdminReleaseContext (WINTRUST.@)
|
|
|
|
*
|
|
|
|
* Release a catalog administrator context handle.
|
|
|
|
*
|
|
|
|
* PARAMS
|
2007-04-05 14:16:56 +00:00
|
|
|
* catAdmin [I] Context handle.
|
2006-09-14 00:12:39 +00:00
|
|
|
* dwFlags [I] Reserved.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE.
|
|
|
|
* Failure: FAIL.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("%p %x\n", hCatAdmin, dwFlags);
|
2007-04-05 14:16:56 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATAdminRemoveCatalog (WINTRUST.@)
|
|
|
|
*
|
|
|
|
* Remove a catalog file.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* catAdmin [I] Context handle.
|
|
|
|
* pwszCatalogFile [I] Catalog file.
|
|
|
|
* dwFlags [I] Reserved.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE.
|
|
|
|
* Failure: FALSE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogFile, DWORD dwFlags)
|
|
|
|
{
|
|
|
|
FIXME("%p %s %x\n", hCatAdmin, debugstr_w(pwszCatalogFile), dwFlags);
|
|
|
|
return DeleteFileW(pwszCatalogFile);
|
2006-09-14 00:12:39 +00:00
|
|
|
}
|
|
|
|
|
2006-09-14 00:15:56 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATClose (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptCATClose(HANDLE hCatalog)
|
|
|
|
{
|
|
|
|
FIXME("(%p) stub\n", hCatalog);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-09-14 00:15:00 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATEnumerateMember (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
CRYPTCATMEMBER *WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER* pPrevMember)
|
|
|
|
{
|
|
|
|
FIXME("(%p, %p) stub\n", hCatalog, pPrevMember);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2006-09-14 00:11:24 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CryptCATOpen (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
HANDLE WINAPI CryptCATOpen(LPWSTR pwszFileName, DWORD fdwOpenFlags, HCRYPTPROV hProv,
|
|
|
|
DWORD dwPublicVersion, DWORD dwEncodingType)
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("(%s, %d, %ld, %d, %d) stub\n", debugstr_w(pwszFileName), fdwOpenFlags,
|
2006-09-14 00:11:24 +00:00
|
|
|
hProv, dwPublicVersion, dwEncodingType);
|
|
|
|
return 0;
|
|
|
|
}
|
2006-09-27 12:36:42 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptSIPCreateIndirectData (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptSIPCreateIndirectData(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pcbIndirectData,
|
|
|
|
SIP_INDIRECT_DATA* pIndirectData)
|
|
|
|
{
|
|
|
|
FIXME("(%p %p %p) stub\n", pSubjectInfo, pcbIndirectData, pIndirectData);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptSIPGetSignedDataMsg (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pdwEncodingType,
|
|
|
|
DWORD dwIndex, DWORD* pcbSignedDataMsg, BYTE* pbSignedDataMsg)
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("(%p %p %d %p %p) stub\n", pSubjectInfo, pdwEncodingType, dwIndex,
|
2006-09-27 12:36:42 +00:00
|
|
|
pcbSignedDataMsg, pbSignedDataMsg);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptSIPPutSignedDataMsg (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptSIPPutSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD pdwEncodingType,
|
|
|
|
DWORD* pdwIndex, DWORD cbSignedDataMsg, BYTE* pbSignedDataMsg)
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("(%p %d %p %d %p) stub\n", pSubjectInfo, pdwEncodingType, pdwIndex,
|
2006-09-27 12:36:42 +00:00
|
|
|
cbSignedDataMsg, pbSignedDataMsg);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptSIPRemoveSignedDataMsg (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo,
|
|
|
|
DWORD dwIndex)
|
|
|
|
{
|
2006-10-04 10:22:58 +00:00
|
|
|
FIXME("(%p %d) stub\n", pSubjectInfo, dwIndex);
|
2006-09-27 12:36:42 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptSIPVerifyIndirectData (WINTRUST.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptSIPVerifyIndirectData(SIP_SUBJECTINFO* pSubjectInfo,
|
|
|
|
SIP_INDIRECT_DATA* pIndirectData)
|
|
|
|
{
|
|
|
|
FIXME("(%p %p) stub\n", pSubjectInfo, pIndirectData);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|