2 * Copyright 2002 Mike McCormack for CodeWeavers
3 * Copyright (C) 2004 Juan Lang
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(crypt
);
28 #define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
30 typedef struct WINE_CRYPTCERTSTORE
33 } WINECRYPT_CERTSTORE
;
40 * HKLM\\Software\\Microsoft\\SystemCertificates\\CA\\
41 * Certificates\\<compressed guid>
43 * CRLs\\<compressed guid>
45 * CTLs\\<compressed guid>
48 HCERTSTORE WINAPI
CertOpenStore( LPCSTR lpszStoreProvider
,
49 DWORD dwMsgAndCertEncodingType
, HCRYPTPROV hCryptProv
,
50 DWORD dwFlags
, const void* pvPara
)
52 WINECRYPT_CERTSTORE
*hcs
;
54 FIXME("%s %08lx %08lx %08lx %p stub\n", debugstr_a(lpszStoreProvider
),
55 dwMsgAndCertEncodingType
, hCryptProv
, dwFlags
, pvPara
);
57 if( lpszStoreProvider
== (LPCSTR
) 0x0009 )
59 FIXME("pvPara = %s\n", debugstr_a( (LPCSTR
) pvPara
) );
62 hcs
= HeapAlloc( GetProcessHeap(), 0, sizeof (WINECRYPT_CERTSTORE
) );
66 hcs
->dwMagic
= WINE_CRYPTCERTSTORE_MAGIC
;
68 return (HCERTSTORE
) hcs
;
71 HCERTSTORE WINAPI
CertOpenSystemStoreA(HCRYPTPROV hProv
,
72 LPCSTR szSubSystemProtocol
)
74 FIXME("(%ld, %s), stub\n", hProv
, debugstr_a(szSubSystemProtocol
));
78 HCERTSTORE WINAPI
CertOpenSystemStoreW(HCRYPTPROV hProv
,
79 LPCWSTR szSubSystemProtocol
)
81 FIXME("(%ld, %s), stub\n", hProv
, debugstr_w(szSubSystemProtocol
));
85 PCCERT_CONTEXT WINAPI
CertEnumCertificatesInStore(HCERTSTORE hCertStore
, PCCERT_CONTEXT pPrev
)
87 FIXME("(%p,%p)\n", hCertStore
, pPrev
);
91 BOOL WINAPI
CertSaveStore(HCERTSTORE hCertStore
, DWORD dwMsgAndCertEncodingType
,
92 DWORD dwSaveAs
, DWORD dwSaveTo
, void* pvSaveToPara
, DWORD dwFlags
)
94 FIXME("(%p,%ld,%ld,%ld,%p,%08lx) stub!\n", hCertStore
,
95 dwMsgAndCertEncodingType
, dwSaveAs
, dwSaveTo
, pvSaveToPara
, dwFlags
);
99 PCCRL_CONTEXT WINAPI
CertCreateCRLContext( DWORD dwCertEncodingType
,
100 const BYTE
* pbCrlEncoded
, DWORD cbCrlEncoded
)
105 TRACE("%08lx %p %08lx\n", dwCertEncodingType
, pbCrlEncoded
, cbCrlEncoded
);
107 pcrl
= HeapAlloc( GetProcessHeap(), 0, sizeof (CRL_CONTEXT
) );
111 data
= HeapAlloc( GetProcessHeap(), 0, cbCrlEncoded
);
114 HeapFree( GetProcessHeap(), 0, pcrl
);
118 pcrl
->dwCertEncodingType
= dwCertEncodingType
;
119 pcrl
->pbCrlEncoded
= data
;
120 pcrl
->cbCrlEncoded
= cbCrlEncoded
;
121 pcrl
->pCrlInfo
= NULL
;
122 pcrl
->hCertStore
= 0;
127 BOOL WINAPI
CertAddCRLContextToStore( HCERTSTORE hCertStore
,
128 PCCRL_CONTEXT pCrlContext
, DWORD dwAddDisposition
,
129 PCCRL_CONTEXT
* ppStoreContext
)
131 FIXME("%p %p %08lx %p\n", hCertStore
, pCrlContext
,
132 dwAddDisposition
, ppStoreContext
);
136 BOOL WINAPI
CertFreeCRLContext( PCCRL_CONTEXT pCrlContext
)
138 FIXME("%p\n", pCrlContext
);
143 BOOL WINAPI
CertCloseStore( HCERTSTORE hCertStore
, DWORD dwFlags
)
145 FIXME("%p %08lx\n", hCertStore
, dwFlags
);
149 HeapFree( GetProcessHeap(), 0, hCertStore
);
154 BOOL WINAPI
CertFreeCertificateContext( PCCERT_CONTEXT pCertContext
)
156 FIXME("%p stub\n", pCertContext
);
160 PCCERT_CONTEXT WINAPI
CertFindCertificateInStore(HCERTSTORE hCertStore
,
161 DWORD dwCertEncodingType
, DWORD dwFlags
, DWORD dwType
,
162 const void *pvPara
, PCCERT_CONTEXT pPrevCertContext
)
164 FIXME("stub: %p %ld %ld %ld %p %p\n", hCertStore
, dwCertEncodingType
,
165 dwFlags
, dwType
, pvPara
, pPrevCertContext
);
166 SetLastError(CRYPT_E_NOT_FOUND
);