Module: wine Branch: master Commit: c7d1d34956ab8a9759bd423ee156aa6472b80522 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c7d1d34956ab8a9759bd423ee1...
Author: Juan Lang juan.lang@gmail.com Date: Wed Jul 23 17:42:09 2008 -0700
wintrust: Don't assume input file is a PE file in CryptSIPGetSignedDataMsg.
---
dlls/wintrust/crypt.c | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 8819ea8..b1b7771 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -202,11 +202,9 @@ BOOL WINAPI CryptSIPCreateIndirectData(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pcb return FALSE; }
-/*********************************************************************** - * CryptSIPGetSignedDataMsg (WINTRUST.@) - */ -BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pdwEncodingType, - DWORD dwIndex, DWORD* pcbSignedDataMsg, BYTE* pbSignedDataMsg) +static BOOL WINTRUST_GetSignedMsgFromPEFile(SIP_SUBJECTINFO *pSubjectInfo, + DWORD *pdwEncodingType, DWORD dwIndex, DWORD *pcbSignedDataMsg, + BYTE *pbSignedDataMsg) { BOOL ret; WIN_CERTIFICATE *pCert = NULL; @@ -264,9 +262,34 @@ BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pdwEn } } } - error: HeapFree(GetProcessHeap(), 0, pCert); + return ret; +} + +/*********************************************************************** + * CryptSIPGetSignedDataMsg (WINTRUST.@) + */ +BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pdwEncodingType, + DWORD dwIndex, DWORD* pcbSignedDataMsg, BYTE* pbSignedDataMsg) +{ + static const GUID unknown = { 0xC689AAB8, 0x8E78, 0x11D0, { 0x8C,0x47, + 0x00,0xC0,0x4F,0xC2,0x95,0xEE } }; + BOOL ret; + + TRACE("(%p %p %d %p %p)\n", pSubjectInfo, pdwEncodingType, dwIndex, + pcbSignedDataMsg, pbSignedDataMsg); + + if (!memcmp(pSubjectInfo->pgSubjectType, &unknown, sizeof(unknown))) + ret = WINTRUST_GetSignedMsgFromPEFile(pSubjectInfo, pdwEncodingType, + dwIndex, pcbSignedDataMsg, pbSignedDataMsg); + else + { + FIXME("unimplemented for subject type %s\n", + debugstr_guid(pSubjectInfo->pgSubjectType)); + ret = FALSE; + } + TRACE("returning %d\n", ret); return ret; }