FreeRDP
Loading...
Searching...
No Matches
cert.c
1
20#include <winpr/config.h>
21
22#include <winpr/crypto.h>
23
151#include <winpr/crt.h>
152#include <winpr/wlog.h>
153#include <winpr/wincrypt.h>
154
155#ifndef _WIN32
156
157#include "crypto.h"
158
159HCERTSTORE CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType,
160 WINPR_ATTR_UNUSED HCRYPTPROV_LEGACY hCryptProv,
161 WINPR_ATTR_UNUSED DWORD dwFlags, WINPR_ATTR_UNUSED const void* pvPara)
162{
163 WINPR_CERTSTORE* certstore = NULL;
164
165 certstore = (WINPR_CERTSTORE*)calloc(1, sizeof(WINPR_CERTSTORE));
166
167 if (certstore)
168 {
169 certstore->lpszStoreProvider = lpszStoreProvider;
170 certstore->dwMsgAndCertEncodingType = dwMsgAndCertEncodingType;
171 }
172
173 return (HCERTSTORE)certstore;
174}
175
176HCERTSTORE CertOpenSystemStoreW(HCRYPTPROV_LEGACY hProv,
177 WINPR_ATTR_UNUSED LPCWSTR szSubsystemProtocol)
178{
179 HCERTSTORE hCertStore = NULL;
180
181 hCertStore = CertOpenStore(CERT_STORE_PROV_FILE, X509_ASN_ENCODING, hProv, 0, NULL);
182
183 return hCertStore;
184}
185
186HCERTSTORE CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv,
187 WINPR_ATTR_UNUSED LPCSTR szSubsystemProtocol)
188{
189 return CertOpenSystemStoreW(hProv, NULL);
190}
191
192BOOL CertCloseStore(HCERTSTORE hCertStore, WINPR_ATTR_UNUSED DWORD dwFlags)
193{
194 WINPR_CERTSTORE* certstore = NULL;
195
196 certstore = (WINPR_CERTSTORE*)hCertStore;
197
198 free(certstore);
199
200 return TRUE;
201}
202
203PCCERT_CONTEXT CertFindCertificateInStore(WINPR_ATTR_UNUSED HCERTSTORE hCertStore,
204 WINPR_ATTR_UNUSED DWORD dwCertEncodingType,
205 WINPR_ATTR_UNUSED DWORD dwFindFlags,
206 WINPR_ATTR_UNUSED DWORD dwFindType,
207 WINPR_ATTR_UNUSED const void* pvFindPara,
208 WINPR_ATTR_UNUSED PCCERT_CONTEXT pPrevCertContext)
209{
210 WLog_ERR("TODO", "TODO: Implement");
211 return (PCCERT_CONTEXT)1;
212}
213
214PCCERT_CONTEXT CertEnumCertificatesInStore(WINPR_ATTR_UNUSED HCERTSTORE hCertStore,
215 WINPR_ATTR_UNUSED PCCERT_CONTEXT pPrevCertContext)
216{
217 WLog_ERR("TODO", "TODO: Implement");
218 return (PCCERT_CONTEXT)NULL;
219}
220
221DWORD CertGetNameStringW(WINPR_ATTR_UNUSED PCCERT_CONTEXT pCertContext,
222 WINPR_ATTR_UNUSED DWORD dwType, WINPR_ATTR_UNUSED DWORD dwFlags,
223 WINPR_ATTR_UNUSED void* pvTypePara, WINPR_ATTR_UNUSED LPWSTR pszNameString,
224 WINPR_ATTR_UNUSED DWORD cchNameString)
225{
226 WLog_ERR("TODO", "TODO: Implement");
227 return 0;
228}
229
230DWORD CertGetNameStringA(WINPR_ATTR_UNUSED PCCERT_CONTEXT pCertContext,
231 WINPR_ATTR_UNUSED DWORD dwType, WINPR_ATTR_UNUSED DWORD dwFlags,
232 WINPR_ATTR_UNUSED void* pvTypePara, WINPR_ATTR_UNUSED LPSTR pszNameString,
233 WINPR_ATTR_UNUSED DWORD cchNameString)
234{
235 WLog_ERR("TODO", "TODO: Implement");
236 return 0;
237}
238
239#endif