2 * Copyright (c) 2006-2010,2012-2016 Apple Inc. All Rights Reserved.
5 #include <CoreFoundation/CoreFoundation.h>
6 #include <Security/SecCertificate.h>
7 #include <Security/SecCertificatePriv.h>
8 #include <Security/SecPolicy.h>
9 #include <Security/SecTrustPriv.h>
10 #include <utilities/array_size.h>
14 #include "shared_regressions.h"
16 /* subject:/jurisdictionC=US/jurisdictionST=California/businessCategory=Private Organization/serialNumber=C0806592/C=US/postalCode=95014/ST=California/L=Cupertino/street=1 Infinite Loop/O=Apple Inc./OU=GNCS Traffic Management/CN=secure.store.apple.com */
17 /* issuer :/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 EV SSL CA - G3 */
19 // #### NOTE: valid from 16 Apr 2015 to 17 April 2017 ###
20 static unsigned char _c0
[]={
21 0x30,0x82,0x07,0x81,0x30,0x82,0x06,0x69,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x5F,
22 0x7C,0x39,0x94,0x36,0x3A,0x86,0x43,0xAA,0x98,0xD7,0xF2,0xDF,0x6C,0xDB,0x48,0x30,
23 0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x77,
24 0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1D,0x30,
25 0x1B,0x06,0x03,0x55,0x04,0x0A,0x13,0x14,0x53,0x79,0x6D,0x61,0x6E,0x74,0x65,0x63,
26 0x20,0x43,0x6F,0x72,0x70,0x6F,0x72,0x61,0x74,0x69,0x6F,0x6E,0x31,0x1F,0x30,0x1D,
27 0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x53,0x79,0x6D,0x61,0x6E,0x74,0x65,0x63,0x20,
28 0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x28,0x30,
29 0x26,0x06,0x03,0x55,0x04,0x03,0x13,0x1F,0x53,0x79,0x6D,0x61,0x6E,0x74,0x65,0x63,
30 0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x45,0x56,0x20,0x53,0x53,0x4C,0x20,
31 0x43,0x41,0x20,0x2D,0x20,0x47,0x33,0x30,0x1E,0x17,0x0D,0x31,0x35,0x30,0x34,0x31,
32 0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x31,0x37,0x30,0x34,0x31,0x37,
33 0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x82,0x01,0x1C,0x31,0x13,0x30,0x11,0x06,
34 0x0B,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x03,0x13,0x02,0x55,0x53,
35 0x31,0x1B,0x30,0x19,0x06,0x0B,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,
36 0x02,0x0C,0x0A,0x43,0x61,0x6C,0x69,0x66,0x6F,0x72,0x6E,0x69,0x61,0x31,0x1D,0x30,
37 0x1B,0x06,0x03,0x55,0x04,0x0F,0x13,0x14,0x50,0x72,0x69,0x76,0x61,0x74,0x65,0x20,
38 0x4F,0x72,0x67,0x61,0x6E,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x31,0x11,0x30,0x0F,
39 0x06,0x03,0x55,0x04,0x05,0x13,0x08,0x43,0x30,0x38,0x30,0x36,0x35,0x39,0x32,0x31,
40 0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0E,0x30,0x0C,
41 0x06,0x03,0x55,0x04,0x11,0x0C,0x05,0x39,0x35,0x30,0x31,0x34,0x31,0x13,0x30,0x11,
42 0x06,0x03,0x55,0x04,0x08,0x0C,0x0A,0x43,0x61,0x6C,0x69,0x66,0x6F,0x72,0x6E,0x69,
43 0x61,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x07,0x0C,0x09,0x43,0x75,0x70,0x65,
44 0x72,0x74,0x69,0x6E,0x6F,0x31,0x18,0x30,0x16,0x06,0x03,0x55,0x04,0x09,0x0C,0x0F,
45 0x31,0x20,0x49,0x6E,0x66,0x69,0x6E,0x69,0x74,0x65,0x20,0x4C,0x6F,0x6F,0x70,0x31,
46 0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0A,0x41,0x70,0x70,0x6C,0x65,0x20,
47 0x49,0x6E,0x63,0x2E,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x0B,0x0C,0x17,0x47,
48 0x4E,0x43,0x53,0x20,0x54,0x72,0x61,0x66,0x66,0x69,0x63,0x20,0x4D,0x61,0x6E,0x61,
49 0x67,0x65,0x6D,0x65,0x6E,0x74,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x0C,
50 0x16,0x73,0x65,0x63,0x75,0x72,0x65,0x2E,0x73,0x74,0x6F,0x72,0x65,0x2E,0x61,0x70,
51 0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,
52 0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,
53 0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0x8A,0xF0,0x79,0x88,0xDE,0x0A,0x7B,0x1A,
54 0x8C,0xAE,0xE8,0xB5,0xB8,0x5E,0x77,0xFF,0x5D,0x54,0x30,0x8C,0x68,0xDA,0xDC,0x85,
55 0xBC,0x2B,0x55,0x74,0x99,0x5E,0x3A,0x02,0x1B,0xE5,0xE4,0xE1,0x22,0x21,0xF0,0x43,
56 0x7D,0x92,0x6B,0xAB,0xC8,0xF1,0x11,0x27,0x9C,0x49,0x24,0x98,0x8A,0xB4,0x39,0xD6,
57 0x5A,0x47,0x29,0x21,0x5D,0xFB,0x90,0x0B,0x3C,0xE1,0x4C,0xEF,0x55,0x2F,0xC4,0xD0,
58 0x1F,0x14,0xFB,0x80,0x63,0xCB,0xAA,0x5C,0x59,0xAD,0x03,0x48,0xB5,0x2B,0xE4,0xD5,
59 0x89,0xE9,0x6B,0xCA,0x7E,0x2A,0x26,0x80,0x90,0xC3,0x57,0xEB,0xA7,0xF9,0x9A,0x13,
60 0x37,0x6F,0xA7,0x7D,0x28,0x8D,0x30,0xCB,0x09,0x6B,0xD7,0xBC,0x94,0x0D,0xDD,0x35,
61 0x86,0xD6,0xEA,0x0B,0x4F,0x97,0xCF,0x4E,0x13,0x49,0x3B,0x3C,0xC8,0xA1,0x54,0x3F,
62 0x8F,0x51,0xD5,0x11,0x77,0xEB,0xB6,0x40,0x94,0xB3,0x96,0xDE,0x76,0x72,0x99,0x33,
63 0xA4,0x63,0xD6,0xE8,0x9C,0xF3,0xAA,0xEB,0xB9,0x37,0xB2,0xED,0x3F,0x46,0x24,0x19,
64 0x7D,0x2B,0xF7,0x73,0x47,0xC9,0x9A,0xC6,0x67,0x26,0x53,0x6F,0xE6,0x2A,0xE0,0x38,
65 0x1F,0x64,0x7E,0x9F,0x27,0x77,0x55,0xA2,0x0C,0x94,0xE2,0x8A,0x8A,0x57,0xEA,0xF4,
66 0xE8,0xE4,0x6E,0x68,0x78,0x8F,0x6F,0x26,0x5B,0x29,0xFB,0xD4,0xA5,0xC5,0x8B,0x9F,
67 0xE6,0x02,0xF1,0x31,0x37,0x56,0xFE,0xB6,0xD4,0x3E,0xCC,0xE7,0x28,0x07,0x89,0xC3,
68 0xD8,0x51,0x83,0x9B,0x5A,0x2F,0x41,0x54,0x9D,0xDF,0x48,0x6A,0x8F,0x1D,0xC1,0x4F,
69 0x6B,0x4A,0x57,0x2C,0x09,0xF4,0x80,0x73,0x02,0x03,0x01,0x00,0x01,0xA3,0x82,0x03,
70 0x60,0x30,0x82,0x03,0x5C,0x30,0x81,0x8C,0x06,0x03,0x55,0x1D,0x11,0x04,0x81,0x84,
71 0x30,0x81,0x81,0x82,0x19,0x73,0x65,0x63,0x75,0x72,0x65,0x2E,0x6E,0x63,0x2D,0x73,
72 0x74,0x6F,0x72,0x65,0x2E,0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x82,0x1A,
73 0x73,0x65,0x63,0x75,0x72,0x65,0x2E,0x6E,0x77,0x6B,0x2D,0x73,0x74,0x6F,0x72,0x65,
74 0x2E,0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x82,0x16,0x73,0x65,0x63,0x75,
75 0x72,0x65,0x2E,0x73,0x74,0x6F,0x72,0x65,0x2E,0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,
76 0x6F,0x6D,0x82,0x17,0x73,0x65,0x63,0x75,0x72,0x65,0x31,0x2E,0x73,0x74,0x6F,0x72,
77 0x65,0x2E,0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x82,0x17,0x73,0x65,0x63,
78 0x75,0x72,0x65,0x32,0x2E,0x73,0x74,0x6F,0x72,0x65,0x2E,0x61,0x70,0x70,0x6C,0x65,
79 0x2E,0x63,0x6F,0x6D,0x30,0x09,0x06,0x03,0x55,0x1D,0x13,0x04,0x02,0x30,0x00,0x30,
80 0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x05,0xA0,0x30,
81 0x1D,0x06,0x03,0x55,0x1D,0x25,0x04,0x16,0x30,0x14,0x06,0x08,0x2B,0x06,0x01,0x05,
82 0x05,0x07,0x03,0x01,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,0x30,0x66,
83 0x06,0x03,0x55,0x1D,0x20,0x04,0x5F,0x30,0x5D,0x30,0x5B,0x06,0x0B,0x60,0x86,0x48,
84 0x01,0x86,0xF8,0x45,0x01,0x07,0x17,0x06,0x30,0x4C,0x30,0x23,0x06,0x08,0x2B,0x06,
85 0x01,0x05,0x05,0x07,0x02,0x01,0x16,0x17,0x68,0x74,0x74,0x70,0x73,0x3A,0x2F,0x2F,
86 0x64,0x2E,0x73,0x79,0x6D,0x63,0x62,0x2E,0x63,0x6F,0x6D,0x2F,0x63,0x70,0x73,0x30,
87 0x25,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x02,0x30,0x19,0x1A,0x17,0x68,
88 0x74,0x74,0x70,0x73,0x3A,0x2F,0x2F,0x64,0x2E,0x73,0x79,0x6D,0x63,0x62,0x2E,0x63,
89 0x6F,0x6D,0x2F,0x72,0x70,0x61,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,
90 0x16,0x80,0x14,0x01,0x59,0xAB,0xE7,0xDD,0x3A,0x0B,0x59,0xA6,0x64,0x63,0xD6,0xCF,
91 0x20,0x07,0x57,0xD5,0x91,0xE7,0x6A,0x30,0x2B,0x06,0x03,0x55,0x1D,0x1F,0x04,0x24,
92 0x30,0x22,0x30,0x20,0xA0,0x1E,0xA0,0x1C,0x86,0x1A,0x68,0x74,0x74,0x70,0x3A,0x2F,
93 0x2F,0x73,0x72,0x2E,0x73,0x79,0x6D,0x63,0x62,0x2E,0x63,0x6F,0x6D,0x2F,0x73,0x72,
94 0x2E,0x63,0x72,0x6C,0x30,0x57,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x01,
95 0x04,0x4B,0x30,0x49,0x30,0x1F,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,
96 0x86,0x13,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x73,0x72,0x2E,0x73,0x79,0x6D,0x63,
97 0x64,0x2E,0x63,0x6F,0x6D,0x30,0x26,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x30,
98 0x02,0x86,0x1A,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x73,0x72,0x2E,0x73,0x79,0x6D,
99 0x63,0x62,0x2E,0x63,0x6F,0x6D,0x2F,0x73,0x72,0x2E,0x63,0x72,0x74,0x30,0x82,0x01,
100 0x80,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0xD6,0x79,0x02,0x04,0x02,0x04,0x82,0x01,
101 0x70,0x04,0x82,0x01,0x6C,0x01,0x6A,0x00,0x76,0x00,0xA4,0xB9,0x09,0x90,0xB4,0x18,
102 0x58,0x14,0x87,0xBB,0x13,0xA2,0xCC,0x67,0x70,0x0A,0x3C,0x35,0x98,0x04,0xF9,0x1B,
103 0xDF,0xB8,0xE3,0x77,0xCD,0x0E,0xC8,0x0D,0xDC,0x10,0x00,0x00,0x01,0x4C,0xC9,0xBC,
104 0xCE,0x1F,0x00,0x00,0x04,0x03,0x00,0x47,0x30,0x45,0x02,0x20,0x46,0xBB,0x30,0x0F,
105 0x9D,0x24,0xA2,0xDB,0x55,0x3C,0xB8,0x40,0x82,0x53,0x3B,0x46,0xD3,0x79,0xF8,0x30,
106 0x3E,0xC6,0x8D,0x5A,0x2E,0x2D,0x81,0x31,0xAA,0x56,0x52,0x38,0x02,0x21,0x00,0xF3,
107 0x83,0xCD,0x9A,0xD5,0xD3,0x94,0x7F,0xB2,0x57,0xDA,0xC9,0xD5,0xAC,0x3C,0x86,0x19,
108 0xC2,0x8F,0x7C,0x54,0x51,0xED,0x1A,0xA3,0x6B,0x6C,0x78,0x40,0xD6,0x5C,0xD2,0x00,
109 0x77,0x00,0x56,0x14,0x06,0x9A,0x2F,0xD7,0xC2,0xEC,0xD3,0xF5,0xE1,0xBD,0x44,0xB2,
110 0x3E,0xC7,0x46,0x76,0xB9,0xBC,0x99,0x11,0x5C,0xC0,0xEF,0x94,0x98,0x55,0xD6,0x89,
111 0xD0,0xDD,0x00,0x00,0x01,0x4C,0xC9,0xBC,0xCF,0x0C,0x00,0x00,0x04,0x03,0x00,0x48,
112 0x30,0x46,0x02,0x21,0x00,0xCE,0x7C,0x18,0x1B,0xD8,0x76,0x19,0x5E,0xEC,0x96,0x29,
113 0x04,0xA8,0x8A,0xCC,0x09,0xDE,0x8D,0x44,0x92,0x73,0xB1,0x6E,0x51,0xC5,0x7C,0xEF,
114 0xCD,0x3B,0xD6,0x71,0xED,0x02,0x21,0x00,0xF9,0x7A,0x53,0x68,0x24,0x14,0x3B,0xB3,
115 0xFF,0x6B,0x67,0xFB,0x34,0x07,0x85,0xA2,0xD1,0x04,0xE1,0x8E,0x5A,0x6E,0xE6,0xFB,
116 0xEA,0x8E,0x04,0x79,0x3E,0x2E,0xF1,0xD7,0x00,0x77,0x00,0x68,0xF6,0x98,0xF8,0x1F,
117 0x64,0x82,0xBE,0x3A,0x8C,0xEE,0xB9,0x28,0x1D,0x4C,0xFC,0x71,0x51,0x5D,0x67,0x93,
118 0xD4,0x44,0xD1,0x0A,0x67,0xAC,0xBB,0x4F,0x4F,0xFB,0xC4,0x00,0x00,0x01,0x4C,0xC9,
119 0xBC,0xCE,0x43,0x00,0x00,0x04,0x03,0x00,0x48,0x30,0x46,0x02,0x21,0x00,0xE4,0x56,
120 0x75,0xAE,0x7E,0xD9,0x7C,0x82,0x93,0x4E,0xA4,0x77,0x6C,0x79,0x17,0xE6,0x2D,0x0A,
121 0x0C,0xFC,0x68,0x83,0x83,0xDC,0x38,0x7F,0x03,0x6D,0xB9,0xFC,0x17,0x13,0x02,0x21,
122 0x00,0xDE,0x03,0x66,0x65,0x43,0xFF,0x1A,0x7C,0x14,0x86,0x78,0xB3,0xA5,0xF0,0xBA,
123 0x97,0xA7,0x8A,0xE5,0x44,0xCF,0x65,0x7B,0xDB,0x6A,0x54,0x0D,0x4E,0x8D,0x9C,0x12,
124 0xDF,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,
125 0x03,0x82,0x01,0x01,0x00,0xC9,0x38,0xED,0x91,0x34,0x2D,0xE5,0x99,0x30,0xCC,0xBE,
126 0x64,0x95,0xE1,0xB4,0xBC,0x6D,0x25,0xC3,0x9B,0x09,0xD6,0xE3,0x32,0x1B,0x7B,0xE3,
127 0xCE,0x57,0xB2,0xB4,0x42,0x74,0xAD,0x59,0x89,0x44,0x7B,0x73,0xF1,0x45,0x75,0x1C,
128 0x12,0x34,0xC4,0x10,0x6C,0x16,0x28,0x00,0xD2,0xFE,0xFD,0xB6,0x5F,0xB3,0xDF,0x11,
129 0x0E,0xBE,0x62,0xC8,0xA2,0x5D,0xC2,0x23,0xFD,0xCD,0x4E,0x49,0xCB,0xBA,0xC5,0x6A,
130 0xFB,0xA3,0x47,0x5A,0x3C,0x2B,0xCD,0xB7,0x39,0xED,0xB7,0x05,0x00,0x46,0x86,0xE3,
131 0x7A,0x71,0x58,0x85,0x4C,0xD9,0x17,0x5D,0xFD,0xDC,0xB2,0x22,0xE1,0x05,0x13,0x22,
132 0x74,0x11,0x4E,0x8A,0x27,0x13,0x46,0x7E,0xF4,0xA5,0x6E,0x4E,0x9A,0xEF,0x73,0x1F,
133 0x44,0x4C,0x3C,0xD7,0x48,0xC8,0x5C,0xEF,0x39,0xEA,0x8C,0x09,0xBA,0x19,0x14,0x45,
134 0x0F,0x61,0x43,0x9E,0x7F,0xEA,0xD9,0xD8,0xD8,0xE3,0x96,0xA3,0x82,0x31,0x2D,0x1C,
135 0x25,0x4E,0xC3,0x9E,0xDD,0xAB,0xEF,0x2A,0xC2,0x7E,0x35,0x24,0x8F,0x75,0xED,0x03,
136 0x83,0x61,0x24,0xF8,0xC1,0x4F,0x48,0xD5,0x54,0xB5,0xA4,0x4A,0x1C,0x9B,0x8F,0x25,
137 0x51,0x9A,0xC2,0xE8,0x98,0x84,0x83,0x45,0x71,0xB0,0x5E,0x6B,0x91,0x61,0xA9,0xDA,
138 0xF5,0x0E,0xB9,0xA8,0x2D,0x2D,0x94,0x42,0xA5,0xF4,0xBE,0x7B,0xD3,0x19,0x8E,0xCD,
139 0x4A,0xB6,0x47,0x9E,0x54,0x5D,0xD7,0x3C,0x69,0x01,0x44,0x15,0x09,0xDA,0xA8,0x89,
140 0x87,0x1A,0x73,0x7A,0x13,0xC7,0x0F,0xA9,0xB7,0x75,0x3D,0x3A,0x27,0x4C,0x49,0x08,
141 0xC7,0xE7,0xE9,0x6F,0xD9,
144 /* subject:/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 EV SSL CA - G3 */
145 /* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 */
147 static unsigned char _c1
[]={
148 0x30,0x82,0x05,0x2B,0x30,0x82,0x04,0x13,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x7E,
149 0xE1,0x4A,0x6F,0x6F,0xEF,0xF2,0xD3,0x7F,0x3F,0xAD,0x65,0x4D,0x3A,0xDA,0xB4,0x30,
150 0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x81,
151 0xCA,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,
152 0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,
153 0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,
154 0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,
155 0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,
156 0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x56,0x65,0x72,0x69,
157 0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,
158 0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,
159 0x6F,0x6E,0x6C,0x79,0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,
160 0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,
161 0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,
162 0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,
163 0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x35,0x30,0x1E,0x17,0x0D,0x31,
164 0x33,0x31,0x30,0x33,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x33,
165 0x31,0x30,0x33,0x30,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x77,0x31,0x0B,0x30,
166 0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1D,0x30,0x1B,0x06,0x03,
167 0x55,0x04,0x0A,0x13,0x14,0x53,0x79,0x6D,0x61,0x6E,0x74,0x65,0x63,0x20,0x43,0x6F,
168 0x72,0x70,0x6F,0x72,0x61,0x74,0x69,0x6F,0x6E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,
169 0x04,0x0B,0x13,0x16,0x53,0x79,0x6D,0x61,0x6E,0x74,0x65,0x63,0x20,0x54,0x72,0x75,
170 0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x28,0x30,0x26,0x06,0x03,
171 0x55,0x04,0x03,0x13,0x1F,0x53,0x79,0x6D,0x61,0x6E,0x74,0x65,0x63,0x20,0x43,0x6C,
172 0x61,0x73,0x73,0x20,0x33,0x20,0x45,0x56,0x20,0x53,0x53,0x4C,0x20,0x43,0x41,0x20,
173 0x2D,0x20,0x47,0x33,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,
174 0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,
175 0x02,0x82,0x01,0x01,0x00,0xD8,0xA1,0x65,0x74,0x23,0xE8,0x2B,0x64,0xE2,0x32,0xD7,
176 0x33,0x37,0x3D,0x8E,0xF5,0x34,0x16,0x48,0xDD,0x4F,0x7F,0x87,0x1C,0xF8,0x44,0x23,
177 0x13,0x8E,0xFB,0x11,0xD8,0x44,0x5A,0x18,0x71,0x8E,0x60,0x16,0x26,0x92,0x9B,0xFD,
178 0x17,0x0B,0xE1,0x71,0x70,0x42,0xFE,0xBF,0xFA,0x1C,0xC0,0xAA,0xA3,0xA7,0xB5,0x71,
179 0xE8,0xFF,0x18,0x83,0xF6,0xDF,0x10,0x0A,0x13,0x62,0xC8,0x3D,0x9C,0xA7,0xDE,0x2E,
180 0x3F,0x0C,0xD9,0x1D,0xE7,0x2E,0xFB,0x2A,0xCE,0xC8,0x9A,0x7F,0x87,0xBF,0xD8,0x4C,
181 0x04,0x15,0x32,0xC9,0xD1,0xCC,0x95,0x71,0xA0,0x4E,0x28,0x4F,0x84,0xD9,0x35,0xFB,
182 0xE3,0x86,0x6F,0x94,0x53,0xE6,0x72,0x8A,0x63,0x67,0x2E,0xBE,0x69,0xF6,0xF7,0x6E,
183 0x8E,0x9C,0x60,0x04,0xEB,0x29,0xFA,0xC4,0x47,0x42,0xD2,0x78,0x98,0xE3,0xEC,0x0B,
184 0xA5,0x92,0xDC,0xB7,0x9A,0xBD,0x80,0x64,0x2B,0x38,0x7C,0x38,0x09,0x5B,0x66,0xF6,
185 0x2D,0x95,0x7A,0x86,0xB2,0x34,0x2E,0x85,0x9E,0x90,0x0E,0x5F,0xB7,0x5D,0xA4,0x51,
186 0x72,0x46,0x70,0x13,0xBF,0x67,0xF2,0xB6,0xA7,0x4D,0x14,0x1E,0x6C,0xB9,0x53,0xEE,
187 0x23,0x1A,0x4E,0x8D,0x48,0x55,0x43,0x41,0xB1,0x89,0x75,0x6A,0x40,0x28,0xC5,0x7D,
188 0xDD,0xD2,0x6E,0xD2,0x02,0x19,0x2F,0x7B,0x24,0x94,0x4B,0xEB,0xF1,0x1A,0xA9,0x9B,
189 0xE3,0x23,0x9A,0xEA,0xFA,0x33,0xAB,0x0A,0x2C,0xB7,0xF4,0x60,0x08,0xDD,0x9F,0x1C,
190 0xCD,0xDD,0x2D,0x01,0x66,0x80,0xAF,0xB3,0x2F,0x29,0x1D,0x23,0xB8,0x8A,0xE1,0xA1,
191 0x70,0x07,0x0C,0x34,0x0F,0x02,0x03,0x01,0x00,0x01,0xA3,0x82,0x01,0x5D,0x30,0x82,
192 0x01,0x59,0x30,0x2F,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x01,0x04,0x23,
193 0x30,0x21,0x30,0x1F,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x86,0x13,
194 0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x73,0x32,0x2E,0x73,0x79,0x6D,0x63,0x62,0x2E,
195 0x63,0x6F,0x6D,0x30,0x12,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x08,0x30,
196 0x06,0x01,0x01,0xFF,0x02,0x01,0x00,0x30,0x65,0x06,0x03,0x55,0x1D,0x20,0x04,0x5E,
197 0x30,0x5C,0x30,0x5A,0x06,0x04,0x55,0x1D,0x20,0x00,0x30,0x52,0x30,0x26,0x06,0x08,
198 0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x01,0x16,0x1A,0x68,0x74,0x74,0x70,0x3A,0x2F,
199 0x2F,0x77,0x77,0x77,0x2E,0x73,0x79,0x6D,0x61,0x75,0x74,0x68,0x2E,0x63,0x6F,0x6D,
200 0x2F,0x63,0x70,0x73,0x30,0x28,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x02,
201 0x30,0x1C,0x1A,0x1A,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x73,
202 0x79,0x6D,0x61,0x75,0x74,0x68,0x2E,0x63,0x6F,0x6D,0x2F,0x72,0x70,0x61,0x30,0x30,
203 0x06,0x03,0x55,0x1D,0x1F,0x04,0x29,0x30,0x27,0x30,0x25,0xA0,0x23,0xA0,0x21,0x86,
204 0x1F,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x73,0x31,0x2E,0x73,0x79,0x6D,0x63,0x62,
205 0x2E,0x63,0x6F,0x6D,0x2F,0x70,0x63,0x61,0x33,0x2D,0x67,0x35,0x2E,0x63,0x72,0x6C,
206 0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,
207 0x30,0x29,0x06,0x03,0x55,0x1D,0x11,0x04,0x22,0x30,0x20,0xA4,0x1E,0x30,0x1C,0x31,
208 0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x03,0x13,0x11,0x53,0x79,0x6D,0x61,0x6E,0x74,
209 0x65,0x63,0x50,0x4B,0x49,0x2D,0x31,0x2D,0x35,0x33,0x33,0x30,0x1D,0x06,0x03,0x55,
210 0x1D,0x0E,0x04,0x16,0x04,0x14,0x01,0x59,0xAB,0xE7,0xDD,0x3A,0x0B,0x59,0xA6,0x64,
211 0x63,0xD6,0xCF,0x20,0x07,0x57,0xD5,0x91,0xE7,0x6A,0x30,0x1F,0x06,0x03,0x55,0x1D,
212 0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x7F,0xD3,0x65,0xA7,0xC2,0xDD,0xEC,0xBB,0xF0,
213 0x30,0x09,0xF3,0x43,0x39,0xFA,0x02,0xAF,0x33,0x31,0x33,0x30,0x0D,0x06,0x09,0x2A,
214 0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x42,
215 0x01,0x55,0x7B,0xD0,0x16,0x1A,0x5D,0x58,0xE8,0xBB,0x9B,0xA8,0x4D,0xD7,0xF3,0xD7,
216 0xEB,0x13,0x94,0x86,0xD6,0x7F,0x21,0x0B,0x47,0xBC,0x57,0x9B,0x92,0x5D,0x4F,0x05,
217 0x9F,0x38,0xA4,0x10,0x7C,0xCF,0x83,0xBE,0x06,0x43,0x46,0x8D,0x08,0xBC,0x6A,0xD7,
218 0x10,0xA6,0xFA,0xAB,0xAF,0x2F,0x61,0xA8,0x63,0xF2,0x65,0xDF,0x7F,0x4C,0x88,0x12,
219 0x88,0x4F,0xB3,0x69,0xD9,0xFF,0x27,0xC0,0x0A,0x97,0x91,0x8F,0x56,0xFB,0x89,0xC4,
220 0xA8,0xBB,0x92,0x2D,0x1B,0x73,0xB0,0xC6,0xAB,0x36,0xF4,0x96,0x6C,0x20,0x08,0xEF,
221 0x0A,0x1E,0x66,0x24,0x45,0x4F,0x67,0x00,0x40,0xC8,0x07,0x54,0x74,0x33,0x3B,0xA6,
222 0xAD,0xBB,0x23,0x9F,0x66,0xED,0xA2,0x44,0x70,0x34,0xFB,0x0E,0xEA,0x01,0xFD,0xCF,
223 0x78,0x74,0xDF,0xA7,0xAD,0x55,0xB7,0x5F,0x4D,0xF6,0xD6,0x3F,0xE0,0x86,0xCE,0x24,
224 0xC7,0x42,0xA9,0x13,0x14,0x44,0x35,0x4B,0xB6,0xDF,0xC9,0x60,0xAC,0x0C,0x7F,0xD9,
225 0x93,0x21,0x4B,0xEE,0x9C,0xE4,0x49,0x02,0x98,0xD3,0x60,0x7B,0x5C,0xBC,0xD5,0x30,
226 0x2F,0x07,0xCE,0x44,0x42,0xC4,0x0B,0x99,0xFE,0xE6,0x9F,0xFC,0xB0,0x78,0x86,0x51,
227 0x6D,0xD1,0x2C,0x9D,0xC6,0x96,0xFB,0x85,0x82,0xBB,0x04,0x2F,0xF7,0x62,0x80,0xEF,
228 0x62,0xDA,0x7F,0xF6,0x0E,0xAC,0x90,0xB8,0x56,0xBD,0x79,0x3F,0xF2,0x80,0x6E,0xA3,
229 0xD9,0xB9,0x0F,0x5D,0x3A,0x07,0x1D,0x91,0x93,0x86,0x4B,0x29,0x4C,0xE1,0xDC,0xB5,
230 0xE1,0xE0,0x33,0x9D,0xB3,0xCB,0x36,0x91,0x4B,0xFE,0xA1,0xB4,0xEE,0xF0,0xF9,
233 /* subject:/CN=self-signed.ssltest.apple.com/C=US */
234 /* issuer :/CN=self-signed.ssltest.apple.com/C=US */
236 static unsigned char _ss0
[]={
237 0x30,0x82,0x03,0x0F,0x30,0x82,0x01,0xF7,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01,
238 0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,
239 0x35,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x03,0x0C,0x1D,0x73,0x65,0x6C,0x66,
240 0x2D,0x73,0x69,0x67,0x6E,0x65,0x64,0x2E,0x73,0x73,0x6C,0x74,0x65,0x73,0x74,0x2E,
241 0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,
242 0x04,0x06,0x13,0x02,0x55,0x53,0x30,0x1E,0x17,0x0D,0x31,0x36,0x30,0x36,0x30,0x37,
243 0x32,0x31,0x35,0x33,0x30,0x38,0x5A,0x17,0x0D,0x31,0x37,0x30,0x36,0x30,0x37,0x32,
244 0x31,0x35,0x33,0x30,0x38,0x5A,0x30,0x35,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,
245 0x03,0x0C,0x1D,0x73,0x65,0x6C,0x66,0x2D,0x73,0x69,0x67,0x6E,0x65,0x64,0x2E,0x73,
246 0x73,0x6C,0x74,0x65,0x73,0x74,0x2E,0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,
247 0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x30,0x82,0x01,
248 0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,
249 0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xCC,0x72,
250 0x7D,0x09,0x36,0x5A,0x6A,0xED,0xC1,0x7A,0x2C,0xF4,0x7C,0x58,0x63,0x05,0x3E,0x91,
251 0x68,0x55,0xB1,0x2A,0x5D,0x57,0xF3,0xA4,0xA7,0x80,0x05,0x41,0x74,0xB2,0xAD,0x5A,
252 0x7F,0x38,0xF6,0xF7,0xFD,0xF9,0x64,0x4D,0xDE,0xF9,0x7A,0xD3,0x8C,0x78,0xE9,0x71,
253 0xCF,0x1D,0x3E,0xF0,0xDB,0x12,0x48,0x74,0x22,0xA8,0x1F,0x3F,0xB9,0xDD,0xB0,0xAD,
254 0x8C,0x10,0x64,0x05,0x0E,0xE2,0x59,0x9A,0xEB,0x3F,0xBF,0xA9,0x48,0x07,0xD9,0x2C,
255 0x07,0x44,0x70,0x14,0x16,0x56,0x9C,0x73,0x01,0x2E,0x0B,0xF1,0x2A,0x9F,0x1C,0xC6,
256 0x78,0x56,0xB7,0x0B,0xDA,0xA6,0xE6,0x99,0x87,0x2D,0x49,0xFB,0xF0,0x47,0x22,0xA6,
257 0x8B,0xF0,0x02,0x37,0x31,0xD0,0x34,0x9F,0x43,0xD1,0x24,0x49,0x94,0x7F,0xFD,0x48,
258 0x9C,0xBA,0x5D,0x6B,0xD4,0xF9,0x9E,0xB5,0x18,0xE4,0xB2,0x06,0x46,0xC3,0xD9,0xE7,
259 0x80,0xD8,0x61,0xA9,0x09,0x5E,0xBA,0x2E,0x58,0x56,0xAE,0x37,0x31,0x6E,0x87,0x98,
260 0xD5,0xC9,0x2B,0x31,0x5C,0x40,0x01,0xDF,0xD5,0x63,0x9E,0x05,0x18,0x21,0x53,0x70,
261 0x62,0x36,0x44,0xCD,0x02,0xC0,0xCC,0x6A,0x58,0xC6,0xF6,0xA4,0xDC,0x89,0x94,0xBD,
262 0x4E,0xC4,0xEE,0xEE,0x40,0x31,0x59,0xC3,0x43,0xAD,0x34,0x30,0xDE,0xA9,0xA7,0x0D,
263 0x85,0xF7,0x96,0x8C,0x45,0xC1,0x6E,0x85,0x39,0x97,0xA6,0x4F,0xEA,0xE8,0x2F,0x01,
264 0x3D,0xC0,0x3B,0x34,0x9F,0x8F,0xCB,0xD6,0x22,0x79,0x2C,0x8C,0x8C,0xE6,0xBB,0x1F,
265 0x89,0x87,0x93,0x3B,0x39,0x4E,0x64,0x7D,0xDA,0x4D,0x52,0x4C,0x97,0xE5,0x02,0x03,
266 0x01,0x00,0x01,0xA3,0x2A,0x30,0x28,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,
267 0xFF,0x04,0x04,0x03,0x02,0x07,0x80,0x30,0x16,0x06,0x03,0x55,0x1D,0x25,0x01,0x01,
268 0xFF,0x04,0x0C,0x30,0x0A,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,0x30,
269 0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,
270 0x01,0x01,0x00,0x36,0x06,0xC9,0xE6,0x98,0xC2,0x84,0x1D,0x13,0x1E,0x54,0x35,0x6D,
271 0xE5,0xCB,0xC5,0xFD,0xD9,0x54,0x45,0x83,0x53,0xB3,0x3B,0xE7,0x30,0x6F,0xAE,0xEA,
272 0x63,0x3F,0xA8,0xFA,0xD9,0x6D,0x0F,0x7D,0xD4,0xB6,0x28,0x66,0xF9,0x57,0x87,0x3E,
273 0x57,0x27,0xB6,0x9A,0x56,0xAE,0xD7,0xE0,0x11,0x20,0x71,0xC1,0xEA,0xF6,0xED,0x74,
274 0x1A,0x5A,0xB1,0x74,0x6C,0xBE,0xAC,0x0E,0x3C,0xD9,0x3E,0xEC,0x17,0x6E,0xF0,0x69,
275 0xC9,0x4D,0xD2,0x7E,0xAE,0x8B,0x01,0xCC,0x1A,0x23,0x7C,0x58,0x07,0x30,0xE4,0x2A,
276 0x12,0xE8,0xA0,0x25,0x65,0x66,0xB5,0xC7,0x5D,0xD8,0x47,0xDF,0xD7,0x51,0xBC,0xA2,
277 0xAA,0xF0,0x2F,0xB5,0x9E,0x20,0x6D,0x1F,0x84,0x00,0xF0,0xD0,0xB8,0x42,0x6A,0x9A,
278 0xE7,0xCA,0x7B,0xE5,0x39,0x09,0x91,0xBF,0xCB,0x4D,0x7A,0x32,0x1E,0x00,0x6E,0xE5,
279 0xF7,0x44,0x80,0x82,0x38,0x53,0x64,0xB7,0x26,0x81,0xCB,0xCE,0xA1,0xAF,0x0C,0x67,
280 0x32,0xC6,0xE4,0x5D,0x09,0x7B,0x37,0xD7,0xC8,0x43,0x44,0xEF,0xC6,0xF8,0x72,0xFF,
281 0x65,0xD4,0x39,0x3D,0xEC,0x72,0xA5,0x28,0xFF,0x70,0x47,0x38,0xA3,0xC7,0xCC,0x5E,
282 0x0F,0xFF,0x43,0x83,0x78,0x49,0x68,0x90,0x48,0x89,0xAD,0xE1,0x2E,0xFA,0x8F,0x59,
283 0xB6,0x08,0x2A,0x72,0x2F,0x52,0x3F,0x73,0x84,0xCA,0xD8,0x18,0x6C,0xDA,0xA3,0x2E,
284 0xF2,0xD7,0x4C,0x21,0xD9,0xF8,0xB1,0x86,0xE9,0x35,0x78,0xE4,0x4F,0xD0,0x93,0x11,
285 0x8F,0xF4,0xB1,0x17,0x4F,0xDE,0xAC,0xBD,0xA9,0xBC,0x94,0xFC,0x2E,0x7D,0xF9,0x05,
289 #define CFReleaseSafe(CF) { CFTypeRef _cf = (CF); if (_cf) CFRelease(_cf); }
290 #define CFReleaseNull(CF) { CFTypeRef _cf = (CF); if (_cf) { (CF) = NULL; CFRelease(_cf); } }
292 /* Test basic add delete update copy matching stuff. */
293 static void tests(void)
296 SecCertificateRef cert0
, cert1
, sscert0
;
297 CFArrayRef anchors
= NULL
;
298 isnt(cert0
= SecCertificateCreateWithBytes(NULL
, _c0
, sizeof(_c0
)),
299 NULL
, "create cert0");
300 isnt(cert1
= SecCertificateCreateWithBytes(NULL
, _c1
, sizeof(_c1
)),
301 NULL
, "create cert1");
302 isnt(sscert0
= SecCertificateCreateWithBytes(NULL
, _ss0
, sizeof(_ss0
)),
303 NULL
, "create sscert0");
304 const void *v_certs
[] = {
308 SecPolicyRef policy
= SecPolicyCreateSSL(false, CFSTR("secure.store.apple.com"));
309 CFArrayRef certs
= CFArrayCreate(NULL
, v_certs
,
310 array_size(v_certs
), NULL
);
311 ok_status(SecTrustCreateWithCertificates(certs
, policy
, &trust
), "create trust");
313 CFDateRef date
= CFDateCreate(NULL
, 455843208.0);
314 ok_status(SecTrustSetVerifyDate(trust
, date
), "set date");
316 SecTrustResultType trustResult
;
317 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
318 is_status(trustResult
, kSecTrustResultUnspecified
,
319 "trust is kSecTrustResultUnspecified");
320 CFDataRef exceptions
;
321 ok(exceptions
= SecTrustCopyExceptions(trust
), "create exceptions");
322 if (!exceptions
) { goto errOut
; }
323 ok(SecTrustSetExceptions(trust
, exceptions
), "set exceptions");
324 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
325 is_status(trustResult
, kSecTrustResultProceed
, "trust is kSecTrustResultProceed");
327 CFReleaseNull(trust
);
328 CFReleaseNull(policy
);
329 policy
= SecPolicyCreateSSL(false, CFSTR("badstore.apple.com"));
330 ok_status(SecTrustCreateWithCertificates(certs
, policy
, &trust
), "create trust with hostname mismatch");
331 ok_status(SecTrustSetVerifyDate(trust
, date
), "set date");
332 ok(SecTrustSetExceptions(trust
, exceptions
), "set old exceptions");
333 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
334 is_status(trustResult
, kSecTrustResultRecoverableTrustFailure
, "trust is kSecTrustResultRecoverableTrustFailure");
335 CFReleaseNull(exceptions
);
336 ok(exceptions
= SecTrustCopyExceptions(trust
), "create exceptions");
337 if (!exceptions
) { goto errOut
; }
338 ok(SecTrustSetExceptions(trust
, exceptions
), "set exceptions");
339 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
340 is_status(trustResult
, kSecTrustResultProceed
, "trust is kSecTrustResultProceed");
342 CFReleaseNull(trust
);
343 ok_status(SecTrustCreateWithCertificates(certs
, policy
, &trust
), "create trust");
344 ok_status(SecTrustSetVerifyDate(trust
, date
), "set date");
345 ok(SecTrustSetExceptions(trust
, exceptions
), "set exceptions");
346 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
347 is_status(trustResult
, kSecTrustResultProceed
, "trust is kSecTrustResultProceed");
348 anchors
= CFArrayCreate(kCFAllocatorDefault
, NULL
, 0, &kCFTypeArrayCallBacks
);
349 ok_status(SecTrustSetAnchorCertificates(trust
, anchors
), "set empty anchor list");
350 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
351 is_status(trustResult
, kSecTrustResultRecoverableTrustFailure
, "trust is kSecTrustResultRecoverableTrustFailure");
353 ok_status(SecTrustSetAnchorCertificatesOnly(trust
, false), "trust passed in anchors and system anchors");
354 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
355 is_status(trustResult
, kSecTrustResultProceed
, "trust is now kSecTrustResultProceed");
357 ok_status(SecTrustSetAnchorCertificatesOnly(trust
, true), "only trust passed in anchors (default)");
358 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
359 is_status(trustResult
, kSecTrustResultRecoverableTrustFailure
, "trust is kSecTrustResultRecoverableTrustFailure again");
361 CFReleaseNull(exceptions
);
362 ok(exceptions
= SecTrustCopyExceptions(trust
), "create exceptions");
363 if (!exceptions
) { goto errOut
; }
364 ok(SecTrustSetExceptions(trust
, exceptions
), "set exceptions");
365 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
366 is_status(trustResult
, kSecTrustResultProceed
, "trust is kSecTrustResultProceed");
368 date
= CFDateCreate(NULL
, 667680000.0);
369 ok_status(SecTrustSetVerifyDate(trust
, date
), "set date to far future so certs are expired");
370 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
371 is_status(trustResult
, kSecTrustResultRecoverableTrustFailure
, "trust is kSecTrustResultRecoverableTrustFailure");
373 CFReleaseNull(trust
);
374 CFReleaseNull(policy
);
375 policy
= SecPolicyCreateSSL(false, CFSTR("self-signed.ssltest.apple.com"));
376 ok_status(SecTrustCreateWithCertificates(sscert0
, policy
, &trust
), "create trust");
377 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
378 is_status(trustResult
, kSecTrustResultRecoverableTrustFailure
, "trust is kSecTrustResultRecoverableTrustFailure");
379 CFReleaseNull(exceptions
);
380 ok(exceptions
= SecTrustCopyExceptions(trust
), "create exceptions");
381 if (!exceptions
) { goto errOut
; }
382 ok(SecTrustSetExceptions(trust
, exceptions
), "set exceptions");
383 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
384 is_status(trustResult
, kSecTrustResultProceed
, "trust is kSecTrustResultProceed");
385 CFReleaseNull(exceptions
);
386 ok(!SecTrustSetExceptions(trust
, NULL
), "clear exceptions");
387 ok_status(SecTrustEvaluate(trust
, &trustResult
), "evaluate trust");
388 is_status(trustResult
, kSecTrustResultRecoverableTrustFailure
, "trust is kSecTrustResultRecoverableTrustFailure");
391 CFReleaseSafe(anchors
);
392 CFReleaseSafe(exceptions
);
393 CFReleaseSafe(trust
);
394 CFReleaseSafe(policy
);
395 CFReleaseSafe(certs
);
396 CFReleaseSafe(cert0
);
397 CFReleaseSafe(cert1
);
398 CFReleaseSafe(sscert0
);
402 int si_27_sectrust_exceptions(int argc
, char *const *argv
)