1 /* Unit test suite for wintrust asn functions
3 * Copyright 2007 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/test.h"
29 static BOOL (WINAPI
*pCryptDecodeObjectEx
)(DWORD
,LPCSTR
,const BYTE
*,DWORD
,DWORD
,PCRYPT_DECODE_PARA
,void*,DWORD
*);
30 static BOOL (WINAPI
*pCryptEncodeObjectEx
)(DWORD
,LPCSTR
,const void*,DWORD
,PCRYPT_ENCODE_PARA
,void*,DWORD
*);
32 static const BYTE falseCriteria
[] = { 0x30,0x06,0x01,0x01,0x00,0x01,0x01,0x00 };
33 static const BYTE trueCriteria
[] = { 0x30,0x06,0x01,0x01,0xff,0x01,0x01,0xff };
35 static void test_encodeSPCFinancialCriteria(void)
40 SPC_FINANCIAL_CRITERIA criteria
= { FALSE
, FALSE
};
42 if (!pCryptEncodeObjectEx
)
44 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeFinancialCriteria tests\n");
47 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_FINANCIAL_CRITERIA_STRUCT
,
48 &criteria
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
49 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
52 ok(size
== sizeof(falseCriteria
), "Unexpected size %d\n", size
);
53 ok(!memcmp(buf
, falseCriteria
, size
), "Unexpected value\n");
56 criteria
.fFinancialInfoAvailable
= criteria
.fMeetsCriteria
= TRUE
;
57 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_FINANCIAL_CRITERIA_STRUCT
,
58 &criteria
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
59 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
62 ok(size
== sizeof(trueCriteria
), "Unexpected size %d\n", size
);
63 ok(!memcmp(buf
, trueCriteria
, size
), "Unexpected value\n");
68 static void test_decodeSPCFinancialCriteria(void)
71 SPC_FINANCIAL_CRITERIA criteria
;
72 DWORD size
= sizeof(criteria
);
74 if (!pCryptDecodeObjectEx
)
76 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCFinancialCriteria tests\n");
80 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_FINANCIAL_CRITERIA_STRUCT
,
81 falseCriteria
, sizeof(falseCriteria
), 0, NULL
, &criteria
, &size
);
82 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
85 ok(!criteria
.fFinancialInfoAvailable
, "expected FALSE\n");
86 ok(!criteria
.fMeetsCriteria
, "expected FALSE\n");
88 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_FINANCIAL_CRITERIA_STRUCT
,
89 trueCriteria
, sizeof(trueCriteria
), 0, NULL
, &criteria
, &size
);
90 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
93 ok(criteria
.fFinancialInfoAvailable
, "expected TRUE\n");
94 ok(criteria
.fMeetsCriteria
, "expected TRUE\n");
98 static WCHAR url
[] = { 'h','t','t','p',':','/','/','w','i','n','e','h','q','.',
100 static const WCHAR nihongoURL
[] = { 'h','t','t','p',':','/','/',0x226f,
102 static const BYTE emptyURLSPCLink
[] = { 0x80,0x00 };
103 static const BYTE urlSPCLink
[] = {
104 0x80,0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,0x65,0x68,0x71,
105 0x2e,0x6f,0x72,0x67};
106 static const BYTE fileSPCLink
[] = {
107 0xa2,0x14,0x80,0x12,0x00,0x68,0x00,0x74,0x00,0x74,0x00,0x70,0x00,0x3a,0x00,
108 0x2f,0x00,0x2f,0x22,0x6f,0x57,0x5b };
109 static const BYTE emptyMonikerSPCLink
[] = {
110 0xa1,0x14,0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
111 0x00,0x00,0x00,0x00,0x00,0x04,0x00 };
112 static BYTE data
[] = { 0xba, 0xad, 0xf0, 0x0d };
113 static const BYTE monikerSPCLink
[] = {
114 0xa1,0x18,0x04,0x10,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,
115 0xea,0xea,0xea,0xea,0xea,0x04,0x04,0xba,0xad,0xf0,0x0d };
117 static void test_encodeSPCLink(void)
122 SPC_LINK link
= { 0 };
124 if (!pCryptEncodeObjectEx
)
126 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeSPCLink tests\n");
130 SetLastError(0xdeadbeef);
131 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
, &link
,
132 CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
133 ok(!ret
&& GetLastError() == E_INVALIDARG
,
134 "Expected E_INVALIDARG, got %08x\n", GetLastError());
135 link
.dwLinkChoice
= SPC_URL_LINK_CHOICE
;
136 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
, &link
,
137 CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
138 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
141 ok(size
== sizeof(emptyURLSPCLink
), "Unexpected size %d\n", size
);
142 ok(!memcmp(buf
, emptyURLSPCLink
, size
), "Unexpected value\n");
145 /* With an invalid char: */
146 U(link
).pwszUrl
= (LPWSTR
)nihongoURL
;
148 SetLastError(0xdeadbeef);
149 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
, &link
,
150 CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
152 (GetLastError() == CRYPT_E_INVALID_IA5_STRING
||
153 GetLastError() == OSS_BAD_PTR
/* Win9x */),
154 "Expected CRYPT_E_INVALID_IA5_STRING, got %08x\n", GetLastError());
155 /* Unlike the crypt32 string encoding routines, size is not set to the
156 * index of the first invalid character.
158 ok(size
== 0, "Expected size 0, got %d\n", size
);
159 U(link
).pwszUrl
= url
;
160 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
, &link
,
161 CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
162 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
165 ok(size
== sizeof(urlSPCLink
), "Unexpected size %d\n", size
);
166 ok(!memcmp(buf
, urlSPCLink
, size
), "Unexpected value\n");
169 link
.dwLinkChoice
= SPC_FILE_LINK_CHOICE
;
170 U(link
).pwszFile
= (LPWSTR
)nihongoURL
;
171 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
, &link
,
172 CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
173 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
176 ok(size
== sizeof(fileSPCLink
), "Unexpected size %d\n", size
);
177 ok(!memcmp(buf
, fileSPCLink
, size
), "Unexpected value\n");
180 link
.dwLinkChoice
= SPC_MONIKER_LINK_CHOICE
;
181 memset(&U(link
).Moniker
, 0, sizeof(U(link
).Moniker
));
182 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
, &link
,
183 CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
184 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
187 ok(size
== sizeof(emptyMonikerSPCLink
), "Unexpected size %d\n", size
);
188 ok(!memcmp(buf
, emptyMonikerSPCLink
, size
), "Unexpected value\n");
191 memset(&U(link
).Moniker
.ClassId
, 0xea, sizeof(U(link
).Moniker
.ClassId
));
192 U(link
).Moniker
.SerializedData
.pbData
= data
;
193 U(link
).Moniker
.SerializedData
.cbData
= sizeof(data
);
194 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
, &link
,
195 CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
196 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
199 ok(size
== sizeof(monikerSPCLink
), "Unexpected size %d\n", size
);
200 ok(!memcmp(buf
, monikerSPCLink
, size
), "Unexpected value\n");
205 static const BYTE badMonikerSPCLink
[] = {
206 0xa1,0x19,0x04,0x11,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,
207 0xea,0xea,0xea,0xea,0xea,0xea,0x04,0x04,0xba,0xad,0xf0,0x0d };
209 static void test_decodeSPCLink(void)
216 if (!pCryptDecodeObjectEx
)
218 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCLink tests\n");
222 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
,
223 emptyURLSPCLink
, sizeof(emptyURLSPCLink
), CRYPT_DECODE_ALLOC_FLAG
, NULL
,
225 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
228 link
= (SPC_LINK
*)buf
;
229 ok(link
->dwLinkChoice
== SPC_URL_LINK_CHOICE
,
230 "Expected SPC_URL_LINK_CHOICE, got %d\n", link
->dwLinkChoice
);
231 ok(lstrlenW(U(*link
).pwszUrl
) == 0, "Expected empty string\n");
234 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
,
235 urlSPCLink
, sizeof(urlSPCLink
), CRYPT_DECODE_ALLOC_FLAG
, NULL
,
237 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
240 link
= (SPC_LINK
*)buf
;
241 ok(link
->dwLinkChoice
== SPC_URL_LINK_CHOICE
,
242 "Expected SPC_URL_LINK_CHOICE, got %d\n", link
->dwLinkChoice
);
243 ok(!lstrcmpW(U(*link
).pwszUrl
, url
), "Unexpected URL\n");
246 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
,
247 fileSPCLink
, sizeof(fileSPCLink
), CRYPT_DECODE_ALLOC_FLAG
, NULL
,
249 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
252 link
= (SPC_LINK
*)buf
;
253 ok(link
->dwLinkChoice
== SPC_FILE_LINK_CHOICE
,
254 "Expected SPC_FILE_LINK_CHOICE, got %d\n", link
->dwLinkChoice
);
255 ok(!lstrcmpW(U(*link
).pwszFile
, nihongoURL
), "Unexpected file\n");
258 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
,
259 emptyMonikerSPCLink
, sizeof(emptyMonikerSPCLink
), CRYPT_DECODE_ALLOC_FLAG
,
261 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
264 SPC_SERIALIZED_OBJECT emptyMoniker
= { { 0 } };
266 link
= (SPC_LINK
*)buf
;
267 ok(link
->dwLinkChoice
== SPC_MONIKER_LINK_CHOICE
,
268 "Expected SPC_MONIKER_LINK_CHOICE, got %d\n", link
->dwLinkChoice
);
269 ok(!memcmp(&U(*link
).Moniker
.ClassId
, &emptyMoniker
.ClassId
,
270 sizeof(emptyMoniker
.ClassId
)), "Unexpected value\n");
271 ok(U(*link
).Moniker
.SerializedData
.cbData
== 0,
272 "Expected no serialized data\n");
275 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
,
276 monikerSPCLink
, sizeof(monikerSPCLink
), CRYPT_DECODE_ALLOC_FLAG
, NULL
,
278 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
283 link
= (SPC_LINK
*)buf
;
284 ok(link
->dwLinkChoice
== SPC_MONIKER_LINK_CHOICE
,
285 "Expected SPC_MONIKER_LINK_CHOICE, got %d\n", link
->dwLinkChoice
);
286 memset(&id
, 0xea, sizeof(id
));
287 ok(!memcmp(&U(*link
).Moniker
.ClassId
, &id
, sizeof(id
)),
288 "Unexpected value\n");
289 ok(U(*link
).Moniker
.SerializedData
.cbData
== sizeof(data
),
290 "Unexpected data size %d\n", U(*link
).Moniker
.SerializedData
.cbData
);
291 ok(!memcmp(U(*link
).Moniker
.SerializedData
.pbData
, data
, sizeof(data
)),
292 "Unexpected value\n");
295 SetLastError(0xdeadbeef);
296 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_LINK_STRUCT
,
297 badMonikerSPCLink
, sizeof(badMonikerSPCLink
), CRYPT_DECODE_ALLOC_FLAG
,
300 (GetLastError() == CRYPT_E_BAD_ENCODE
||
301 GetLastError() == OSS_DATA_ERROR
/* Win9x */),
302 "Expected CRYPT_E_BAD_ENCODE, got %08x\n", GetLastError());
305 static const BYTE emptySequence
[] = { 0x30,0x00 };
306 static BYTE flags
[] = { 1 };
307 static const BYTE onlyFlagsPEImage
[] = { 0x30,0x04,0x03,0x02,0x00,0x01 };
308 static const BYTE moreFlagsPEImage
[] = {
309 0x30,0x06,0x03,0x04,0x04,0xff,0x80,0x10 };
310 static const BYTE onlyEmptyFilePEImage
[] = {
311 0x30,0x06,0xa0,0x04,0xa2,0x02,0x80,0x00 };
312 static const BYTE flagsAndEmptyFilePEImage
[] = {
313 0x30,0x0a,0x03,0x02,0x00,0x01,0xa0,0x04,0xa2,0x02,0x80,0x00 };
314 static const BYTE flagsAndFilePEImage
[] = {
315 0x30,0x1c,0x03,0x02,0x00,0x01,0xa0,0x16,0xa2,0x14,0x80,0x12,0x00,0x68,0x00,
316 0x74,0x00,0x74,0x00,0x70,0x00,0x3a,0x00,0x2f,0x00,0x2f,0x22,0x6f,0x57,0x5b };
318 static void test_encodeSPCPEImage(void)
323 SPC_PE_IMAGE_DATA imageData
= { { 0 } };
324 SPC_LINK link
= { 0 };
326 if (!pCryptEncodeObjectEx
)
328 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeSPCPEImage tests\n");
332 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
333 &imageData
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
334 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
337 ok(size
== sizeof(emptySequence
), "Unexpected size %d\n", size
);
338 ok(!memcmp(buf
, emptySequence
, sizeof(emptySequence
)),
339 "Unexpected value\n");
342 /* With an invalid link: */
343 imageData
.pFile
= &link
;
344 SetLastError(0xdeadbeef);
345 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
346 &imageData
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
347 ok(!ret
&& GetLastError () == E_INVALIDARG
,
348 "Expected E_INVALIDARG, got %08x\n", GetLastError());
349 /* With just unused bits field set: */
350 imageData
.pFile
= NULL
;
351 imageData
.Flags
.cUnusedBits
= 1;
352 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
353 &imageData
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
354 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
357 ok(size
== sizeof(emptySequence
), "Unexpected size %d\n", size
);
358 ok(!memcmp(buf
, emptySequence
, sizeof(emptySequence
)),
359 "Unexpected value\n");
362 /* With flags set: */
363 imageData
.Flags
.cUnusedBits
= 0;
364 imageData
.Flags
.pbData
= flags
;
365 imageData
.Flags
.cbData
= sizeof(flags
);
366 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
367 &imageData
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
368 if (!ret
&& GetLastError() == OSS_TOO_LONG
)
370 skip("SPC_PE_IMAGE_DATA_STRUCT not supported\n");
373 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
376 ok(size
== sizeof(onlyFlagsPEImage
), "Unexpected size %d\n", size
);
377 ok(!memcmp(buf
, onlyFlagsPEImage
, sizeof(onlyFlagsPEImage
)),
378 "Unexpected value\n");
381 /* With just an empty file: */
382 imageData
.Flags
.cbData
= 0;
383 link
.dwLinkChoice
= SPC_FILE_LINK_CHOICE
;
384 imageData
.pFile
= &link
;
385 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
386 &imageData
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
387 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
390 ok(size
== sizeof(onlyEmptyFilePEImage
), "Unexpected size %d\n", size
);
391 ok(!memcmp(buf
, onlyEmptyFilePEImage
, sizeof(onlyEmptyFilePEImage
)),
392 "Unexpected value\n");
395 /* With flags and an empty file: */
396 imageData
.Flags
.pbData
= flags
;
397 imageData
.Flags
.cbData
= sizeof(flags
);
398 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
399 &imageData
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
400 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
403 ok(size
== sizeof(flagsAndEmptyFilePEImage
), "Unexpected size %d\n",
405 ok(!memcmp(buf
, flagsAndEmptyFilePEImage
,
406 sizeof(flagsAndEmptyFilePEImage
)), "Unexpected value\n");
409 /* Finally, a non-empty file: */
410 U(link
).pwszFile
= (LPWSTR
)nihongoURL
;
411 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
412 &imageData
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
413 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
416 ok(size
== sizeof(flagsAndFilePEImage
), "Unexpected size %d\n", size
);
417 ok(!memcmp(buf
, flagsAndFilePEImage
, sizeof(flagsAndFilePEImage
)),
418 "Unexpected value\n");
423 static void test_decodeSPCPEImage(void)
425 static const WCHAR emptyString
[] = { 0 };
429 SPC_PE_IMAGE_DATA
*imageData
;
431 if (!pCryptDecodeObjectEx
)
433 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCPEImage tests\n");
437 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
438 emptySequence
, sizeof(emptySequence
),
439 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
440 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
443 imageData
= (SPC_PE_IMAGE_DATA
*)buf
;
444 ok(imageData
->Flags
.cbData
== 0, "Expected empty flags, got %d\n",
445 imageData
->Flags
.cbData
);
446 ok(imageData
->pFile
== NULL
, "Expected no file\n");
449 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
450 onlyFlagsPEImage
, sizeof(onlyFlagsPEImage
),
451 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
452 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
455 imageData
= (SPC_PE_IMAGE_DATA
*)buf
;
456 ok(imageData
->Flags
.cbData
== sizeof(flags
),
457 "Unexpected flags size %d\n", imageData
->Flags
.cbData
);
458 if (imageData
->Flags
.cbData
)
459 ok(!memcmp(imageData
->Flags
.pbData
, flags
, sizeof(flags
)),
460 "Unexpected flags\n");
461 ok(imageData
->pFile
== NULL
, "Expected no file\n");
464 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
465 onlyEmptyFilePEImage
, sizeof(onlyEmptyFilePEImage
),
466 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
467 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
470 imageData
= (SPC_PE_IMAGE_DATA
*)buf
;
471 ok(imageData
->Flags
.cbData
== 0, "Expected empty flags, got %d\n",
472 imageData
->Flags
.cbData
);
473 ok(imageData
->pFile
!= NULL
, "Expected a file\n");
474 if (imageData
->pFile
)
476 ok(imageData
->pFile
->dwLinkChoice
== SPC_FILE_LINK_CHOICE
,
477 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
478 imageData
->pFile
->dwLinkChoice
);
479 ok(!lstrcmpW(U(*imageData
->pFile
).pwszFile
, emptyString
),
480 "Unexpected file\n");
484 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
485 flagsAndEmptyFilePEImage
, sizeof(flagsAndEmptyFilePEImage
),
486 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
487 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
490 imageData
= (SPC_PE_IMAGE_DATA
*)buf
;
491 ok(imageData
->Flags
.cbData
== sizeof(flags
),
492 "Unexpected flags size %d\n", imageData
->Flags
.cbData
);
493 if (imageData
->Flags
.cbData
)
494 ok(!memcmp(imageData
->Flags
.pbData
, flags
, sizeof(flags
)),
495 "Unexpected flags\n");
496 ok(imageData
->pFile
!= NULL
, "Expected a file\n");
497 if (imageData
->pFile
)
499 ok(imageData
->pFile
->dwLinkChoice
== SPC_FILE_LINK_CHOICE
,
500 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
501 imageData
->pFile
->dwLinkChoice
);
502 ok(!lstrcmpW(U(*imageData
->pFile
).pwszFile
, emptyString
),
503 "Unexpected file\n");
507 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_PE_IMAGE_DATA_STRUCT
,
508 flagsAndFilePEImage
, sizeof(flagsAndFilePEImage
),
509 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
510 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
513 imageData
= (SPC_PE_IMAGE_DATA
*)buf
;
514 ok(imageData
->Flags
.cbData
== sizeof(flags
),
515 "Unexpected flags size %d\n", imageData
->Flags
.cbData
);
516 if (imageData
->Flags
.cbData
)
517 ok(!memcmp(imageData
->Flags
.pbData
, flags
, sizeof(flags
)),
518 "Unexpected flags\n");
519 ok(imageData
->pFile
!= NULL
, "Expected a file\n");
520 if (imageData
->pFile
)
522 ok(imageData
->pFile
->dwLinkChoice
== SPC_FILE_LINK_CHOICE
,
523 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
524 imageData
->pFile
->dwLinkChoice
);
525 ok(!lstrcmpW(U(*imageData
->pFile
).pwszFile
, nihongoURL
),
526 "Unexpected file\n");
532 static WCHAR foo
[] = { 'f','o','o',0 };
533 static WCHAR guidStr
[] = { '{','8','b','c','9','6','b','0','0','-',
534 '8','d','a','1','-','1','1','c','f','-','8','7','3','6','-','0','0',
535 'a','a','0','0','a','4','8','5','e','b','}',0 };
537 static const BYTE emptyCatMemberInfo
[] = { 0x30,0x05,0x1e,0x00,0x02,0x01,0x00 };
538 static const BYTE catMemberInfoWithSillyGuid
[] = {
539 0x30,0x0b,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00 };
540 static const BYTE catMemberInfoWithGuid
[] = {
541 0x30,0x51,0x1e,0x4c,0x00,0x7b,0x00,0x38,0x00,0x62,0x00,0x63,0x00,0x39,0x00,0x36,
542 0x00,0x62,0x00,0x30,0x00,0x30,0x00,0x2d,0x00,0x38,0x00,0x64,0x00,0x61,0x00,0x31,
543 0x00,0x2d,0x00,0x31,0x00,0x31,0x00,0x63,0x00,0x66,0x00,0x2d,0x00,0x38,0x00,0x37,
544 0x00,0x33,0x00,0x36,0x00,0x2d,0x00,0x30,0x00,0x30,0x00,0x61,0x00,0x61,0x00,0x30,
545 0x00,0x30,0x00,0x61,0x00,0x34,0x00,0x38,0x00,0x35,0x00,0x65,0x00,0x62,0x00,0x7d,
548 static void test_encodeCatMemberInfo(void)
555 memset(&info
, 0, sizeof(info
));
557 if (!pCryptEncodeObjectEx
)
559 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeCatMemberInfo tests\n");
563 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, CAT_MEMBERINFO_STRUCT
,
564 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
565 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
568 ok(size
== sizeof(emptyCatMemberInfo
), "Unexpected size %d\n", size
);
569 ok(!memcmp(buf
, emptyCatMemberInfo
, sizeof(emptyCatMemberInfo
)),
570 "Unexpected value\n");
573 info
.pwszSubjGuid
= foo
;
574 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, CAT_MEMBERINFO_STRUCT
,
575 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
576 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
579 ok(size
== sizeof(catMemberInfoWithSillyGuid
), "Unexpected size %d\n",
581 ok(!memcmp(buf
, catMemberInfoWithSillyGuid
,
582 sizeof(catMemberInfoWithSillyGuid
)), "Unexpected value\n");
585 info
.pwszSubjGuid
= guidStr
;
586 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, CAT_MEMBERINFO_STRUCT
,
587 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
588 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
591 ok(size
== sizeof(catMemberInfoWithGuid
), "Unexpected size %d\n",
593 ok(!memcmp(buf
, catMemberInfoWithGuid
, sizeof(catMemberInfoWithGuid
)),
594 "Unexpected value\n");
599 static void test_decodeCatMemberInfo(void)
604 CAT_MEMBERINFO
*info
;
606 if (!pCryptDecodeObjectEx
)
608 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeCatMemberInfo tests\n");
612 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, CAT_MEMBERINFO_STRUCT
,
613 emptyCatMemberInfo
, sizeof(emptyCatMemberInfo
),
614 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
615 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
618 info
= (CAT_MEMBERINFO
*)buf
;
619 ok(!info
->pwszSubjGuid
|| !info
->pwszSubjGuid
[0],
620 "expected empty pwszSubjGuid\n");
621 ok(info
->dwCertVersion
== 0, "expected dwCertVersion == 0, got %d\n",
622 info
->dwCertVersion
);
625 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, CAT_MEMBERINFO_STRUCT
,
626 catMemberInfoWithSillyGuid
, sizeof(catMemberInfoWithSillyGuid
),
627 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
628 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
631 info
= (CAT_MEMBERINFO
*)buf
;
632 ok(info
->pwszSubjGuid
&& !lstrcmpW(info
->pwszSubjGuid
, foo
),
633 "unexpected pwszSubjGuid\n");
634 ok(info
->dwCertVersion
== 0, "expected dwCertVersion == 0, got %d\n",
635 info
->dwCertVersion
);
638 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, CAT_MEMBERINFO_STRUCT
,
639 catMemberInfoWithGuid
, sizeof(catMemberInfoWithGuid
),
640 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
641 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
644 info
= (CAT_MEMBERINFO
*)buf
;
645 ok(info
->pwszSubjGuid
&& !lstrcmpW(info
->pwszSubjGuid
, guidStr
),
646 "unexpected pwszSubjGuid\n");
647 ok(info
->dwCertVersion
== 0, "expected dwCertVersion == 0, got %d\n",
648 info
->dwCertVersion
);
653 static const BYTE emptyCatNameValue
[] = {
654 0x30,0x07,0x1e,0x00,0x02,0x01,0x00,0x04,0x00 };
655 static const BYTE catNameValueWithTag
[] = {
656 0x30,0x0d,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00,0x04,0x00 };
657 static const BYTE catNameValueWithFlags
[] = {
658 0x30,0x0a,0x1e,0x00,0x02,0x04,0xf0,0x0d,0xd0,0x0d,0x04,0x00 };
659 static const BYTE catNameValueWithValue
[] = {
660 0x30,0x0b,0x1e,0x00,0x02,0x01,0x00,0x04,0x04,0x01,0x02,0x03,0x04 };
662 static BYTE aVal
[] = { 1,2,3,4 };
664 static void test_encodeCatNameValue(void)
666 static WCHAR foo
[] = { 'f','o','o',0 };
672 memset(&value
, 0, sizeof(value
));
673 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
674 &value
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
675 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
678 ok(size
== sizeof(emptyCatNameValue
), "Unexpected size %d\n", size
);
679 ok(!memcmp(buf
, emptyCatNameValue
, sizeof(emptyCatNameValue
)),
680 "Unexpected value\n");
684 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
685 &value
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
686 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
689 ok(size
== sizeof(catNameValueWithTag
), "Unexpected size %d\n", size
);
690 ok(!memcmp(buf
, catNameValueWithTag
, sizeof(catNameValueWithTag
)),
691 "Unexpected value\n");
694 value
.pwszTag
= NULL
;
695 value
.fdwFlags
= 0xf00dd00d;
696 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
697 &value
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
698 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
701 ok(size
== sizeof(catNameValueWithFlags
), "Unexpected size %d\n", size
);
702 ok(!memcmp(buf
, catNameValueWithFlags
, sizeof(catNameValueWithFlags
)),
703 "Unexpected value\n");
707 value
.Value
.cbData
= sizeof(aVal
);
708 value
.Value
.pbData
= aVal
;
709 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
710 &value
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
711 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
714 ok(size
== sizeof(catNameValueWithValue
), "Unexpected size %d\n", size
);
715 ok(!memcmp(buf
, catNameValueWithValue
, sizeof(catNameValueWithValue
)),
716 "Unexpected value\n");
721 static void test_decodeCatNameValue(void)
726 CAT_NAMEVALUE
*value
;
729 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
730 emptyCatNameValue
, sizeof(emptyCatNameValue
),
731 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
732 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
735 value
= (CAT_NAMEVALUE
*)buf
;
736 ok(!value
->pwszTag
|| !value
->pwszTag
[0], "expected empty pwszTag\n");
737 ok(value
->fdwFlags
== 0, "expected fdwFlags == 0, got %08x\n",
739 ok(value
->Value
.cbData
== 0, "expected 0-length value, got %d\n",
740 value
->Value
.cbData
);
744 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
745 catNameValueWithTag
, sizeof(catNameValueWithTag
),
746 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
747 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
750 value
= (CAT_NAMEVALUE
*)buf
;
751 ok(value
->pwszTag
&& !lstrcmpW(value
->pwszTag
, foo
),
752 "unexpected pwszTag\n");
753 ok(value
->fdwFlags
== 0, "expected fdwFlags == 0, got %08x\n",
755 ok(value
->Value
.cbData
== 0, "expected 0-length value, got %d\n",
756 value
->Value
.cbData
);
760 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
761 catNameValueWithFlags
, sizeof(catNameValueWithFlags
),
762 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
763 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
766 value
= (CAT_NAMEVALUE
*)buf
;
767 ok(!value
->pwszTag
|| !value
->pwszTag
[0], "expected empty pwszTag\n");
768 ok(value
->fdwFlags
== 0xf00dd00d,
769 "expected fdwFlags == 0xf00dd00d, got %08x\n", value
->fdwFlags
);
770 ok(value
->Value
.cbData
== 0, "expected 0-length value, got %d\n",
771 value
->Value
.cbData
);
775 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, CAT_NAMEVALUE_STRUCT
,
776 catNameValueWithValue
, sizeof(catNameValueWithValue
),
777 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
778 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
781 value
= (CAT_NAMEVALUE
*)buf
;
782 ok(!value
->pwszTag
|| !value
->pwszTag
[0], "expected empty pwszTag\n");
783 ok(value
->fdwFlags
== 0, "expected fdwFlags == 0, got %08x\n",
785 ok(value
->Value
.cbData
== sizeof(aVal
), "unexpected size %d\n",
786 value
->Value
.cbData
);
787 ok(!memcmp(value
->Value
.pbData
, aVal
, value
->Value
.cbData
),
788 "unexpected value\n");
793 static const WCHAR progName
[] = { 'A',' ','p','r','o','g','r','a','m',0 };
794 static const BYTE spOpusInfoWithProgramName
[] = {
795 0x30,0x16,0xa0,0x14,0x80,0x12,0x00,0x41,0x00,0x20,0x00,0x70,0x00,0x72,0x00,0x6f,
796 0x00,0x67,0x00,0x72,0x00,0x61,0x00,0x6d };
797 static WCHAR winehq
[] = { 'h','t','t','p',':','/','/','w','i','n','e','h','q',
798 '.','o','r','g','/',0 };
799 static const BYTE spOpusInfoWithMoreInfo
[] = {
800 0x30,0x16,0xa1,0x14,0x80,0x12,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,
801 0x65,0x68,0x71,0x2e,0x6f,0x72,0x67,0x2f };
802 static const BYTE spOpusInfoWithPublisherInfo
[] = {
803 0x30,0x16,0xa2,0x14,0x80,0x12,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,
804 0x65,0x68,0x71,0x2e,0x6f,0x72,0x67,0x2f };
806 static void test_encodeSpOpusInfo(void)
811 SPC_SP_OPUS_INFO info
;
814 memset(&info
, 0, sizeof(info
));
815 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
816 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
817 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
820 ok(size
== sizeof(emptySequence
), "unexpected size %d\n", size
);
821 ok(!memcmp(buf
, emptySequence
, size
), "unexpected value\n");
824 info
.pwszProgramName
= progName
;
825 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
826 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
827 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
830 ok(size
== sizeof(spOpusInfoWithProgramName
), "unexpected size %d\n",
832 ok(!memcmp(buf
, spOpusInfoWithProgramName
, size
),
833 "unexpected value\n");
836 info
.pwszProgramName
= NULL
;
837 memset(&moreInfo
, 0, sizeof(moreInfo
));
838 info
.pMoreInfo
= &moreInfo
;
839 SetLastError(0xdeadbeef);
840 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
841 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
842 ok(!ret
&& GetLastError() == E_INVALIDARG
,
843 "expected E_INVALIDARG, got %08x\n", GetLastError());
844 moreInfo
.dwLinkChoice
= SPC_URL_LINK_CHOICE
;
845 U(moreInfo
).pwszUrl
= winehq
;
846 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
847 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
848 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
851 ok(size
== sizeof(spOpusInfoWithMoreInfo
),
852 "unexpected size %d\n", size
);
853 ok(!memcmp(buf
, spOpusInfoWithMoreInfo
, size
),
854 "unexpected value\n");
857 info
.pMoreInfo
= NULL
;
858 info
.pPublisherInfo
= &moreInfo
;
859 ret
= pCryptEncodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
860 &info
, CRYPT_ENCODE_ALLOC_FLAG
, NULL
, &buf
, &size
);
861 ok(ret
, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
864 ok(size
== sizeof(spOpusInfoWithPublisherInfo
),
865 "unexpected size %d\n", size
);
866 ok(!memcmp(buf
, spOpusInfoWithPublisherInfo
, size
),
867 "unexpected value\n");
872 static void test_decodeSpOpusInfo(void)
876 SPC_SP_OPUS_INFO
*info
;
878 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
879 emptySequence
, sizeof(emptySequence
), CRYPT_DECODE_ALLOC_FLAG
, NULL
,
881 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
884 ok(!info
->pwszProgramName
, "expected NULL\n");
885 ok(!info
->pMoreInfo
, "expected NULL\n");
886 ok(!info
->pPublisherInfo
, "expected NULL\n");
889 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
890 spOpusInfoWithProgramName
, sizeof(spOpusInfoWithProgramName
),
891 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &info
, &size
);
892 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
895 ok(info
->pwszProgramName
&& !lstrcmpW(info
->pwszProgramName
,
896 progName
), "unexpected program name\n");
897 ok(!info
->pMoreInfo
, "expected NULL\n");
898 ok(!info
->pPublisherInfo
, "expected NULL\n");
901 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
902 spOpusInfoWithMoreInfo
, sizeof(spOpusInfoWithMoreInfo
),
903 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &info
, &size
);
904 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
907 ok(!info
->pwszProgramName
, "expected NULL\n");
908 ok(info
->pMoreInfo
!= NULL
, "expected a value for pMoreInfo\n");
911 ok(info
->pMoreInfo
->dwLinkChoice
== SPC_URL_LINK_CHOICE
,
912 "unexpected link choice %d\n", info
->pMoreInfo
->dwLinkChoice
);
913 ok(!lstrcmpW(U(*info
->pMoreInfo
).pwszUrl
, winehq
),
914 "unexpected link value\n");
916 ok(!info
->pPublisherInfo
, "expected NULL\n");
919 ret
= pCryptDecodeObjectEx(X509_ASN_ENCODING
, SPC_SP_OPUS_INFO_STRUCT
,
920 spOpusInfoWithPublisherInfo
, sizeof(spOpusInfoWithPublisherInfo
),
921 CRYPT_DECODE_ALLOC_FLAG
, NULL
, &info
, &size
);
922 ok(ret
, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
925 ok(!info
->pwszProgramName
, "expected NULL\n");
926 ok(!info
->pMoreInfo
, "expected NULL\n");
927 ok(info
->pPublisherInfo
!= NULL
,
928 "expected a value for pPublisherInfo\n");
929 if (info
->pPublisherInfo
)
931 ok(info
->pPublisherInfo
->dwLinkChoice
== SPC_URL_LINK_CHOICE
,
932 "unexpected link choice %d\n",
933 info
->pPublisherInfo
->dwLinkChoice
);
934 ok(!lstrcmpW(U(*info
->pPublisherInfo
).pwszUrl
, winehq
),
935 "unexpected link value\n");
943 HMODULE hCrypt32
= LoadLibraryA("crypt32.dll");
944 pCryptDecodeObjectEx
= (void*)GetProcAddress(hCrypt32
, "CryptDecodeObjectEx");
945 pCryptEncodeObjectEx
= (void*)GetProcAddress(hCrypt32
, "CryptEncodeObjectEx");
947 test_encodeSPCFinancialCriteria();
948 test_decodeSPCFinancialCriteria();
949 test_encodeSPCLink();
950 test_decodeSPCLink();
951 test_encodeSPCPEImage();
952 test_decodeSPCPEImage();
953 test_encodeCatMemberInfo();
954 test_decodeCatMemberInfo();
955 test_encodeCatNameValue();
956 test_decodeCatNameValue();
957 test_encodeSpOpusInfo();
958 test_decodeSpOpusInfo();
960 FreeLibrary(hCrypt32
);