1 | /*
|
---|
2 | * Copyright (C) 2004 Francois Gouget
|
---|
3 | *
|
---|
4 | * This library is free software; you can redistribute it and/or
|
---|
5 | * modify it under the terms of the GNU Lesser General Public
|
---|
6 | * License as published by the Free Software Foundation; either
|
---|
7 | * version 2.1 of the License, or (at your option) any later version.
|
---|
8 | *
|
---|
9 | * This library is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
12 | * Lesser General Public License for more details.
|
---|
13 | *
|
---|
14 | * You should have received a copy of the GNU Lesser General Public
|
---|
15 | * License along with this library; if not, write to the Free Software
|
---|
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef __WINE_WINTRUST_H
|
---|
29 | #define __WINE_WINTRUST_H
|
---|
30 |
|
---|
31 | #include <wincrypt.h>
|
---|
32 |
|
---|
33 |
|
---|
34 | #include <pshpack8.h>
|
---|
35 |
|
---|
36 | typedef struct WINTRUST_FILE_INFO_
|
---|
37 | {
|
---|
38 | DWORD cbStruct;
|
---|
39 | LPCWSTR pcwszFilePath;
|
---|
40 | HANDLE hFile;
|
---|
41 | GUID* pgKnownSubject;
|
---|
42 | } WINTRUST_FILE_INFO, *PWINTRUST_FILE_INFO;
|
---|
43 |
|
---|
44 | typedef struct WINTRUST_CATALOG_INFO_
|
---|
45 | {
|
---|
46 | DWORD cbStruct;
|
---|
47 | DWORD dwCatalogVersion;
|
---|
48 | LPCWSTR pcwszCatalogFilePath;
|
---|
49 | LPCWSTR pcwszMemberTag;
|
---|
50 | LPCWSTR pcwszMemberFilePath;
|
---|
51 | HANDLE hMemberFile;
|
---|
52 | BYTE* pbCalculatedFileHash;
|
---|
53 | DWORD cbCalculatedFileHash;
|
---|
54 | PCCTL_CONTEXT pcCatalogContext;
|
---|
55 | } WINTRUST_CATALOG_INFO, *PWINTRUST_CATALOG_INFO;
|
---|
56 |
|
---|
57 | typedef struct WINTRUST_BLOB_INFO_
|
---|
58 | {
|
---|
59 | DWORD cbStruct;
|
---|
60 | GUID gSubject;
|
---|
61 | LPCWSTR pcwszDisplayName;
|
---|
62 | DWORD cbMemObject;
|
---|
63 | BYTE* pbMemObject;
|
---|
64 | DWORD cbMemSignedMsg;
|
---|
65 | BYTE* pbMemSignedMsg;
|
---|
66 | } WINTRUST_BLOB_INFO, *PWINTRUST_BLOB_INFO;
|
---|
67 |
|
---|
68 | typedef struct WINTRUST_SGNR_INFO_
|
---|
69 | {
|
---|
70 | DWORD cbStruct;
|
---|
71 | LPCWSTR pcwszDisplayName;
|
---|
72 | CMSG_SIGNER_INFO* psSignerInfo;
|
---|
73 | DWORD chStores;
|
---|
74 | HCERTSTORE* pahStores;
|
---|
75 | } WINTRUST_SGNR_INFO, *PWINTRUST_SGNR_INFO;
|
---|
76 |
|
---|
77 | typedef struct WINTRUST_CERT_INFO_
|
---|
78 | {
|
---|
79 | DWORD cbStruct;
|
---|
80 | LPCWSTR pcwszDisplayName;
|
---|
81 | CERT_CONTEXT* psCertContext;
|
---|
82 | DWORD chStores;
|
---|
83 | HCERTSTORE* pahStores;
|
---|
84 | DWORD dwFlags;
|
---|
85 | FILETIME* psftVerifyAsOf;
|
---|
86 | } WINTRUST_CERT_INFO, *PWINTRUST_CERT_INFO;
|
---|
87 |
|
---|
88 | #define WTCI_DONT_OPEN_STORES 0x00000001
|
---|
89 | #define WTCI_OPEN_ONLY_ROOT 0x00000002
|
---|
90 |
|
---|
91 | /* dwUIChoice */
|
---|
92 | #define WTD_UI_ALL 1
|
---|
93 | #define WTD_UI_NONE 2
|
---|
94 | #define WTD_UI_NOBAD 3
|
---|
95 | #define WTD_UI_NOGOOD 4
|
---|
96 | /* fdwRevocationChecks */
|
---|
97 | #define WTD_REVOKE_NONE 0
|
---|
98 | #define WTD_REVOKE_WHOLECHAIN 1
|
---|
99 | /* dwUnionChoice */
|
---|
100 | #define WTD_CHOICE_FILE 1
|
---|
101 | #define WTD_CHOICE_CATALOG 2
|
---|
102 | #define WTD_CHOICE_BLOB 3
|
---|
103 | #define WTD_CHOICE_SIGNER 4
|
---|
104 | #define WTD_CHOICE_CERT 5
|
---|
105 |
|
---|
106 | typedef struct _WINTRUST_DATA
|
---|
107 | {
|
---|
108 | DWORD cbStruct;
|
---|
109 | LPVOID pPolicyCallbackData;
|
---|
110 | LPVOID pSIPClientData;
|
---|
111 | DWORD dwUIChoice;
|
---|
112 | DWORD fdwRevocationChecks;
|
---|
113 | DWORD dwUnionChoice;
|
---|
114 | union
|
---|
115 | {
|
---|
116 | struct WINTRUST_FILE_INFO_* pFile;
|
---|
117 | struct WINTRUST_CATALOG_INFO_* pCatalog;
|
---|
118 | struct WINTRUST_BLOB_INFO_* pBlob;
|
---|
119 | struct WINTRUST_SGNR_INFO_* pSgnr;
|
---|
120 | struct WINTRUST_CERT_INFO_* pCert;
|
---|
121 | } DUMMYUNIONNAME;
|
---|
122 |
|
---|
123 | DWORD dwStateAction;
|
---|
124 | HANDLE hWVTStateData;
|
---|
125 | WCHAR* pwszURLReference;
|
---|
126 | DWORD dwProvFlags;
|
---|
127 | DWORD dwUIContext;
|
---|
128 | } WINTRUST_DATA, *PWINTRUST_DATA;
|
---|
129 |
|
---|
130 | #define WTD_STATEACTION_IGNORE 0
|
---|
131 | #define WTD_STATEACTION_VERIFY 1
|
---|
132 | #define WTD_STATEACTION_CLOSE 2
|
---|
133 | #define WTD_STATEACTION_AUTO_CACHE 3
|
---|
134 | #define WTD_STATEACTION_AUTO_CACHE_FLUSH 4
|
---|
135 |
|
---|
136 | #define WTD_PROV_FLAGS_MASK 0x0000ffff
|
---|
137 | #define WTD_USE_IE4_TRUST_FLAG 0x00000001
|
---|
138 | #define WTD_NO_IE4_CHAIN_FLAG 0x00000002
|
---|
139 | #define WTD_NO_POLICY_USAGE_FLAG 0x00000004
|
---|
140 | #define WTD_REVOCATION_CHECK_NONE 0x00000010
|
---|
141 | #define WTD_REVOCATION_CHECK_END_CERT 0x00000020
|
---|
142 | #define WTD_REVOCATION_CHECK_CHAIN 0x00000040
|
---|
143 | #define WTD_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 0x00000080
|
---|
144 | #define WTD_SAFER_FLAG 0x00000100
|
---|
145 | #define WTD_HASH_ONLY_FLAG 0x00000200
|
---|
146 | #define WTD_USE_DEFAULT_OSVER_CHECK 0x00000400
|
---|
147 | #define WTD_LIFETIME_SIGNING_FLAG 0x00000800
|
---|
148 | #define WTD_CACHE_ONLY_URL_RETRIEVAL 0x00001000
|
---|
149 |
|
---|
150 | #define WTD_UICONTEXT_EXECUTE 0
|
---|
151 | #define WTD_UICONTEXT_INSTALL 1
|
---|
152 |
|
---|
153 | typedef struct _CRYPT_TRUST_REG_ENTRY
|
---|
154 | {
|
---|
155 | DWORD cbStruct;
|
---|
156 | WCHAR *pwszDLLName;
|
---|
157 | WCHAR *pwszFunctionName;
|
---|
158 | } CRYPT_TRUST_REG_ENTRY, *PCRYPT_TRUST_REG_ENTRY;
|
---|
159 |
|
---|
160 | typedef struct _CRYPT_REGISTER_ACTIONID
|
---|
161 | {
|
---|
162 | DWORD cbStruct;
|
---|
163 | CRYPT_TRUST_REG_ENTRY sInitProvider;
|
---|
164 | CRYPT_TRUST_REG_ENTRY sObjectProvider;
|
---|
165 | CRYPT_TRUST_REG_ENTRY sSignatureProvider;
|
---|
166 | CRYPT_TRUST_REG_ENTRY sCertificateProvider;
|
---|
167 | CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider;
|
---|
168 | CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider;
|
---|
169 | CRYPT_TRUST_REG_ENTRY sTestPolicyProvider;
|
---|
170 | CRYPT_TRUST_REG_ENTRY sCleanupProvider;
|
---|
171 | } CRYPT_REGISTER_ACTIONID, *PCRYPT_REGISTER_ACTIONID;
|
---|
172 |
|
---|
173 | typedef struct _CRYPT_PROVIDER_REGDEFUSAGE
|
---|
174 | {
|
---|
175 | DWORD cbStruct;
|
---|
176 | GUID *pgActionID;
|
---|
177 | WCHAR *pwszDllName;
|
---|
178 | char *pwszLoadCallbackDataFunctionName;
|
---|
179 | char *pwszFreeCallbackDataFunctionName;
|
---|
180 | } CRYPT_PROVIDER_REGDEFUSAGE, *PCRYPT_PROVIDER_REGDEFUSAGE;
|
---|
181 |
|
---|
182 | typedef struct _CRYPT_PROVUI_DATA {
|
---|
183 | DWORD cbStruct;
|
---|
184 | DWORD dwFinalError;
|
---|
185 | WCHAR *pYesButtonText;
|
---|
186 | WCHAR *pNoButtonText;
|
---|
187 | WCHAR *pMoreInfoButtonText;
|
---|
188 | WCHAR *pAdvancedLinkText;
|
---|
189 | WCHAR *pCopyActionText;
|
---|
190 | WCHAR *pCopyActionTextNoTS;
|
---|
191 | WCHAR *pCopyActionTextNotSigned;
|
---|
192 | } CRYPT_PROVUI_DATA, *PCRYPT_PROVUI_DATA;
|
---|
193 |
|
---|
194 | typedef struct _CRYPT_PROVIDER_CERT {
|
---|
195 | DWORD cbStruct;
|
---|
196 | PCCERT_CONTEXT pCert;
|
---|
197 | BOOL fCommercial;
|
---|
198 | BOOL fTrustedRoot;
|
---|
199 | BOOL fSelfSigned;
|
---|
200 | BOOL fTestCert;
|
---|
201 | DWORD dwRevokedReason;
|
---|
202 | DWORD dwConfidence;
|
---|
203 | DWORD dwError;
|
---|
204 | CTL_CONTEXT *pTrustListContext;
|
---|
205 | BOOL fTrustListSignerCert;
|
---|
206 | PCCTL_CONTEXT pCtlContext;
|
---|
207 | DWORD dwCtlError;
|
---|
208 | BOOL fIsCyclic;
|
---|
209 | PCERT_CHAIN_ELEMENT pChainElement;
|
---|
210 | } CRYPT_PROVIDER_CERT, *PCRYPT_PROVIDER_CERT;
|
---|
211 |
|
---|
212 | #define CERT_CONFIDENCE_SIG 0x10000000
|
---|
213 | #define CERT_CONFIDENCE_TIME 0x01000000
|
---|
214 | #define CERT_CONFIDENCE_TIMENEST 0x00100000
|
---|
215 | #define CERT_CONFIDENCE_AUTHIDEXT 0x00010000
|
---|
216 | #define CERT_CONFIDENCE_HYGIENE 0x00001000
|
---|
217 | #define CERT_CONFIDENCE_HIGHEST 0x11111000
|
---|
218 |
|
---|
219 | typedef struct _CRYPT_PROVIDER_SGNR {
|
---|
220 | DWORD cbStruct;
|
---|
221 | FILETIME sftVerifyAsOf;
|
---|
222 | DWORD csCertChain;
|
---|
223 | CRYPT_PROVIDER_CERT *pasCertChain;
|
---|
224 | DWORD dwSignerType;
|
---|
225 | CMSG_SIGNER_INFO *psSigner;
|
---|
226 | DWORD dwError;
|
---|
227 | DWORD csCounterSigners;
|
---|
228 | struct _CRYPT_PROVIDER_SGNR *pasCounterSigners;
|
---|
229 | PCCERT_CHAIN_CONTEXT pChainContext;
|
---|
230 | } CRYPT_PROVIDER_SGNR, *PCRYPT_PROVIDER_SGNR;
|
---|
231 |
|
---|
232 | #define SGNR_TYPE_TIMESTAMP 0x00000010
|
---|
233 |
|
---|
234 | typedef struct _CRYPT_PROVIDER_PRIVDATA {
|
---|
235 | DWORD cbStruct;
|
---|
236 | GUID gProviderID;
|
---|
237 | DWORD cbProvData;
|
---|
238 | void *pvProvData;
|
---|
239 | } CRYPT_PROVIDER_PRIVDATA, *PCRYPT_PROVIDER_PRIVDATA;
|
---|
240 |
|
---|
241 | struct _CRYPT_PROVIDER_DATA;
|
---|
242 |
|
---|
243 | #define TRUSTERROR_STEP_WVTPARAMS 0
|
---|
244 | #define TRUSTERROR_STEP_FILEIO 2
|
---|
245 | #define TRUSTERROR_STEP_SIP 3
|
---|
246 | #define TRUSTERROR_STEP_SIPSUBJINFO 5
|
---|
247 | #define TRUSTERROR_STEP_CATALOGFILE 6
|
---|
248 | #define TRUSTERROR_STEP_CERTSTORE 7
|
---|
249 | #define TRUSTERROR_STEP_MESSAGE 8
|
---|
250 | #define TRUSTERROR_STEP_MSG_SIGNERCOUNT 9
|
---|
251 | #define TRUSTERROR_STEP_MSG_INNERCNTTYPE 10
|
---|
252 | #define TRUSTERROR_STEP_MSG_INNERCNT 11
|
---|
253 | #define TRUSTERROR_STEP_MSG_STORE 12
|
---|
254 | #define TRUSTERROR_STEP_MSG_SIGNERINFO 13
|
---|
255 | #define TRUSTERROR_STEP_MSG_SIGNERCERT 14
|
---|
256 | #define TRUSTERROR_STEP_MSG_CERTCHAIN 15
|
---|
257 | #define TRUSTERROR_STEP_MSG_COUNTERSIGINFO 16
|
---|
258 | #define TRUSTERROR_STEP_MSG_COUNTERSIGCERT 17
|
---|
259 | #define TRUSTERROR_STEP_VERIFY_MSGHASH 18
|
---|
260 | #define TRUSTERROR_STEP_VERIFY_MSGINDIRECTDATA 19
|
---|
261 | #define TRUSTERROR_STEP_FINAL_WVTINIT 30
|
---|
262 | #define TRUSTERROR_STEP_FINAL_INITPROV 31
|
---|
263 | #define TRUSTERROR_STEP_FINAL_OBJPROV 32
|
---|
264 | #define TRUSTERROR_STEP_FINAL_SIGPROV 33
|
---|
265 | #define TRUSTERROR_STEP_FINAL_CERTPROV 34
|
---|
266 | #define TRUSTERROR_STEP_FINAL_CERTCHKPROV 35
|
---|
267 | #define TRUSTERROR_STEP_FINAL_POLICYPROV 36
|
---|
268 | #define TRUSTERROR_STEP_FINAL_UIPROV 37
|
---|
269 |
|
---|
270 | #define TRUSTERROR_MAX_STEPS 38
|
---|
271 |
|
---|
272 | typedef void * (__WINE_ALLOC_SIZE(1) WINAPI *PFN_CPD_MEM_ALLOC)(DWORD cbSize);
|
---|
273 | typedef void (WINAPI *PFN_CPD_MEM_FREE)(void *pvMem2Free);
|
---|
274 | typedef BOOL (WINAPI *PFN_CPD_ADD_STORE)(struct _CRYPT_PROVIDER_DATA *pProvData,
|
---|
275 | HCERTSTORE hStore2Add);
|
---|
276 | typedef BOOL (WINAPI *PFN_CPD_ADD_SGNR)(struct _CRYPT_PROVIDER_DATA *pProvData,
|
---|
277 | BOOL fCounterSigner, DWORD idxSigner, struct _CRYPT_PROVIDER_SGNR *pSgnr2Add);
|
---|
278 | typedef BOOL (WINAPI *PFN_CPD_ADD_CERT)(struct _CRYPT_PROVIDER_DATA *pProvData,
|
---|
279 | DWORD idxSigner, BOOL fCounterSigner, DWORD idxCounterSigner,
|
---|
280 | PCCERT_CONTEXT pCert2Add);
|
---|
281 | typedef BOOL (WINAPI *PFN_CPD_ADD_PRIVDATA)(struct _CRYPT_PROVIDER_DATA *pProvData,
|
---|
282 | struct _CRYPT_PROVIDER_PRIVDATA *pPrivData2Add);
|
---|
283 | typedef HRESULT (WINAPI *PFN_PROVIDER_INIT_CALL)(
|
---|
284 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
285 | typedef HRESULT (WINAPI *PFN_PROVIDER_OBJTRUST_CALL)(
|
---|
286 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
287 | typedef HRESULT (WINAPI *PFN_PROVIDER_SIGTRUST_CALL)(
|
---|
288 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
289 | typedef HRESULT (WINAPI *PFN_PROVIDER_CERTTRUST_CALL)(
|
---|
290 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
291 | typedef HRESULT (WINAPI *PFN_PROVIDER_FINALPOLICY_CALL)(
|
---|
292 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
293 | typedef HRESULT (WINAPI *PFN_PROVIDER_TESTFINALPOLICY_CALL)(
|
---|
294 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
295 | typedef HRESULT (WINAPI *PFN_PROVIDER_CLEANUP_CALL)(
|
---|
296 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
297 | typedef BOOL (WINAPI *PFN_PROVIDER_CERTCHKPOLICY_CALL)(
|
---|
298 | struct _CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner,
|
---|
299 | BOOL fCounterSignerChain, DWORD idxCounterSigner);
|
---|
300 |
|
---|
301 | typedef struct _CRYPT_PROVIDER_FUNCTIONS {
|
---|
302 | DWORD cbStruct;
|
---|
303 | PFN_CPD_MEM_ALLOC pfnAlloc;
|
---|
304 | PFN_CPD_MEM_FREE pfnFree;
|
---|
305 | PFN_CPD_ADD_STORE pfnAddStore2Chain;
|
---|
306 | PFN_CPD_ADD_SGNR pfnAddSgnr2Chain;
|
---|
307 | PFN_CPD_ADD_CERT pfnAddCert2Chain;
|
---|
308 | PFN_CPD_ADD_PRIVDATA pfnAddPrivData2Chain;
|
---|
309 | PFN_PROVIDER_INIT_CALL pfnInitialize;
|
---|
310 | PFN_PROVIDER_OBJTRUST_CALL pfnObjectTrust;
|
---|
311 | PFN_PROVIDER_SIGTRUST_CALL pfnSignatureTrust;
|
---|
312 | PFN_PROVIDER_CERTTRUST_CALL pfnCertificateTrust;
|
---|
313 | PFN_PROVIDER_FINALPOLICY_CALL pfnFinalPolicy;
|
---|
314 | PFN_PROVIDER_CERTCHKPOLICY_CALL pfnCertCheckPolicy;
|
---|
315 | PFN_PROVIDER_TESTFINALPOLICY_CALL pfnTestFinalPolicy;
|
---|
316 | struct _CRYPT_PROVUI_FUNCS *psUIpfns;
|
---|
317 | PFN_PROVIDER_CLEANUP_CALL pfnCleanupPolicy;
|
---|
318 | } CRYPT_PROVIDER_FUNCTIONS, *PCRYPT_PROVIDER_FUNCTIONS;
|
---|
319 |
|
---|
320 | struct SIP_DISPATCH_INFO_;
|
---|
321 | struct SIP_SUBJECTINFO_;
|
---|
322 | struct SIP_INDIRECT_DATA_;
|
---|
323 |
|
---|
324 | typedef struct _PROVDATA_SIP {
|
---|
325 | DWORD cbStruct;
|
---|
326 | GUID gSubject;
|
---|
327 | struct SIP_DISPATCH_INFO_ *pSip;
|
---|
328 | struct SIP_DISPATCH_INFO_ *pCATSip;
|
---|
329 | struct SIP_SUBJECTINFO_ *psSipSubjectInfo;
|
---|
330 | struct SIP_SUBJECTINFO_ *psSipCATSubjectInfo;
|
---|
331 | struct SIP_INDIRECT_DATA_ *psIndirectData;
|
---|
332 | } PROVDATA_SIP, *PPROVDATA_SIP;
|
---|
333 |
|
---|
334 | typedef struct _CRYPT_PROVIDER_DATA {
|
---|
335 | DWORD cbStruct;
|
---|
336 | WINTRUST_DATA *pWintrustData;
|
---|
337 | BOOL fOpenedFile;
|
---|
338 | HWND hWndParent;
|
---|
339 | GUID *pgActionID;
|
---|
340 | HCRYPTPROV hProv;
|
---|
341 | DWORD dwError;
|
---|
342 | DWORD dwRegSecuritySettings;
|
---|
343 | DWORD dwRegPolicySettings;
|
---|
344 | CRYPT_PROVIDER_FUNCTIONS *psPfns;
|
---|
345 | DWORD cdwTrustStepErrors;
|
---|
346 | DWORD *padwTrustStepErrors;
|
---|
347 | DWORD chStores;
|
---|
348 | HCERTSTORE *pahStores;
|
---|
349 | DWORD dwEncoding;
|
---|
350 | HCRYPTMSG hMsg;
|
---|
351 | DWORD csSigners;
|
---|
352 | CRYPT_PROVIDER_SGNR *pasSigners;
|
---|
353 | DWORD csProvPrivData;
|
---|
354 | CRYPT_PROVIDER_PRIVDATA *pasProvPrivData;
|
---|
355 | DWORD dwSubjectChoice;
|
---|
356 | union {
|
---|
357 | struct _PROVDATA_SIP *pPDSip;
|
---|
358 | } DUMMYUNIONNAME;
|
---|
359 | char *pszUsageOID;
|
---|
360 | BOOL fRecallWithState;
|
---|
361 | FILETIME sftSystemTime;
|
---|
362 | char *pszCTLSignerUsageOID;
|
---|
363 | DWORD dwProvFlags;
|
---|
364 | DWORD dwFinalError;
|
---|
365 | PCERT_USAGE_MATCH pRequestUsage;
|
---|
366 | DWORD dwTrustPubSettings;
|
---|
367 | DWORD dwUIStateFlags;
|
---|
368 | } CRYPT_PROVIDER_DATA, *PCRYPT_PROVIDER_DATA;
|
---|
369 |
|
---|
370 | #define CPD_CHOICE_SIP 1
|
---|
371 |
|
---|
372 | #define CPD_USE_NT5_CHAIN_FLAG 0x80000000
|
---|
373 | #define CPD_REVOCATION_CHECK_NONE 0x00010000
|
---|
374 | #define CPD_REVOCATION_CHECK_END_CERT 0x00020000
|
---|
375 | #define CPD_REVOCATION_CHECK_CHAIN 0x00040000
|
---|
376 | #define CPD_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 0x00080000
|
---|
377 |
|
---|
378 | #define CPD_UISTATE_MODE_PROMPT 0x00000000
|
---|
379 | #define CPD_UISTATE_MODE_BLOCK 0x00000001
|
---|
380 | #define CPD_UISTATE_MODE_ALLOW 0x00000002
|
---|
381 | #define CPD_UISTATE_MODE_MASK 0x00000003
|
---|
382 |
|
---|
383 | typedef BOOL (*PFN_PROVUI_CALL)(HWND hWndSecurityDialog,
|
---|
384 | struct _CRYPT_PROVIDER_DATA *pProvData);
|
---|
385 |
|
---|
386 | typedef struct _CRYPT_PROVUI_FUNCS {
|
---|
387 | DWORD cbStruct;
|
---|
388 | CRYPT_PROVUI_DATA psUIData;
|
---|
389 | PFN_PROVUI_CALL pfnOnMoreInfoClick;
|
---|
390 | PFN_PROVUI_CALL pfnOnMoreInfoClickDefault;
|
---|
391 | PFN_PROVUI_CALL pfnOnAdvancedClick;
|
---|
392 | PFN_PROVUI_CALL pfnOnAdvancedClickDefault;
|
---|
393 | } CRYPT_PROVUI_FUNCS, *PCRYPT_PROVUI_FUNCS;
|
---|
394 |
|
---|
395 | #include <poppack.h>
|
---|
396 |
|
---|
397 | #define WVT_OFFSETOF(t,f) ((ULONG)((ULONG_PTR)(&((t*)0)->f)))
|
---|
398 | #define WVT_ISINSTRUCT(t,s,f) (WVT_OFFSETOF(t,f) + sizeof(((t*)0)->f) <= (s))
|
---|
399 | #define WVT_IS_CBSTRUCT_GT_MEMBEROFFSET(t,s,f) WVT_ISINSTRUCT(t,s,f)
|
---|
400 |
|
---|
401 | #define WTPF_TRUSTTEST 0x00000020
|
---|
402 | #define WTPF_TESTCANBEVALID 0x00000080
|
---|
403 | #define WTPF_IGNOREEXPIRATION 0x00000100
|
---|
404 | #define WTPF_IGNOREREVOKATION 0x00000200
|
---|
405 | #define WTPF_OFFLINEOK_IND 0x00000400
|
---|
406 | #define WTPF_OFFLINEOK_COM 0x00000800
|
---|
407 | #define WTPF_OFFLINEOKNBU_IND 0x00001000
|
---|
408 | #define WTPF_OFFLINEOKNBU_COM 0x00002000
|
---|
409 | #define WTPF_VERIFY_V1_OFF 0x00010000
|
---|
410 | #define WTPF_IGNOREREVOCATIONONTS 0x00020000
|
---|
411 | #define WTPF_ALLOWONLYPERTRUST 0x00040000
|
---|
412 |
|
---|
413 | #define WT_ADD_ACTION_ID_RET_RESULT_FLAG 1
|
---|
414 |
|
---|
415 | #ifdef __cplusplus
|
---|
416 | extern "C" {
|
---|
417 | #endif
|
---|
418 |
|
---|
419 | #if defined(__GNUC__)
|
---|
420 | #define WT_PROVIDER_CERTTRUST_FUNCTION (const WCHAR []) \
|
---|
421 | {'W','i','n','t','r','u','s','t','C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t', 0}
|
---|
422 | #elif defined(_MSC_VER)
|
---|
423 | #define WT_PROVIDER_CERTTRUST_FUNCTION L"WintrustCertificateTrust"
|
---|
424 | #else
|
---|
425 | static const WCHAR WT_PROVIDER_CERTTRUST_FUNCTION[] =
|
---|
426 | {'W','i','n','t','r','u','s','t','C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t', 0};
|
---|
427 | #endif
|
---|
428 |
|
---|
429 | BOOL WINAPI WintrustAddActionID(GUID*,DWORD,CRYPT_REGISTER_ACTIONID*);
|
---|
430 | BOOL WINAPI WintrustRemoveActionID(GUID*);
|
---|
431 | BOOL WINAPI WintrustLoadFunctionPointers(GUID*,CRYPT_PROVIDER_FUNCTIONS*);
|
---|
432 | BOOL WINAPI WintrustAddDefaultForUsage(const char*,CRYPT_PROVIDER_REGDEFUSAGE*);
|
---|
433 | void WINAPI WintrustGetRegPolicyFlags(DWORD*);
|
---|
434 | BOOL WINAPI WintrustSetRegPolicyFlags(DWORD);
|
---|
435 | LONG WINAPI WinVerifyTrust(HWND,GUID*,LPVOID);
|
---|
436 | HRESULT WINAPI WinVerifyTrustEx(HWND,GUID*,WINTRUST_DATA*);
|
---|
437 |
|
---|
438 | CRYPT_PROVIDER_CERT * WINAPI WTHelperGetProvCertFromChain(
|
---|
439 | CRYPT_PROVIDER_SGNR *pSgnr, DWORD idxCert);
|
---|
440 | CRYPT_PROVIDER_SGNR * WINAPI WTHelperGetProvSignerFromChain(
|
---|
441 | CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSigner,
|
---|
442 | DWORD idxCounterSigner);
|
---|
443 | CRYPT_PROVIDER_DATA * WINAPI WTHelperProvDataFromStateData(HANDLE hStateData);
|
---|
444 | CRYPT_PROVIDER_PRIVDATA * WINAPI WTHelperGetProvPrivateDataFromChain(CRYPT_PROVIDER_DATA *,GUID *);
|
---|
445 |
|
---|
446 | #define SPC_INDIRECT_DATA_OBJID "1.3.6.1.4.1.311.2.1.4"
|
---|
447 | #define SPC_SP_AGENCY_INFO_OBJID "1.3.6.1.4.1.311.2.1.10"
|
---|
448 | #define SPC_STATEMENT_TYPE_OBJID "1.3.6.1.4.1.311.2.1.11"
|
---|
449 | #define SPC_SP_OPUS_INFO_OBJID "1.3.6.1.4.1.311.2.1.12"
|
---|
450 | #define SPC_CERT_EXTENSIONS_OBJID "1.3.6.1.4.1.311.2.1.14"
|
---|
451 | #define SPC_PE_IMAGE_DATA_OBJID "1.3.6.1.4.1.311.2.1.15"
|
---|
452 | #define SPC_RAW_FILE_DATA_OBJID "1.3.6.1.4.1.311.2.1.18"
|
---|
453 | #define SPC_STRUCTURED_STORAGE_DATA_OBJID "1.3.6.1.4.1.311.2.1.19"
|
---|
454 | #define SPC_JAVA_CLASS_DATA_OBJID "1.3.6.1.4.1.311.2.1.20"
|
---|
455 | #define SPC_INDIVIDUAL_SP_KEY_PURPOSE_OBJID "1.3.6.1.4.1.311.2.1.21"
|
---|
456 | #define SPC_COMMERCIAL_SP_KEY_PURPOSE_OBJID "1.3.6.1.4.1.311.2.1.22"
|
---|
457 | #define SPC_CAB_DATA_OBJID "1.3.6.1.4.1.311.2.1.25"
|
---|
458 | #define SPC_GLUE_RDN_OBJID "1.3.6.1.4.1.311.2.1.25"
|
---|
459 | #define SPC_MINIMAL_CRITERIA_OBJID "1.3.6.1.4.1.311.2.1.26"
|
---|
460 | #define SPC_FINANCIAL_CRITERIA_OBJID "1.3.6.1.4.1.311.2.1.27"
|
---|
461 | #define SPC_LINK_OBJID "1.3.6.1.4.1.311.2.1.28"
|
---|
462 | #define SPC_SIGINFO_OBJID "1.3.6.1.4.1.311.2.1.30"
|
---|
463 | #define CAT_NAMEVALUE_OBJID "1.3.6.1.4.1.311.12.2.1"
|
---|
464 | #define CAT_MEMBERINFO_OBJID "1.3.6.1.4.1.311.12.2.2"
|
---|
465 |
|
---|
466 | #define SPC_SP_AGENCY_INFO_STRUCT ((LPCSTR) 2000)
|
---|
467 | #define SPC_MINIMAL_CRITERIA_STRUCT ((LPCSTR) 2001)
|
---|
468 | #define SPC_FINANCIAL_CRITERIA_STRUCT ((LPCSTR) 2002)
|
---|
469 | #define SPC_INDIRECT_DATA_CONTENT_STRUCT ((LPCSTR) 2003)
|
---|
470 | #define SPC_PE_IMAGE_DATA_STRUCT ((LPCSTR) 2004)
|
---|
471 | #define SPC_LINK_STRUCT ((LPCSTR) 2005)
|
---|
472 | #define SPC_STATEMENT_TYPE_STRUCT ((LPCSTR) 2006)
|
---|
473 | #define SPC_SP_OPUS_INFO_STRUCT ((LPCSTR) 2007)
|
---|
474 | #define SPC_CAB_DATA_STRUCT ((LPCSTR) 2008)
|
---|
475 | #define SPC_JAVA_CLASS_DATA_STRUCT ((LPCSTR) 2009)
|
---|
476 | #define SPC_SIGINFO_STRUCT ((LPCSTR) 2130)
|
---|
477 | #define CAT_NAMEVALUE_STRUCT ((LPCSTR) 2221)
|
---|
478 | #define CAT_MEMBERINFO_STRUCT ((LPCSTR) 2222)
|
---|
479 |
|
---|
480 | #define SPC_UUID_LENGTH 16
|
---|
481 | typedef BYTE SPC_UUID[SPC_UUID_LENGTH];
|
---|
482 |
|
---|
483 | typedef struct _SPC_SERIALIZED_OBJECT
|
---|
484 | {
|
---|
485 | SPC_UUID ClassId;
|
---|
486 | CRYPT_DATA_BLOB SerializedData;
|
---|
487 | } SPC_SERIALIZED_OBJECT, *PSPC_SERIALIZED_OBJECT;
|
---|
488 |
|
---|
489 | typedef struct SPC_SIGINFO_
|
---|
490 | {
|
---|
491 | DWORD dwSipVersion;
|
---|
492 | GUID gSIPGuid;
|
---|
493 | DWORD dwReserved1;
|
---|
494 | DWORD dwReserved2;
|
---|
495 | DWORD dwReserved3;
|
---|
496 | DWORD dwReserved4;
|
---|
497 | DWORD dwReserved5;
|
---|
498 | } SPC_SIGINFO, *PSPC_SIGINFO;
|
---|
499 |
|
---|
500 | #define SPC_URL_LINK_CHOICE 1
|
---|
501 | #define SPC_MONIKER_LINK_CHOICE 2
|
---|
502 | #define SPC_FILE_LINK_CHOICE 3
|
---|
503 |
|
---|
504 | typedef struct SPC_LINK_
|
---|
505 | {
|
---|
506 | DWORD dwLinkChoice;
|
---|
507 | union
|
---|
508 | {
|
---|
509 | LPWSTR pwszUrl;
|
---|
510 | SPC_SERIALIZED_OBJECT Moniker;
|
---|
511 | LPWSTR pwszFile;
|
---|
512 | } DUMMYUNIONNAME;
|
---|
513 | } SPC_LINK, *PSPC_LINK;
|
---|
514 |
|
---|
515 | typedef struct _SPC_PE_IMAGE_DATA
|
---|
516 | {
|
---|
517 | CRYPT_BIT_BLOB Flags;
|
---|
518 | PSPC_LINK pFile;
|
---|
519 | } SPC_PE_IMAGE_DATA, *PSPC_PE_IMAGE_DATA;
|
---|
520 |
|
---|
521 | typedef struct _SPC_INDIRECT_DATA_CONTENT
|
---|
522 | {
|
---|
523 | CRYPT_ATTRIBUTE_TYPE_VALUE Data;
|
---|
524 | CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm;
|
---|
525 | CRYPT_HASH_BLOB Digest;
|
---|
526 | } SPC_INDIRECT_DATA_CONTENT, *PSPC_INDIRECT_DATA_CONTENT;
|
---|
527 |
|
---|
528 | typedef struct _SPC_FINANCIAL_CRITERIA
|
---|
529 | {
|
---|
530 | BOOL fFinancialInfoAvailable;
|
---|
531 | BOOL fMeetsCriteria;
|
---|
532 | } SPC_FINANCIAL_CRITERIA, *PSPC_FINANCIAL_CRITERIA;
|
---|
533 |
|
---|
534 | typedef struct _SPC_IMAGE
|
---|
535 | {
|
---|
536 | struct SPC_LINK_ *pImageLink;
|
---|
537 | CRYPT_DATA_BLOB Bitmap;
|
---|
538 | CRYPT_DATA_BLOB Metafile;
|
---|
539 | CRYPT_DATA_BLOB EnhancedMetafile;
|
---|
540 | CRYPT_DATA_BLOB GifFile;
|
---|
541 | } SPC_IMAGE, *PSPC_IMAGE;
|
---|
542 |
|
---|
543 | typedef struct _SPC_SP_AGENCY_INFO
|
---|
544 | {
|
---|
545 | struct SPC_LINK_ *pPolicyInformation;
|
---|
546 | LPWSTR pwszPolicyDisplayText;
|
---|
547 | PSPC_IMAGE pLogoImage;
|
---|
548 | struct SPC_LINK_ *pLogoLink;
|
---|
549 | } SPC_SP_AGENCY_INFO, *PSPC_SP_AGENCY_INFO;
|
---|
550 |
|
---|
551 | typedef struct _SPC_STATEMENT_TYPE
|
---|
552 | {
|
---|
553 | DWORD cKeyPurposeId;
|
---|
554 | LPSTR *rgpszKeyPurposeId;
|
---|
555 | } SPC_STATEMENT_TYPE, *PSPC_STATEMENT_TYPE;
|
---|
556 |
|
---|
557 | typedef struct _SPC_SP_OPUS_INFO
|
---|
558 | {
|
---|
559 | LPCWSTR pwszProgramName;
|
---|
560 | struct SPC_LINK_ *pMoreInfo;
|
---|
561 | struct SPC_LINK_ *pPublisherInfo;
|
---|
562 | } SPC_SP_OPUS_INFO, *PSPC_SP_OPUS_INFO;
|
---|
563 |
|
---|
564 | typedef struct _CAT_NAMEVALUE
|
---|
565 | {
|
---|
566 | LPWSTR pwszTag;
|
---|
567 | DWORD fdwFlags;
|
---|
568 | CRYPT_DATA_BLOB Value;
|
---|
569 | } CAT_NAMEVALUE, *PCAT_NAMEVALUE;
|
---|
570 |
|
---|
571 | typedef struct _CAT_MEMBERINFO
|
---|
572 | {
|
---|
573 | LPWSTR pwszSubjGuid;
|
---|
574 | DWORD dwCertVersion;
|
---|
575 | } CAT_MEMBERINFO, *PCAT_MEMBERINFO;
|
---|
576 |
|
---|
577 | /* PSDK protects the remaining defines with WT_DEFINE_ALL_APIS, but it's
|
---|
578 | * defined by default. No need to protect against bad headers from old PSDKs.
|
---|
579 | */
|
---|
580 |
|
---|
581 | typedef struct _WIN_CERTIFICATE {
|
---|
582 | DWORD dwLength;
|
---|
583 | WORD wRevision; /* WIN_CERT_REVISION_xxx */
|
---|
584 | WORD wCertificateType; /* WIN_CERT_TYPE_xxx */
|
---|
585 | BYTE bCertificate[ANYSIZE_ARRAY];
|
---|
586 | } WIN_CERTIFICATE, *LPWIN_CERTIFICATE;
|
---|
587 |
|
---|
588 | #define WIN_CERT_REVISION_1_0 0x0100
|
---|
589 | #define WIN_CERT_REVISION_2_0 0x0200
|
---|
590 |
|
---|
591 | #define WIN_CERT_TYPE_X509 0x0001 /* X.509 Certificate */
|
---|
592 | #define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002 /* PKCS SignedData */
|
---|
593 | #define WIN_CERT_TYPE_RESERVED_1 0x0003 /* Reserved */
|
---|
594 | #define WIN_CERT_TYPE_TS_STACK_SIGNED 0x0004
|
---|
595 |
|
---|
596 | typedef LPVOID WIN_TRUST_SUBJECT;
|
---|
597 |
|
---|
598 | typedef struct _WIN_TRUST_ACTDATA_CONTEXT_WITH_SUBJECT
|
---|
599 | {
|
---|
600 | HANDLE hClientToken;
|
---|
601 | GUID *SubjectType;
|
---|
602 | WIN_TRUST_SUBJECT Subject;
|
---|
603 | } WIN_TRUST_ACTDATA_CONTEXT_WITH_SUBJECT,
|
---|
604 | *LPWIN_TRUST_ACTDATA_CONTEXT_WITH_SUBJECT;
|
---|
605 |
|
---|
606 | typedef struct _WIN_TRUST_ACTDATA_CONTEXT_SUBJECT_ONLY
|
---|
607 | {
|
---|
608 | GUID *SubjectType;
|
---|
609 | WIN_TRUST_SUBJECT Subject;
|
---|
610 | } WIN_TRUST_ACTDATA_CONTEXT_SUBJECT_ONLY,
|
---|
611 | *LPWIN_TRUST_ACTDATA_CONTEXT_SUBJECT_ONLY;
|
---|
612 |
|
---|
613 | typedef struct _WIN_TRUST_SUBJECT_FILE
|
---|
614 | {
|
---|
615 | HANDLE hFile;
|
---|
616 | LPCWSTR lpPath;
|
---|
617 | } WIN_TRUST_SUBJECT_FILE, *LPWIN_TRUST_SUBJECT_FILE;
|
---|
618 |
|
---|
619 | typedef struct _WIN_TRUST_SUBJECT_FILE_AND_DISPLAY
|
---|
620 | {
|
---|
621 | HANDLE hFile;
|
---|
622 | LPCWSTR lpPath;
|
---|
623 | LPCWSTR lpDisplayName;
|
---|
624 | } WIN_TRUST_SUBJECT_FILE_AND_DISPLAY, *LPWIN_TRUST_SUBJECT_FILE_AND_DISPLAY;
|
---|
625 |
|
---|
626 | #define WIN_SPUB_ACTION_PUBLISHED_SOFTWARE \
|
---|
627 | { 0x64b9d180, 0x8da2, 0x11cf, { 0x87,0x36,0x00,0xaa,0x00,0xa4,0x85,0xeb }}
|
---|
628 |
|
---|
629 | #ifdef __cplusplus
|
---|
630 | }
|
---|
631 | #endif
|
---|
632 |
|
---|
633 | #endif
|
---|