]> git.saurik.com Git - apple/security.git/blob - OSX/sec/Security/Regressions/secitem/si-83-seccertificate-sighashalg.c
Security-58286.251.4.tar.gz
[apple/security.git] / OSX / sec / Security / Regressions / secitem / si-83-seccertificate-sighashalg.c
1 /*
2 * si-83-seccertificate-sighashalg.c
3 * Security
4 *
5 * Copyright (c) 2015 Apple Inc. All Rights Reserved.
6 *
7 */
8
9 #include <CoreFoundation/CoreFoundation.h>
10 #include <Security/SecCertificate.h>
11 #include <Security/SecCertificatePriv.h>
12 #include <utilities/SecCFWrappers.h>
13 #include <stdlib.h>
14 #include <unistd.h>
15
16 #include "shared_regressions.h"
17
18 /* prototypes */
19 int si_83_seccertificate_sighashalg(int argc, char *const *argv);
20
21 /* test certs */
22 static const UInt8 RSA_MD2[]={
23 0x30,0x82,0x02,0x3D,0x30,0x82,0x01,0xA6,0x02,0x11,0x00,0xCD,0xBA,0x7F,0x56,0xF0,
24 0xDF,0xE4,0xBC,0x54,0xFE,0x22,0xAC,0xB3,0x72,0xAA,0x55,0x30,0x0D,0x06,0x09,0x2A,
25 0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x02,0x05,0x00,0x30,0x5F,0x31,0x0B,0x30,0x09,
26 0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,
27 0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,
28 0x63,0x2E,0x31,0x37,0x30,0x35,0x06,0x03,0x55,0x04,0x0B,0x13,0x2E,0x43,0x6C,0x61,
29 0x73,0x73,0x20,0x31,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,
30 0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,
31 0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x39,
32 0x36,0x30,0x31,0x32,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x38,
33 0x30,0x38,0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x5F,0x31,0x0B,0x30,
34 0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,
35 0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,
36 0x6E,0x63,0x2E,0x31,0x37,0x30,0x35,0x06,0x03,0x55,0x04,0x0B,0x13,0x2E,0x43,0x6C,
37 0x61,0x73,0x73,0x20,0x31,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,
38 0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,
39 0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x81,0x9F,0x30,
40 0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,
41 0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xE5,0x19,0xBF,0x6D,0xA3,0x56,0x61,
42 0x2D,0x99,0x48,0x71,0xF6,0x67,0xDE,0xB9,0x8D,0xEB,0xB7,0x9E,0x86,0x80,0x0A,0x91,
43 0x0E,0xFA,0x38,0x25,0xAF,0x46,0x88,0x82,0xE5,0x73,0xA8,0xA0,0x9B,0x24,0x5D,0x0D,
44 0x1F,0xCC,0x65,0x6E,0x0C,0xB0,0xD0,0x56,0x84,0x18,0x87,0x9A,0x06,0x9B,0x10,0xA1,
45 0x73,0xDF,0xB4,0x58,0x39,0x6B,0x6E,0xC1,0xF6,0x15,0xD5,0xA8,0xA8,0x3F,0xAA,0x12,
46 0x06,0x8D,0x31,0xAC,0x7F,0xB0,0x34,0xD7,0x8F,0x34,0x67,0x88,0x09,0xCD,0x14,0x11,
47 0xE2,0x4E,0x45,0x56,0x69,0x1F,0x78,0x02,0x80,0xDA,0xDC,0x47,0x91,0x29,0xBB,0x36,
48 0xC9,0x63,0x5C,0xC5,0xE0,0xD7,0x2D,0x87,0x7B,0xA1,0xB7,0x32,0xB0,0x7B,0x30,0xBA,
49 0x2A,0x2F,0x31,0xAA,0xEE,0xA3,0x67,0xDA,0xDB,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,
50 0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x02,0x05,0x00,0x03,0x81,0x81,
51 0x00,0x4C,0x3F,0xB8,0x8B,0xC6,0x68,0xDF,0xEE,0x43,0x33,0x0E,0x5D,0xE9,0xA6,0xCB,
52 0x07,0x84,0x4D,0x7A,0x33,0xFF,0x92,0x1B,0xF4,0x36,0xAD,0xD8,0x95,0x22,0x36,0x68,
53 0x11,0x6C,0x7C,0x42,0xCC,0xF3,0x9C,0x2E,0xC4,0x07,0x3F,0x14,0xB0,0x0F,0x4F,0xFF,
54 0x90,0x92,0x76,0xF9,0xE2,0xBC,0x4A,0xE9,0x8F,0xCD,0xA0,0x80,0x0A,0xF7,0xC5,0x29,
55 0xF1,0x82,0x22,0x5D,0xB8,0xB1,0xDD,0x81,0x23,0xA3,0x7B,0x25,0x15,0x46,0x30,0x79,
56 0x16,0xF8,0xEA,0x05,0x4B,0x94,0x7F,0x1D,0xC2,0x1C,0xC8,0xE3,0xB7,0xF4,0x10,0x40,
57 0x3C,0x13,0xC3,0x5F,0x1F,0x53,0xE8,0x48,0xE4,0x86,0xB4,0x7B,0xA1,0x35,0xB0,0x7B,
58 0x25,0xBA,0xB8,0xD3,0x8E,0xAB,0x3F,0x38,0x9D,0x00,0x34,0x00,0x98,0xF3,0xD1,0x71,
59 0x94,
60 };
61
62 static const UInt8 RSA_MD5[]={
63 0x30,0x82,0x02,0x5A,0x30,0x82,0x01,0xC3,0x02,0x02,0x01,0xA5,0x30,0x0D,0x06,0x09,
64 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x30,0x75,0x31,0x0B,0x30,
65 0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x18,0x30,0x16,0x06,0x03,
66 0x55,0x04,0x0A,0x13,0x0F,0x47,0x54,0x45,0x20,0x43,0x6F,0x72,0x70,0x6F,0x72,0x61,
67 0x74,0x69,0x6F,0x6E,0x31,0x27,0x30,0x25,0x06,0x03,0x55,0x04,0x0B,0x13,0x1E,0x47,
68 0x54,0x45,0x20,0x43,0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x53,0x6F,
69 0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x23,0x30,
70 0x21,0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x47,0x54,0x45,0x20,0x43,0x79,0x62,0x65,
71 0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,
72 0x6F,0x74,0x30,0x1E,0x17,0x0D,0x39,0x38,0x30,0x38,0x31,0x33,0x30,0x30,0x32,0x39,
73 0x30,0x30,0x5A,0x17,0x0D,0x31,0x38,0x30,0x38,0x31,0x33,0x32,0x33,0x35,0x39,0x30,
74 0x30,0x5A,0x30,0x75,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,
75 0x53,0x31,0x18,0x30,0x16,0x06,0x03,0x55,0x04,0x0A,0x13,0x0F,0x47,0x54,0x45,0x20,
76 0x43,0x6F,0x72,0x70,0x6F,0x72,0x61,0x74,0x69,0x6F,0x6E,0x31,0x27,0x30,0x25,0x06,
77 0x03,0x55,0x04,0x0B,0x13,0x1E,0x47,0x54,0x45,0x20,0x43,0x79,0x62,0x65,0x72,0x54,
78 0x72,0x75,0x73,0x74,0x20,0x53,0x6F,0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x2C,0x20,
79 0x49,0x6E,0x63,0x2E,0x31,0x23,0x30,0x21,0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x47,
80 0x54,0x45,0x20,0x43,0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,
81 0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F,0x74,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,
82 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,
83 0x81,0x89,0x02,0x81,0x81,0x00,0x95,0x0F,0xA0,0xB6,0xF0,0x50,0x9C,0xE8,0x7A,0xC7,
84 0x88,0xCD,0xDD,0x17,0x0E,0x2E,0xB0,0x94,0xD0,0x1B,0x3D,0x0E,0xF6,0x94,0xC0,0x8A,
85 0x94,0xC7,0x06,0xC8,0x90,0x97,0xC8,0xB8,0x64,0x1A,0x7A,0x7E,0x6C,0x3C,0x53,0xE1,
86 0x37,0x28,0x73,0x60,0x7F,0xB2,0x97,0x53,0x07,0x9F,0x53,0xF9,0x6D,0x58,0x94,0xD2,
87 0xAF,0x8D,0x6D,0x88,0x67,0x80,0xE6,0xED,0xB2,0x95,0xCF,0x72,0x31,0xCA,0xA5,0x1C,
88 0x72,0xBA,0x5C,0x02,0xE7,0x64,0x42,0xE7,0xF9,0xA9,0x2C,0xD6,0x3A,0x0D,0xAC,0x8D,
89 0x42,0xAA,0x24,0x01,0x39,0xE6,0x9C,0x3F,0x01,0x85,0x57,0x0D,0x58,0x87,0x45,0xF8,
90 0xD3,0x85,0xAA,0x93,0x69,0x26,0x85,0x70,0x48,0x80,0x3F,0x12,0x15,0xC7,0x79,0xB4,
91 0x1F,0x05,0x2F,0x3B,0x62,0x99,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,
92 0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x03,0x81,0x81,0x00,0x6D,0xEB,
93 0x1B,0x09,0xE9,0x5E,0xD9,0x51,0xDB,0x67,0x22,0x61,0xA4,0x2A,0x3C,0x48,0x77,0xE3,
94 0xA0,0x7C,0xA6,0xDE,0x73,0xA2,0x14,0x03,0x85,0x3D,0xFB,0xAB,0x0E,0x30,0xC5,0x83,
95 0x16,0x33,0x81,0x13,0x08,0x9E,0x7B,0x34,0x4E,0xDF,0x40,0xC8,0x74,0xD7,0xB9,0x7D,
96 0xDC,0xF4,0x76,0x55,0x7D,0x9B,0x63,0x54,0x18,0xE9,0xF0,0xEA,0xF3,0x5C,0xB1,0xD9,
97 0x8B,0x42,0x1E,0xB9,0xC0,0x95,0x4E,0xBA,0xFA,0xD5,0xE2,0x7C,0xF5,0x68,0x61,0xBF,
98 0x8E,0xEC,0x05,0x97,0x5F,0x5B,0xB0,0xD7,0xA3,0x85,0x34,0xC4,0x24,0xA7,0x0D,0x0F,
99 0x95,0x93,0xEF,0xCB,0x94,0xD8,0x9E,0x1F,0x9D,0x5C,0x85,0x6D,0xC7,0xAA,0xAE,0x4F,
100 0x1F,0x22,0xB5,0xCD,0x95,0xAD,0xBA,0xA7,0xCC,0xF9,0xAB,0x0B,0x7A,0x7F,
101 };
102
103 static const UInt8 RSA_SHA1[]={
104 0x30,0x82,0x04,0xBB,0x30,0x82,0x03,0xA3,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x02,
105 0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,
106 0x62,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x13,
107 0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x41,0x70,0x70,0x6C,0x65,0x20,0x49,
108 0x6E,0x63,0x2E,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B,0x13,0x1D,0x41,0x70,
109 0x70,0x6C,0x65,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,
110 0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31,0x16,0x30,0x14,0x06,
111 0x03,0x55,0x04,0x03,0x13,0x0D,0x41,0x70,0x70,0x6C,0x65,0x20,0x52,0x6F,0x6F,0x74,
112 0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x36,0x30,0x34,0x32,0x35,0x32,0x31,0x34,
113 0x30,0x33,0x36,0x5A,0x17,0x0D,0x33,0x35,0x30,0x32,0x30,0x39,0x32,0x31,0x34,0x30,
114 0x33,0x36,0x5A,0x30,0x62,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,
115 0x55,0x53,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x41,0x70,0x70,
116 0x6C,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B,
117 0x13,0x1D,0x41,0x70,0x70,0x6C,0x65,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,
118 0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31,
119 0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x03,0x13,0x0D,0x41,0x70,0x70,0x6C,0x65,0x20,
120 0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,
121 0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,
122 0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xE4,0x91,0xA9,0x09,0x1F,0x91,0xDB,0x1E,
123 0x47,0x50,0xEB,0x05,0xED,0x5E,0x79,0x84,0x2D,0xEB,0x36,0xA2,0x57,0x4C,0x55,0xEC,
124 0x8B,0x19,0x89,0xDE,0xF9,0x4B,0x6C,0xF5,0x07,0xAB,0x22,0x30,0x02,0xE8,0x18,0x3E,
125 0xF8,0x50,0x09,0xD3,0x7F,0x41,0xA8,0x98,0xF9,0xD1,0xCA,0x66,0x9C,0x24,0x6B,0x11,
126 0xD0,0xA3,0xBB,0xE4,0x1B,0x2A,0xC3,0x1F,0x95,0x9E,0x7A,0x0C,0xA4,0x47,0x8B,0x5B,
127 0xD4,0x16,0x37,0x33,0xCB,0xC4,0x0F,0x4D,0xCE,0x14,0x69,0xD1,0xC9,0x19,0x72,0xF5,
128 0x5D,0x0E,0xD5,0x7F,0x5F,0x9B,0xF2,0x25,0x03,0xBA,0x55,0x8F,0x4D,0x5D,0x0D,0xF1,
129 0x64,0x35,0x23,0x15,0x4B,0x15,0x59,0x1D,0xB3,0x94,0xF7,0xF6,0x9C,0x9E,0xCF,0x50,
130 0xBA,0xC1,0x58,0x50,0x67,0x8F,0x08,0xB4,0x20,0xF7,0xCB,0xAC,0x2C,0x20,0x6F,0x70,
131 0xB6,0x3F,0x01,0x30,0x8C,0xB7,0x43,0xCF,0x0F,0x9D,0x3D,0xF3,0x2B,0x49,0x28,0x1A,
132 0xC8,0xFE,0xCE,0xB5,0xB9,0x0E,0xD9,0x5E,0x1C,0xD6,0xCB,0x3D,0xB5,0x3A,0xAD,0xF4,
133 0x0F,0x0E,0x00,0x92,0x0B,0xB1,0x21,0x16,0x2E,0x74,0xD5,0x3C,0x0D,0xDB,0x62,0x16,
134 0xAB,0xA3,0x71,0x92,0x47,0x53,0x55,0xC1,0xAF,0x2F,0x41,0xB3,0xF8,0xFB,0xE3,0x70,
135 0xCD,0xE6,0xA3,0x4C,0x45,0x7E,0x1F,0x4C,0x6B,0x50,0x96,0x41,0x89,0xC4,0x74,0x62,
136 0x0B,0x10,0x83,0x41,0x87,0x33,0x8A,0x81,0xB1,0x30,0x58,0xEC,0x5A,0x04,0x32,0x8C,
137 0x68,0xB3,0x8F,0x1D,0xDE,0x65,0x73,0xFF,0x67,0x5E,0x65,0xBC,0x49,0xD8,0x76,0x9F,
138 0x33,0x14,0x65,0xA1,0x77,0x94,0xC9,0x2D,0x02,0x03,0x01,0x00,0x01,0xA3,0x82,0x01,
139 0x7A,0x30,0x82,0x01,0x76,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,
140 0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,
141 0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,
142 0x14,0x2B,0xD0,0x69,0x47,0x94,0x76,0x09,0xFE,0xF4,0x6B,0x8D,0x2E,0x40,0xA6,0xF7,
143 0x47,0x4D,0x7F,0x08,0x5E,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,
144 0x80,0x14,0x2B,0xD0,0x69,0x47,0x94,0x76,0x09,0xFE,0xF4,0x6B,0x8D,0x2E,0x40,0xA6,
145 0xF7,0x47,0x4D,0x7F,0x08,0x5E,0x30,0x82,0x01,0x11,0x06,0x03,0x55,0x1D,0x20,0x04,
146 0x82,0x01,0x08,0x30,0x82,0x01,0x04,0x30,0x82,0x01,0x00,0x06,0x09,0x2A,0x86,0x48,
147 0x86,0xF7,0x63,0x64,0x05,0x01,0x30,0x81,0xF2,0x30,0x2A,0x06,0x08,0x2B,0x06,0x01,
148 0x05,0x05,0x07,0x02,0x01,0x16,0x1E,0x68,0x74,0x74,0x70,0x73,0x3A,0x2F,0x2F,0x77,
149 0x77,0x77,0x2E,0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x2F,0x61,0x70,0x70,
150 0x6C,0x65,0x63,0x61,0x2F,0x30,0x81,0xC3,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,
151 0x02,0x02,0x30,0x81,0xB6,0x1A,0x81,0xB3,0x52,0x65,0x6C,0x69,0x61,0x6E,0x63,0x65,
152 0x20,0x6F,0x6E,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x65,0x72,0x74,0x69,0x66,0x69,
153 0x63,0x61,0x74,0x65,0x20,0x62,0x79,0x20,0x61,0x6E,0x79,0x20,0x70,0x61,0x72,0x74,
154 0x79,0x20,0x61,0x73,0x73,0x75,0x6D,0x65,0x73,0x20,0x61,0x63,0x63,0x65,0x70,0x74,
155 0x61,0x6E,0x63,0x65,0x20,0x6F,0x66,0x20,0x74,0x68,0x65,0x20,0x74,0x68,0x65,0x6E,
156 0x20,0x61,0x70,0x70,0x6C,0x69,0x63,0x61,0x62,0x6C,0x65,0x20,0x73,0x74,0x61,0x6E,
157 0x64,0x61,0x72,0x64,0x20,0x74,0x65,0x72,0x6D,0x73,0x20,0x61,0x6E,0x64,0x20,0x63,
158 0x6F,0x6E,0x64,0x69,0x74,0x69,0x6F,0x6E,0x73,0x20,0x6F,0x66,0x20,0x75,0x73,0x65,
159 0x2C,0x20,0x63,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x70,0x6F,
160 0x6C,0x69,0x63,0x79,0x20,0x61,0x6E,0x64,0x20,0x63,0x65,0x72,0x74,0x69,0x66,0x69,
161 0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x70,0x72,0x61,0x63,0x74,0x69,0x63,0x65,0x20,
162 0x73,0x74,0x61,0x74,0x65,0x6D,0x65,0x6E,0x74,0x73,0x2E,0x30,0x0D,0x06,0x09,0x2A,
163 0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x5C,
164 0x36,0x99,0x4C,0x2D,0x78,0xB7,0xED,0x8C,0x9B,0xDC,0xF3,0x77,0x9B,0xF2,0x76,0xD2,
165 0x77,0x30,0x4F,0xC1,0x1F,0x85,0x83,0x85,0x1B,0x99,0x3D,0x47,0x37,0xF2,0xA9,0x9B,
166 0x40,0x8E,0x2C,0xD4,0xB1,0x90,0x12,0xD8,0xBE,0xF4,0x73,0x9B,0xEE,0xD2,0x64,0x0F,
167 0xCB,0x79,0x4F,0x34,0xD8,0xA2,0x3E,0xF9,0x78,0xFF,0x6B,0xC8,0x07,0xEC,0x7D,0x39,
168 0x83,0x8B,0x53,0x20,0xD3,0x38,0xC4,0xB1,0xBF,0x9A,0x4F,0x0A,0x6B,0xFF,0x2B,0xFC,
169 0x59,0xA7,0x05,0x09,0x7C,0x17,0x40,0x56,0x11,0x1E,0x74,0xD3,0xB7,0x8B,0x23,0x3B,
170 0x47,0xA3,0xD5,0x6F,0x24,0xE2,0xEB,0xD1,0xB7,0x70,0xDF,0x0F,0x45,0xE1,0x27,0xCA,
171 0xF1,0x6D,0x78,0xED,0xE7,0xB5,0x17,0x17,0xA8,0xDC,0x7E,0x22,0x35,0xCA,0x25,0xD5,
172 0xD9,0x0F,0xD6,0x6B,0xD4,0xA2,0x24,0x23,0x11,0xF7,0xA1,0xAC,0x8F,0x73,0x81,0x60,
173 0xC6,0x1B,0x5B,0x09,0x2F,0x92,0xB2,0xF8,0x44,0x48,0xF0,0x60,0x38,0x9E,0x15,0xF5,
174 0x3D,0x26,0x67,0x20,0x8A,0x33,0x6A,0xF7,0x0D,0x82,0xCF,0xDE,0xEB,0xA3,0x2F,0xF9,
175 0x53,0x6A,0x5B,0x64,0xC0,0x63,0x33,0x77,0xF7,0x3A,0x07,0x2C,0x56,0xEB,0xDA,0x0F,
176 0x21,0x0E,0xDA,0xBA,0x73,0x19,0x4F,0xB5,0xD9,0x36,0x7F,0xC1,0x87,0x55,0xD9,0xA7,
177 0x99,0xB9,0x32,0x42,0xFB,0xD8,0xD5,0x71,0x9E,0x7E,0xA1,0x52,0xB7,0x1B,0xBD,0x93,
178 0x42,0x24,0x12,0x2A,0xC7,0x0F,0x1D,0xB6,0x4D,0x9C,0x5E,0x63,0xC8,0x4B,0x80,0x17,
179 0x50,0xAA,0x8A,0xD5,0xDA,0xE4,0xFC,0xD0,0x09,0x07,0x37,0xB0,0x75,0x75,0x21,
180 };
181
182 static const UInt8 RSA_SHA256[]={
183 0x30,0x82,0x03,0x5F,0x30,0x82,0x02,0x47,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04,
184 0x00,0x00,0x00,0x00,0x01,0x21,0x58,0x53,0x08,0xA2,0x30,0x0D,0x06,0x09,0x2A,0x86,
185 0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06,
186 0x03,0x55,0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,
187 0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x33,0x31,0x13,0x30,
188 0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,
189 0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,
190 0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x33,0x31,
191 0x38,0x31,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x30,0x33,0x31,0x38,
192 0x31,0x30,0x30,0x30,0x30,0x30,0x5A,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,
193 0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x52,
194 0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x33,0x31,0x13,0x30,0x11,0x06,
195 0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,
196 0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,
197 0x6C,0x53,0x69,0x67,0x6E,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,
198 0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,
199 0x0A,0x02,0x82,0x01,0x01,0x00,0xCC,0x25,0x76,0x90,0x79,0x06,0x78,0x22,0x16,0xF5,
200 0xC0,0x83,0xB6,0x84,0xCA,0x28,0x9E,0xFD,0x05,0x76,0x11,0xC5,0xAD,0x88,0x72,0xFC,
201 0x46,0x02,0x43,0xC7,0xB2,0x8A,0x9D,0x04,0x5F,0x24,0xCB,0x2E,0x4B,0xE1,0x60,0x82,
202 0x46,0xE1,0x52,0xAB,0x0C,0x81,0x47,0x70,0x6C,0xDD,0x64,0xD1,0xEB,0xF5,0x2C,0xA3,
203 0x0F,0x82,0x3D,0x0C,0x2B,0xAE,0x97,0xD7,0xB6,0x14,0x86,0x10,0x79,0xBB,0x3B,0x13,
204 0x80,0x77,0x8C,0x08,0xE1,0x49,0xD2,0x6A,0x62,0x2F,0x1F,0x5E,0xFA,0x96,0x68,0xDF,
205 0x89,0x27,0x95,0x38,0x9F,0x06,0xD7,0x3E,0xC9,0xCB,0x26,0x59,0x0D,0x73,0xDE,0xB0,
206 0xC8,0xE9,0x26,0x0E,0x83,0x15,0xC6,0xEF,0x5B,0x8B,0xD2,0x04,0x60,0xCA,0x49,0xA6,
207 0x28,0xF6,0x69,0x3B,0xF6,0xCB,0xC8,0x28,0x91,0xE5,0x9D,0x8A,0x61,0x57,0x37,0xAC,
208 0x74,0x14,0xDC,0x74,0xE0,0x3A,0xEE,0x72,0x2F,0x2E,0x9C,0xFB,0xD0,0xBB,0xBF,0xF5,
209 0x3D,0x00,0xE1,0x06,0x33,0xE8,0x82,0x2B,0xAE,0x53,0xA6,0x3A,0x16,0x73,0x8C,0xDD,
210 0x41,0x0E,0x20,0x3A,0xC0,0xB4,0xA7,0xA1,0xE9,0xB2,0x4F,0x90,0x2E,0x32,0x60,0xE9,
211 0x57,0xCB,0xB9,0x04,0x92,0x68,0x68,0xE5,0x38,0x26,0x60,0x75,0xB2,0x9F,0x77,0xFF,
212 0x91,0x14,0xEF,0xAE,0x20,0x49,0xFC,0xAD,0x40,0x15,0x48,0xD1,0x02,0x31,0x61,0x19,
213 0x5E,0xB8,0x97,0xEF,0xAD,0x77,0xB7,0x64,0x9A,0x7A,0xBF,0x5F,0xC1,0x13,0xEF,0x9B,
214 0x62,0xFB,0x0D,0x6C,0xE0,0x54,0x69,0x16,0xA9,0x03,0xDA,0x6E,0xE9,0x83,0x93,0x71,
215 0x76,0xC6,0x69,0x85,0x82,0x17,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,
216 0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,
217 0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,
218 0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x8F,0xF0,0x4B,0x7F,0xA8,
219 0x2E,0x45,0x24,0xAE,0x4D,0x50,0xFA,0x63,0x9A,0x8B,0xDE,0xE2,0xDD,0x1B,0xBC,0x30,
220 0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,
221 0x01,0x01,0x00,0x4B,0x40,0xDB,0xC0,0x50,0xAA,0xFE,0xC8,0x0C,0xEF,0xF7,0x96,0x54,
222 0x45,0x49,0xBB,0x96,0x00,0x09,0x41,0xAC,0xB3,0x13,0x86,0x86,0x28,0x07,0x33,0xCA,
223 0x6B,0xE6,0x74,0xB9,0xBA,0x00,0x2D,0xAE,0xA4,0x0A,0xD3,0xF5,0xF1,0xF1,0x0F,0x8A,
224 0xBF,0x73,0x67,0x4A,0x83,0xC7,0x44,0x7B,0x78,0xE0,0xAF,0x6E,0x6C,0x6F,0x03,0x29,
225 0x8E,0x33,0x39,0x45,0xC3,0x8E,0xE4,0xB9,0x57,0x6C,0xAA,0xFC,0x12,0x96,0xEC,0x53,
226 0xC6,0x2D,0xE4,0x24,0x6C,0xB9,0x94,0x63,0xFB,0xDC,0x53,0x68,0x67,0x56,0x3E,0x83,
227 0xB8,0xCF,0x35,0x21,0xC3,0xC9,0x68,0xFE,0xCE,0xDA,0xC2,0x53,0xAA,0xCC,0x90,0x8A,
228 0xE9,0xF0,0x5D,0x46,0x8C,0x95,0xDD,0x7A,0x58,0x28,0x1A,0x2F,0x1D,0xDE,0xCD,0x00,
229 0x37,0x41,0x8F,0xED,0x44,0x6D,0xD7,0x53,0x28,0x97,0x7E,0xF3,0x67,0x04,0x1E,0x15,
230 0xD7,0x8A,0x96,0xB4,0xD3,0xDE,0x4C,0x27,0xA4,0x4C,0x1B,0x73,0x73,0x76,0xF4,0x17,
231 0x99,0xC2,0x1F,0x7A,0x0E,0xE3,0x2D,0x08,0xAD,0x0A,0x1C,0x2C,0xFF,0x3C,0xAB,0x55,
232 0x0E,0x0F,0x91,0x7E,0x36,0xEB,0xC3,0x57,0x49,0xBE,0xE1,0x2E,0x2D,0x7C,0x60,0x8B,
233 0xC3,0x41,0x51,0x13,0x23,0x9D,0xCE,0xF7,0x32,0x6B,0x94,0x01,0xA8,0x99,0xE7,0x2C,
234 0x33,0x1F,0x3A,0x3B,0x25,0xD2,0x86,0x40,0xCE,0x3B,0x2C,0x86,0x78,0xC9,0x61,0x2F,
235 0x14,0xBA,0xEE,0xDB,0x55,0x6F,0xDF,0x84,0xEE,0x05,0x09,0x4D,0xBD,0x28,0xD8,0x72,
236 0xCE,0xD3,0x62,0x50,0x65,0x1E,0xEB,0x92,0x97,0x83,0x31,0xD9,0xB3,0xB5,0xCA,0x47,
237 0x58,0x3F,0x5F,
238 };
239
240 static const UInt8 RSA_SHA512[]={
241 0x30,0x82,0x05,0xD3,0x30,0x82,0x03,0xBB,0xA0,0x03,0x02,0x01,0x02,0x02,0x15,0x00,
242 0xB8,0x59,0x14,0x71,0x3F,0x57,0xDF,0x8F,0x31,0xC0,0x33,0x3D,0xD2,0xD6,0x19,0x7A,
243 0x23,0x17,0xB4,0xEB,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,
244 0x0D,0x05,0x00,0x30,0x81,0x80,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,
245 0x02,0x50,0x4C,0x31,0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x0A,0x13,0x19,0x55,0x6E,
246 0x69,0x7A,0x65,0x74,0x6F,0x20,0x54,0x65,0x63,0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69,
247 0x65,0x73,0x20,0x53,0x2E,0x41,0x2E,0x31,0x27,0x30,0x25,0x06,0x03,0x55,0x04,0x0B,
248 0x13,0x1E,0x43,0x65,0x72,0x74,0x75,0x6D,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,
249 0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,
250 0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x43,0x65,0x72,0x74,0x75,
251 0x6D,0x20,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,
252 0x6B,0x20,0x43,0x41,0x20,0x32,0x30,0x1E,0x17,0x0D,0x31,0x31,0x31,0x30,0x30,0x36,
253 0x30,0x38,0x33,0x39,0x35,0x36,0x5A,0x17,0x0D,0x34,0x36,0x31,0x30,0x30,0x36,0x30,
254 0x38,0x33,0x39,0x35,0x36,0x5A,0x30,0x81,0x80,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,
255 0x04,0x06,0x13,0x02,0x50,0x4C,0x31,0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x0A,0x13,
256 0x19,0x55,0x6E,0x69,0x7A,0x65,0x74,0x6F,0x20,0x54,0x65,0x63,0x68,0x6E,0x6F,0x6C,
257 0x6F,0x67,0x69,0x65,0x73,0x20,0x53,0x2E,0x41,0x2E,0x31,0x27,0x30,0x25,0x06,0x03,
258 0x55,0x04,0x0B,0x13,0x1E,0x43,0x65,0x72,0x74,0x75,0x6D,0x20,0x43,0x65,0x72,0x74,
259 0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,
260 0x69,0x74,0x79,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x43,0x65,
261 0x72,0x74,0x75,0x6D,0x20,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x4E,0x65,0x74,
262 0x77,0x6F,0x72,0x6B,0x20,0x43,0x41,0x20,0x32,0x30,0x82,0x02,0x22,0x30,0x0D,0x06,
263 0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x02,0x0F,
264 0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xBD,0xF9,0x78,0xF8,0xE6,0xD5,
265 0x80,0x0C,0x64,0x9D,0x86,0x1B,0x96,0x64,0x67,0x3F,0x22,0x3A,0x1E,0x75,0x01,0x7D,
266 0xEF,0xFB,0x5C,0x67,0x8C,0xC9,0xCC,0x5C,0x6B,0xA9,0x91,0xE6,0xB9,0x42,0xE5,0x20,
267 0x4B,0x9B,0xDA,0x9B,0x7B,0xB9,0x99,0x5D,0xD9,0x9B,0x80,0x4B,0xD7,0x84,0x40,0x2B,
268 0x27,0xD3,0xE8,0xBA,0x30,0xBB,0x3E,0x09,0x1A,0xA7,0x49,0x95,0xEF,0x2B,0x40,0x24,
269 0xC2,0x97,0xC7,0xA7,0xEE,0x9B,0x25,0xEF,0xA8,0x0A,0x00,0x97,0x85,0x5A,0xAA,0x9D,
270 0xDC,0x29,0xC9,0xE2,0x35,0x07,0xEB,0x70,0x4D,0x4A,0xD6,0xC1,0xB3,0x56,0xB8,0xA1,
271 0x41,0x38,0x9B,0xD1,0xFB,0x31,0x7F,0x8F,0xE0,0x5F,0xE1,0xB1,0x3F,0x0F,0x8E,0x16,
272 0x49,0x60,0xD7,0x06,0x8D,0x18,0xF9,0xAA,0x26,0x10,0xAB,0x2A,0xD3,0xD0,0xD1,0x67,
273 0x8D,0x1B,0x46,0xBE,0x47,0x30,0xD5,0x2E,0x72,0xD1,0xC5,0x63,0xDA,0xE7,0x63,0x79,
274 0x44,0x7E,0x4B,0x63,0x24,0x89,0x86,0x2E,0x34,0x3F,0x29,0x4C,0x52,0x8B,0x2A,0xA7,
275 0xC0,0xE2,0x91,0x28,0x89,0xB9,0xC0,0x5B,0xF9,0x1D,0xD9,0xE7,0x27,0xAD,0xFF,0x9A,
276 0x02,0x97,0xC1,0xC6,0x50,0x92,0x9B,0x02,0x2C,0xBD,0xA9,0xB9,0x34,0x59,0x0A,0xBF,
277 0x84,0x4A,0xFF,0xDF,0xFE,0xB3,0x9F,0xEB,0xD9,0x9E,0xE0,0x98,0x23,0xEC,0xA6,0x6B,
278 0x77,0x16,0x2A,0xDB,0xCC,0xAD,0x3B,0x1C,0xA4,0x87,0xDC,0x46,0x73,0x5E,0x19,0x62,
279 0x68,0x45,0x57,0xE4,0x90,0x82,0x42,0xBB,0x42,0xD6,0xF0,0x61,0xE0,0xC1,0xA3,0x3D,
280 0x66,0xA3,0x5D,0xF4,0x18,0xEE,0x88,0xC9,0x8D,0x17,0x45,0x29,0x99,0x32,0x75,0x02,
281 0x31,0xEE,0x29,0x26,0xC8,0x6B,0x02,0xE6,0xB5,0x62,0x45,0x7F,0x37,0x15,0x5A,0x23,
282 0x68,0x89,0xD4,0x3E,0xDE,0x4E,0x27,0xB0,0xF0,0x40,0x0C,0xBC,0x4D,0x17,0xCB,0x4D,
283 0xA2,0xB3,0x1E,0xD0,0x06,0x5A,0xDD,0xF6,0x93,0xCF,0x57,0x75,0x99,0xF5,0xFA,0x86,
284 0x1A,0x67,0x78,0xB3,0xBF,0x96,0xFE,0x34,0xDC,0xBD,0xE7,0x52,0x56,0xE5,0xB3,0xE5,
285 0x75,0x7B,0xD7,0x41,0x91,0x05,0xDC,0x5D,0x69,0xE3,0x95,0x0D,0x43,0xB9,0xFC,0x83,
286 0x96,0x39,0x95,0x7B,0x6C,0x80,0x5A,0x4F,0x13,0x72,0xC6,0xD7,0x7D,0x29,0x7A,0x44,
287 0xBA,0x52,0xA4,0x2A,0xD5,0x41,0x46,0x09,0x20,0xFE,0x22,0xA0,0xB6,0x5B,0x30,0x8D,
288 0xBC,0x89,0x0C,0xD5,0xD7,0x70,0xF8,0x87,0x52,0xFD,0xDA,0xEF,0xAC,0x51,0x2E,0x07,
289 0xB3,0x4E,0xFE,0xD0,0x09,0xDA,0x70,0xEF,0x98,0xFA,0x56,0xE6,0x6D,0xDB,0xB5,0x57,
290 0x4B,0xDC,0xE5,0x2C,0x25,0x15,0xC8,0x9E,0x2E,0x78,0x4E,0xF8,0xDA,0x9C,0x9E,0x86,
291 0x2C,0xCA,0x57,0xF3,0x1A,0xE5,0xC8,0x92,0x8B,0x1A,0x82,0x96,0x7A,0xC3,0xBC,0x50,
292 0x12,0x69,0xD8,0x0E,0x5A,0x46,0x8B,0x3A,0xEB,0x26,0xFA,0x23,0xC9,0xB6,0xB0,0x81,
293 0xBE,0x42,0x00,0xA4,0xF8,0xD6,0xFE,0x30,0x2E,0xC7,0xD2,0x46,0xF6,0xE5,0x8E,0x75,
294 0xFD,0xF2,0xCC,0xB9,0xD0,0x87,0x5B,0xCC,0x06,0x10,0x60,0xBB,0x83,0x35,0xB7,0x5E,
295 0x67,0xDE,0x47,0xEC,0x99,0x48,0xF1,0xA4,0xA1,0x15,0xFE,0xAD,0x8C,0x62,0x8E,0x39,
296 0x55,0x4F,0x39,0x16,0xB9,0xB1,0x63,0x9D,0xFF,0xB7,0x02,0x03,0x01,0x00,0x01,0xA3,
297 0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,
298 0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xB6,
299 0xA1,0x54,0x39,0x02,0xC3,0xA0,0x3F,0x8E,0x8A,0xBC,0xFA,0xD4,0xF8,0x1C,0xA6,0xD1,
300 0x3A,0x0E,0xFD,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,
301 0x02,0x01,0x06,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,
302 0x05,0x00,0x03,0x82,0x02,0x01,0x00,0x9D,0x53,0xC2,0x81,0x25,0xDC,0x35,0x2C,0xAE,
303 0x0A,0xDD,0x5A,0x9B,0x46,0x30,0x56,0xBB,0xD4,0xB4,0x6C,0x4B,0x86,0xE6,0x0A,0xA5,
304 0xD2,0x92,0x8A,0x9A,0x8D,0xDC,0x8F,0xB4,0xEE,0x76,0xF4,0x03,0xCB,0xEB,0x9B,0x01,
305 0x78,0xAB,0x2A,0x6B,0xB5,0xBA,0x23,0x4E,0x31,0x7C,0xB5,0x2C,0xDD,0x2D,0x69,0x67,
306 0x33,0x6E,0x63,0x5D,0x39,0x18,0x12,0xF8,0xA0,0x28,0x53,0x44,0x87,0xAB,0x6A,0xC4,
307 0x92,0x96,0x1F,0x2A,0xA2,0x1C,0xBA,0x9D,0xDD,0x27,0xFB,0x52,0x4D,0xB0,0x8F,0x5A,
308 0xE8,0xED,0x8D,0xC3,0x68,0xE3,0x92,0xA0,0x26,0x0C,0x87,0x90,0xB0,0x03,0xEA,0x6A,
309 0x65,0x28,0x08,0xC4,0x46,0x78,0xE0,0x5B,0xBA,0x0E,0xF0,0x33,0xDC,0x27,0xB6,0x7E,
310 0x88,0x3D,0xBD,0x92,0xA4,0x96,0x7E,0x41,0xA8,0x80,0x08,0x7B,0xD6,0x36,0x12,0xBC,
311 0x10,0x15,0x9B,0x24,0xBC,0xAB,0xAD,0x7D,0x11,0x89,0x2F,0x31,0xED,0xF8,0xD2,0xCF,
312 0x53,0x8E,0xEB,0xB4,0x53,0xA7,0xE7,0x04,0xCA,0x2F,0xA6,0x22,0xC4,0x11,0xDC,0xEB,
313 0x98,0xC9,0x22,0x5D,0x41,0x6A,0xDC,0x0A,0x52,0x04,0x5B,0xBC,0x2E,0xA0,0x7D,0xC7,
314 0xB6,0x92,0xBB,0x24,0xA0,0xF3,0x37,0xD1,0x2B,0x43,0xA8,0xCC,0xF1,0x68,0x78,0x1A,
315 0x7E,0x6F,0x63,0x90,0x7B,0x9F,0x74,0xC8,0x6B,0xD9,0x0B,0x55,0xF6,0x79,0x03,0x3D,
316 0x83,0xC7,0x41,0x40,0x92,0xFB,0x76,0x0B,0x37,0x25,0x17,0x3C,0xAF,0x3E,0xFA,0x3C,
317 0x5C,0x1B,0x86,0xF9,0x4A,0x0C,0x3F,0x8A,0xC4,0x5E,0x0E,0x98,0xF1,0xAD,0xEE,0xCF,
318 0xE0,0xFD,0x21,0x35,0xC7,0x33,0x61,0xCC,0xA2,0x37,0x18,0x43,0x7C,0x33,0xE9,0xAE,
319 0x76,0x82,0x82,0x07,0x45,0x48,0x3B,0xC9,0x67,0x6E,0xAD,0xA3,0x85,0xE8,0x96,0x56,
320 0xCF,0xBC,0xBB,0xFA,0xAB,0xCB,0xB7,0x57,0x27,0x8D,0x1A,0x2F,0x99,0xF3,0x23,0x33,
321 0x34,0x8E,0xCA,0x53,0x63,0xD3,0x57,0x34,0x50,0x4F,0xCF,0x49,0xC1,0x05,0xBA,0xC5,
322 0xA8,0x87,0x7B,0xE3,0x86,0x8F,0xFB,0x43,0xA2,0x12,0xE9,0xAC,0x51,0xEC,0x04,0x76,
323 0x4C,0xF0,0xFA,0x8F,0xB9,0x31,0x13,0xE9,0x08,0xB7,0x24,0x09,0xF9,0xA0,0xB7,0x07,
324 0x36,0x58,0x57,0xCF,0xC4,0xBB,0x7E,0x49,0x66,0x95,0x35,0x04,0xB6,0x77,0x35,0xB8,
325 0xA9,0x53,0x29,0x5F,0x92,0x85,0xF8,0x52,0xC4,0x5A,0x4E,0xFD,0x06,0x61,0x39,0xFB,
326 0x7D,0xD0,0x76,0x47,0x92,0xCC,0xEC,0x2B,0xBD,0x84,0x6E,0xE6,0x9B,0x45,0xC1,0x7D,
327 0x62,0xB1,0x53,0x2D,0x9E,0x75,0xA0,0xE7,0xC9,0x28,0x50,0xD7,0xE5,0xBC,0xA8,0xAA,
328 0x07,0x78,0x6A,0xB9,0x74,0xB4,0x60,0xF3,0x84,0x8D,0x03,0xDC,0xAE,0x91,0xDA,0x74,
329 0x44,0x0D,0x7B,0x42,0xA9,0x77,0xD6,0x2B,0x7C,0xA1,0xC6,0x6C,0x13,0x53,0x22,0xA9,
330 0x12,0x9A,0xA5,0xF9,0x4F,0x28,0x45,0x35,0xB0,0x97,0x4F,0x46,0x65,0x85,0xC5,0xF4,
331 0xFD,0x62,0xA2,0xA2,0x6A,0xFC,0x34,0x30,0x06,0x7E,0xDF,0x0C,0xE0,0x73,0x81,0x96,
332 0xC9,0x44,0x2A,0xDE,0x1F,0x82,0xEC,0x6C,0x72,0x57,0xAD,0x29,0x64,0xA4,0xF1,0xC6,
333 0x29,0x8E,0x35,0x60,0x53,0xCE,0x6B,0xD9,0x02,0xBE,0x39,0x30,0x75,0xE0,0xF7,0x5C,
334 0x63,0x6A,0xF0,0x40,0xC1,0x2C,0x8D,
335 };
336
337 static const UInt8 ECDSA_SHA1[]={
338 0x30,0x82,0x02,0x40,0x30,0x82,0x01,0xE7,0xA0,0x03,0x02,0x01,0x02,0x02,0x02,0x04,
339 0x19,0x30,0x09,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,0x30,0x81,0x9B,0x31,
340 0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0B,0x13,0x0B,0x53,0x41,0x4D,0x50,0x4C,0x45,
341 0x20,0x4F,0x4E,0x4C,0x59,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,
342 0x43,0x65,0x72,0x74,0x69,0x63,0x6F,0x6D,0x20,0x43,0x6F,0x72,0x70,0x2E,0x31,0x10,
343 0x30,0x0E,0x06,0x03,0x55,0x04,0x07,0x13,0x07,0x54,0x6F,0x72,0x6F,0x6E,0x74,0x6F,
344 0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x04,0x13,0x07,0x4F,0x6E,0x74,0x61,0x72,
345 0x69,0x6F,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x03,0x13,0x30,0x74,0x6C,0x73,
346 0x2E,0x73,0x65,0x63,0x67,0x2E,0x6F,0x72,0x67,0x20,0x45,0x43,0x43,0x20,0x73,0x65,
347 0x63,0x70,0x32,0x35,0x36,0x72,0x31,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,
348 0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31,0x0B,0x30,
349 0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x36,
350 0x30,0x35,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x31,0x35,0x30,
351 0x35,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x30,0x81,0x8B,0x31,0x14,0x30,
352 0x12,0x06,0x03,0x55,0x04,0x0B,0x13,0x0B,0x53,0x41,0x4D,0x50,0x4C,0x45,0x20,0x4F,
353 0x4E,0x4C,0x59,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x43,0x65,
354 0x72,0x74,0x69,0x63,0x6F,0x6D,0x20,0x43,0x6F,0x72,0x70,0x2E,0x31,0x10,0x30,0x0E,
355 0x06,0x03,0x55,0x04,0x07,0x13,0x07,0x54,0x6F,0x72,0x6F,0x6E,0x74,0x6F,0x31,0x10,
356 0x30,0x0E,0x06,0x03,0x55,0x04,0x04,0x13,0x07,0x4F,0x6E,0x74,0x61,0x72,0x69,0x6F,
357 0x31,0x36,0x30,0x34,0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x74,0x6C,0x73,0x2E,0x73,
358 0x65,0x63,0x67,0x2E,0x6F,0x72,0x67,0x20,0x45,0x43,0x43,0x20,0x73,0x65,0x63,0x70,
359 0x32,0x35,0x36,0x72,0x31,0x20,0x43,0x6C,0x69,0x65,0x6E,0x74,0x20,0x43,0x65,0x72,
360 0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x30,0x59,0x30,0x13,0x06,0x07,0x2A,0x86,
361 0x48,0xCE,0x3D,0x02,0x01,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,0x03,
362 0x42,0x00,0x04,0x36,0x48,0x98,0xF8,0xB3,0xD0,0xC4,0x2E,0xCA,0x99,0x3D,0x14,0xBB,
363 0x14,0x24,0xF5,0x89,0x82,0x36,0xE3,0x34,0xB2,0xF5,0x35,0x07,0xD0,0xA8,0xDE,0x14,
364 0x84,0xD7,0x78,0xA4,0x62,0x01,0x77,0xEA,0xBD,0xA9,0xA3,0x9F,0x8B,0x48,0x5F,0x3C,
365 0x7A,0xA1,0x96,0x40,0xD1,0x2C,0xB6,0xDD,0xEA,0x21,0xF8,0xED,0x29,0x70,0x44,0x80,
366 0x49,0x2E,0x77,0xA3,0x2A,0x30,0x28,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,
367 0xFF,0x04,0x04,0x03,0x02,0x03,0x88,0x30,0x16,0x06,0x03,0x55,0x1D,0x25,0x01,0x01,
368 0xFF,0x04,0x0C,0x30,0x0A,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,0x30,
369 0x09,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,0x03,0x48,0x00,0x30,0x45,0x02,
370 0x20,0x45,0xA2,0x99,0x2C,0xE0,0x08,0xB2,0xEE,0x09,0xCD,0x1D,0x51,0x42,0x60,0x3F,
371 0x56,0x4D,0x2D,0xA1,0x7D,0xAB,0xD0,0xF5,0x6D,0xF7,0xF0,0xE2,0x23,0x33,0xBC,0xBD,
372 0xB3,0x02,0x21,0x00,0xCD,0xFB,0x57,0x1C,0x3A,0x32,0xD1,0xBC,0x67,0xBB,0x0F,0x1D,
373 0x12,0xEB,0x63,0x12,0x1F,0x50,0x37,0x67,0x77,0x66,0x2B,0xE1,0x37,0xD4,0x8F,0xDD,
374 0xE0,0xAA,0xE4,0x22,
375 };
376
377 static const UInt8 ECDSA_SHA256[] = {
378 0x30,0x82,0x01,0xE1,0x30,0x82,0x01,0x87,0xA0,0x03,0x02,0x01,0x02,0x02,0x11,0x2A,
379 0x38,0xA4,0x1C,0x96,0x0A,0x04,0xDE,0x42,0xB2,0x28,0xA5,0x0B,0xE8,0x34,0x98,0x02,
380 0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,0x30,0x50,0x31,0x24,
381 0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,
382 0x69,0x67,0x6E,0x20,0x45,0x43,0x43,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,
383 0x2D,0x20,0x52,0x34,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,
384 0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55,
385 0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E,
386 0x17,0x0D,0x31,0x32,0x31,0x31,0x31,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,
387 0x0D,0x33,0x38,0x30,0x31,0x31,0x39,0x30,0x33,0x31,0x34,0x30,0x37,0x5A,0x30,0x50,
388 0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x47,0x6C,0x6F,0x62,0x61,
389 0x6C,0x53,0x69,0x67,0x6E,0x20,0x45,0x43,0x43,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,
390 0x41,0x20,0x2D,0x20,0x52,0x34,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13,
391 0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x31,0x13,0x30,0x11,0x06,
392 0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,
393 0x30,0x59,0x30,0x13,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x08,0x2A,
394 0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,0x03,0x42,0x00,0x04,0xB8,0xC6,0x79,0xD3,0x8F,
395 0x6C,0x25,0x0E,0x9F,0x2E,0x39,0x19,0x1C,0x03,0xA4,0xAE,0x9A,0xE5,0x39,0x07,0x09,
396 0x16,0xCA,0x63,0xB1,0xB9,0x86,0xF8,0x8A,0x57,0xC1,0x57,0xCE,0x42,0xFA,0x73,0xA1,
397 0xF7,0x65,0x42,0xFF,0x1E,0xC1,0x00,0xB2,0x6E,0x73,0x0E,0xFF,0xC7,0x21,0xE5,0x18,
398 0xA4,0xAA,0xD9,0x71,0x3F,0xA8,0xD4,0xB9,0xCE,0x8C,0x1D,0xA3,0x42,0x30,0x40,0x30,
399 0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,
400 0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,
401 0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x54,0xB0,0x7B,0xAD,0x45,
402 0xB8,0xE2,0x40,0x7F,0xFB,0x0A,0x6E,0xFB,0xBE,0x33,0xC9,0x3C,0xA3,0x84,0xD5,0x30,
403 0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,0x03,0x48,0x00,0x30,0x45,
404 0x02,0x21,0x00,0xDC,0x92,0xA1,0xA0,0x13,0xA6,0xCF,0x03,0xB0,0xE6,0xC4,0x21,0x97,
405 0x90,0xFA,0x14,0x57,0x2D,0x03,0xEC,0xEE,0x3C,0xD3,0x6E,0xCA,0xA8,0x6C,0x76,0xBC,
406 0xA2,0xDE,0xBB,0x02,0x20,0x27,0xA8,0x85,0x27,0x35,0x9B,0x56,0xC6,0xA3,0xF2,0x47,
407 0xD2,0xB7,0x6E,0x1B,0x02,0x00,0x17,0xAA,0x67,0xA6,0x15,0x91,0xDE,0xFA,0x94,0xEC,
408 0x7B,0x0B,0xF8,0x9F,0x84,
409 };
410
411 static const UInt8 ECDSA_SHA384[] = {
412 0x30,0x82,0x02,0x43,0x30,0x82,0x01,0xC9,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x2D,
413 0xC5,0xFC,0x88,0xD2,0xC5,0x4B,0x95,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,
414 0x04,0x03,0x03,0x30,0x67,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x03,0x0C,0x12,
415 0x41,0x70,0x70,0x6C,0x65,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,
416 0x47,0x33,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B,0x0C,0x1D,0x41,0x70,0x70,
417 0x6C,0x65,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,
418 0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31,0x13,0x30,0x11,0x06,0x03,
419 0x55,0x04,0x0A,0x0C,0x0A,0x41,0x70,0x70,0x6C,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,
420 0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x30,0x1E,0x17,0x0D,
421 0x31,0x34,0x30,0x34,0x33,0x30,0x31,0x38,0x31,0x39,0x30,0x36,0x5A,0x17,0x0D,0x33,
422 0x39,0x30,0x34,0x33,0x30,0x31,0x38,0x31,0x39,0x30,0x36,0x5A,0x30,0x67,0x31,0x1B,
423 0x30,0x19,0x06,0x03,0x55,0x04,0x03,0x0C,0x12,0x41,0x70,0x70,0x6C,0x65,0x20,0x52,
424 0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x47,0x33,0x31,0x26,0x30,0x24,0x06,
425 0x03,0x55,0x04,0x0B,0x0C,0x1D,0x41,0x70,0x70,0x6C,0x65,0x20,0x43,0x65,0x72,0x74,
426 0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,
427 0x69,0x74,0x79,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0A,0x41,0x70,
428 0x70,0x6C,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,
429 0x06,0x13,0x02,0x55,0x53,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,
430 0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0x98,0xE9,0x2F,
431 0x3D,0x40,0x72,0xA4,0xED,0x93,0x22,0x72,0x81,0x13,0x1C,0xDD,0x10,0x95,0xF1,0xC5,
432 0xA3,0x4E,0x71,0xDC,0x14,0x16,0xD9,0x0E,0xE5,0xA6,0x05,0x2A,0x77,0x64,0x7B,0x5F,
433 0x4E,0x38,0xD3,0xBB,0x1C,0x44,0xB5,0x7F,0xF5,0x1F,0xB6,0x32,0x62,0x5D,0xC9,0xE9,
434 0x84,0x5B,0x4F,0x30,0x4F,0x11,0x5A,0x00,0xFD,0x58,0x58,0x0C,0xA5,0xF5,0x0F,0x2C,
435 0x4D,0x07,0x47,0x13,0x75,0xDA,0x97,0x97,0x97,0x6F,0x31,0x5C,0xED,0x2B,0x9D,0x7B,
436 0x20,0x3B,0xD8,0xB9,0x54,0xD9,0x5E,0x99,0xA4,0x3A,0x51,0x0A,0x31,0xA3,0x42,0x30,
437 0x40,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xBB,0xB0,0xDE,0xA1,
438 0x58,0x33,0x88,0x9A,0xA4,0x8A,0x99,0xDE,0xBE,0xBD,0xEB,0xAF,0xDA,0xCB,0x24,0xAB,
439 0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,
440 0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,
441 0x06,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x68,0x00,
442 0x30,0x65,0x02,0x31,0x00,0x83,0xE9,0xC1,0xC4,0x16,0x5E,0x1A,0x5D,0x34,0x18,0xD9,
443 0xED,0xEF,0xF4,0x6C,0x0E,0x00,0x46,0x4B,0xB8,0xDF,0xB2,0x46,0x11,0xC5,0x0F,0xFD,
444 0xE6,0x7A,0x8C,0xA1,0xA6,0x6B,0xCE,0xC2,0x03,0xD4,0x9C,0xF5,0x93,0xC6,0x74,0xB8,
445 0x6A,0xDF,0xAA,0x23,0x15,0x02,0x30,0x6D,0x66,0x8A,0x10,0xCA,0xD4,0x0D,0xD4,0x4F,
446 0xCD,0x8D,0x43,0x3E,0xB4,0x8A,0x63,0xA5,0x33,0x6E,0xE3,0x6D,0xDA,0x17,0xB7,0x64,
447 0x1F,0xC8,0x53,0x26,0xF9,0x88,0x62,0x74,0x39,0x0B,0x17,0x5B,0xCB,0x51,0xA8,0x0C,
448 0xE8,0x18,0x03,0xE7,0xA2,0xB2,0x28,
449 };
450
451 static const UInt8 DSA_SHA1[] = {
452 0x30,0x82,0x02,0x1E,0x30,0x82,0x01,0xDD,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x02,
453 0x30,0x09,0x06,0x07,0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,0x30,0x3F,0x31,0x0B,0x30,
454 0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1F,0x30,0x1D,0x06,0x03,
455 0x55,0x04,0x0A,0x13,0x16,0x54,0x65,0x73,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,
456 0x69,0x63,0x61,0x74,0x65,0x73,0x20,0x32,0x30,0x31,0x31,0x31,0x0F,0x30,0x0D,0x06,
457 0x03,0x55,0x04,0x03,0x13,0x06,0x44,0x53,0x41,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,
458 0x31,0x30,0x30,0x31,0x30,0x31,0x30,0x38,0x33,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,
459 0x30,0x31,0x32,0x33,0x31,0x30,0x38,0x33,0x30,0x30,0x30,0x5A,0x30,0x54,0x31,0x0B,
460 0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1F,0x30,0x1D,0x06,
461 0x03,0x55,0x04,0x0A,0x13,0x16,0x54,0x65,0x73,0x74,0x20,0x43,0x65,0x72,0x74,0x69,
462 0x66,0x69,0x63,0x61,0x74,0x65,0x73,0x20,0x32,0x30,0x31,0x31,0x31,0x24,0x30,0x22,
463 0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x44,0x53,0x41,0x20,0x50,0x61,0x72,0x61,0x6D,
464 0x65,0x74,0x65,0x72,0x73,0x20,0x49,0x6E,0x68,0x65,0x72,0x69,0x74,0x65,0x64,0x20,
465 0x43,0x41,0x30,0x81,0x92,0x30,0x09,0x06,0x07,0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,
466 0x03,0x81,0x84,0x00,0x02,0x81,0x80,0x74,0x2F,0x4F,0x75,0xD0,0x81,0x57,0x23,0x6F,
467 0x2D,0x66,0x63,0x90,0xD1,0x42,0x20,0xCB,0x43,0x9F,0x4E,0xE2,0xF5,0x3A,0x14,0xD2,
468 0xD8,0xC7,0xEA,0xDD,0xF3,0xB2,0x1E,0x81,0x9A,0x61,0x10,0x40,0x09,0xB2,0x7A,0x51,
469 0xF3,0x66,0xF9,0x36,0x23,0x70,0x54,0xE8,0xE9,0x66,0x7A,0x94,0xA5,0xB1,0xF4,0x1B,
470 0x31,0x18,0x56,0x5D,0xBF,0x8A,0x19,0x16,0x47,0x91,0x60,0xAA,0xF9,0x8D,0x45,0x5C,
471 0x02,0x4B,0x7F,0x67,0xB3,0x02,0xF6,0x8F,0x6D,0x14,0xB9,0xCD,0x64,0x90,0xDD,0x0C,
472 0x88,0xC7,0xC4,0x4B,0x12,0xD1,0xB8,0xBE,0x32,0xA0,0x9F,0xB9,0x4A,0x84,0x33,0xC3,
473 0xAB,0xB6,0x42,0x4B,0x4B,0x32,0xED,0x29,0x3D,0x07,0xF8,0x07,0x7E,0xA2,0xF7,0xD8,
474 0xA2,0x56,0x53,0x71,0x2A,0x53,0x7B,0xA3,0x7C,0x30,0x7A,0x30,0x1F,0x06,0x03,0x55,
475 0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x8F,0x90,0xC6,0x8C,0x74,0xE8,0x7B,0x0C,
476 0xC8,0x59,0xC7,0x7D,0x3C,0x5B,0x54,0x59,0x60,0x25,0x0B,0xB1,0x30,0x1D,0x06,0x03,
477 0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x65,0x81,0x9F,0x70,0x3A,0x8C,0xAD,0xF6,0x43,
478 0x1D,0xC8,0xE7,0x8F,0x55,0x8E,0xE8,0x4B,0xDB,0x87,0xE2,0x30,0x0E,0x06,0x03,0x55,
479 0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x17,0x06,0x03,0x55,
480 0x1D,0x20,0x04,0x10,0x30,0x0E,0x30,0x0C,0x06,0x0A,0x60,0x86,0x48,0x01,0x65,0x03,
481 0x02,0x01,0x30,0x01,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,
482 0x30,0x03,0x01,0x01,0xFF,0x30,0x09,0x06,0x07,0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,
483 0x03,0x30,0x00,0x30,0x2D,0x02,0x14,0x47,0xF0,0x98,0xC9,0xBB,0x05,0xA9,0x82,0xC5,
484 0x11,0x2B,0x7A,0x5F,0xC9,0x11,0xE5,0x83,0x90,0xB7,0xD9,0x02,0x15,0x00,0x93,0xE1,
485 0x0B,0xBE,0xAD,0x25,0x08,0x00,0x07,0x88,0x70,0xDF,0xC3,0x59,0x4F,0x22,0x9C,0xEA,
486 0xD4,0x0F,
487 };
488
489 static const UInt8 RSAPSS_SHA256[] = {
490 0x30,0x82,0x04,0x51,0x30,0x82,0x03,0x05,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x7B,
491 0x20,0x9C,0x9D,0xDF,0x9C,0xED,0x93,0x43,0x73,0x51,0x0D,0x1B,0xD2,0x8A,0xDC,0x30,
492 0x41,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,0x30,0x34,0xA0,0x0F,
493 0x30,0x0D,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0xA1,
494 0x1C,0x30,0x1A,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,0x30,0x0D,
495 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0xA2,0x03,0x02,
496 0x01,0x20,0x30,0x31,0x31,0x2F,0x30,0x2D,0x06,0x03,0x55,0x04,0x03,0x13,0x26,0x54,
497 0x75,0x63,0x73,0x6F,0x6E,0x20,0x55,0x6E,0x69,0x66,0x69,0x65,0x64,0x20,0x53,0x63,
498 0x68,0x6F,0x6F,0x6C,0x20,0x44,0x69,0x73,0x74,0x72,0x69,0x63,0x74,0x20,0x52,0x6F,
499 0x6F,0x74,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x31,0x34,0x30,0x39,0x30,0x32,0x30,
500 0x37,0x31,0x36,0x32,0x39,0x5A,0x17,0x0D,0x33,0x34,0x30,0x39,0x30,0x32,0x30,0x37,
501 0x32,0x38,0x33,0x33,0x5A,0x30,0x31,0x31,0x2F,0x30,0x2D,0x06,0x03,0x55,0x04,0x03,
502 0x13,0x26,0x54,0x75,0x63,0x73,0x6F,0x6E,0x20,0x55,0x6E,0x69,0x66,0x69,0x65,0x64,
503 0x20,0x53,0x63,0x68,0x6F,0x6F,0x6C,0x20,0x44,0x69,0x73,0x74,0x72,0x69,0x63,0x74,
504 0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,
505 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,
506 0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xC7,0x5F,0x0B,0x3D,0x69,0x0B,0x4F,
507 0x05,0x0A,0xD9,0x2F,0xFC,0x06,0xD7,0x7E,0x16,0xD2,0x36,0x9E,0x97,0x24,0x4A,0x1B,
508 0xCE,0x8E,0x39,0xE6,0x4E,0x2F,0xF3,0x42,0x52,0x61,0x35,0x5F,0x97,0xD5,0x3C,0x06,
509 0x85,0x2E,0x39,0xD2,0xE9,0x4D,0x5C,0xEA,0xB9,0xE7,0x04,0x22,0x40,0xE1,0x30,0x61,
510 0xD6,0xCC,0x4C,0x0F,0x3B,0xE5,0x25,0x3B,0x21,0x33,0xB7,0x5F,0xA6,0x33,0xC0,0x08,
511 0x18,0xD9,0x4A,0xF7,0xC8,0x1C,0xEE,0x16,0xF5,0x7C,0xB1,0xBF,0x9A,0x01,0x7E,0x21,
512 0x9F,0x0A,0xD7,0xAC,0x63,0xBA,0xA8,0x9B,0x21,0x64,0x6F,0x2B,0x42,0xFA,0x97,0x8B,
513 0xCC,0xF9,0x04,0x91,0x79,0xE1,0xB9,0xFA,0xC2,0xBD,0x2F,0x54,0x02,0x67,0xB1,0xDF,
514 0xB8,0x78,0x76,0x06,0x2B,0xC4,0x2E,0xBA,0x62,0xDB,0x70,0x49,0x59,0x8A,0x64,0xD0,
515 0x71,0xCC,0x60,0x1F,0xC4,0x89,0xE7,0xE2,0x95,0x05,0x39,0x88,0x43,0x21,0x45,0xAE,
516 0x80,0x72,0x2C,0xF6,0x70,0xE1,0xA6,0x65,0x52,0x4F,0x67,0x18,0x7C,0x80,0x4F,0xD3,
517 0xE1,0x6C,0x39,0xAB,0x58,0x6F,0x4A,0x7B,0xB1,0xFB,0x21,0xF5,0xF6,0x26,0xCB,0x15,
518 0x22,0xEF,0x63,0x1E,0x0E,0xBF,0x92,0xB2,0x3D,0x52,0x79,0xBC,0xE9,0xFE,0x62,0x18,
519 0x83,0x0A,0x1D,0x97,0xF0,0x8E,0xE9,0x11,0x77,0x8F,0xDF,0xE5,0x0B,0xB8,0x0D,0xDB,
520 0x6B,0x27,0x21,0xE0,0x12,0xB9,0xF4,0xB5,0xA2,0xD9,0x80,0xF4,0x64,0x66,0x5C,0x61,
521 0xB6,0x16,0xC8,0x21,0x8B,0xDC,0x66,0x4F,0xEE,0x22,0x7F,0x07,0xA8,0x19,0x05,0x9E,
522 0x83,0x0F,0x1E,0xC1,0x93,0x58,0x6C,0xEF,0xB3,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,
523 0xFC,0x30,0x81,0xF9,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,
524 0x86,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,
525 0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xFC,0xEE,0x66,
526 0x3B,0xB0,0xC7,0xD4,0x6F,0x68,0x37,0xBA,0x99,0x27,0x73,0xEE,0x4F,0x8D,0x9B,0xE3,
527 0xF4,0x30,0x10,0x06,0x09,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x15,0x01,0x04,0x03,
528 0x02,0x01,0x01,0x30,0x81,0x82,0x06,0x03,0x55,0x1D,0x20,0x04,0x7B,0x30,0x79,0x30,
529 0x77,0x06,0x08,0x2A,0x03,0x04,0x8B,0x2F,0x43,0x59,0x05,0x30,0x6B,0x30,0x3A,0x06,
530 0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x02,0x30,0x2E,0x1E,0x2C,0x00,0x4C,0x00,
531 0x65,0x00,0x67,0x00,0x61,0x00,0x6C,0x00,0x20,0x00,0x50,0x00,0x6F,0x00,0x6C,0x00,
532 0x69,0x00,0x63,0x00,0x79,0x00,0x20,0x00,0x53,0x00,0x74,0x00,0x61,0x00,0x74,0x00,
533 0x65,0x00,0x6D,0x00,0x65,0x00,0x6E,0x00,0x74,0x30,0x2D,0x06,0x08,0x2B,0x06,0x01,
534 0x05,0x05,0x07,0x02,0x01,0x16,0x21,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,
535 0x6C,0x2E,0x74,0x75,0x73,0x64,0x31,0x2E,0x6F,0x72,0x67,0x2F,0x70,0x6B,0x69,0x2F,
536 0x63,0x70,0x73,0x2E,0x74,0x78,0x74,0x00,0x30,0x23,0x06,0x09,0x2B,0x06,0x01,0x04,
537 0x01,0x82,0x37,0x15,0x02,0x04,0x16,0x04,0x14,0x10,0xF3,0x7D,0x95,0x8D,0xB7,0x2F,
538 0x44,0x17,0xD7,0xED,0x56,0xC3,0x7E,0x64,0xAA,0x4F,0xEF,0x26,0xEA,0x30,0x41,0x06,
539 0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,0x30,0x34,0xA0,0x0F,0x30,0x0D,
540 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0xA1,0x1C,0x30,
541 0x1A,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,0x30,0x0D,0x06,0x09,
542 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0xA2,0x03,0x02,0x01,0x20,
543 0x03,0x82,0x01,0x01,0x00,0x03,0x1F,0xF8,0x3C,0x15,0x37,0xA7,0xBB,0xB1,0x6A,0x27,
544 0xDB,0x27,0x7F,0xF8,0x23,0xAD,0x51,0xEE,0x87,0x61,0xC8,0xAB,0x56,0x83,0x1C,0x11,
545 0xA9,0xAC,0x79,0xB4,0x7E,0x2E,0x33,0x3F,0xBD,0x98,0x7B,0xE4,0x28,0xAB,0xB1,0xCB,
546 0x00,0xEE,0xB3,0x2D,0x6B,0x8D,0x15,0xAD,0x4B,0x51,0x29,0xFE,0x05,0xE6,0x5C,0x1C,
547 0xBA,0x70,0xAF,0x30,0x13,0x2C,0xAE,0xDD,0x8D,0x95,0xF5,0x56,0x13,0x2B,0x43,0x07,
548 0x0F,0xC3,0xCB,0xDA,0x2B,0x46,0x44,0x8E,0x12,0xE3,0x9E,0x14,0xE2,0x5E,0x74,0x07,
549 0x0C,0x92,0xDE,0x99,0x45,0x37,0x51,0xFB,0xDB,0x75,0xFE,0x16,0x37,0x58,0x05,0xB3,
550 0xDE,0x3E,0xD1,0x77,0x57,0x6A,0x56,0xF1,0xF6,0xC1,0x9F,0xA8,0x93,0xCF,0xA8,0x67,
551 0x32,0xE1,0xDB,0x65,0x12,0x39,0x76,0x91,0xB7,0x85,0xDD,0xF0,0x30,0xEF,0x6E,0x68,
552 0x41,0xCD,0x72,0x0B,0x8D,0x85,0x50,0x26,0xC1,0x0B,0x93,0x2B,0x9F,0x07,0x44,0x57,
553 0x84,0x55,0x3F,0x28,0x75,0x05,0x12,0x04,0x58,0x27,0x24,0x5D,0x21,0x68,0xB5,0xF4,
554 0xB9,0xFA,0xE6,0xC1,0xCB,0x99,0x7C,0x85,0x45,0x01,0xFE,0x43,0x8C,0xCA,0x9E,0x44,
555 0x32,0x46,0x23,0xFC,0xBD,0x2D,0xCA,0x19,0xF8,0xDB,0x1C,0x9F,0x85,0x3D,0x7C,0xAA,
556 0xCC,0x42,0x16,0x4D,0x61,0x7D,0xA1,0x67,0xD5,0xC0,0x25,0x62,0xDB,0xE2,0x61,0xB0,
557 0xDD,0xB6,0xD6,0x07,0x03,0x1B,0xD0,0x0E,0xB2,0xBA,0xC2,0xBF,0x24,0x7C,0x2B,0x82,
558 0xEB,0xEE,0xB0,0x29,0xE5,0x8E,0xDD,0x55,0xF6,0x3B,0x5E,0x46,0x0D,0xCE,0x55,0xEA,
559 0x70,0x2F,0xFF,0xF8,0x74,
560 };
561
562 static void test_signature_hash_algorithm()
563 {
564 SecCertificateRef cert=NULL;
565 SecSignatureHashAlgorithm alg=0;
566
567 isnt(cert = SecCertificateCreateWithBytes(NULL, RSA_MD2, sizeof(RSA_MD2)),
568 NULL, "create RSA_MD2");
569 alg = SecCertificateGetSignatureHashAlgorithm(cert);
570 ok(alg == kSecSignatureHashAlgorithmMD2, "expected kSecSignatureHashAlgorithmMD2 (got %d)", (int)alg);
571 CFReleaseNull(cert);
572
573 isnt(cert = SecCertificateCreateWithBytes(NULL, RSA_MD5, sizeof(RSA_MD5)),
574 NULL, "create RSA_MD5");
575 alg = SecCertificateGetSignatureHashAlgorithm(cert);
576 ok(alg == kSecSignatureHashAlgorithmMD5, "expected kSecSignatureHashAlgorithmMD5 (got %d)", (int)alg);
577 CFReleaseNull(cert);
578
579 isnt(cert = SecCertificateCreateWithBytes(NULL, RSA_SHA1, sizeof(RSA_SHA1)),
580 NULL, "create RSA_SHA1");
581 alg = SecCertificateGetSignatureHashAlgorithm(cert);
582 ok(alg == kSecSignatureHashAlgorithmSHA1, "expected kSecSignatureHashAlgorithmSHA1 (got %d)", (int)alg);
583 CFReleaseNull(cert);
584
585 isnt(cert = SecCertificateCreateWithBytes(NULL, RSA_SHA256, sizeof(RSA_SHA256)),
586 NULL, "create RSA_SHA256");
587 alg = SecCertificateGetSignatureHashAlgorithm(cert);
588 ok(alg == kSecSignatureHashAlgorithmSHA256, "expected kSecSignatureHashAlgorithmSHA256 (got %d)", (int)alg);
589 CFReleaseNull(cert);
590
591 isnt(cert = SecCertificateCreateWithBytes(NULL, RSA_SHA512, sizeof(RSA_SHA512)),
592 NULL, "create RSA_SHA512");
593 alg = SecCertificateGetSignatureHashAlgorithm(cert);
594 ok(alg == kSecSignatureHashAlgorithmSHA512, "expected kSecSignatureHashAlgorithmSHA512 (got %d)", (int)alg);
595 CFReleaseNull(cert);
596
597 isnt(cert = SecCertificateCreateWithBytes(NULL, DSA_SHA1, sizeof(DSA_SHA1)),
598 NULL, "create DSA_SHA1");
599 alg = SecCertificateGetSignatureHashAlgorithm(cert);
600 ok(alg == kSecSignatureHashAlgorithmSHA1, "expected kSecSignatureHashAlgorithmSHA1 (got %d)", (int)alg);
601 CFReleaseNull(cert);
602
603 isnt(cert = SecCertificateCreateWithBytes(NULL, ECDSA_SHA1, sizeof(ECDSA_SHA1)),
604 NULL, "create ECDSA_SHA1");
605 alg = SecCertificateGetSignatureHashAlgorithm(cert);
606 ok(alg == kSecSignatureHashAlgorithmSHA1, "expected kSecSignatureHashAlgorithmSHA1 (got %d)", (int)alg);
607 CFReleaseNull(cert);
608
609 isnt(cert = SecCertificateCreateWithBytes(NULL, ECDSA_SHA256, sizeof(ECDSA_SHA256)),
610 NULL, "create ECDSA_SHA256");
611 alg = SecCertificateGetSignatureHashAlgorithm(cert);
612 ok(alg == kSecSignatureHashAlgorithmSHA256, "expected kSecSignatureHashAlgorithmSHA256 (got %d)", (int)alg);
613 CFReleaseNull(cert);
614
615 isnt(cert = SecCertificateCreateWithBytes(NULL, ECDSA_SHA384, sizeof(ECDSA_SHA384)),
616 NULL, "create ECDSA_SHA384");
617 alg = SecCertificateGetSignatureHashAlgorithm(cert);
618 ok(alg == kSecSignatureHashAlgorithmSHA384, "expected kSecSignatureHashAlgorithmSHA384 (got %d)", (int)alg);
619 CFReleaseNull(cert);
620
621 /* %%% RSAPSS is not yet supported; change this test when it is. <rdar://19356971> */
622 isnt(cert = SecCertificateCreateWithBytes(NULL, RSAPSS_SHA256, sizeof(RSAPSS_SHA256)),
623 NULL, "create RSAPSS_SHA256");
624 alg = SecCertificateGetSignatureHashAlgorithm(cert);
625 ok(alg == kSecSignatureHashAlgorithmUnknown, "expected kSecSignatureHashAlgorithmUnknown (got %d)", (int)alg);
626 CFReleaseNull(cert);
627
628 }
629
630 static void tests(void)
631 {
632 test_signature_hash_algorithm();
633 }
634
635 int si_83_seccertificate_sighashalg(int argc, char *const *argv)
636 {
637 plan_tests(20);
638
639 tests();
640
641 return 0;
642 }