2 * Copyright 2002 Mike McCormack for CodeWeavers
3 * Copyright 2005-2008 Juan Lang
4 * Copyright 2006 Paul Vriens
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "crypt32_private.h"
33 #include "wine/debug.h"
34 #include "wine/list.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(crypt
);
38 /* convert a guid to a wide character string */
39 static void CRYPT_guid2wstr( const GUID
*guid
, LPWSTR wstr
)
43 sprintf(str
, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
44 guid
->Data1
, guid
->Data2
, guid
->Data3
,
45 guid
->Data4
[0], guid
->Data4
[1], guid
->Data4
[2], guid
->Data4
[3],
46 guid
->Data4
[4], guid
->Data4
[5], guid
->Data4
[6], guid
->Data4
[7] );
47 MultiByteToWideChar( CP_ACP
, 0, str
, -1, wstr
, 40 );
50 /***********************************************************************
51 * CRYPT_SIPDeleteFunction
53 * Helper function for CryptSIPRemoveProvider
55 static LONG
CRYPT_SIPDeleteFunction( const GUID
*guid
, LPCWSTR szKey
)
57 WCHAR szFullKey
[ 0x100 ];
58 LONG r
= ERROR_SUCCESS
;
60 /* max length of szFullKey depends on our code only, so we won't overrun */
61 lstrcpyW( szFullKey
, L
"Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptSIPDll" );
62 lstrcatW( szFullKey
, szKey
);
63 CRYPT_guid2wstr( guid
, &szFullKey
[ lstrlenW( szFullKey
) ] );
65 r
= RegDeleteKeyW(HKEY_LOCAL_MACHINE
, szFullKey
);
70 /***********************************************************************
71 * CryptSIPRemoveProvider (CRYPT32.@)
73 * Remove a SIP provider and its functions from the registry.
76 * pgProv [I] Pointer to a GUID for this SIP provider
80 * Failure: FALSE. (Look at GetLastError()).
83 * Registry errors are always reported via SetLastError(). Every registry
84 * deletion will be tried.
86 BOOL WINAPI
CryptSIPRemoveProvider(GUID
*pgProv
)
88 LONG r
= ERROR_SUCCESS
;
89 LONG remove_error
= ERROR_SUCCESS
;
91 TRACE("%s\n", debugstr_guid(pgProv
));
95 SetLastError(ERROR_INVALID_PARAMETER
);
100 #define CRYPT_SIPREMOVEPROV( key ) \
101 r = CRYPT_SIPDeleteFunction( pgProv, key); \
102 if (r != ERROR_SUCCESS) remove_error = r
104 CRYPT_SIPREMOVEPROV( L
"PutSignedDataMsg\\" );
105 CRYPT_SIPREMOVEPROV( L
"GetSignedDataMsg\\" );
106 CRYPT_SIPREMOVEPROV( L
"RemoveSignedDataMsg\\" );
107 CRYPT_SIPREMOVEPROV( L
"CreateIndirectData\\" );
108 CRYPT_SIPREMOVEPROV( L
"VerifyIndirectData\\" );
109 CRYPT_SIPREMOVEPROV( L
"IsMyFileType\\" );
110 CRYPT_SIPREMOVEPROV( L
"IsMyFileType2\\" );
112 #undef CRYPT_SIPREMOVEPROV
114 if (remove_error
!= ERROR_SUCCESS
)
116 SetLastError(remove_error
);
124 * Helper for CryptSIPAddProvider
126 * Add a registry key containing a dll name and function under
127 * "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\<func>\\<guid>"
129 static LONG
CRYPT_SIPWriteFunction( const GUID
*guid
, LPCWSTR szKey
,
130 LPCWSTR szDll
, LPCWSTR szFunction
)
132 WCHAR szFullKey
[ 0x100 ];
133 LONG r
= ERROR_SUCCESS
;
137 return ERROR_SUCCESS
;
139 /* max length of szFullKey depends on our code only, so we won't overrun */
140 lstrcpyW( szFullKey
, L
"Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptSIPDll" );
141 lstrcatW( szFullKey
, szKey
);
142 CRYPT_guid2wstr( guid
, &szFullKey
[ lstrlenW( szFullKey
) ] );
144 TRACE("key is %s\n", debugstr_w( szFullKey
) );
146 r
= RegCreateKeyW( HKEY_LOCAL_MACHINE
, szFullKey
, &hKey
);
147 if( r
!= ERROR_SUCCESS
) goto error_close_key
;
149 /* write the values */
150 r
= RegSetValueExW( hKey
, L
"FuncName", 0, REG_SZ
, (const BYTE
*) szFunction
,
151 ( lstrlenW( szFunction
) + 1 ) * sizeof (WCHAR
) );
152 if( r
!= ERROR_SUCCESS
) goto error_close_key
;
153 r
= RegSetValueExW( hKey
, L
"Dll", 0, REG_SZ
, (const BYTE
*) szDll
,
154 ( lstrlenW( szDll
) + 1) * sizeof (WCHAR
) );
163 /***********************************************************************
164 * CryptSIPAddProvider (CRYPT32.@)
166 * Add a SIP provider and its functions to the registry.
169 * psNewProv [I] Pointer to a structure with information about
170 * the functions this SIP provider can perform.
174 * Failure: FALSE. (Look at GetLastError()).
177 * Registry errors are always reported via SetLastError(). If a
178 * registry error occurs the rest of the registry write operations
181 BOOL WINAPI
CryptSIPAddProvider(SIP_ADD_NEWPROVIDER
*psNewProv
)
183 LONG r
= ERROR_SUCCESS
;
185 TRACE("%p\n", psNewProv
);
188 psNewProv
->cbStruct
< FIELD_OFFSET(SIP_ADD_NEWPROVIDER
, pwszGetCapFuncName
) ||
189 !psNewProv
->pwszGetFuncName
||
190 !psNewProv
->pwszPutFuncName
||
191 !psNewProv
->pwszCreateFuncName
||
192 !psNewProv
->pwszVerifyFuncName
||
193 !psNewProv
->pwszRemoveFuncName
)
195 SetLastError(ERROR_INVALID_PARAMETER
);
199 TRACE("%s %s %s %s %s\n",
200 debugstr_guid( psNewProv
->pgSubject
),
201 debugstr_w( psNewProv
->pwszDLLFileName
),
202 debugstr_w( psNewProv
->pwszMagicNumber
),
203 debugstr_w( psNewProv
->pwszIsFunctionName
),
204 debugstr_w( psNewProv
->pwszIsFunctionNameFmt2
) );
206 #define CRYPT_SIPADDPROV( key, field ) \
207 r = CRYPT_SIPWriteFunction( psNewProv->pgSubject, key, \
208 psNewProv->pwszDLLFileName, psNewProv->field); \
209 if (r != ERROR_SUCCESS) goto end_function
211 CRYPT_SIPADDPROV( L
"PutSignedDataMsg\\", pwszPutFuncName
);
212 CRYPT_SIPADDPROV( L
"GetSignedDataMsg\\", pwszGetFuncName
);
213 CRYPT_SIPADDPROV( L
"RemoveSignedDataMsg\\", pwszRemoveFuncName
);
214 CRYPT_SIPADDPROV( L
"CreateIndirectData\\", pwszCreateFuncName
);
215 CRYPT_SIPADDPROV( L
"VerifyIndirectData\\", pwszVerifyFuncName
);
216 CRYPT_SIPADDPROV( L
"IsMyFileType\\", pwszIsFunctionName
);
217 CRYPT_SIPADDPROV( L
"IsMyFileType2\\", pwszIsFunctionNameFmt2
);
219 #undef CRYPT_SIPADDPROV
223 if (r
!= ERROR_SUCCESS
)
232 static void *CRYPT_LoadSIPFuncFromKey(HKEY key
, HMODULE
*pLib
)
236 WCHAR dllName
[MAX_PATH
];
237 char functionName
[MAX_PATH
];
241 /* Read the DLL entry */
242 size
= sizeof(dllName
);
243 r
= RegQueryValueExW(key
, L
"Dll", NULL
, NULL
, (LPBYTE
)dllName
, &size
);
246 /* Read the Function entry */
247 size
= sizeof(functionName
);
248 r
= RegQueryValueExA(key
, "FuncName", NULL
, NULL
, (LPBYTE
)functionName
,
252 lib
= LoadLibraryW(dllName
);
255 func
= GetProcAddress(lib
, functionName
);
265 /***********************************************************************
266 * CryptSIPRetrieveSubjectGuid (CRYPT32.@)
268 * Determine the right SIP GUID for the given file.
271 * FileName [I] Filename.
272 * hFileIn [I] Optional handle to the file.
273 * pgSubject [O] The SIP's GUID.
276 * Success: TRUE. pgSubject contains the SIP GUID.
277 * Failure: FALSE. (Look at GetLastError()).
280 * On failure pgSubject will contain a NULL GUID.
281 * The handle is always preferred above the filename.
283 BOOL WINAPI CryptSIPRetrieveSubjectGuid
284 (LPCWSTR FileName
, HANDLE hFileIn
, GUID
*pgSubject
)
289 LARGE_INTEGER zero
, oldPos
;
290 /* FIXME, find out if there is a name for this GUID */
291 static const GUID unknown
= { 0xC689AAB8, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
292 static const GUID cabGUID
= { 0xc689aaba, 0x8e78, 0x11d0, {0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee }};
293 static const GUID catGUID
= { 0xDE351A43, 0x8E59, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
294 static const WORD dosHdr
= IMAGE_DOS_SIGNATURE
;
295 static const BYTE cabHdr
[] = { 'M','S','C','F' };
296 BYTE hdr
[SIP_MAX_MAGIC_NUMBER
];
297 LONG r
= ERROR_SUCCESS
;
300 TRACE("(%s %p %p)\n", wine_dbgstr_w(FileName
), hFileIn
, pgSubject
);
302 if (!pgSubject
|| (!FileName
&& !hFileIn
))
304 SetLastError(ERROR_INVALID_PARAMETER
);
308 /* Set pgSubject to zero's */
309 memset(pgSubject
, 0 , sizeof(GUID
));
312 /* Use the given handle, make sure not to close this one ourselves */
316 hFile
= CreateFileW(FileName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
317 /* Last error is set by CreateFile */
318 if (hFile
== INVALID_HANDLE_VALUE
) return FALSE
;
322 SetFilePointerEx(hFile
, zero
, &oldPos
, FILE_CURRENT
);
323 SetFilePointer(hFile
, 0, NULL
, FILE_BEGIN
);
324 if (!ReadFile(hFile
, hdr
, sizeof(hdr
), &count
, NULL
))
327 if (count
< SIP_MAX_MAGIC_NUMBER
)
329 SetLastError(ERROR_INVALID_PARAMETER
);
333 TRACE("file magic = 0x%02x%02x%02x%02x\n", hdr
[0], hdr
[1], hdr
[2], hdr
[3]);
334 /* As everything is in place now we start looking at the file header */
335 if (!memcmp(hdr
, &dosHdr
, sizeof(dosHdr
)))
337 *pgSubject
= unknown
;
342 /* Quick-n-dirty check for a cab file. */
343 if (!memcmp(hdr
, cabHdr
, sizeof(cabHdr
)))
345 *pgSubject
= cabGUID
;
350 /* If it's asn.1-encoded, it's probably a .cat file. */
353 DWORD fileLen
= GetFileSize(hFile
, NULL
);
355 TRACE("fileLen = %ld\n", fileLen
);
356 /* Sanity-check length */
357 if (hdr
[1] < 0x80 && fileLen
== 2 + hdr
[1])
359 *pgSubject
= catGUID
;
364 else if (hdr
[1] == 0x80)
366 /* Indefinite length, can't verify with just the header, assume it
369 *pgSubject
= catGUID
;
376 BYTE lenBytes
= hdr
[1] & 0x7f;
378 if (lenBytes
== 1 && fileLen
== 2 + lenBytes
+ hdr
[2])
380 *pgSubject
= catGUID
;
385 else if (lenBytes
== 2 && fileLen
== 2 + lenBytes
+
386 (hdr
[2] << 8 | hdr
[3]))
388 *pgSubject
= catGUID
;
393 else if (fileLen
> 0xffff)
395 /* The file size must be greater than 2 bytes in length, so
396 * assume it is a .cat file
398 *pgSubject
= catGUID
;
406 /* Check for supported functions using CryptSIPDllIsMyFileType */
407 r
= RegOpenKeyExW(HKEY_LOCAL_MACHINE
, L
"Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptSIPDllIsMyFileType\\", 0, KEY_READ
, &key
);
408 if (r
== ERROR_SUCCESS
)
410 DWORD index
= 0, size
;
411 WCHAR subKeyName
[MAX_PATH
];
414 size
= ARRAY_SIZE(subKeyName
);
415 r
= RegEnumKeyExW(key
, index
++, subKeyName
, &size
, NULL
, NULL
,
417 if (r
== ERROR_SUCCESS
)
421 r
= RegOpenKeyExW(key
, subKeyName
, 0, KEY_READ
, &subKey
);
422 if (r
== ERROR_SUCCESS
)
425 pfnIsFileSupported isMy
= CRYPT_LoadSIPFuncFromKey(subKey
,
430 bRet
= isMy(hFile
, pgSubject
);
436 } while (!bRet
&& r
== ERROR_SUCCESS
);
440 /* Check for supported functions using CryptSIPDllIsMyFileType2 */
443 r
= RegOpenKeyExW(HKEY_LOCAL_MACHINE
, L
"Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptSIPDllIsMyFileType2\\", 0, KEY_READ
, &key
);
444 if (r
== ERROR_SUCCESS
)
446 DWORD index
= 0, size
;
447 WCHAR subKeyName
[MAX_PATH
];
450 size
= ARRAY_SIZE(subKeyName
);
451 r
= RegEnumKeyExW(key
, index
++, subKeyName
, &size
, NULL
, NULL
,
453 if (r
== ERROR_SUCCESS
)
457 r
= RegOpenKeyExW(key
, subKeyName
, 0, KEY_READ
, &subKey
);
458 if (r
== ERROR_SUCCESS
)
461 pfnIsFileSupportedName isMy2
=
462 CRYPT_LoadSIPFuncFromKey(subKey
, &lib
);
466 bRet
= isMy2((LPWSTR
)FileName
, pgSubject
);
472 } while (!bRet
&& r
== ERROR_SUCCESS
);
478 SetLastError(TRUST_E_SUBJECT_FORM_UNKNOWN
);
481 /* If we didn't open this one we shouldn't close it (hFile is a copy),
482 * but we should reset the file pointer to its original position.
487 SetFilePointerEx(hFile
, oldPos
, NULL
, FILE_BEGIN
);
492 static LONG
CRYPT_OpenSIPFunctionKey(const GUID
*guid
, LPCWSTR function
,
495 WCHAR szFullKey
[ 0x100 ];
497 lstrcpyW(szFullKey
, L
"Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptSIPDll");
498 lstrcatW(szFullKey
, function
);
499 CRYPT_guid2wstr(guid
, &szFullKey
[lstrlenW(szFullKey
)]);
500 return RegOpenKeyExW(HKEY_LOCAL_MACHINE
, szFullKey
, 0, KEY_READ
, key
);
503 /* Loads the function named function for the SIP specified by pgSubject, and
504 * returns it if found. Returns NULL on error. If the function is loaded,
505 * *pLib is set to the library in which it is found.
507 static void *CRYPT_LoadSIPFunc(const GUID
*pgSubject
, LPCWSTR function
,
514 TRACE("(%s, %s)\n", debugstr_guid(pgSubject
), debugstr_w(function
));
516 r
= CRYPT_OpenSIPFunctionKey(pgSubject
, function
, &key
);
519 func
= CRYPT_LoadSIPFuncFromKey(key
, pLib
);
522 TRACE("returning %p\n", func
);
526 typedef struct _WINE_SIP_PROVIDER
{
528 SIP_DISPATCH_INFO info
;
532 static struct list providers
= { &providers
, &providers
};
533 static CRITICAL_SECTION providers_cs
;
534 static CRITICAL_SECTION_DEBUG providers_cs_debug
=
537 { &providers_cs_debug
.ProcessLocksList
,
538 &providers_cs_debug
.ProcessLocksList
},
539 0, 0, { (DWORD_PTR
)(__FILE__
": providers_cs") }
541 static CRITICAL_SECTION providers_cs
= { &providers_cs_debug
, -1, 0, 0, 0, 0 };
543 static void CRYPT_CacheSIP(const GUID
*pgSubject
, SIP_DISPATCH_INFO
*info
)
545 WINE_SIP_PROVIDER
*prov
= CryptMemAlloc(sizeof(WINE_SIP_PROVIDER
));
549 prov
->subject
= *pgSubject
;
551 EnterCriticalSection(&providers_cs
);
552 list_add_tail(&providers
, &prov
->entry
);
553 LeaveCriticalSection(&providers_cs
);
557 static WINE_SIP_PROVIDER
*CRYPT_GetCachedSIP(const GUID
*pgSubject
)
559 WINE_SIP_PROVIDER
*provider
= NULL
, *ret
= NULL
;
561 EnterCriticalSection(&providers_cs
);
562 LIST_FOR_EACH_ENTRY(provider
, &providers
, WINE_SIP_PROVIDER
, entry
)
564 if (IsEqualGUID(pgSubject
, &provider
->subject
))
567 if (provider
&& IsEqualGUID(pgSubject
, &provider
->subject
))
569 LeaveCriticalSection(&providers_cs
);
573 static inline BOOL
CRYPT_IsSIPCached(const GUID
*pgSubject
)
575 return CRYPT_GetCachedSIP(pgSubject
) != NULL
;
578 void crypt_sip_free(void)
580 WINE_SIP_PROVIDER
*prov
, *next
;
582 LIST_FOR_EACH_ENTRY_SAFE(prov
, next
, &providers
, WINE_SIP_PROVIDER
, entry
)
584 list_remove(&prov
->entry
);
585 FreeLibrary(prov
->info
.hSIP
);
588 DeleteCriticalSection(&providers_cs
);
591 /* Loads the SIP for pgSubject into the global cache. Returns FALSE if the
592 * SIP isn't registered or is invalid.
594 static BOOL
CRYPT_LoadSIP(const GUID
*pgSubject
)
596 SIP_DISPATCH_INFO sip
= { 0 };
597 HMODULE lib
= NULL
, temp
= NULL
;
599 sip
.pfGet
= CRYPT_LoadSIPFunc(pgSubject
, L
"GetSignedDataMsg\\", &lib
);
602 sip
.pfPut
= CRYPT_LoadSIPFunc(pgSubject
, L
"PutSignedDataMsg\\", &temp
);
603 if (!sip
.pfPut
|| temp
!= lib
)
607 sip
.pfCreate
= CRYPT_LoadSIPFunc(pgSubject
, L
"CreateIndirectData\\", &temp
);
608 if (!sip
.pfCreate
|| temp
!= lib
)
612 sip
.pfVerify
= CRYPT_LoadSIPFunc(pgSubject
, L
"VerifyIndirectData\\", &temp
);
613 if (!sip
.pfVerify
|| temp
!= lib
)
617 sip
.pfRemove
= CRYPT_LoadSIPFunc(pgSubject
, L
"RemoveSignedDataMsg\\", &temp
);
618 if (!sip
.pfRemove
|| temp
!= lib
)
622 CRYPT_CacheSIP(pgSubject
, &sip
);
628 SetLastError(TRUST_E_SUBJECT_FORM_UNKNOWN
);
632 /***********************************************************************
633 * CryptSIPLoad (CRYPT32.@)
635 * Load some internal crypt32 functions into a SIP_DISPATCH_INFO structure.
638 * pgSubject [I] The GUID.
640 * pSipDispatch [I] The loaded functions.
643 * Success: TRUE. pSipDispatch contains the functions.
644 * Failure: FALSE. (Look at GetLastError()).
647 * CryptSIPLoad uses caching for the list of GUIDs and whether a SIP is
650 * An application calls CryptSipLoad which will return a structure with the
651 * function addresses of some internal crypt32 functions. The application will
652 * then call these functions which will be forwarded to the appropriate SIP.
654 * CryptSIPLoad will load the needed SIP but doesn't unload this dll. The unloading
655 * is done when crypt32 is unloaded.
657 BOOL WINAPI CryptSIPLoad
658 (const GUID
*pgSubject
, DWORD dwFlags
, SIP_DISPATCH_INFO
*pSipDispatch
)
660 TRACE("(%s %ld %p)\n", debugstr_guid(pgSubject
), dwFlags
, pSipDispatch
);
662 if (!pgSubject
|| dwFlags
!= 0 || !pSipDispatch
)
664 SetLastError(ERROR_INVALID_PARAMETER
);
667 if (!CRYPT_IsSIPCached(pgSubject
) && !CRYPT_LoadSIP(pgSubject
))
670 pSipDispatch
->hSIP
= NULL
;
671 pSipDispatch
->pfGet
= CryptSIPGetSignedDataMsg
;
672 pSipDispatch
->pfPut
= CryptSIPPutSignedDataMsg
;
673 pSipDispatch
->pfCreate
= CryptSIPCreateIndirectData
;
674 pSipDispatch
->pfVerify
= CryptSIPVerifyIndirectData
;
675 pSipDispatch
->pfRemove
= CryptSIPRemoveSignedDataMsg
;
680 /***********************************************************************
681 * CryptSIPCreateIndirectData (CRYPT32.@)
683 BOOL WINAPI
CryptSIPCreateIndirectData(SIP_SUBJECTINFO
* pSubjectInfo
, DWORD
* pcbIndirectData
,
684 SIP_INDIRECT_DATA
* pIndirectData
)
686 WINE_SIP_PROVIDER
*sip
;
689 TRACE("(%p %p %p)\n", pSubjectInfo
, pcbIndirectData
, pIndirectData
);
691 if (!pSubjectInfo
|| !pSubjectInfo
->pgSubjectType
|| !pcbIndirectData
)
693 SetLastError(ERROR_INVALID_PARAMETER
);
696 if ((sip
= CRYPT_GetCachedSIP(pSubjectInfo
->pgSubjectType
)))
697 ret
= sip
->info
.pfCreate(pSubjectInfo
, pcbIndirectData
, pIndirectData
);
698 TRACE("returning %d\n", ret
);
702 /***********************************************************************
703 * CryptSIPGetSignedDataMsg (CRYPT32.@)
705 BOOL WINAPI
CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO
* pSubjectInfo
, DWORD
* pdwEncodingType
,
706 DWORD dwIndex
, DWORD
* pcbSignedDataMsg
, BYTE
* pbSignedDataMsg
)
708 WINE_SIP_PROVIDER
*sip
;
711 TRACE("(%p %p %ld %p %p)\n", pSubjectInfo
, pdwEncodingType
, dwIndex
,
712 pcbSignedDataMsg
, pbSignedDataMsg
);
714 if ((sip
= CRYPT_GetCachedSIP(pSubjectInfo
->pgSubjectType
)))
715 ret
= sip
->info
.pfGet(pSubjectInfo
, pdwEncodingType
, dwIndex
,
716 pcbSignedDataMsg
, pbSignedDataMsg
);
717 TRACE("returning %d\n", ret
);
721 /***********************************************************************
722 * CryptSIPPutSignedDataMsg (CRYPT32.@)
724 BOOL WINAPI
CryptSIPPutSignedDataMsg(SIP_SUBJECTINFO
* pSubjectInfo
, DWORD pdwEncodingType
,
725 DWORD
* pdwIndex
, DWORD cbSignedDataMsg
, BYTE
* pbSignedDataMsg
)
727 WINE_SIP_PROVIDER
*sip
;
730 TRACE("(%p %ld %p %ld %p)\n", pSubjectInfo
, pdwEncodingType
, pdwIndex
,
731 cbSignedDataMsg
, pbSignedDataMsg
);
733 if ((sip
= CRYPT_GetCachedSIP(pSubjectInfo
->pgSubjectType
)))
734 ret
= sip
->info
.pfPut(pSubjectInfo
, pdwEncodingType
, pdwIndex
,
735 cbSignedDataMsg
, pbSignedDataMsg
);
736 TRACE("returning %d\n", ret
);
740 /***********************************************************************
741 * CryptSIPRemoveSignedDataMsg (CRYPT32.@)
743 BOOL WINAPI
CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO
* pSubjectInfo
,
746 WINE_SIP_PROVIDER
*sip
;
749 TRACE("(%p %ld)\n", pSubjectInfo
, dwIndex
);
751 if ((sip
= CRYPT_GetCachedSIP(pSubjectInfo
->pgSubjectType
)))
752 ret
= sip
->info
.pfRemove(pSubjectInfo
, dwIndex
);
753 TRACE("returning %d\n", ret
);
757 /***********************************************************************
758 * CryptSIPVerifyIndirectData (CRYPT32.@)
760 BOOL WINAPI
CryptSIPVerifyIndirectData(SIP_SUBJECTINFO
* pSubjectInfo
,
761 SIP_INDIRECT_DATA
* pIndirectData
)
763 WINE_SIP_PROVIDER
*sip
;
766 TRACE("(%p %p)\n", pSubjectInfo
, pIndirectData
);
768 if ((sip
= CRYPT_GetCachedSIP(pSubjectInfo
->pgSubjectType
)))
769 ret
= sip
->info
.pfVerify(pSubjectInfo
, pIndirectData
);
770 TRACE("returning %d\n", ret
);
774 /***********************************************************************
775 * CryptSIPRetrieveSubjectGuidForCatalogFile (CRYPT32.@)
777 BOOL WINAPI
CryptSIPRetrieveSubjectGuidForCatalogFile(LPCWSTR filename
, HANDLE handle
, GUID
*subject
)
779 FIXME("(%s %p %p)\n", debugstr_w(filename
), handle
, subject
);
780 SetLastError(ERROR_INVALID_PARAMETER
);