ReactOS  0.4.14-dev-55-g2da92ac
asn.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wincrypt.h"
#include "wintrust.h"
#include "wine/test.h"
Include dependency graph for asn.c:

Go to the source code of this file.

Functions

static BOOL (WINAPI *pCryptDecodeObjectEx)(DWORD
 
static void test_encodeSPCFinancialCriteria (void)
 
static void test_decodeSPCFinancialCriteria (void)
 
static void test_encodeSPCLink (void)
 
static void test_decodeSPCLink (void)
 
static void test_encodeSPCPEImage (void)
 
static void test_decodeSPCPEImage (void)
 
static void test_encodeCatMemberInfo (void)
 
static void test_decodeCatMemberInfo (void)
 
static void test_encodeCatNameValue (void)
 
static void test_decodeCatNameValue (void)
 
static void test_encodeSpOpusInfo (void)
 
static void test_decodeSpOpusInfo (void)
 
 START_TEST (asn)
 

Variables

static LPCSTR
 
static const BYTE DWORD
 
static const BYTE PCRYPT_DECODE_PARA
 
static const BYTE void DWORD *static const void PCRYPT_ENCODE_PARA
 
static const BYTE void DWORD *static const void void DWORD *static const BYTE falseCriteria [] = { 0x30,0x06,0x01,0x01,0x00,0x01,0x01,0x00 }
 
static const BYTE trueCriteria [] = { 0x30,0x06,0x01,0x01,0xff,0x01,0x01,0xff }
 
static WCHAR url []
 
static const WCHAR nihongoURL []
 
static const BYTE emptyURLSPCLink [] = { 0x80,0x00 }
 
static const BYTE urlSPCLink []
 
static const BYTE fileSPCLink []
 
static const BYTE emptyMonikerSPCLink []
 
static BYTE data [] = { 0xba, 0xad, 0xf0, 0x0d }
 
static const BYTE monikerSPCLink []
 
static const BYTE badMonikerSPCLink []
 
static const BYTE emptySequence [] = { 0x30,0x00 }
 
static BYTE flags [] = { 1 }
 
static const BYTE onlyFlagsPEImage [] = { 0x30,0x04,0x03,0x02,0x00,0x01 }
 
static const BYTE onlyEmptyFilePEImage []
 
static const BYTE flagsAndEmptyFilePEImage []
 
static const BYTE flagsAndFilePEImage []
 
static WCHAR foo [] = { 'f','o','o',0 }
 
static WCHAR guidStr []
 
static const BYTE emptyCatMemberInfo [] = { 0x30,0x05,0x1e,0x00,0x02,0x01,0x00 }
 
static const BYTE catMemberInfoWithSillyGuid []
 
static const BYTE catMemberInfoWithGuid []
 
static const BYTE emptyCatNameValue []
 
static const BYTE catNameValueWithTag []
 
static const BYTE catNameValueWithFlags []
 
static const BYTE catNameValueWithValue []
 
static BYTE aVal [] = { 1,2,3,4 }
 
static const WCHAR progName [] = { 'A',' ','p','r','o','g','r','a','m',0 }
 
static const BYTE spOpusInfoWithProgramName []
 
static WCHAR winehq []
 
static const BYTE spOpusInfoWithMoreInfo []
 
static const BYTE spOpusInfoWithPublisherInfo []
 

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pCryptDecodeObjectEx)
static

Referenced by CRYPT_AsnDecodeBool().

◆ START_TEST()

START_TEST ( asn  )

Definition at line 939 of file asn.c.

940 {
941  HMODULE hCrypt32 = LoadLibraryA("crypt32.dll");
942  pCryptDecodeObjectEx = (void*)GetProcAddress(hCrypt32, "CryptDecodeObjectEx");
943  pCryptEncodeObjectEx = (void*)GetProcAddress(hCrypt32, "CryptEncodeObjectEx");
944 
957 
958  FreeLibrary(hCrypt32);
959 }
static void test_decodeSpOpusInfo(void)
Definition: asn.c:870
static void test_decodeSPCFinancialCriteria(void)
Definition: asn.c:68
static void test_decodeCatNameValue(void)
Definition: asn.c:719
static void test_decodeCatMemberInfo(void)
Definition: asn.c:597
static void test_encodeCatMemberInfo(void)
Definition: asn.c:546
static void test_encodeSPCPEImage(void)
Definition: asn.c:316
static void test_encodeCatNameValue(void)
Definition: asn.c:662
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
static void test_encodeSpOpusInfo(void)
Definition: asn.c:804
#define FreeLibrary(x)
Definition: compat.h:405
static void test_decodeSPCPEImage(void)
Definition: asn.c:421
static void test_encodeSPCLink(void)
Definition: asn.c:117
static void test_decodeSPCLink(void)
Definition: asn.c:209
static void test_encodeSPCFinancialCriteria(void)
Definition: asn.c:35
#define GetProcAddress(x, y)
Definition: compat.h:410

◆ test_decodeCatMemberInfo()

static void test_decodeCatMemberInfo ( void  )
static

Definition at line 597 of file asn.c.

598 {
599  BOOL ret;
600  LPBYTE buf;
601  DWORD size;
603 
604  if (!pCryptDecodeObjectEx)
605  {
606  win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeCatMemberInfo tests\n");
607  return;
608  }
609 
610  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
613  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
614  if (ret)
615  {
616  info = (CAT_MEMBERINFO *)buf;
617  ok(!info->pwszSubjGuid || !info->pwszSubjGuid[0],
618  "expected empty pwszSubjGuid\n");
619  ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
620  info->dwCertVersion);
621  LocalFree(buf);
622  }
623  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
626  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
627  if (ret)
628  {
629  info = (CAT_MEMBERINFO *)buf;
630  ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, foo),
631  "unexpected pwszSubjGuid\n");
632  ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
633  info->dwCertVersion);
634  LocalFree(buf);
635  }
636  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
639  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
640  if (ret)
641  {
642  info = (CAT_MEMBERINFO *)buf;
643  ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, guidStr),
644  "unexpected pwszSubjGuid\n");
645  ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
646  info->dwCertVersion);
647  LocalFree(buf);
648  }
649 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define CAT_MEMBERINFO_STRUCT
Definition: wintrust.h:513
struct _test_info info[]
Definition: SetCursorPos.c:19
static const BYTE catMemberInfoWithGuid[]
Definition: asn.c:538
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
static WCHAR guidStr[]
Definition: asn.c:531
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
static const BYTE catMemberInfoWithSillyGuid[]
Definition: asn.c:536
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
static const BYTE emptyCatMemberInfo[]
Definition: asn.c:535
#define CRYPT_DECODE_ALLOC_FLAG
Definition: wincrypt.h:3454
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_decodeCatNameValue()

static void test_decodeCatNameValue ( void  )
static

Definition at line 719 of file asn.c.

720 {
721  BOOL ret;
722  LPBYTE buf;
723  DWORD size;
725 
726  buf = NULL;
727  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
730  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
731  if (ret)
732  {
733  value = (CAT_NAMEVALUE *)buf;
734  ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
735  ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
736  value->fdwFlags);
737  ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
738  value->Value.cbData);
739  LocalFree(buf);
740  }
741  buf = NULL;
742  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
745  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
746  if (ret)
747  {
748  value = (CAT_NAMEVALUE *)buf;
749  ok(value->pwszTag && !lstrcmpW(value->pwszTag, foo),
750  "unexpected pwszTag\n");
751  ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
752  value->fdwFlags);
753  ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
754  value->Value.cbData);
755  LocalFree(buf);
756  }
757  buf = NULL;
758  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
761  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
762  if (ret)
763  {
764  value = (CAT_NAMEVALUE *)buf;
765  ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
766  ok(value->fdwFlags == 0xf00dd00d,
767  "expected fdwFlags == 0xf00dd00d, got %08x\n", value->fdwFlags);
768  ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
769  value->Value.cbData);
770  LocalFree(buf);
771  }
772  buf = NULL;
773  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
776  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
777  if (ret)
778  {
779  value = (CAT_NAMEVALUE *)buf;
780  ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
781  ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
782  value->fdwFlags);
783  ok(value->Value.cbData == sizeof(aVal), "unexpected size %d\n",
784  value->Value.cbData);
785  ok(!memcmp(value->Value.pbData, aVal, value->Value.cbData),
786  "unexpected value\n");
787  LocalFree(buf);
788  }
789 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CAT_NAMEVALUE_STRUCT
Definition: wintrust.h:512
smooth NULL
Definition: ftsmooth.c:416
static const BYTE catNameValueWithTag[]
Definition: asn.c:653
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
static const BYTE catNameValueWithFlags[]
Definition: asn.c:655
int ret
static const BYTE catNameValueWithValue[]
Definition: asn.c:657
static BYTE aVal[]
Definition: asn.c:660
GLsizei const GLfloat * value
Definition: glext.h:6069
static const BYTE emptyCatNameValue[]
Definition: asn.c:651
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
#define CRYPT_DECODE_ALLOC_FLAG
Definition: wincrypt.h:3454

Referenced by START_TEST().

◆ test_decodeSPCFinancialCriteria()

static void test_decodeSPCFinancialCriteria ( void  )
static

Definition at line 68 of file asn.c.

69 {
70  BOOL ret;
71  SPC_FINANCIAL_CRITERIA criteria;
72  DWORD size = sizeof(criteria);
73 
74  if (!pCryptDecodeObjectEx)
75  {
76  win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCFinancialCriteria tests\n");
77  return;
78  }
79 
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());
83  if (ret)
84  {
85  ok(!criteria.fFinancialInfoAvailable, "expected FALSE\n");
86  ok(!criteria.fMeetsCriteria, "expected FALSE\n");
87  }
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());
91  if (ret)
92  {
93  ok(criteria.fFinancialInfoAvailable, "expected TRUE\n");
94  ok(criteria.fMeetsCriteria, "expected TRUE\n");
95  }
96 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const BYTE void DWORD *static const void void DWORD *static const BYTE falseCriteria[]
Definition: asn.c:32
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const BYTE trueCriteria[]
Definition: asn.c:33
#define ok(value,...)
Definition: atltest.h:57
#define SPC_FINANCIAL_CRITERIA_STRUCT
Definition: wintrust.h:503
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_decodeSPCLink()

static void test_decodeSPCLink ( void  )
static

Definition at line 209 of file asn.c.

210 {
211  BOOL ret;
212  LPBYTE buf = NULL;
213  DWORD size = 0;
214  SPC_LINK *link;
215 
216  if (!pCryptDecodeObjectEx)
217  {
218  win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCLink tests\n");
219  return;
220  }
221 
222  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
224  &buf, &size);
225  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
226  if (ret)
227  {
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");
232  LocalFree(buf);
233  }
234  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
236  &buf, &size);
237  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
238  if (ret)
239  {
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");
244  LocalFree(buf);
245  }
246  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
248  &buf, &size);
249  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
250  if (ret)
251  {
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");
256  LocalFree(buf);
257  }
258  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
260  NULL, &buf, &size);
261  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
262  if (ret)
263  {
264  SPC_SERIALIZED_OBJECT emptyMoniker = { { 0 } };
265 
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");
273  LocalFree(buf);
274  }
275  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
277  &buf, &size);
278  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
279  if (ret)
280  {
281  SPC_UUID id;
282 
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");
293  LocalFree(buf);
294  }
295  SetLastError(0xdeadbeef);
296  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
298  NULL, &buf, &size);
299  ok(!ret &&
301  GetLastError() == OSS_DATA_ERROR /* WinNT */),
302  "Expected CRYPT_E_BAD_ENCODE, got %08x\n", GetLastError());
303 }
static WCHAR url[]
Definition: asn.c:98
static const BYTE badMonikerSPCLink[]
Definition: asn.c:205
BYTE SPC_UUID[SPC_UUID_LENGTH]
Definition: wintrust.h:516
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define U(x)
Definition: wordpad.c:44
#define SPC_LINK_STRUCT
Definition: wintrust.h:506
#define SPC_FILE_LINK_CHOICE
Definition: wintrust.h:537
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define lstrlenW
Definition: compat.h:407
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
static const BYTE urlSPCLink[]
Definition: asn.c:103
smooth NULL
Definition: ftsmooth.c:416
#define SPC_URL_LINK_CHOICE
Definition: wintrust.h:535
static const BYTE emptyMonikerSPCLink[]
Definition: asn.c:109
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR nihongoURL[]
Definition: asn.c:100
#define CRYPT_E_BAD_ENCODE
Definition: winerror.h:3005
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define SPC_MONIKER_LINK_CHOICE
Definition: wintrust.h:536
int ret
#define OSS_DATA_ERROR
Definition: winerror.h:3042
static const BYTE emptyURLSPCLink[]
Definition: asn.c:102
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
GLenum GLuint id
Definition: glext.h:5579
#define CRYPT_DECODE_ALLOC_FLAG
Definition: wincrypt.h:3454
const WCHAR * link
Definition: db.cpp:988
static const BYTE monikerSPCLink[]
Definition: asn.c:113
static const BYTE fileSPCLink[]
Definition: asn.c:106
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_decodeSPCPEImage()

static void test_decodeSPCPEImage ( void  )
static

Definition at line 421 of file asn.c.

422 {
423  static const WCHAR emptyString[] = { 0 };
424  BOOL ret;
425  LPBYTE buf = NULL;
426  DWORD size = 0;
427  SPC_PE_IMAGE_DATA *imageData;
428 
429  if (!pCryptDecodeObjectEx)
430  {
431  win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCPEImage tests\n");
432  return;
433  }
434 
435  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
436  emptySequence, sizeof(emptySequence),
438  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
439  if (ret)
440  {
441  imageData = (SPC_PE_IMAGE_DATA *)buf;
442  ok(imageData->Flags.cbData == 0, "Expected empty flags, got %d\n",
443  imageData->Flags.cbData);
444  ok(imageData->pFile == NULL, "Expected no file\n");
445  LocalFree(buf);
446  }
447  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
450  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
451  if (ret)
452  {
453  imageData = (SPC_PE_IMAGE_DATA *)buf;
454  ok(imageData->Flags.cbData == sizeof(flags),
455  "Unexpected flags size %d\n", imageData->Flags.cbData);
456  if (imageData->Flags.cbData)
457  ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
458  "Unexpected flags\n");
459  ok(imageData->pFile == NULL, "Expected no file\n");
460  LocalFree(buf);
461  }
462  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
465  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
466  if (ret)
467  {
468  imageData = (SPC_PE_IMAGE_DATA *)buf;
469  ok(imageData->Flags.cbData == 0, "Expected empty flags, got %d\n",
470  imageData->Flags.cbData);
471  ok(imageData->pFile != NULL, "Expected a file\n");
472  if (imageData->pFile)
473  {
474  ok(imageData->pFile->dwLinkChoice == SPC_FILE_LINK_CHOICE,
475  "Expected SPC_FILE_LINK_CHOICE, got %d\n",
476  imageData->pFile->dwLinkChoice);
477  ok(!lstrcmpW(U(*imageData->pFile).pwszFile, emptyString),
478  "Unexpected file\n");
479  }
480  LocalFree(buf);
481  }
482  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
485  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
486  if (ret)
487  {
488  imageData = (SPC_PE_IMAGE_DATA *)buf;
489  ok(imageData->Flags.cbData == sizeof(flags),
490  "Unexpected flags size %d\n", imageData->Flags.cbData);
491  if (imageData->Flags.cbData)
492  ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
493  "Unexpected flags\n");
494  ok(imageData->pFile != NULL, "Expected a file\n");
495  if (imageData->pFile)
496  {
497  ok(imageData->pFile->dwLinkChoice == SPC_FILE_LINK_CHOICE,
498  "Expected SPC_FILE_LINK_CHOICE, got %d\n",
499  imageData->pFile->dwLinkChoice);
500  ok(!lstrcmpW(U(*imageData->pFile).pwszFile, emptyString),
501  "Unexpected file\n");
502  }
503  LocalFree(buf);
504  }
505  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
508  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
509  if (ret)
510  {
511  imageData = (SPC_PE_IMAGE_DATA *)buf;
512  ok(imageData->Flags.cbData == sizeof(flags),
513  "Unexpected flags size %d\n", imageData->Flags.cbData);
514  if (imageData->Flags.cbData)
515  ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
516  "Unexpected flags\n");
517  ok(imageData->pFile != NULL, "Expected a file\n");
518  if (imageData->pFile)
519  {
520  ok(imageData->pFile->dwLinkChoice == SPC_FILE_LINK_CHOICE,
521  "Expected SPC_FILE_LINK_CHOICE, got %d\n",
522  imageData->pFile->dwLinkChoice);
523  ok(!lstrcmpW(U(*imageData->pFile).pwszFile, nihongoURL),
524  "Unexpected file\n");
525  }
526  LocalFree(buf);
527  }
528 }
static const BYTE emptySequence[]
Definition: asn.c:305
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define U(x)
Definition: wordpad.c:44
static const BYTE flagsAndFilePEImage[]
Definition: asn.c:312
#define SPC_FILE_LINK_CHOICE
Definition: wintrust.h:537
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const BYTE onlyFlagsPEImage[]
Definition: asn.c:307
static const BYTE flagsAndEmptyFilePEImage[]
Definition: asn.c:310
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
static const BYTE onlyEmptyFilePEImage[]
Definition: asn.c:308
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR nihongoURL[]
Definition: asn.c:100
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
PSPC_LINK pFile
Definition: wintrust.h:553
GLbitfield flags
Definition: glext.h:7161
int ret
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
CRYPT_BIT_BLOB Flags
Definition: wintrust.h:552
#define CRYPT_DECODE_ALLOC_FLAG
Definition: wincrypt.h:3454
#define SPC_PE_IMAGE_DATA_STRUCT
Definition: wintrust.h:505
#define win_skip
Definition: test.h:141
BYTE * pbData
Definition: wincrypt.h:197

Referenced by START_TEST().

◆ test_decodeSpOpusInfo()

static void test_decodeSpOpusInfo ( void  )
static

Definition at line 870 of file asn.c.

871 {
872  BOOL ret;
873  DWORD size;
875 
876  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
878  &info, &size);
879  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
880  if (ret)
881  {
882  ok(!info->pwszProgramName, "expected NULL\n");
883  ok(!info->pMoreInfo, "expected NULL\n");
884  ok(!info->pPublisherInfo, "expected NULL\n");
885  LocalFree(info);
886  }
887  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
890  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
891  if (ret)
892  {
893  ok(info->pwszProgramName && !lstrcmpW(info->pwszProgramName,
894  progName), "unexpected program name\n");
895  ok(!info->pMoreInfo, "expected NULL\n");
896  ok(!info->pPublisherInfo, "expected NULL\n");
897  LocalFree(info);
898  }
899  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
902  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
903  if (ret)
904  {
905  ok(!info->pwszProgramName, "expected NULL\n");
906  ok(info->pMoreInfo != NULL, "expected a value for pMoreInfo\n");
907  if (info->pMoreInfo)
908  {
909  ok(info->pMoreInfo->dwLinkChoice == SPC_URL_LINK_CHOICE,
910  "unexpected link choice %d\n", info->pMoreInfo->dwLinkChoice);
911  ok(!lstrcmpW(U(*info->pMoreInfo).pwszUrl, winehq),
912  "unexpected link value\n");
913  }
914  ok(!info->pPublisherInfo, "expected NULL\n");
915  LocalFree(info);
916  }
917  ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
920  ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
921  if (ret)
922  {
923  ok(!info->pwszProgramName, "expected NULL\n");
924  ok(!info->pMoreInfo, "expected NULL\n");
925  ok(info->pPublisherInfo != NULL,
926  "expected a value for pPublisherInfo\n");
927  if (info->pPublisherInfo)
928  {
929  ok(info->pPublisherInfo->dwLinkChoice == SPC_URL_LINK_CHOICE,
930  "unexpected link choice %d\n",
931  info->pPublisherInfo->dwLinkChoice);
932  ok(!lstrcmpW(U(*info->pPublisherInfo).pwszUrl, winehq),
933  "unexpected link value\n");
934  }
935  LocalFree(info);
936  }
937 }
static const BYTE spOpusInfoWithProgramName[]
Definition: asn.c:792
static const BYTE emptySequence[]
Definition: asn.c:305
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define U(x)
Definition: wordpad.c:44
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const WCHAR progName[]
Definition: asn.c:791
struct _test_info info[]
Definition: SetCursorPos.c:19
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SPC_SP_OPUS_INFO_STRUCT
Definition: wintrust.h:508
smooth NULL
Definition: ftsmooth.c:416
static const BYTE spOpusInfoWithPublisherInfo[]
Definition: asn.c:800
#define SPC_URL_LINK_CHOICE
Definition: wintrust.h:535
static WCHAR winehq[]
Definition: asn.c:795
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
static const BYTE spOpusInfoWithMoreInfo[]
Definition: asn.c:797
int ret
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
#define CRYPT_DECODE_ALLOC_FLAG
Definition: wincrypt.h:3454

Referenced by START_TEST().

◆ test_encodeCatMemberInfo()

static void test_encodeCatMemberInfo ( void  )
static

Definition at line 546 of file asn.c.

547 {
549  BOOL ret;
550  DWORD size = 0;
551  LPBYTE buf;
552 
553  memset(&info, 0, sizeof(info));
554 
555  if (!pCryptEncodeObjectEx)
556  {
557  win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeCatMemberInfo tests\n");
558  return;
559  }
560 
561  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
563  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
564  if (ret)
565  {
566  ok(size == sizeof(emptyCatMemberInfo), "Unexpected size %d\n", size);
568  "Unexpected value\n");
569  LocalFree(buf);
570  }
571  info.pwszSubjGuid = foo;
572  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
574  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
575  if (ret)
576  {
577  ok(size == sizeof(catMemberInfoWithSillyGuid), "Unexpected size %d\n",
578  size);
580  sizeof(catMemberInfoWithSillyGuid)), "Unexpected value\n");
581  LocalFree(buf);
582  }
583  info.pwszSubjGuid = guidStr;
584  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
586  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
587  if (ret)
588  {
589  ok(size == sizeof(catMemberInfoWithGuid), "Unexpected size %d\n",
590  size);
592  "Unexpected value\n");
593  LocalFree(buf);
594  }
595 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define CAT_MEMBERINFO_STRUCT
Definition: wintrust.h:513
struct _test_info info[]
Definition: SetCursorPos.c:19
static const BYTE catMemberInfoWithGuid[]
Definition: asn.c:538
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
static WCHAR guidStr[]
Definition: asn.c:531
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
static const BYTE catMemberInfoWithSillyGuid[]
Definition: asn.c:536
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static WCHAR foo[]
Definition: asn.c:530
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
static const BYTE emptyCatMemberInfo[]
Definition: asn.c:535
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3441
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_encodeCatNameValue()

static void test_encodeCatNameValue ( void  )
static

Definition at line 662 of file asn.c.

663 {
664  static WCHAR foo[] = { 'f','o','o',0 };
665  BOOL ret;
666  LPBYTE buf;
667  DWORD size;
669 
670  memset(&value, 0, sizeof(value));
671  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
673  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
674  if (ret)
675  {
676  ok(size == sizeof(emptyCatNameValue), "Unexpected size %d\n", size);
678  "Unexpected value\n");
679  LocalFree(buf);
680  }
681  value.pwszTag = foo;
682  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
684  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
685  if (ret)
686  {
687  ok(size == sizeof(catNameValueWithTag), "Unexpected size %d\n", size);
689  "Unexpected value\n");
690  LocalFree(buf);
691  }
692  value.pwszTag = NULL;
693  value.fdwFlags = 0xf00dd00d;
694  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
696  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
697  if (ret)
698  {
699  ok(size == sizeof(catNameValueWithFlags), "Unexpected size %d\n", size);
701  "Unexpected value\n");
702  LocalFree(buf);
703  }
704  value.fdwFlags = 0;
705  value.Value.cbData = sizeof(aVal);
706  value.Value.pbData = aVal;
707  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
709  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
710  if (ret)
711  {
712  ok(size == sizeof(catNameValueWithValue), "Unexpected size %d\n", size);
714  "Unexpected value\n");
715  LocalFree(buf);
716  }
717 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CAT_NAMEVALUE_STRUCT
Definition: wintrust.h:512
smooth NULL
Definition: ftsmooth.c:416
static const BYTE catNameValueWithTag[]
Definition: asn.c:653
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const BYTE catNameValueWithFlags[]
Definition: asn.c:655
int ret
static const BYTE catNameValueWithValue[]
Definition: asn.c:657
static WCHAR foo[]
Definition: asn.c:530
static BYTE aVal[]
Definition: asn.c:660
GLsizei const GLfloat * value
Definition: glext.h:6069
static const BYTE emptyCatNameValue[]
Definition: asn.c:651
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3441
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_encodeSPCFinancialCriteria()

static void test_encodeSPCFinancialCriteria ( void  )
static

Definition at line 35 of file asn.c.

36 {
37  BOOL ret;
38  DWORD size = 0;
39  LPBYTE buf;
40  SPC_FINANCIAL_CRITERIA criteria = { FALSE, FALSE };
41 
42  if (!pCryptEncodeObjectEx)
43  {
44  win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeFinancialCriteria tests\n");
45  return;
46  }
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());
50  if (ret)
51  {
52  ok(size == sizeof(falseCriteria), "Unexpected size %d\n", size);
53  ok(!memcmp(buf, falseCriteria, size), "Unexpected value\n");
54  LocalFree(buf);
55  }
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());
60  if (ret)
61  {
62  ok(size == sizeof(trueCriteria), "Unexpected size %d\n", size);
63  ok(!memcmp(buf, trueCriteria, size), "Unexpected value\n");
64  LocalFree(buf);
65  }
66 }
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const BYTE void DWORD *static const void void DWORD *static const BYTE falseCriteria[]
Definition: asn.c:32
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const BYTE trueCriteria[]
Definition: asn.c:33
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3441
#define SPC_FINANCIAL_CRITERIA_STRUCT
Definition: wintrust.h:503
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_encodeSPCLink()

static void test_encodeSPCLink ( void  )
static

Definition at line 117 of file asn.c.

118 {
119  BOOL ret;
120  DWORD size = 0;
121  LPBYTE buf;
122  SPC_LINK link = { 0 };
123 
124  if (!pCryptEncodeObjectEx)
125  {
126  win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeSPCLink tests\n");
127  return;
128  }
129 
130  SetLastError(0xdeadbeef);
131  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
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,
138  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
139  if (ret)
140  {
141  ok(size == sizeof(emptyURLSPCLink), "Unexpected size %d\n", size);
142  ok(!memcmp(buf, emptyURLSPCLink, size), "Unexpected value\n");
143  LocalFree(buf);
144  }
145  /* With an invalid char: */
146  U(link).pwszUrl = (LPWSTR)nihongoURL;
147  size = 1;
148  SetLastError(0xdeadbeef);
149  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
151  ok(!ret &&
153  GetLastError() == OSS_BAD_PTR /* WinNT */),
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.
157  */
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,
162  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
163  if (ret)
164  {
165  ok(size == sizeof(urlSPCLink), "Unexpected size %d\n", size);
166  ok(!memcmp(buf, urlSPCLink, size), "Unexpected value\n");
167  LocalFree(buf);
168  }
169  link.dwLinkChoice = SPC_FILE_LINK_CHOICE;
170  U(link).pwszFile = (LPWSTR)nihongoURL;
171  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
173  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
174  if (ret)
175  {
176  ok(size == sizeof(fileSPCLink), "Unexpected size %d\n", size);
177  ok(!memcmp(buf, fileSPCLink, size), "Unexpected value\n");
178  LocalFree(buf);
179  }
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,
184  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
185  if (ret)
186  {
187  ok(size == sizeof(emptyMonikerSPCLink), "Unexpected size %d\n", size);
188  ok(!memcmp(buf, emptyMonikerSPCLink, size), "Unexpected value\n");
189  LocalFree(buf);
190  }
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,
196  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
197  if (ret)
198  {
199  ok(size == sizeof(monikerSPCLink), "Unexpected size %d\n", size);
200  ok(!memcmp(buf, monikerSPCLink, size), "Unexpected value\n");
201  LocalFree(buf);
202  }
203 }
static WCHAR url[]
Definition: asn.c:98
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define U(x)
Definition: wordpad.c:44
#define SPC_LINK_STRUCT
Definition: wintrust.h:506
#define SPC_FILE_LINK_CHOICE
Definition: wintrust.h:537
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static BYTE data[]
Definition: asn.c:112
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
static const BYTE urlSPCLink[]
Definition: asn.c:103
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define SPC_URL_LINK_CHOICE
Definition: wintrust.h:535
static const BYTE emptyMonikerSPCLink[]
Definition: asn.c:109
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR nihongoURL[]
Definition: asn.c:100
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
#define SPC_MONIKER_LINK_CHOICE
Definition: wintrust.h:536
int ret
static const BYTE emptyURLSPCLink[]
Definition: asn.c:102
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3441
#define CRYPT_E_INVALID_IA5_STRING
Definition: winerror.h:3026
#define OSS_BAD_PTR
Definition: winerror.h:3048
const WCHAR * link
Definition: db.cpp:988
static const BYTE monikerSPCLink[]
Definition: asn.c:113
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static const BYTE fileSPCLink[]
Definition: asn.c:106
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_encodeSPCPEImage()

static void test_encodeSPCPEImage ( void  )
static

Definition at line 316 of file asn.c.

317 {
318  BOOL ret;
319  DWORD size = 0;
320  LPBYTE buf;
321  SPC_PE_IMAGE_DATA imageData = { { 0 } };
322  SPC_LINK link = { 0 };
323 
324  if (!pCryptEncodeObjectEx)
325  {
326  win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeSPCPEImage tests\n");
327  return;
328  }
329 
330  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
331  &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
332  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
333  if (ret)
334  {
335  ok(size == sizeof(emptySequence), "Unexpected size %d\n", size);
337  "Unexpected value\n");
338  LocalFree(buf);
339  }
340  /* With an invalid link: */
341  imageData.pFile = &link;
342  SetLastError(0xdeadbeef);
343  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
344  &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
345  ok(!ret && GetLastError () == E_INVALIDARG,
346  "Expected E_INVALIDARG, got %08x\n", GetLastError());
347  /* With just unused bits field set: */
348  imageData.pFile = NULL;
349  imageData.Flags.cUnusedBits = 1;
350  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
351  &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
352  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
353  if (ret)
354  {
355  ok(size == sizeof(emptySequence), "Unexpected size %d\n", size);
357  "Unexpected value\n");
358  LocalFree(buf);
359  }
360  /* With flags set: */
361  imageData.Flags.cUnusedBits = 0;
362  imageData.Flags.pbData = flags;
363  imageData.Flags.cbData = sizeof(flags);
364  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
365  &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
366  if (!ret && GetLastError() == OSS_TOO_LONG)
367  {
368  skip("SPC_PE_IMAGE_DATA_STRUCT not supported\n");
369  return;
370  }
371  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
372  if (ret)
373  {
374  ok(size == sizeof(onlyFlagsPEImage), "Unexpected size %d\n", size);
376  "Unexpected value\n");
377  LocalFree(buf);
378  }
379  /* With just an empty file: */
380  imageData.Flags.cbData = 0;
381  link.dwLinkChoice = SPC_FILE_LINK_CHOICE;
382  imageData.pFile = &link;
383  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
384  &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
385  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
386  if (ret)
387  {
388  ok(size == sizeof(onlyEmptyFilePEImage), "Unexpected size %d\n", size);
390  "Unexpected value\n");
391  LocalFree(buf);
392  }
393  /* With flags and an empty file: */
394  imageData.Flags.pbData = flags;
395  imageData.Flags.cbData = sizeof(flags);
396  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
397  &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
398  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
399  if (ret)
400  {
401  ok(size == sizeof(flagsAndEmptyFilePEImage), "Unexpected size %d\n",
402  size);
404  sizeof(flagsAndEmptyFilePEImage)), "Unexpected value\n");
405  LocalFree(buf);
406  }
407  /* Finally, a non-empty file: */
408  U(link).pwszFile = (LPWSTR)nihongoURL;
409  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
410  &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
411  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
412  if (ret)
413  {
414  ok(size == sizeof(flagsAndFilePEImage), "Unexpected size %d\n", size);
416  "Unexpected value\n");
417  LocalFree(buf);
418  }
419 }
static const BYTE emptySequence[]
Definition: asn.c:305
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define U(x)
Definition: wordpad.c:44
static const BYTE flagsAndFilePEImage[]
Definition: asn.c:312
#define SPC_FILE_LINK_CHOICE
Definition: wintrust.h:537
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const BYTE onlyFlagsPEImage[]
Definition: asn.c:307
static const BYTE flagsAndEmptyFilePEImage[]
Definition: asn.c:310
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
static const BYTE onlyEmptyFilePEImage[]
Definition: asn.c:308
unsigned int BOOL
Definition: ntddk_ex.h:94
#define OSS_TOO_LONG
Definition: winerror.h:3053
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR nihongoURL[]
Definition: asn.c:100
DWORD cUnusedBits
Definition: wincrypt.h:198
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
PSPC_LINK pFile
Definition: wintrust.h:553
static BYTE flags[]
Definition: asn.c:306
int ret
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3441
CRYPT_BIT_BLOB Flags
Definition: wintrust.h:552
const WCHAR * link
Definition: db.cpp:988
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define SPC_PE_IMAGE_DATA_STRUCT
Definition: wintrust.h:505
#define win_skip
Definition: test.h:141
BYTE * pbData
Definition: wincrypt.h:197

Referenced by START_TEST().

◆ test_encodeSpOpusInfo()

static void test_encodeSpOpusInfo ( void  )
static

Definition at line 804 of file asn.c.

805 {
806  BOOL ret;
807  LPBYTE buf;
808  DWORD size;
810  SPC_LINK moreInfo;
811 
812  memset(&info, 0, sizeof(info));
813  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
815  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
816  if (ret)
817  {
818  ok(size == sizeof(emptySequence), "unexpected size %d\n", size);
819  ok(!memcmp(buf, emptySequence, size), "unexpected value\n");
820  LocalFree(buf);
821  }
822  info.pwszProgramName = progName;
823  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
825  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
826  if (ret)
827  {
828  ok(size == sizeof(spOpusInfoWithProgramName), "unexpected size %d\n",
829  size);
831  "unexpected value\n");
832  LocalFree(buf);
833  }
834  info.pwszProgramName = NULL;
835  memset(&moreInfo, 0, sizeof(moreInfo));
836  info.pMoreInfo = &moreInfo;
837  SetLastError(0xdeadbeef);
838  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
840  ok(!ret && GetLastError() == E_INVALIDARG,
841  "expected E_INVALIDARG, got %08x\n", GetLastError());
843  U(moreInfo).pwszUrl = winehq;
844  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
846  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
847  if (ret)
848  {
849  ok(size == sizeof(spOpusInfoWithMoreInfo),
850  "unexpected size %d\n", size);
852  "unexpected value\n");
853  LocalFree(buf);
854  }
855  info.pMoreInfo = NULL;
856  info.pPublisherInfo = &moreInfo;
857  ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
859  ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
860  if (ret)
861  {
863  "unexpected size %d\n", size);
865  "unexpected value\n");
866  LocalFree(buf);
867  }
868 }
static const BYTE spOpusInfoWithProgramName[]
Definition: asn.c:792
static const BYTE emptySequence[]
Definition: asn.c:305
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define U(x)
Definition: wordpad.c:44
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const WCHAR progName[]
Definition: asn.c:791
struct _test_info info[]
Definition: SetCursorPos.c:19
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SPC_SP_OPUS_INFO_STRUCT
Definition: wintrust.h:508
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const BYTE spOpusInfoWithPublisherInfo[]
Definition: asn.c:800
#define SPC_URL_LINK_CHOICE
Definition: wintrust.h:535
static WCHAR winehq[]
Definition: asn.c:795
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
static const BYTE spOpusInfoWithMoreInfo[]
Definition: asn.c:797
int ret
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define ok(value,...)
Definition: atltest.h:57
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3441
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

Variable Documentation

◆ aVal

BYTE aVal[] = { 1,2,3,4 }
static

Definition at line 660 of file asn.c.

Referenced by test_decodeCatNameValue(), and test_encodeCatNameValue().

◆ badMonikerSPCLink

const BYTE badMonikerSPCLink[]
static
Initial value:
= {
0xa1,0x19,0x04,0x11,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,
0xea,0xea,0xea,0xea,0xea,0xea,0x04,0x04,0xba,0xad,0xf0,0x0d }

Definition at line 205 of file asn.c.

Referenced by test_decodeSPCLink().

◆ catMemberInfoWithGuid

const BYTE catMemberInfoWithGuid[]
static
Initial value:
= {
0x30,0x51,0x1e,0x4c,0x00,0x7b,0x00,0x38,0x00,0x62,0x00,0x63,0x00,0x39,0x00,0x36,
0x00,0x62,0x00,0x30,0x00,0x30,0x00,0x2d,0x00,0x38,0x00,0x64,0x00,0x61,0x00,0x31,
0x00,0x2d,0x00,0x31,0x00,0x31,0x00,0x63,0x00,0x66,0x00,0x2d,0x00,0x38,0x00,0x37,
0x00,0x33,0x00,0x36,0x00,0x2d,0x00,0x30,0x00,0x30,0x00,0x61,0x00,0x61,0x00,0x30,
0x00,0x30,0x00,0x61,0x00,0x34,0x00,0x38,0x00,0x35,0x00,0x65,0x00,0x62,0x00,0x7d,
0x02,0x01,0x00 }

Definition at line 538 of file asn.c.

Referenced by test_decodeCatMemberInfo(), and test_encodeCatMemberInfo().

◆ catMemberInfoWithSillyGuid

const BYTE catMemberInfoWithSillyGuid[]
static
Initial value:
= {
0x30,0x0b,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00 }

Definition at line 536 of file asn.c.

Referenced by test_decodeCatMemberInfo(), and test_encodeCatMemberInfo().

◆ catNameValueWithFlags

const BYTE catNameValueWithFlags[]
static
Initial value:
= {
0x30,0x0a,0x1e,0x00,0x02,0x04,0xf0,0x0d,0xd0,0x0d,0x04,0x00 }

Definition at line 655 of file asn.c.

Referenced by test_decodeCatNameValue(), and test_encodeCatNameValue().

◆ catNameValueWithTag

const BYTE catNameValueWithTag[]
static
Initial value:
= {
0x30,0x0d,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00,0x04,0x00 }

Definition at line 653 of file asn.c.

Referenced by test_decodeCatNameValue(), and test_encodeCatNameValue().

◆ catNameValueWithValue

const BYTE catNameValueWithValue[]
static
Initial value:
= {
0x30,0x0b,0x1e,0x00,0x02,0x01,0x00,0x04,0x04,0x01,0x02,0x03,0x04 }

Definition at line 657 of file asn.c.

Referenced by test_decodeCatNameValue(), and test_encodeCatNameValue().

◆ data

BYTE data[] = { 0xba, 0xad, 0xf0, 0x0d }
static

Definition at line 112 of file asn.c.

Referenced by CRYPT_AsnDecodeSPCLinkInternal(), and test_encodeSPCLink().

◆ DWORD

Definition at line 29 of file asn.c.

◆ emptyCatMemberInfo

const BYTE emptyCatMemberInfo[] = { 0x30,0x05,0x1e,0x00,0x02,0x01,0x00 }
static

Definition at line 535 of file asn.c.

Referenced by test_decodeCatMemberInfo(), and test_encodeCatMemberInfo().

◆ emptyCatNameValue

const BYTE emptyCatNameValue[]
static
Initial value:
= {
0x30,0x07,0x1e,0x00,0x02,0x01,0x00,0x04,0x00 }

Definition at line 651 of file asn.c.

Referenced by test_decodeCatNameValue(), and test_encodeCatNameValue().

◆ emptyMonikerSPCLink

const BYTE emptyMonikerSPCLink[]
static
Initial value:
= {
0xa1,0x14,0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x04,0x00 }

Definition at line 109 of file asn.c.

Referenced by test_decodeSPCLink(), and test_encodeSPCLink().

◆ emptySequence

const BYTE emptySequence[] = { 0x30,0x00 }
static

◆ emptyURLSPCLink

const BYTE emptyURLSPCLink[] = { 0x80,0x00 }
static

Definition at line 102 of file asn.c.

Referenced by test_decodeSPCLink(), and test_encodeSPCLink().

◆ falseCriteria

const BYTE void DWORD* static const void void DWORD* static const BYTE falseCriteria[] = { 0x30,0x06,0x01,0x01,0x00,0x01,0x01,0x00 }
static

Definition at line 32 of file asn.c.

Referenced by test_decodeSPCFinancialCriteria(), and test_encodeSPCFinancialCriteria().

◆ fileSPCLink

const BYTE fileSPCLink[]
static
Initial value:
= {
0xa2,0x14,0x80,0x12,0x00,0x68,0x00,0x74,0x00,0x74,0x00,0x70,0x00,0x3a,0x00,
0x2f,0x00,0x2f,0x22,0x6f,0x57,0x5b }

Definition at line 106 of file asn.c.

Referenced by test_decodeSPCLink(), and test_encodeSPCLink().

◆ flags

BYTE flags[] = { 1 }
static

Definition at line 306 of file asn.c.

Referenced by test_encodeSPCPEImage().

◆ flagsAndEmptyFilePEImage

const BYTE flagsAndEmptyFilePEImage[]
static
Initial value:
= {
0x30,0x0a,0x03,0x02,0x00,0x01,0xa0,0x04,0xa2,0x02,0x80,0x00 }

Definition at line 310 of file asn.c.

Referenced by test_decodeSPCPEImage(), and test_encodeSPCPEImage().

◆ flagsAndFilePEImage

const BYTE flagsAndFilePEImage[]
static
Initial value:
= {
0x30,0x1c,0x03,0x02,0x00,0x01,0xa0,0x16,0xa2,0x14,0x80,0x12,0x00,0x68,0x00,
0x74,0x00,0x74,0x00,0x70,0x00,0x3a,0x00,0x2f,0x00,0x2f,0x22,0x6f,0x57,0x5b }

Definition at line 312 of file asn.c.

Referenced by test_decodeSPCPEImage(), and test_encodeSPCPEImage().

◆ foo

WCHAR foo[] = { 'f','o','o',0 }
static

Definition at line 530 of file asn.c.

Referenced by test_encodeCatMemberInfo(), and test_encodeCatNameValue().

◆ guidStr

WCHAR guidStr[]
static
Initial value:
= { '{','8','b','c','9','6','b','0','0','-',
'8','d','a','1','-','1','1','c','f','-','8','7','3','6','-','0','0',
'a','a','0','0','a','4','8','5','e','b','}',0 }

Definition at line 531 of file asn.c.

Referenced by CComCatCachedCategory::CacheDSA(), CComCatCachedCategory::LoadFromRegistry(), SETUPDI_GuidToString(), test_decodeCatMemberInfo(), and test_encodeCatMemberInfo().

◆ LPCSTR

Definition at line 29 of file asn.c.

◆ monikerSPCLink

const BYTE monikerSPCLink[]
static
Initial value:
= {
0xa1,0x18,0x04,0x10,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,
0xea,0xea,0xea,0xea,0xea,0x04,0x04,0xba,0xad,0xf0,0x0d }

Definition at line 113 of file asn.c.

Referenced by test_decodeSPCLink(), and test_encodeSPCLink().

◆ nihongoURL

const WCHAR nihongoURL[]
static
Initial value:
= { 'h','t','t','p',':','/','/',0x226f,
0x575b, 0 }

Definition at line 100 of file asn.c.

Referenced by test_decodeSPCLink(), test_decodeSPCPEImage(), test_encodeSPCLink(), and test_encodeSPCPEImage().

◆ onlyEmptyFilePEImage

const BYTE onlyEmptyFilePEImage[]
static
Initial value:
= {
0x30,0x06,0xa0,0x04,0xa2,0x02,0x80,0x00 }

Definition at line 308 of file asn.c.

Referenced by test_decodeSPCPEImage(), and test_encodeSPCPEImage().

◆ onlyFlagsPEImage

const BYTE onlyFlagsPEImage[] = { 0x30,0x04,0x03,0x02,0x00,0x01 }
static

Definition at line 307 of file asn.c.

Referenced by test_decodeSPCPEImage(), and test_encodeSPCPEImage().

◆ PCRYPT_DECODE_PARA

Definition at line 29 of file asn.c.

◆ PCRYPT_ENCODE_PARA

Definition at line 30 of file asn.c.

◆ progName

const WCHAR progName[] = { 'A',' ','p','r','o','g','r','a','m',0 }
static

Definition at line 791 of file asn.c.

Referenced by test_decodeSpOpusInfo(), and test_encodeSpOpusInfo().

◆ spOpusInfoWithMoreInfo

const BYTE spOpusInfoWithMoreInfo[]
static
Initial value:
= {
0x30,0x16,0xa1,0x14,0x80,0x12,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,
0x65,0x68,0x71,0x2e,0x6f,0x72,0x67,0x2f }

Definition at line 797 of file asn.c.

Referenced by test_decodeSpOpusInfo(), and test_encodeSpOpusInfo().

◆ spOpusInfoWithProgramName

const BYTE spOpusInfoWithProgramName[]
static
Initial value:
= {
0x30,0x16,0xa0,0x14,0x80,0x12,0x00,0x41,0x00,0x20,0x00,0x70,0x00,0x72,0x00,0x6f,
0x00,0x67,0x00,0x72,0x00,0x61,0x00,0x6d }

Definition at line 792 of file asn.c.

Referenced by test_decodeSpOpusInfo(), and test_encodeSpOpusInfo().

◆ spOpusInfoWithPublisherInfo

const BYTE spOpusInfoWithPublisherInfo[]
static
Initial value:
= {
0x30,0x16,0xa2,0x14,0x80,0x12,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,
0x65,0x68,0x71,0x2e,0x6f,0x72,0x67,0x2f }

Definition at line 800 of file asn.c.

Referenced by test_decodeSpOpusInfo(), and test_encodeSpOpusInfo().

◆ trueCriteria

const BYTE trueCriteria[] = { 0x30,0x06,0x01,0x01,0xff,0x01,0x01,0xff }
static

Definition at line 33 of file asn.c.

Referenced by test_decodeSPCFinancialCriteria(), and test_encodeSPCFinancialCriteria().

◆ url

WCHAR url[]
static
Initial value:
= { 'h','t','t','p',':','/','/','w','i','n','e','h','q','.',
'o','r','g',0 }

Definition at line 98 of file asn.c.

Referenced by test_decodeSPCLink(), and test_encodeSPCLink().

◆ urlSPCLink

const BYTE urlSPCLink[]
static
Initial value:
= {
0x80,0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,0x65,0x68,0x71,
0x2e,0x6f,0x72,0x67}

Definition at line 103 of file asn.c.

Referenced by test_decodeSPCLink(), and test_encodeSPCLink().

◆ winehq

WCHAR winehq[]
static
Initial value:
= { 'h','t','t','p',':','/','/','w','i','n','e','h','q',
'.','o','r','g','/',0 }

Definition at line 795 of file asn.c.

Referenced by test_decodeSpOpusInfo(), and test_encodeSpOpusInfo().