OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ssa-dse-10.c] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -w -fdump-tree-dse-vops" } */
3
 
4
__extension__ typedef __SIZE_TYPE__ size_t;
5
typedef struct _IO_FILE FILE;
6
typedef struct
7
{
8
} __mbstate_t;
9
typedef struct
10
{
11
} _G_fpos_t;
12
typedef struct
13
{
14
};
15
typedef int (*__gconv_trans_fct) (struct __gconv_step *,
16
      size_t *);
17
typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
18
     size_t *);
19
struct __gconv_trans_data
20
{
21
};
22
struct __gconv_step_data
23
{
24
};
25
typedef struct __gconv_info
26
{
27
} *__gconv_t;
28
typedef union
29
{
30
  struct
31
  {
32
  } __combined;
33
} _G_iconv_t;
34
typedef __builtin_va_list __gnuc_va_list;
35
enum __codecvt_result
36
{
37
  __codecvt_noconv
38
};
39
struct _IO_FILE {
40
};
41
vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
42
{
43
}
44
putchar (int __c)
45
{
46
}
47
fputc_unlocked (int __c, FILE *__stream)
48
{
49
}
50
putc_unlocked (int __c, FILE *__stream)
51
{
52
}
53
__attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream)
54
{
55
}
56
extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
57
     __gnuc_va_list __ap);
58
gets (char *__str)
59
{
60
}
61
extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
62
     FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
63
fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
64
{
65
}
66
typedef void *LPVOID;
67
typedef int BOOL, *PBOOL, *LPBOOL;
68
typedef unsigned char BYTE, *PBYTE, *LPBYTE;
69
typedef unsigned short WORD, *PWORD, *LPWORD;
70
typedef unsigned int DWORD, *PDWORD, *LPDWORD;
71
typedef struct _GUID
72
{
73
} GUID;
74
enum
75
{
76
  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
77
};
78
extern char *__strtok_r (char *__restrict __s,
79
    __const char *__restrict __delim,
80
         char **__restrict __save_ptr)
81
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
82
__strcspn_c3 (__const char *__s, int __reject1, int __reject2,
83
       int __reject3)
84
{
85
}
86
extern __inline size_t __strspn_c3 (__const char *__s, int __accept1,
87
        int __accept2, int __accept3);
88
extern __inline size_t
89
__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
90
{
91
}
92
extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
93
         int __accept2);
94
extern __inline char *
95
__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
96
{
97
}
98
extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
99
       int __accept3)
100
{
101
}
102
__strtok_r_1c (char *__s, char __sep, char **__nextp)
103
{
104
    {
105
   {
106
   }
107
    }
108
}
109
__strsep_1c (char **__s, char __reject)
110
{
111
}
112
__strsep_2c (char **__s, char __reject1, char __reject2)
113
{
114
    {
115
 {
116
 }
117
    }
118
}
119
extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
120
       char __reject3);
121
extern __inline char *
122
__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
123
{
124
    {
125
 {
126
     {
127
     }
128
 }
129
    }
130
}
131
__attribute__ ((__nothrow__)) __memcpy_ichk (void *__restrict __dest, __const void *__restrict __src, size_t __len)
132
{
133
}
134
__attribute__ ((__nothrow__)) __memmove_ichk (void *__dest, __const void *__src, size_t __len)
135
{
136
}
137
__attribute__ ((__nothrow__)) __strncpy_ichk (char *__restrict __dest, __const char *__restrict __src, size_t __len)
138
{
139
}
140
__attribute__ ((__nothrow__)) stpncpy (char *__dest, __const char *__src, size_t __n)
141
{
142
  if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
143
      && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1)))
144
    return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
145
}
146
__attribute__ ((__nothrow__)) __strncat_ichk (char *__restrict __dest, __const char *__restrict __src, size_t __len)
147
{
148
}
149
typedef void *PVOID;
150
typedef char CHAR, *PCHAR;
151
typedef int LONG, *PLONG;
152
typedef unsigned short WCHAR, *PWCHAR;
153
typedef CHAR *PSTR, *LPSTR, *NPSTR;
154
typedef const CHAR *PCSTR, *LPCSTR;
155
typedef WCHAR *PWSTR, *LPWSTR, *NWPSTR;
156
typedef LONG HRESULT;
157
typedef struct _MEMORY_BASIC_INFORMATION
158
{
159
} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
160
typedef enum _HEAP_INFORMATION_CLASS {
161
    HeapCompatibilityInformation,
162
} HEAP_INFORMATION_CLASS;
163
typedef struct _FLOATING_SAVE_AREA
164
{
165
} CONTEXT86;
166
typedef struct _LDT_ENTRY {
167
    union {
168
        struct {
169
        } Bits;
170
    } HighWord;
171
} LDT_ENTRY, *PLDT_ENTRY;
172
typedef struct _EXCEPTION_RECORD
173
{
174
} EXCEPTION_RECORD, *PEXCEPTION_RECORD;
175
typedef struct _EXCEPTION_POINTERS
176
{
177
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
178
typedef struct _NT_TIB
179
{
180
 union {
181
 } ;
182
} NT_TIB, *PNT_TIB;
183
extern inline struct _TEB * __attribute__((__stdcall__)) NtCurrentTeb(void)
184
{
185
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
186
typedef struct _IMAGE_SYMBOL {
187
    union {
188
        struct {
189
        } FcnAry;
190
    } Section;
191
} IMAGE_AUX_SYMBOL;
192
typedef struct _IMAGE_EXPORT_DIRECTORY {
193
 union {
194
 } u1;
195
} IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF;
196
typedef struct _IMAGE_BASE_RELOCATION
197
{
198
} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
199
typedef struct _IMAGE_RELOCATION
200
{
201
    union {
202
    } ;
203
} IMAGE_RELOCATION, *PIMAGE_RELOCATION;
204
typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
205
{
206
} IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
207
typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
208
 union {
209
  struct {
210
  } ;
211
                struct {
212
  } ;
213
 } ;
214
} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
215
typedef enum ReplacesCorHdrNumericDefines
216
{
217
    MAX_PACKAGE_NAME = 1024,
218
} ReplacesCorHdrNumericDefines;
219
typedef struct IMAGE_COR20_HEADER
220
{
221
} MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
222
typedef PVOID PSECURITY_DESCRIPTOR;
223
typedef enum _TOKEN_INFORMATION_CLASS {
224
  TokenUser = 1,
225
} TOKEN_INFORMATION_CLASS;
226
typedef struct _GENERIC_MAPPING {
227
} ACL, *PACL;
228
typedef struct _ACL_SIZE_INFORMATION
229
{
230
} ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION;
231
typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
232
typedef struct {
233
} SID_AND_ATTRIBUTES;
234
typedef enum {
235
    WinBuiltinTerminalServerLicenseServersSid = 60
236
} WELL_KNOWN_SID_TYPE;
237
typedef struct _TOKEN_USER {
238
} TOKEN_GROUPS, *PTOKEN_GROUPS;
239
typedef union _LARGE_INTEGER {
240
    struct {
241
    };
242
} LARGE_INTEGER, *PLARGE_INTEGER;
243
typedef union _ULARGE_INTEGER {
244
    struct {
245
    };
246
} LUID, *PLUID;
247
typedef struct _LUID_AND_ATTRIBUTES {
248
} LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
249
typedef enum tagTOKEN_TYPE {
250
  TokenPrimary = 1,
251
} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL;
252
typedef struct _SECURITY_QUALITY_OF_SERVICE {
253
} QUOTA_LIMITS_EX, *PQUOTA_LIMITS_EX;
254
typedef enum _LATENCY_TIME {
255
        VerifyProcessorPowerPolicyDc,
256
} POWER_INFORMATION_LEVEL;
257
typedef struct _ADMINISTRATOR_POWER_POLICY {
258
} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
259
typedef struct _RTL_CRITICAL_SECTION {
260
} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
261
typedef struct _IO_COUNTERS {
262
} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
263
typedef struct {
264
} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
265
typedef struct {
266
} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
267
typedef struct {
268
} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
269
typedef struct tagSIZE
270
{
271
} POINT, *PPOINT, *LPPOINT;
272
typedef struct _POINTL
273
{
274
} FILETIME, *PFILETIME, *LPFILETIME;
275
typedef struct tagRECT
276
{
277
  } ldiv_t;
278
extern double strtod (__const char *__restrict __nptr,
279
        char **__restrict __endptr)
280
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
281
extern long int strtol (__const char *__restrict __nptr,
282
   char **__restrict __endptr, int __base)
283
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
284
extern long int __strtol_internal (__const char *__restrict __nptr,
285
       int __base, int __group)
286
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
287
extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
288
          int __base, int __group)
289
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
290
extern __inline double
291
__attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr)
292
{
293
}
294
extern __inline long int
295
__attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base)
296
{
297
}
298
__attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base)
299
{
300
}
301
__attribute__ ((__nothrow__)) atoi (__const char *__nptr)
302
{
303
}
304
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
305
typedef struct
306
  {
307
  };
308
extern int random_r (struct random_data *__restrict __buf,
309
       int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
310
struct drand48_data
311
  {
312
  };
313
extern int drand48_r (struct drand48_data *__restrict __buffer,
314
        long int *__restrict __result)
315
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
316
extern int mrand48_r (struct drand48_data *__restrict __buffer,
317
        long int *__restrict __result)
318
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
319
extern int jrand48_r (unsigned short int __xsubi[3],
320
        long int *__restrict __result)
321
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
322
extern int seed48_r (unsigned short int __seed16v[3],
323
       struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
324
extern char *qfcvt (long double __value, int __ndigit,
325
        size_t __resolvedlen) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
326
__attribute__ ((__nothrow__)) realpath (__const char *__restrict __name, char *__restrict __resolved)
327
{
328
}
329
__attribute__ ((__nothrow__)) ptsname_r (int __fd, char *__buf, size_t __buflen)
330
{
331
}
332
typedef struct _EXCEPTION_DEBUG_INFO {
333
} EXCEPTION_DEBUG_INFO;
334
typedef struct _CREATE_THREAD_DEBUG_INFO {
335
} CREATE_THREAD_DEBUG_INFO;
336
typedef struct _CREATE_PROCESS_DEBUG_INFO {
337
} CREATE_PROCESS_DEBUG_INFO;
338
typedef struct _EXIT_THREAD_DEBUG_INFO {
339
} LOAD_DLL_DEBUG_INFO;
340
typedef struct _UNLOAD_DLL_DEBUG_INFO {
341
} RIP_INFO;
342
typedef struct _DEBUG_EVENT {
343
    union {
344
    } u;
345
} DEBUG_EVENT, *LPDEBUG_EVENT;
346
typedef struct _OFSTRUCT
347
{
348
} WIN32_FIND_DATAA, *PWIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
349
typedef struct _WIN32_FIND_DATAW
350
{
351
} WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
352
typedef enum _FINDEX_SEARCH_OPS
353
{
354
 FindExSearchNameMatch,
355
} FINDEX_SEARCH_OPS;
356
typedef struct _PROCESS_HEAP_ENTRY
357
{
358
    union {
359
        struct {
360
        } Block;
361
        struct {
362
        } Region;
363
    } ;
364
} PROCESS_HEAP_ENTRY, *PPROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY;
365
typedef struct tagMEMORYSTATUS
366
{
367
} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
368
typedef struct _SYSTEMTIME{
369
        WORD wYear;
370
} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
371
typedef struct _OVERLAPPED {
372
        union {
373
            struct {
374
            } ;
375
        } ;
376
} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
377
typedef struct _TIME_ZONE_INFORMATION{
378
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
379
typedef struct _BY_HANDLE_FILE_INFORMATION
380
{
381
} ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, *PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
382
typedef struct tagACTCTX_SECTION_KEYED_DATA {
383
} COMMTIMEOUTS,*LPCOMMTIMEOUTS;
384
typedef enum _COMPUTER_NAME_FORMAT
385
{
386
 ComputerNameNetBIOS,
387
} COMPUTER_NAME_FORMAT;
388
typedef struct tagHW_PROFILE_INFOA {
389
} HW_PROFILE_INFOA, *LPHW_PROFILE_INFOA;
390
typedef struct tagHW_PROFILE_INFOW {
391
} HW_PROFILE_INFOW, *LPHW_PROFILE_INFOW;
392
BOOL __attribute__((__stdcall__)) SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,
393
                                                SECURITY_DESCRIPTOR_CONTROL);
394
typedef struct tagSYSLEVEL
395
{
396
} SYSLEVEL;
397
static inline PVOID __attribute__((__stdcall__)) InterlockedCompareExchangePointer( PVOID volatile *dest, PVOID xchg, PVOID compare )
398
{
399
}
400
static inline PVOID __attribute__((__stdcall__)) InterlockedExchangePointer( PVOID volatile *dest, PVOID val )
401
{
402
}
403
typedef unsigned long HCRYPTPROV;
404
typedef unsigned long HCRYPTKEY;
405
typedef void *HCERTSTOREPROV;
406
typedef struct _PROV_ENUMALGS {
407
} PROV_ENUMALGS;
408
typedef struct _HMAC_INFO {
409
} HMAC_INFO, *PHMAC_INFO;
410
typedef struct _CRYPTOAPI_BLOB {
411
  DWORD cbData;
412
  BYTE* pbData;
413
} CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
414
  CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
415
  CERT_NAME_BLOB, *PCERT_NAME_BLOB,
416
  CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB,
417
  CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
418
  CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
419
typedef struct _CRYPTPROTECT_PROMPTSTRUCT{
420
} CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT;
421
typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
422
  LPSTR pszObjId;
423
  CRYPT_OBJID_BLOB Parameters;
424
} CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
425
typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
426
} CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
427
typedef struct _PUBLICKEYSTRUC {
428
} BLOBHEADER, PUBLICKEYSTRUC;
429
typedef struct _RSAPUBKEY {
430
    DWORD magic;
431
    DWORD pubexp;
432
} RSAPUBKEY;
433
typedef struct _CRYPT_BIT_BLOB {
434
    DWORD cbData;
435
    BYTE *pbData;
436
    DWORD cUnusedBits;
437
} CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB;
438
typedef struct _CRYPT_KEY_PROV_PARAM {
439
} CRYPT_KEY_PROV_PARAM, *PCRYPT_KEY_PROV_PARAM;
440
typedef struct _CRYPT_KEY_PROV_INFO {
441
    CRYPT_ALGORITHM_IDENTIFIER Algorithm;
442
    CRYPT_BIT_BLOB PublicKey;
443
} CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO;
444
typedef struct _CERT_EXTENSION {
445
    LPSTR pszObjId;
446
    CRYPT_OBJID_BLOB Value;
447
} CERT_EXTENSION, *PCERT_EXTENSION;
448
typedef struct _CERT_EXTENSIONS {
449
    DWORD cExtension;
450
    PCERT_EXTENSION rgExtension;
451
} CERT_EXTENSIONS, *PCERT_EXTENSIONS;
452
typedef struct _CERT_INFO {
453
    CRYPT_INTEGER_BLOB SerialNumber;
454
    CERT_NAME_BLOB Subject;
455
    CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
456
} CERT_INFO, *PCERT_INFO;
457
typedef struct _CERT_RDN_ATTR {
458
    LPSTR pszObjId;
459
    CERT_RDN_VALUE_BLOB Value;
460
} CERT_RDN_ATTR, *PCERT_RDN_ATTR;
461
typedef struct _CERT_RDN {
462
} CERT_RDN, *PCERT_RDN;
463
typedef struct _CERT_NAME_INFO {
464
    DWORD cRDN;
465
} CERT_NAME_INFO, *PCERT_NAME_INFO;
466
typedef struct _CERT_NAME_VALUE {
467
    DWORD dwValueType;
468
    CERT_RDN_VALUE_BLOB Value;
469
} CERT_NAME_VALUE, *PCERT_NAME_VALUE;
470
typedef struct _CERT_ENCRYPTED_PRIVATE_KEY_INFO {
471
    CERT_NAME_BLOB CertIssuer;
472
} CERT_AUTHORITY_KEY_ID_INFO, *PCERT_AUTHORITY_KEY_ID_INFO;
473
typedef struct _CERT_PRIVATE_KEY_VALIDITY {
474
} CERT_OTHER_NAME, *PCERT_OTHER_NAME;
475
typedef struct _CERT_ALT_NAME_ENTRY {
476
    DWORD dwAltNameChoice;
477
    union {
478
        LPWSTR pwszURL;
479
    } ;
480
} CERT_ALT_NAME_ENTRY, *PCERT_ALT_NAME_ENTRY;
481
typedef struct _CERT_ALT_NAME_INFO {
482
    DWORD cAltEntry;
483
    PCERT_ALT_NAME_ENTRY rgAltEntry;
484
} CERT_ALT_NAME_INFO, *PCERT_ALT_NAME_INFO;
485
typedef struct _CERT_BASIC_CONSTRAINTS_INFO {
486
    CERT_NAME_BLOB *rgSubtreesConstraint;
487
} CERT_BASIC_CONSTRAINTS_INFO, *PCERT_BASIC_CONSTRAINTS_INFO;
488
typedef struct _CERT_BASIC_CONSTRAINTS2_INFO {
489
} CERT_BASIC_CONSTRAINTS2_INFO, *PCERT_BASIC_CONSTRAINTS2_INFO;
490
typedef struct _CERT_POLICY_QUALIFIER_INFO {
491
} CERT_POLICY_QUALIFIER_INFO, *PCERT_POLICY_QUALIFIER_INFO;
492
typedef struct _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE {
493
} CERT_POLICY_QUALIFIER_NOTICE_REFERENCE,
494
 *PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE;
495
typedef struct _CERT_POLICY_QUALIFIER_USER_NOTICE {
496
    DWORD cValue;
497
    PCRYPT_DER_BLOB rgValue;
498
} CRYPT_SEQUENCE_OF_ANY, *PCRYPT_SEQUENCE_OF_ANY;
499
typedef struct _CERT_AUTHORITY_KEY_ID2_INFO {
500
    PCERT_INFO pCertInfo;
501
} CERT_CONTEXT, *PCERT_CONTEXT;
502
typedef const CERT_CONTEXT *PCCERT_CONTEXT;
503
typedef struct _CRL_ENTRY {
504
} CRL_ENTRY, *PCRL_ENTRY;
505
typedef struct _CRL_INFO {
506
    DWORD cCRLEntry;
507
    DWORD cExtension;
508
} CRL_INFO, *PCRL_INFO;
509
typedef struct _CRL_DIST_POINT_NAME {
510
    DWORD dwDistPointNameChoice;
511
    union {
512
    } ;
513
} CRL_DIST_POINT_NAME, *PCRL_DIST_POINT_NAME;
514
typedef struct _CRL_DIST_POINT {
515
    CRL_DIST_POINT_NAME DistPointName;
516
    CRYPT_BIT_BLOB ReasonFlags;
517
    CERT_ALT_NAME_INFO CRLIssuer;
518
} CRL_DIST_POINT, *PCRL_DIST_POINT;
519
typedef struct _CRL_DIST_POINTS_INFO {
520
    DWORD cDistPoint;
521
    PCRL_DIST_POINT rgDistPoint;
522
} CRL_DIST_POINTS_INFO, *PCRL_DIST_POINTS_INFO;
523
typedef struct _CRL_ISSUING_DIST_POINT {
524
    BOOL fOnlyContainsUserCerts;
525
} CRL_ISSUING_DIST_POINT, *PCRL_ISSUING_DIST_POINT;
526
typedef struct _CERT_GENERAL_SUBTREE {
527
} CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE;
528
typedef struct _CRYPT_ATTRIBUTES {
529
} CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES;
530
typedef struct _CERT_REQUEST_INFO {
531
    DWORD dwVersion;
532
    CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
533
    CRYPT_BIT_BLOB Signature;
534
} CERT_SIGNED_CONTENT_INFO, *PCERT_SIGNED_CONTENT_INFO;
535
typedef struct _CRL_CONTEXT {
536
} CRL_CONTEXT, *PCRL_CONTEXT;
537
typedef struct _VTableProvStruc {
538
} CTL_CONTEXT, *PCTL_CONTEXT;
539
typedef struct _CRYPT_TIME_STAMP_REQUEST_INFO {
540
} CERT_REVOCATION_STATUS, *PCERT_REVOCATION_STATUS;
541
typedef struct _CERT_TRUST_STATUS {
542
} CERT_SYSTEM_STORE_RELOCATE_PARA, *PCERT_SYSTEM_STORE_RELOCATE_PARA;
543
typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)(
544
 void *pvArg);
545
typedef struct _CRYPT_ENCODE_PARA {
546
} CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO;
547
typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)(
548
 DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara);
549
typedef struct _CERT_STORE_PROV_FIND_INFO {
550
} CERT_STORE_PROV_FIND_INFO, *PCERT_STORE_PROV_FIND_INFO;
551
typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_STORE_PROV_FIND_CERT)(HCERTSTOREPROV hStoreProv,
552
 DWORD dwFlags, void **ppvStoreProvFindInfo, PCCERT_CONTEXT *ppProvCertContext);
553
typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_STORE_PROV_FREE_FIND_CERT)(
554
 DWORD dwFlags, void *pvData, DWORD *pcbData);
555
typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_STORE_PROV_GET_CTL_PROPERTY)(
556
 DWORD dwFlags, void *pvData);
557
typedef struct _CERT_CREATE_CONTEXT_PARA {
558
} CRYPT_OID_FUNC_ENTRY, *PCRYPT_OID_FUNC_ENTRY;
559
typedef BOOL (__attribute__((__stdcall__)) *PFN_CRYPT_ENUM_OID_FUNC)(DWORD dwEncodingType,
560
 const DWORD rgcbValueData[], void *pvArg);
561
typedef struct _CRYPT_OID_INFO {
562
    union {
563
    } ;
564
} CRYPT_OID_INFO, *PCRYPT_OID_INFO;
565
typedef const CRYPT_OID_INFO CCRYPT_OID_INFO, *PCCRYPT_OID_INFO;
566
typedef BOOL (__attribute__((__stdcall__)) *PFN_CRYPT_ENUM_OID_INFO)(PCCRYPT_OID_INFO pInfo,
567
 void *pvArg);
568
typedef struct _CRYPT_SIGN_MESSAGE_PARA {
569
} CRYPT_HASH_MESSAGE_PARA, *PCRYPT_HASH_MESSAGE_PARA;
570
typedef struct _CRYPT_KEY_SIGN_MESSAGE_PARA {
571
} CRYPT_URL_INFO, *PCRYPT_URL_INFO;
572
typedef void (__attribute__((__stdcall__)) *PFN_CRYPT_ASYNC_PARAM_FREE_FUNC)(LPSTR pszParamOid,
573
 LPVOID pvParam);
574
typedef struct _CRYPT_CREDENTIALS {
575
} CRYPT_CREDENTIALS, *PCRYPT_CREDENTIALS;
576
typedef struct _CRYPT_PASSWORD_CREDENTIALSA {
577
} CRYPT_PASSWORD_CREDENTIALSW, *PCRYPT_PASSWORD_CREDENTIALSW;
578
typedef struct _CRYPT_RETRIEVE_AUX_INFO {
579
} CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO;
580
typedef struct _CERT_CHAIN_ENGINE_CONFIG
581
{
582
} CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
583
BOOL __attribute__((__stdcall__)) CryptExportPublicKeyInfoEx(HCRYPTPROV hCryptProv, DWORD dwKeySpec,
584
 DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags,
585
 void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
586
BOOL __attribute__((__stdcall__)) CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv,
587
 PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
588
struct encodedInt
589
{
590
    int val;
591
    const BYTE *encoded;
592
};
593
static const struct encodedInt ints[] = {
594
};
595
struct encodedBigInt
596
{
597
    const BYTE *val;
598
    const BYTE *encoded;
599
};
600
static const struct encodedBigInt bigInts[] = {
601
};
602
static const struct encodedBigInt bigUInts[] = {
603
};
604
static void test_encodeInt(DWORD dwEncoding)
605
{
606
    DWORD bufSize = 0;
607
    int i;
608
    BOOL ret;
609
    CRYPT_INTEGER_BLOB blob;
610
    BYTE *buf = ((void *)0);
611
    ret = CryptEncodeObjectEx(0, ((LPCSTR)27), &ints[0].val, 0, ((void *)0), ((void *)0),
612
     "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
613
    {
614
        ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)27), &ints[i].val,
615
         0x08000, ((void *)0), &buf, &bufSize);
616
        {
617
            (winetest_set_location("encode.c", 119), 0) ? 0 : winetest_ok(buf[0] == 2, "Got unexpected type %d for integer (expected 2)\n",
618
             buf[1], ints[i].encoded[1]);
619
        }
620
        ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)28), &blob,
621
         0, ((void *)0), ((void *)0), &bufSize);
622
        {
623
        }
624
        ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)38), &blob,
625
         0x08000, ((void *)0), &buf, &bufSize);
626
        {
627
            (winetest_set_location("encode.c", 187), 0) ? 0 : winetest_ok(buf[1] == bigUInts[i].encoded[1], "Got length %d, expected %d\n",
628
             buf[1], bigUInts[i].encoded[1]);
629
            (winetest_set_location("encode.c", 189), 0) ? 0 : winetest_ok(!memcmp(buf + 1, bigUInts[i].encoded + 1,
630
             bigUInts[i].encoded[1] + 1),
631
             "Encoded value didn't match expected\n");
632
        }
633
    }
634
}
635
static void test_decodeInt(DWORD dwEncoding)
636
{
637
    static const BYTE longForm[] = { 2, 0x81, 0x01, 0x01 };
638
    BYTE *buf = ((void *)0);
639
    DWORD bufSize = 0;
640
    int i;
641
    BOOL ret;
642
    ret = CryptDecodeObjectEx(3, ((LPCSTR)27), (BYTE *)&ints[0].encoded,
643
     ints[0].encoded[1] + 2, 0, ((void *)0), ((void *)0), &bufSize);
644
    (winetest_set_location("encode.c", 225), 0) ? 0 : winetest_ok(!ret && GetLastError() == ((HRESULT)0x80093104L),
645
     "Expected CRYPT_E_ASN1_BADTAG, got %d\n", GetLastError());
646
    {
647
        {
648
            (winetest_set_location("encode.c", 249), 0) ? 0 : winetest_ok(!memcmp(buf, &ints[i].val, bufSize), "Expected %d, got %d\n",
649
             ints[i].val, *(int *)buf);
650
        }
651
    }
652
    {
653
        ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)28),
654
         &bufSize);
655
        {
656
            CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)buf;
657
            (winetest_set_location("encode.c", 296), 0) ? 0 : winetest_ok(blob->cbData == strlen((const char*)bigUInts[i].val),
658
             "Unexpected value\n");
659
        }
660
    }
661
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)28), longForm,
662
     sizeof(longForm), 0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
663
    {
664
    }
665
}
666
static const struct encodedInt enums[] = {
667
};
668
static const LPCSTR enumeratedTypes[] = { ((LPCSTR)29),
669
 "2.5.29.21" };
670
static void test_encodeEnumerated(DWORD dwEncoding)
671
{
672
    DWORD i, j;
673
    {
674
        {
675
            BOOL ret;
676
            DWORD bufSize = 0;
677
            ret = CryptEncodeObjectEx(dwEncoding, enumeratedTypes[i],
678
             &bufSize);
679
            {
680
            }
681
        }
682
    }
683
}
684
static void test_decodeEnumerated(DWORD dwEncoding)
685
{
686
    DWORD i, j;
687
    {
688
        {
689
            BOOL ret;
690
            DWORD bufSize = sizeof(int);
691
            int val;
692
            ret = CryptDecodeObjectEx(dwEncoding, enumeratedTypes[i],
693
             (BYTE *)&val, &bufSize);
694
            (winetest_set_location("encode.c", 403), 0) ? 0 : winetest_ok(val == enums[j].val, "Unexpected value %d, expected %d\n",
695
             val, enums[j].val);
696
        }
697
    }
698
}
699
struct encodedFiletime
700
{
701
    SYSTEMTIME sysTime;
702
    const BYTE *encodedTime;
703
};
704
static void testTimeEncoding(DWORD dwEncoding, LPCSTR structType,
705
 const struct encodedFiletime *time)
706
{
707
}
708
static void testTimeDecoding(DWORD dwEncoding, LPCSTR structType,
709
 const struct encodedFiletime *time)
710
{
711
    BOOL ret;
712
    if (structType == ((LPCSTR)30) ||
713
     (time->sysTime.wYear >= 1950 && time->sysTime.wYear <= 2050))
714
    {
715
    }
716
        (winetest_set_location("encode.c", 476), 0) ? 0 : winetest_ok(!ret && GetLastError() == ((HRESULT)0x8009310BL),
717
         "Expected CRYPT_E_ASN1_BADTAG, got 0x%08x\n", GetLastError());
718
}
719
static const BYTE bin22[] = {
720
    0x18,0x0f,'2','1','4','5','0','6','0','6','1','6','1','0','0','0','Z'};
721
static const struct encodedFiletime times[] = {
722
};
723
static void test_encodeFiletime(DWORD dwEncoding)
724
{
725
    {
726
    }
727
}
728
static const BYTE bin23[] = {
729
    0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','0','0','0','Z'};
730
static const BYTE bin24[] = {
731
    0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','9','9','9','Z'};
732
static const BYTE bin26[] = {
733
    0x17,0x0b,'4','5','0','6','0','6','1','6','1','0','Z'};
734
static const BYTE bin33[] = {
735
    0x17,0x0f,'4','5','0','6','0','6','1','6','1','0','-','0','1','0','0'};
736
static const BYTE bin35[] = {
737
    0x17,0x08, '4','5','0','6','0','6','1','6'};
738
static const BYTE bin38[] = {
739
    0x18,0x08, '2','1','4','5','0','6','0','6'};
740
static void test_decodeFiletime(DWORD dwEncoding)
741
{
742
    static const struct encodedFiletime otherTimes[] = {
743
    };
744
    static const unsigned char *bogusTimes[] = {
745
    };
746
    {
747
    }
748
}
749
static const char commonName[] = "Juan Lang";
750
static const char surName[] = "Lang";
751
static const BYTE emptySequence[] = { 0x30, 0 };
752
static const BYTE emptyRDNs[] = { 0x30, 0x02, 0x31, 0 };
753
static const BYTE twoRDNs[] = {
754
    0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0};
755
static const BYTE encodedTwoRDNs[] = {
756
};
757
static const BYTE us[] = { 0x55, 0x53 };
758
static const BYTE minnesota[] = { 0x4d, 0x69, 0x6e, 0x6e, 0x65, 0x73, 0x6f,
759
 0x6f, 0x6c, 0x69, 0x73 };
760
static const BYTE codeweavers[] = { 0x43, 0x6f, 0x64, 0x65, 0x57, 0x65, 0x61,
761
 0x76, 0x65, 0x72, 0x73 };
762
static const BYTE wine[] = { 0x57, 0x69, 0x6e, 0x65, 0x20, 0x44, 0x65, 0x76,
763
 0x65, 0x6c, 0x6f, 0x70, 0x6d, 0x65, 0x6e, 0x74 };
764
static const BYTE aric[] = { 0x61, 0x72, 0x69, 0x63, 0x40, 0x63, 0x6f, 0x64,
765
 0x65, 0x77, 0x65, 0x61, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x6f, 0x6d };
766
static CHAR oid_us[] = "2.5.4.6",
767
            oid_aric[] = "1.2.840.113549.1.9.1";
768
static CERT_RDN_ATTR rdnAttrs[] = { { oid_us, 4, { sizeof(us), (LPBYTE)us } },
769
                                           { oid_aric, 7, { sizeof(aric), (LPBYTE)aric } } };
770
static const BYTE encodedRDNAttrs[] = {
771
};
772
static void test_encodeName(DWORD dwEncoding)
773
{
774
    CERT_NAME_INFO info;
775
    static CHAR oid_common_name[] = "2.5.4.3",
776
                oid_sur_name[] = "2.5.4.4";
777
    BOOL ret;
778
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)7), ((void *)0),
779
     "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
780
    {
781
    }
782
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)7), &info,
783
     "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
784
    {
785
    }
786
    {
787
    }
788
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)7), &info,
789
     "Expected E_INVALIDARG, got %08x\n", GetLastError());
790
    {
791
    }
792
}
793
static WCHAR commonNameW[] = { 'J','u','a','n',' ','L','a','n','g',0 };
794
static const BYTE twoRDNsNoNull[] = {
795
 0x20,0x4c,0x61,0x6e,0x67 };
796
static const BYTE anyType[] = {
797
 0x61,0x4c,0x67,0x6e };
798
static void test_encodeUnicodeName(DWORD dwEncoding)
799
{
800
    BOOL ret;
801
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)20), ((void *)0),
802
     "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
803
    {
804
    }
805
}
806
static void compareNameValues(const CERT_NAME_VALUE *expected,
807
 const CERT_NAME_VALUE *got)
808
{
809
    (winetest_set_location("encode.c", 913), 0) ? 0 : winetest_ok(got->dwValueType == expected->dwValueType,
810
     expected->dwValueType, got->Value.cbData, expected->Value.cbData);
811
        (winetest_set_location("encode.c", 920), 0) ? 0 : winetest_ok(!memcmp(got->Value.pbData, expected->Value.pbData,
812
         (((got->Value.cbData) < (expected->Value.cbData)) ? (got->Value.cbData) : (expected->Value.cbData))),
813
         "String type %d: unexpected value\n", expected->dwValueType);
814
}
815
static void compareRDNAttrs(const CERT_RDN_ATTR *expected,
816
 const CERT_RDN_ATTR *got)
817
{
818
    {
819
        {
820
            (winetest_set_location("encode.c", 934), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (got->pszObjId) && __builtin_constant_p (expected->pszObjId) && (__s1_len = strlen (got->pszObjId), __s2_len = strlen (expected->pszObjId), (!((size_t)(const void *)((got->pszObjId) + 1) - (size_t)(const void *)(got->pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((expected->pszObjId) + 1) - (size_t)(const void *)(expected->pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp (got->pszObjId, expected->pszObjId) : (__builtin_constant_p (got->pszObjId) && ((size_t)(const void *)((got->pszObjId) + 1) - (size_t)(const void *)(got->pszObjId) == 1) && (__s1_len = strlen (got->pszObjId), __s1_len < 4) ? (__builtin_constant_p (expected->pszObjId) && ((size_t)(const void *)((expected->pszObjId) + 1) - (size_t)(const void *)(expected->pszObjId) == 1) ? __builtin_strcmp (got->pszObjId, expected->pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (expected->pszObjId); register int __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (expected->pszObjId) && ((size_t)(const void *)((expected->pszObjId) + 1) - (size_t)(const void *)(expected->pszObjId) == 1) && (__s2_len = strlen (expected->pszObjId), __s2_len < 4) ? (__builtin_constant_p (got->pszObjId) && ((size_t)(const void *)((got->pszObjId) + 1) - (size_t)(const void *)(got->pszObjId) == 1) ? __builtin_strcmp (got->pszObjId, expected->pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (got->pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[3]); } } __result; }))) : __builtin_strcmp (got->pszObjId, expected->pszObjId)))); }),
821
             expected->pszObjId);
822
        }
823
    }
824
}
825
static void compareRDNs(const CERT_RDN *expected, const CERT_RDN *got)
826
{
827
    {
828
    }
829
}
830
static void compareNames(const CERT_NAME_INFO *expected,
831
 const CERT_NAME_INFO *got)
832
{
833
    (winetest_set_location("encode.c", 959), 0) ? 0 : winetest_ok(got->cRDN == expected->cRDN, "Expected %d RDNs, got %d\n",
834
     expected->cRDN, got->cRDN);
835
    {
836
    }
837
}
838
static void test_decodeName(DWORD dwEncoding)
839
{
840
    BYTE *buf = ((void *)0);
841
    DWORD bufSize = 0;
842
    BOOL ret;
843
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)7), emptySequence,
844
     (BYTE *)&buf, &bufSize);
845
    {
846
        static CHAR oid_sur_name[] = "2.5.4.4",
847
                    oid_common_name[] = "2.5.4.3";
848
        CERT_RDN_ATTR attrs[] = {
849
         { oid_sur_name, 4, { sizeof(surName),
850
          (BYTE *)commonName } },
851
        };
852
    }
853
    {
854
    }
855
}
856
static void test_decodeUnicodeName(DWORD dwEncoding)
857
{
858
    BYTE *buf = ((void *)0);
859
    DWORD bufSize = 0;
860
    BOOL ret;
861
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)20), emptySequence,
862
     (BYTE *)&buf, &bufSize);
863
    {
864
    }
865
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)20), emptyRDNs,
866
     (BYTE *)&buf, &bufSize);
867
    {
868
    }
869
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)20), twoRDNsNoNull,
870
     (BYTE *)&buf, &bufSize);
871
    {
872
        static CHAR oid_sur_name[] = "2.5.4.4",
873
                    oid_common_name[] = "2.5.4.3";
874
        CERT_RDN_ATTR attrs[] = {
875
         { oid_sur_name, 4,
876
         { lstrlenW(commonNameW) * sizeof(WCHAR), (BYTE *)commonNameW } },
877
        };
878
    }
879
}
880
struct EncodedNameValue
881
{
882
    CERT_NAME_VALUE value;
883
};
884
static const char bogusPrintable[] = "~";
885
static const BYTE bin42[] = { 0x16,0x02,0x80,0x00 };
886
static const BYTE bin43[] = { 0x13,0x02,0x7e,0x00 };
887
static BYTE octetCommonNameValue[] = {
888
 0x12,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
889
static BYTE printableCommonNameValue[] = {
890
 0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
891
static BYTE t61CommonNameValue[] = {
892
 0x14,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
893
static BYTE graphicCommonNameValue[] = {
894
 0x61,0x00,0x6e,0x00,0x67,0x00,0x00 };
895
static BYTE utf8CommonNameValue[] = {
896
 0x0c,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
897
static struct EncodedNameValue nameValues[] = {
898
 { { 5, { sizeof(commonName), (BYTE *)commonName } },
899
     sizeof(bin42) },
900
 { { 4, { sizeof(bogusPrintable),
901
     (BYTE *)bogusPrintable } }, bin43, sizeof(bin43) },
902
};
903
static void test_encodeNameValue(DWORD dwEncoding)
904
{
905
    DWORD size = 0, i;
906
    BOOL ret;
907
    CERT_NAME_VALUE value = { 0, { 0, ((void *)0) } };
908
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)6), &value,
909
     "Expected CRYPT_E_ASN1_CHOICE, got %08x\n", GetLastError());
910
    {
911
        (winetest_set_location("encode.c", 1209), 0) ? 0 : winetest_ok(size == sizeof(printableCommonNameValue), "Unexpected size %d\n",
912
         "Unexpected encoding\n");
913
        ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)6),
914
         nameValues[i].value.dwValueType, GetLastError());
915
        {
916
        }
917
    }
918
}
919
static void test_decodeNameValue(DWORD dwEncoding)
920
{
921
    int i;
922
    BYTE *buf = ((void *)0);
923
    DWORD bufSize = 0;
924
    BOOL ret;
925
    {
926
        ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)6),
927
         (BYTE *)&buf, &bufSize);
928
        {
929
            compareNameValues(&nameValues[i].value,
930
             (const CERT_NAME_VALUE *)buf);
931
        }
932
    }
933
}
934
static const BYTE emptyURL[] = { 0x30, 0x02, 0x86, 0x00 };
935
static const WCHAR url[] = { 'h','t','t','p',':','/','/','w','i','n','e',
936
 0x6f, 0x72, 0x67 };
937
static const BYTE encodedIPAddr[] = { 0x30, 0x06, 0x87, 0x04, 0x7f, 0x00, 0x00,
938
 0x01 };
939
static void test_encodeAltName(DWORD dwEncoding)
940
{
941
    CERT_ALT_NAME_INFO info = { 0 };
942
    BYTE *buf = ((void *)0);
943
    DWORD size = 0;
944
    BOOL ret;
945
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)12), &info,
946
     0x08000, ((void *)0), (BYTE *)&buf, &size);
947
    {
948
    }
949
    {
950
    }
951
}
952
static void test_decodeAltName(DWORD dwEncoding)
953
{
954
    BOOL ret;
955
    DWORD bufSize = 0;
956
    CERT_ALT_NAME_INFO *info;
957
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)12),
958
     &bufSize);
959
    {
960
        (winetest_set_location("encode.c", 1392), 0) ? 0 : winetest_ok(info->cAltEntry == 0, "Expected 0 entries, got %d\n",
961
         info->cAltEntry);
962
    }
963
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)12), emptyURL,
964
     &bufSize);
965
    {
966
    }
967
}
968
struct encodedBits
969
{
970
    const BYTE *encoded;
971
    DWORD cbDecoded;
972
};
973
static const struct encodedBits bits[] = {
974
};
975
static void test_encodeBits(DWORD dwEncoding)
976
{
977
    DWORD i;
978
    {
979
        DWORD bufSize = 0;
980
        {
981
            (winetest_set_location("encode.c", 1802), 0) ? 0 : winetest_ok(bufSize == bits[i].encoded[1] + 2,
982
             bits[i].encoded[1] + 2);
983
        }
984
    }
985
}
986
static void test_decodeBits(DWORD dwEncoding)
987
{
988
    DWORD i;
989
    {
990
        {
991
            CRYPT_BIT_BLOB *blob;
992
            (winetest_set_location("encode.c", 1835), 0) ? 0 : winetest_ok(blob->cbData == bits[i].cbDecoded,
993
                 "Unexpected value\n");
994
        }
995
    }
996
    {
997
    }
998
}
999
struct Constraints2
1000
{
1001
    CERT_BASIC_CONSTRAINTS2_INFO info;
1002
};
1003
static const struct Constraints2 constraints2[] = {
1004
};
1005
static const BYTE encodedDomainName[] = { 0x30, 0x2b, 0x31, 0x29, 0x30, 0x11,
1006
 0x16, 0x06, 0x77, 0x69, 0x6e, 0x65, 0x68, 0x71 };
1007
static void test_encodeBasicConstraints(DWORD dwEncoding)
1008
{
1009
    CERT_NAME_BLOB nameBlob = { sizeof(encodedDomainName),
1010
     (LPBYTE)encodedDomainName };
1011
    {
1012
        {
1013
        }
1014
    }
1015
    {
1016
    }
1017
}
1018
static const unsigned char encodedCommonName[] = {
1019
    0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,'J','u','a','n',' ','L','a','n','g',0};
1020
static void test_decodeBasicConstraints(DWORD dwEncoding)
1021
{
1022
    static const BYTE inverted[] = { 0x30, 0x06, 0x02, 0x01, 0x01, 0x01, 0x01,
1023
     0xff };
1024
    DWORD i;
1025
    BOOL ret;
1026
    BYTE *buf = ((void *)0);
1027
    DWORD bufSize = 0;
1028
    {
1029
        ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)15),
1030
         0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
1031
        {
1032
            CERT_BASIC_CONSTRAINTS2_INFO *info =
1033
            (winetest_set_location("encode.c", 1984), 0) ? 0 : winetest_ok(!memcmp(info, &constraints2[i].info, sizeof(*info)),
1034
             "Unexpected value for item %d\n", i);
1035
        }
1036
    }
1037
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)15),
1038
     (BYTE *)&buf, &bufSize);
1039
    {
1040
        CERT_BASIC_CONSTRAINTS_INFO *info = (CERT_BASIC_CONSTRAINTS_INFO *)buf;
1041
        {
1042
            (winetest_set_location("encode.c", 2043), 0) ? 0 : winetest_ok(info->rgSubtreesConstraint[0].cbData ==
1043
             info->rgSubtreesConstraint[0].cbData);
1044
            (winetest_set_location("encode.c", 2046), 0) ? 0 : winetest_ok(!memcmp(info->rgSubtreesConstraint[0].pbData, encodedDomainName,
1045
             sizeof(encodedDomainName)), "Unexpected value\n");
1046
        }
1047
    }
1048
}
1049
static const BYTE modulus1[] = { 0,0,0,1,1,1,1,1 };
1050
struct EncodedRSAPubKey
1051
{
1052
    const BYTE *modulus;
1053
    size_t decodedModulusLen;
1054
};
1055
struct EncodedRSAPubKey rsaPubKeys[] = {
1056
};
1057
static void test_encodeRsaPublicKey(DWORD dwEncoding)
1058
{
1059
    BYTE toEncode[sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + sizeof(modulus1)];
1060
    RSAPUBKEY *rsaPubKey = (RSAPUBKEY *)(toEncode + sizeof(BLOBHEADER));
1061
    BOOL ret;
1062
    BYTE *buf = ((void *)0);
1063
    DWORD bufSize = 0, i;
1064
    ret = CryptDecodeObjectEx(dwEncoding, "1.2.840.113549.1.1.1",
1065
     "Expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError());
1066
    {
1067
        {
1068
            (winetest_set_location("encode.c", 2210), 0) ? 0 : winetest_ok(bufSize >= sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) +
1069
             "Wrong size %d\n", bufSize);
1070
            (winetest_set_location("encode.c", 2223), 0) ? 0 : winetest_ok(rsaPubKey->magic == 0x31415352,
1071
             rsaPubKey->pubexp);
1072
            (winetest_set_location("encode.c", 2229), 0) ? 0 : winetest_ok(!memcmp(buf + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY),
1073
             rsaPubKeys[i].modulus, rsaPubKeys[i].decodedModulusLen),
1074
             "Unexpected modulus\n");
1075
        }
1076
    }
1077
}
1078
static const BYTE intSequence[] = { 0x30, 0x1b, 0x02, 0x01, 0x01, 0x02, 0x01,
1079
 0x02, 0xff, 0x7f, 0x02, 0x04, 0xba, 0xdd, 0xf0, 0x0d };
1080
static const BYTE mixedSequence[] = { 0x30, 0x27, 0x17, 0x0d, 0x30, 0x35, 0x30,
1081
 0xff, 0x7f, 0x02, 0x04, 0xba, 0xdd, 0xf0, 0x0d };
1082
static void test_encodeSequenceOfAny(DWORD dwEncoding)
1083
{
1084
    BYTE *buf = ((void *)0);
1085
    {
1086
    }
1087
    {
1088
        (winetest_set_location("encode.c", 2284), 0) ? 0 : winetest_ok(!memcmp(buf, mixedSequence, mixedSequence[1] + 2),
1089
         "Unexpected value\n");
1090
    }
1091
}
1092
static void test_decodeSequenceOfAny(DWORD dwEncoding)
1093
{
1094
    BOOL ret;
1095
    BYTE *buf = ((void *)0);
1096
    DWORD bufSize = 0;
1097
    {
1098
        {
1099
        }
1100
    }
1101
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)34), mixedSequence,
1102
     &bufSize);
1103
    {
1104
        CRYPT_SEQUENCE_OF_ANY *seq = (CRYPT_SEQUENCE_OF_ANY *)buf;
1105
        (winetest_set_location("encode.c", 2324), 0) ? 0 : winetest_ok(seq->cValue == sizeof(ints) / sizeof(ints[0]),
1106
         seq->rgValue[0].cbData);
1107
        (winetest_set_location("encode.c", 2330), 0) ? 0 : winetest_ok(!memcmp(seq->rgValue[0].pbData, times[0].encodedTime,
1108
         times[0].encodedTime[1] + 2), "Unexpected value\n");
1109
    }
1110
}
1111
struct encodedExtensions
1112
{
1113
    CERT_EXTENSIONS exts;
1114
};
1115
static BYTE noncrit_ext_data[] = { 0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
1116
static CHAR oid_basic_constraints2[] = "2.5.29.19";
1117
static CERT_EXTENSION nonCriticalExt =
1118
 { oid_basic_constraints2, 0, { 8, noncrit_ext_data } };
1119
static const struct encodedExtensions exts[] = {
1120
};
1121
static void test_encodeExtensions(DWORD dwEncoding)
1122
{
1123
    DWORD i;
1124
    {
1125
        {
1126
        }
1127
    }
1128
    {
1129
        BOOL ret;
1130
        BYTE *buf = ((void *)0);
1131
        DWORD bufSize = 0;
1132
        ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)5),
1133
         ((void *)0), (BYTE *)&buf, &bufSize);
1134
        {
1135
            CERT_EXTENSIONS *ext = (CERT_EXTENSIONS *)buf;
1136
            DWORD j;
1137
            (winetest_set_location("encode.c", 2405), 0) ? 0 : winetest_ok(ext->cExtension == exts[i].exts.cExtension,
1138
             ext->cExtension);
1139
            {
1140
                (winetest_set_location("encode.c", 2410), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (ext->rgExtension[j].pszObjId) && __builtin_constant_p (exts[i].exts.rgExtension[j].pszObjId) && (__s1_len = strlen (ext->rgExtension[j].pszObjId), __s2_len = strlen (exts[i].exts.rgExtension[j].pszObjId), (!((size_t)(const void *)((ext->rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(ext->rgExtension[j].pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((exts[i].exts.rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(exts[i].exts.rgExtension[j].pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId) : (__builtin_constant_p (ext->rgExtension[j].pszObjId) && ((size_t)(const void *)((ext->rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(ext->rgExtension[j].pszObjId) == 1) && (__s1_len = strlen (ext->rgExtension[j].pszObjId), __s1_len < 4) ? (__builtin_constant_p (exts[i].exts.rgExtension[j].pszObjId) && ((size_t)(const void *)((exts[i].exts.rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(exts[i].exts.rgExtension[j].pszObjId) == 1) ? __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId); register int __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (exts[i].exts.rgExtension[j].pszObjId) && ((size_t)(const void *)((exts[i].exts.rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(exts[i].exts.rgExtension[j].pszObjId) == 1) && (__s2_len = strlen (exts[i].exts.rgExtension[j].pszObjId), __s2_len < 4) ? (__builtin_constant_p (ext->rgExtension[j].pszObjId) && ((size_t)(const void *)((ext->rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(ext->rgExtension[j].pszObjId) == 1) ? __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[3]); } } __result; }))) : __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId)))); }),
1141
                 ext->rgExtension[j].pszObjId);
1142
                (winetest_set_location("encode.c", 2415), 0) ? 0 : winetest_ok(!memcmp(ext->rgExtension[j].Value.pbData,
1143
                 exts[i].exts.rgExtension[j].Value.cbData),
1144
                 "Unexpected value\n");
1145
            }
1146
        }
1147
    }
1148
}
1149
struct encodedPublicKey
1150
{
1151
    const BYTE *encoded;
1152
    const BYTE *encodedNoNull;
1153
};
1154
static const BYTE aKey[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd,
1155
 0xe, 0xf };
1156
static const BYTE params[] = { 0x02, 0x01, 0x01 };
1157
static const unsigned char bin66[] = {
1158
    0x30,0x0f,0x30,0x0a,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x05,0x00,0x03,0x01,0x00};
1159
static const unsigned char bin67[] = {
1160
    0x30,0x0d,0x30,0x08,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x03,0x01,0x00};
1161
static const unsigned char bin69[] = {
1162
    0x0f};
1163
static unsigned char bin72[] = { 0x05,0x00};
1164
static CHAR oid_bogus[] = "1.2.3",
1165
            oid_rsa[] = "1.2.840.113549";
1166
static const struct encodedPublicKey pubKeys[] = {
1167
 { { { oid_rsa, { 0, ((void *)0) } }, { 0, ((void *)0), 0} },
1168
  { { oid_rsa, { 2, bin72 } }, { sizeof(aKey), (BYTE *)aKey, 0} } },
1169
 { { { oid_rsa, { sizeof(params), (BYTE *)params } }, { sizeof(aKey),
1170
  (BYTE *)aKey, 0 } } },
1171
};
1172
static void test_encodePublicKeyInfo(DWORD dwEncoding)
1173
{
1174
    DWORD i;
1175
    {
1176
        BOOL ret;
1177
        BYTE *buf = ((void *)0);
1178
        DWORD bufSize = 0;
1179
        ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)8),
1180
         &bufSize);
1181
        {
1182
            (winetest_set_location("encode.c", 2505), 0) ? 0 : winetest_ok(bufSize == pubKeys[i].encoded[1] + 2 ||
1183
             pubKeys[i].encodedNoNull[1] + 2, bufSize);
1184
                (winetest_set_location("encode.c", 2510), 0) ? 0 : winetest_ok(!memcmp(buf, pubKeys[i].encoded, pubKeys[i].encoded[1] + 2),
1185
                 "Unexpected value\n");
1186
                (winetest_set_location("encode.c", 2513), 0) ? 0 : winetest_ok(!memcmp(buf, pubKeys[i].encodedNoNull,
1187
                 pubKeys[i].encodedNoNull[1] + 2), "Unexpected value\n");
1188
        }
1189
    }
1190
}
1191
static void comparePublicKeyInfo(const CERT_PUBLIC_KEY_INFO *expected,
1192
 const CERT_PUBLIC_KEY_INFO *got)
1193
{
1194
    (winetest_set_location("encode.c", 2523), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (expected->Algorithm.pszObjId) && __builtin_constant_p (got->Algorithm.pszObjId) && (__s1_len = strlen (expected->Algorithm.pszObjId), __s2_len = strlen (got->Algorithm.pszObjId), (!((size_t)(const void *)((expected->Algorithm.pszObjId) + 1) - (size_t)(const void *)(expected->Algorithm.pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((got->Algorithm.pszObjId) + 1) - (size_t)(const void *)(got->Algorithm.pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId) : (__builtin_constant_p (expected->Algorithm.pszObjId) && ((size_t)(const void *)((expected->Algorithm.pszObjId) + 1) - (size_t)(const void *)(expected->Algorithm.pszObjId) == 1) && (__s1_len = strlen (expected->Algorithm.pszObjId), __s1_len < 4) ? (__builtin_constant_p (got->Algorithm.pszObjId) && ((size_t)(const void *)((got->Algorithm.pszObjId) + 1) - (size_t)(const void *)(got->Algorithm.pszObjId) == 1) ? __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (got->Algorithm.pszObjId); register int __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (got->Algorithm.pszObjId) && ((size_t)(const void *)((got->Algorithm.pszObjId) + 1) - (size_t)(const void *)(got->Algorithm.pszObjId) == 1) && (__s2_len = strlen (got->Algorithm.pszObjId), __s2_len < 4) ? (__builtin_constant_p (expected->Algorithm.pszObjId) && ((size_t)(const void *)((expected->Algorithm.pszObjId) + 1) - (size_t)(const void *)(expected->Algorithm.pszObjId) == 1) ? __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[3]); } } __result; }))) : __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId)))); }),
1195
     expected->PublicKey.cbData, got->PublicKey.cbData);
1196
        (winetest_set_location("encode.c", 2538), 0) ? 0 : winetest_ok(!memcmp(expected->PublicKey.pbData, got->PublicKey.pbData,
1197
         got->PublicKey.cbData), "Unexpected public key value\n");
1198
}
1199
static void test_decodePublicKeyInfo(DWORD dwEncoding)
1200
{
1201
    static const BYTE bogusPubKeyInfo[] = { 0x30, 0x22, 0x30, 0x0d, 0x06, 0x06,
1202
     0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f };
1203
    BOOL ret;
1204
    BYTE *buf = ((void *)0);
1205
    DWORD bufSize = 0;
1206
    {
1207
        ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)8),
1208
         0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
1209
        {
1210
        }
1211
    }
1212
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)8),
1213
     "Expected CRYPT_E_ASN1_CORRUPT, got %08x\n", GetLastError());
1214
}
1215
static const BYTE v1Cert[] = { 0x30, 0x33, 0x02, 0x00, 0x30, 0x02, 0x06, 0x00,
1216
 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 };
1217
static const BYTE v2Cert[] = { 0x30, 0x38, 0xa0, 0x03, 0x02, 0x01, 0x01, 0x02,
1218
 0x30, 0x5a, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 };
1219
static const BYTE v3Cert[] = { 0x30, 0x38, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02,
1220
 0x30, 0x5a, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 };
1221
static const BYTE v1CertWithConstraints[] = { 0x30, 0x4b, 0x02, 0x00, 0x30,
1222
 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 };
1223
static const BYTE v1CertWithSerial[] = { 0x30, 0x4c, 0x02, 0x01, 0x01, 0x30,
1224
 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 };
1225
static const BYTE bigCert[] = { 0x30, 0x7a, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06,
1226
 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 };
1227
static void test_encodeCertToBeSigned(DWORD dwEncoding)
1228
{
1229
    BOOL ret;
1230
    BYTE *buf = ((void *)0);
1231
    DWORD size = 0;
1232
    CERT_INFO info = { 0 };
1233
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)2), ((void *)0),
1234
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1235
    {
1236
    }
1237
    {
1238
    }
1239
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)2), &info,
1240
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1241
    {
1242
    }
1243
    {
1244
    }
1245
}
1246
static void test_decodeCertToBeSigned(DWORD dwEncoding)
1247
{
1248
    static const BYTE *corruptCerts[] = { v1Cert, v2Cert, v3Cert,
1249
     v1CertWithConstraints, v1CertWithSerial };
1250
    BOOL ret;
1251
    (winetest_set_location("encode.c", 2727), 0) ? 0 : winetest_ok(!ret && GetLastError() == ((HRESULT)0x80093102L),
1252
     "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
1253
    {
1254
        ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)2),
1255
         "Expected CRYPT_E_ASN1_CORRUPT, got %08x\n", GetLastError());
1256
    }
1257
    {
1258
    }
1259
}
1260
static const BYTE hash[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd,
1261
 0xe, 0xf };
1262
static const BYTE signedBigCert[] = {
1263
 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 };
1264
static void test_encodeCert(DWORD dwEncoding)
1265
{
1266
    CERT_SIGNED_CONTENT_INFO info = { { sizeof(bigCert), (BYTE *)bigCert },
1267
     { ((void *)0), { 0, ((void *)0) } }, { sizeof(hash), (BYTE *)hash, 0 } };
1268
    BOOL ret;
1269
    BYTE *buf = ((void *)0);
1270
    DWORD bufSize = 0;
1271
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)1), &info,
1272
     0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
1273
    {
1274
    }
1275
}
1276
static void test_decodeCert(DWORD dwEncoding)
1277
{
1278
    BOOL ret;
1279
    BYTE *buf = ((void *)0);
1280
    DWORD size = 0;
1281
    {
1282
    }
1283
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)2), signedBigCert,
1284
     sizeof(signedBigCert), 0x08000, ((void *)0), (BYTE *)&buf, &size);
1285
    {
1286
        CERT_INFO *info = (CERT_INFO *)buf;
1287
        (winetest_set_location("encode.c", 2843), 0) ? 0 : winetest_ok(info->SerialNumber.cbData == 1,
1288
         *info->SerialNumber.pbData);
1289
        (winetest_set_location("encode.c", 2852), 0) ? 0 : winetest_ok(info->Subject.cbData == sizeof(encodedCommonName),
1290
         "Wrong size %d\n", info->Subject.cbData);
1291
        (winetest_set_location("encode.c", 2854), 0) ? 0 : winetest_ok(!memcmp(info->Subject.pbData, encodedCommonName,
1292
         info->Subject.cbData), "Unexpected subject\n");
1293
    }
1294
}
1295
static const BYTE distPointWithUrl[] = { 0x30, 0x19, 0x30, 0x17, 0xa0, 0x15,
1296
 0x6e, 0x65, 0x68, 0x71, 0x2e, 0x6f, 0x72, 0x67 };
1297
static const BYTE distPointWithIssuer[] = { 0x30, 0x17, 0x30, 0x15, 0xa2, 0x13,
1298
 0x2e, 0x6f, 0x72, 0x67 };
1299
static const BYTE crlReason = 1 |
1300
 3;
1301
static void test_encodeCRLDistPoints(DWORD dwEncoding)
1302
{
1303
    CRL_DIST_POINTS_INFO xxxinfo = { 0 };
1304
    CRL_DIST_POINT point = { { 0 } };
1305
    BOOL ret;
1306
    BYTE *buf = ((void *)0);
1307
    DWORD size = 0;
1308
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)35), &xxxinfo,
1309
     "Expected E_INVALIDARG, got %08x\n", GetLastError());
1310
    xxxinfo.cDistPoint = 1;
1311
    xxxinfo.rgDistPoint = &point;
1312
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)35), &xxxinfo,
1313
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1314
    point.ReasonFlags.cbData = sizeof(crlReason);
1315
    {
1316
    }
1317
}
1318
static void test_decodeCRLDistPoints(DWORD dwEncoding)
1319
{
1320
    BOOL ret;
1321
    BYTE *buf = ((void *)0);
1322
    DWORD size = 0;
1323
    PCERT_ALT_NAME_ENTRY entry;
1324
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)35),
1325
     (BYTE *)&buf, &size);
1326
    {
1327
        (winetest_set_location("encode.c", 3065), 0) ? 0 : winetest_ok(entry->dwAltNameChoice == 7,
1328
         "Expected CERT_ALT_NAME_URL, got %d\n", entry->dwAltNameChoice);
1329
    }
1330
}
1331
static const BYTE urlIDP[] = { 0x30,0x17,0xa0,0x15,0xa0,0x13,0x86,0x11,0x68,
1332
 0x67 };
1333
static void test_encodeCRLIssuingDistPoint(DWORD dwEncoding)
1334
{
1335
    BOOL ret;
1336
    BYTE *buf = ((void *)0);
1337
    DWORD size = 0;
1338
    CRL_ISSUING_DIST_POINT point = { { 0 } };
1339
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)54), ((void *)0),
1340
     "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
1341
    {
1342
    }
1343
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)54), &point,
1344
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1345
    {
1346
    }
1347
    {
1348
    }
1349
}
1350
static void compareAltNameEntry(const CERT_ALT_NAME_ENTRY *expected,
1351
 const CERT_ALT_NAME_ENTRY *got)
1352
{
1353
    (winetest_set_location("encode.c", 3149), 0) ? 0 : winetest_ok(expected->dwAltNameChoice == got->dwAltNameChoice,
1354
     got->dwAltNameChoice);
1355
    {
1356
        {
1357
            (winetest_set_location("encode.c", 3161), 0) ? 0 : winetest_ok((!(*expected).pwszURL && !(*got).pwszURL) ||
1358
               !lstrcmpW((*expected).pwszURL, (*got).pwszURL), "Unexpected name\n");
1359
        }
1360
    }
1361
}
1362
static void compareAltNameInfo(const CERT_ALT_NAME_INFO *expected,
1363
 const CERT_ALT_NAME_INFO *got)
1364
{
1365
}
1366
static const BYTE v1CRL[] = { 0x30, 0x15, 0x30, 0x02, 0x06, 0x00, 0x18, 0x0f,
1367
 0x30, 0x5a };
1368
static const BYTE v2CRL[] = { 0x30, 0x18, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06,
1369
 0x30, 0x30, 0x30, 0x30, 0x5a };
1370
static const BYTE v1CRLWithIssuer[] = { 0x30, 0x2c, 0x30, 0x02, 0x06, 0x00,
1371
 0x5a };
1372
static const BYTE v1CRLWithIssuerAndEmptyEntry[] = { 0x30, 0x43, 0x30, 0x02,
1373
 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a };
1374
static const BYTE v1CRLWithIssuerAndEntry[] = { 0x30, 0x44, 0x30, 0x02, 0x06,
1375
 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a };
1376
static const BYTE v1CRLWithEntryExt[] = { 0x30,0x5a,0x30,0x02,0x06,0x00,0x30,
1377
 0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
1378
static const BYTE v1CRLWithExt[] = { 0x30,0x5c,0x30,0x02,0x06,0x00,0x30,0x15,
1379
 0xff,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
1380
static const BYTE v2CRLWithExt[] = { 0x30,0x5c,0x02,0x01,0x01,0x30,0x02,0x06,
1381
 0x13,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
1382
static const BYTE v2CRLWithIssuingDistPoint[] = { 0x30,0x5c,0x02,0x01,0x01,
1383
 0x03,0x55,0x1d,0x13,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
1384
static void test_encodeCRLToBeSigned(DWORD dwEncoding)
1385
{
1386
    BOOL ret;
1387
    BYTE *buf = ((void *)0);
1388
    DWORD size = 0;
1389
    CRL_INFO info = { 0 };
1390
    {
1391
        (winetest_set_location("encode.c", 3386), 0) ? 0 : winetest_ok(size == sizeof(v1CRLWithIssuerAndEntry),
1392
         "Wrong size %d\n", size);
1393
    }
1394
    {
1395
    }
1396
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)3), &info,
1397
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1398
    {
1399
    }
1400
    {
1401
    }
1402
}
1403
static const BYTE verisignCRL[] = { 0x30, 0x82, 0x01, 0xb1, 0x30, 0x82, 0x01,
1404
0x61,0xc0,0x99,0x16,0x71,0x05,0xb6,0x25,0x14,0x64,0x4f,0x30 };
1405
static void test_decodeCRLToBeSigned(DWORD dwEncoding)
1406
{
1407
    BOOL ret;
1408
    BYTE *buf = ((void *)0);
1409
    DWORD size = 0, i;
1410
    {
1411
    }
1412
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
1413
     (BYTE *)&buf, &size);
1414
    {
1415
        CRL_INFO *info = (CRL_INFO *)buf;
1416
        (winetest_set_location("encode.c", 4016), 0) ? 0 : winetest_ok(info->cCRLEntry == 0, "Expected 0 CRL entries, got %d\n",
1417
         "Unexpected issuer\n");
1418
    }
1419
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
1420
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1421
    {
1422
        CRL_INFO *info = (CRL_INFO *)buf;
1423
        (winetest_set_location("encode.c", 4041), 0) ? 0 : winetest_ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %d\n",
1424
         "Unexpected issuer\n");
1425
    }
1426
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
1427
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1428
    {
1429
        CRL_INFO *info = (CRL_INFO *)buf;
1430
        (winetest_set_location("encode.c", 4085), 0) ? 0 : winetest_ok(info->cCRLEntry == 209, "Expected 209 CRL entries, got %d\n",
1431
         info->cExtension);
1432
    }
1433
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
1434
     ((void *)0), (BYTE *)&buf, &size);
1435
    {
1436
    }
1437
}
1438
static const BYTE authorityKeyIdWithIssuer[] = { 0x30,0x19,0xa1,0x17,0x30,0x15,
1439
 0x20,0x4c,0x61,0x6e,0x67,0x00 };
1440
static const BYTE authorityKeyIdWithSerial[] = { 0x30,0x03,0x82,0x01,0x01 };
1441
static void test_encodeAuthorityKeyId(DWORD dwEncoding)
1442
{
1443
    CERT_AUTHORITY_KEY_ID_INFO info = { { 0 } };
1444
    BOOL ret;
1445
    BYTE *buf = ((void *)0);
1446
    DWORD size = 0;
1447
    {
1448
    }
1449
    {
1450
    }
1451
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)9), &info,
1452
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1453
    {
1454
    }
1455
    ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)9), &info,
1456
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1457
    {
1458
        (winetest_set_location("encode.c", 4284), 0) ? 0 : winetest_ok(size == sizeof(authorityKeyIdWithSerial), "Unexpected size %d\n",
1459
         size);
1460
    }
1461
}
1462
static void test_decodeAuthorityKeyId(DWORD dwEncoding)
1463
{
1464
    BOOL ret;
1465
    LPBYTE buf = ((void *)0);
1466
    DWORD size = 0;
1467
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)9),
1468
     (BYTE *)&buf, &size);
1469
    {
1470
    }
1471
    ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)9),
1472
     0x08000, ((void *)0), (BYTE *)&buf, &size);
1473
    {
1474
        (winetest_set_location("encode.c", 4355), 0) ? 0 : winetest_ok(size >= sizeof(CERT_AUTHORITY_KEY_ID_INFO), "Unexpected size %d\n",
1475
         "Unexpected serial number\n");
1476
    }
1477
}
1478
static void testExportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO *pInfo)
1479
{
1480
    BOOL ret;
1481
    DWORD size = 0;
1482
    {
1483
        ret = CryptExportPublicKeyInfoEx(csp, 2, 0x00000001,
1484
         ((void *)0), 0, ((void *)0), ((void *)0), &size);
1485
        {
1486
            {
1487
                (winetest_set_location("encode.c", 4416), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ((*pInfo)->Algorithm.pszObjId) && __builtin_constant_p ("1.2.840.113549.1.1.1") && (__s1_len = strlen ((*pInfo)->Algorithm.pszObjId), __s2_len = strlen ("1.2.840.113549.1.1.1"), (!((size_t)(const void *)(((*pInfo)->Algorithm.pszObjId) + 1) - (size_t)(const void *)((*pInfo)->Algorithm.pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) || __s2_len >= 4)) ? __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1") : (__builtin_constant_p ((*pInfo)->Algorithm.pszObjId) && ((size_t)(const void *)(((*pInfo)->Algorithm.pszObjId) + 1) - (size_t)(const void *)((*pInfo)->Algorithm.pszObjId) == 1) && (__s1_len = strlen ((*pInfo)->Algorithm.pszObjId), __s1_len < 4) ? (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) ? __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"); register int __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) && (__s2_len = strlen ("1.2.840.113549.1.1.1"), __s2_len < 4) ? (__builtin_constant_p ((*pInfo)->Algorithm.pszObjId) && ((size_t)(const void *)(((*pInfo)->Algorithm.pszObjId) + 1) - (size_t)(const void *)((*pInfo)->Algorithm.pszObjId) == 1) ? __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[3]); } } __result; }))) : __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1")))); }),
1488
                 (*pInfo)->Algorithm.pszObjId);
1489
            }
1490
        }
1491
    }
1492
}
1493
static const BYTE expiredCert[] = { 0x30, 0x82, 0x01, 0x33, 0x30, 0x81, 0xe2,
1494
 0x49, 0xe5, 0xf9, 0x65, 0xf3 };
1495
static void testImportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO info)
1496
{
1497
    BOOL ret;
1498
    HCRYPTKEY key;
1499
    PCCERT_CONTEXT context;
1500
    (winetest_set_location("encode.c", 4464), 0) ? 0 : winetest_ok(!ret && GetLastError() == 2,
1501
     GetLastError());
1502
    {
1503
        (winetest_set_location("encode.c", 4485), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ("1.2.840.113549.1.1.1") && __builtin_constant_p (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) && (__s1_len = strlen ("1.2.840.113549.1.1.1"), __s2_len = strlen (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId), (!((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) || __s1_len >= 4) && (!((size_t)(const void *)((context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) + 1) - (size_t)(const void *)(context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) : (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) && (__s1_len = strlen ("1.2.840.113549.1.1.1"), __s1_len < 4) ? (__builtin_constant_p (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) && ((size_t)(const void *)((context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) + 1) - (size_t)(const void *)(context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) == 1) ? __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId); register int __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) && ((size_t)(const void *)((context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) + 1) - (size_t)(const void *)(context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) == 1) && (__s2_len = strlen (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId), __s2_len < 4) ? (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) ? __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[3]); } } __result; }))) : __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId)))); }),
1504
         &context->pCertInfo->SubjectPublicKeyInfo, 0, 0, ((void *)0), &key);
1505
    }
1506
}
1507
static const char cspName[] = "WineCryptTemp";
1508
static void testPortPublicKeyInfo(void)
1509
{
1510
    HCRYPTPROV csp;
1511
    BOOL ret;
1512
    CryptAcquireContextA(&csp, cspName, "Microsoft Base Cryptographic Provider v1.0", 1,
1513
     0x00000008);
1514
    ret = CryptAcquireContextA(&csp, cspName, "Microsoft Base Cryptographic Provider v1.0", 1,
1515
     0x00000010);
1516
}
1517
void func_encode(void)
1518
{
1519
    test_encodeCRLDistPoints(0x00000001);
1520
}
1521
 
1522
/* { dg-final { scan-tree-dump-times " xxxinfo = {}" 1 "dse1"} } */
1523
/* { dg-final { cleanup-tree-dump "dse\[1-2\]" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.