1c2c66affSColin Finck /*
2c2c66affSColin Finck * MSSIGN32 implementation
3c2c66affSColin Finck *
4c2c66affSColin Finck * Copyright 2009 Austin English
5c2c66affSColin Finck *
6c2c66affSColin Finck * This library is free software; you can redistribute it and/or
7c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public
8c2c66affSColin Finck * License as published by the Free Software Foundation; either
9c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version.
10c2c66affSColin Finck *
11c2c66affSColin Finck * This library is distributed in the hope that it will be useful,
12c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
13c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14c2c66affSColin Finck * Lesser General Public License for more details.
15c2c66affSColin Finck *
16c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public
17c2c66affSColin Finck * License along with this library; if not, write to the Free Software
18c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19c2c66affSColin Finck */
20c2c66affSColin Finck
21c2c66affSColin Finck #include <stdarg.h>
22c2c66affSColin Finck
233d03add4SAmine Khaldi #include "windef.h"
243d03add4SAmine Khaldi #include "winbase.h"
253d03add4SAmine Khaldi #include "wincrypt.h"
26c2c66affSColin Finck
273d03add4SAmine Khaldi #include "wine/debug.h"
28*f3c326b2SAmine Khaldi #include "wine/heap.h"
29*f3c326b2SAmine Khaldi
30*f3c326b2SAmine Khaldi #include "mssign32_private.h"
31c2c66affSColin Finck
32c2c66affSColin Finck WINE_DEFAULT_DEBUG_CHANNEL(mssign);
33c2c66affSColin Finck
DllMain(HINSTANCE hinst,DWORD reason,LPVOID lpv)34c2c66affSColin Finck BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID lpv )
35c2c66affSColin Finck {
36c2c66affSColin Finck switch(reason)
37c2c66affSColin Finck {
38c2c66affSColin Finck case DLL_WINE_PREATTACH:
39c2c66affSColin Finck return FALSE; /* prefer native version */
40c2c66affSColin Finck case DLL_PROCESS_ATTACH:
41c2c66affSColin Finck DisableThreadLibraryCalls( hinst );
42c2c66affSColin Finck break;
43c2c66affSColin Finck }
44c2c66affSColin Finck return TRUE;
45c2c66affSColin Finck }
46c2c66affSColin Finck
47c2c66affSColin Finck
PvkGetCryptProv(HWND hwnd,LPCWSTR pwszCaption,LPCWSTR pwszCapiProvider,DWORD dwProviderType,LPCWSTR pwszPvkFile,LPCWSTR pwszKeyContainerName,DWORD * pdwKeySpec,LPWSTR * ppwszTmpContainer,HCRYPTPROV * phCryptProv)48c2c66affSColin Finck HRESULT WINAPI PvkGetCryptProv(HWND hwnd, LPCWSTR pwszCaption, LPCWSTR pwszCapiProvider,
49c2c66affSColin Finck DWORD dwProviderType, LPCWSTR pwszPvkFile, LPCWSTR pwszKeyContainerName,
50c2c66affSColin Finck DWORD *pdwKeySpec, LPWSTR *ppwszTmpContainer, HCRYPTPROV *phCryptProv)
51c2c66affSColin Finck {
52c2c66affSColin Finck FIXME("%p %s %s %d %s %s %p %p %p stub\n", hwnd, debugstr_w(pwszCaption), debugstr_w(pwszCapiProvider),
53c2c66affSColin Finck dwProviderType, debugstr_w(pwszPvkFile), debugstr_w(pwszKeyContainerName),
54c2c66affSColin Finck pdwKeySpec, ppwszTmpContainer, phCryptProv);
55c2c66affSColin Finck
56c2c66affSColin Finck return E_FAIL;
57c2c66affSColin Finck }
58c2c66affSColin Finck
PvkPrivateKeyAcquireContextFromMemory(LPCWSTR pwszProvName,DWORD dwProvType,BYTE * pbData,DWORD cbData,HWND hwndOwner,LPCWSTR pwszKeyName,DWORD * pdwKeySpec,HCRYPTPROV * phCryptProv,LPWSTR * ppwszTmpContainer)59c2c66affSColin Finck BOOL WINAPI PvkPrivateKeyAcquireContextFromMemory(LPCWSTR pwszProvName, DWORD dwProvType,
60c2c66affSColin Finck BYTE *pbData, DWORD cbData, HWND hwndOwner, LPCWSTR pwszKeyName,
61c2c66affSColin Finck DWORD *pdwKeySpec, HCRYPTPROV *phCryptProv, LPWSTR *ppwszTmpContainer)
62c2c66affSColin Finck {
63c2c66affSColin Finck FIXME("%s %d %p %d %p %s %p %p %p stub\n", debugstr_w(pwszProvName), dwProvType,
64c2c66affSColin Finck pbData, cbData, hwndOwner, debugstr_w(pwszKeyName), pdwKeySpec,
65c2c66affSColin Finck phCryptProv, ppwszTmpContainer);
66c2c66affSColin Finck
67c2c66affSColin Finck return FALSE;
68c2c66affSColin Finck }
69c2c66affSColin Finck
PvkFreeCryptProv(HCRYPTPROV hProv,LPCWSTR pwszCapiProvider,DWORD dwProviderType,LPWSTR pwszTmpContainer)70c2c66affSColin Finck void WINAPI PvkFreeCryptProv(HCRYPTPROV hProv, LPCWSTR pwszCapiProvider, DWORD dwProviderType,
71c2c66affSColin Finck LPWSTR pwszTmpContainer)
72c2c66affSColin Finck {
73c2c66affSColin Finck FIXME("%08lx %s %d %s stub\n", hProv, debugstr_w(pwszCapiProvider), dwProviderType,
74c2c66affSColin Finck debugstr_w(pwszTmpContainer));
75c2c66affSColin Finck }
76*f3c326b2SAmine Khaldi
SignerSignEx(DWORD flags,SIGNER_SUBJECT_INFO * subject_info,SIGNER_CERT * signer_cert,SIGNER_SIGNATURE_INFO * signature_info,SIGNER_PROVIDER_INFO * provider_info,const WCHAR * http_time_stamp,CRYPT_ATTRIBUTES * request,void * sip_data,SIGNER_CONTEXT ** signer_context)77*f3c326b2SAmine Khaldi HRESULT WINAPI SignerSignEx(DWORD flags, SIGNER_SUBJECT_INFO *subject_info, SIGNER_CERT *signer_cert,
78*f3c326b2SAmine Khaldi SIGNER_SIGNATURE_INFO *signature_info, SIGNER_PROVIDER_INFO *provider_info,
79*f3c326b2SAmine Khaldi const WCHAR *http_time_stamp, CRYPT_ATTRIBUTES *request, void *sip_data,
80*f3c326b2SAmine Khaldi SIGNER_CONTEXT **signer_context)
81*f3c326b2SAmine Khaldi {
82*f3c326b2SAmine Khaldi FIXME("%x %p %p %p %p %s %p %p %p stub\n", flags, subject_info, signer_cert, signature_info, provider_info,
83*f3c326b2SAmine Khaldi wine_dbgstr_w(http_time_stamp), request, sip_data, signer_cert);
84*f3c326b2SAmine Khaldi return E_NOTIMPL;
85*f3c326b2SAmine Khaldi }
86*f3c326b2SAmine Khaldi
SignerFreeSignerContext(SIGNER_CONTEXT * signer_context)87*f3c326b2SAmine Khaldi HRESULT WINAPI SignerFreeSignerContext(SIGNER_CONTEXT *signer_context)
88*f3c326b2SAmine Khaldi {
89*f3c326b2SAmine Khaldi heap_free(signer_context);
90*f3c326b2SAmine Khaldi return S_OK;
91*f3c326b2SAmine Khaldi }
92