1 |
747 |
jeremybenn |
// Copyright 2009 The Go Authors. All rights reserved.
|
2 |
|
|
// Use of this source code is governed by a BSD-style
|
3 |
|
|
// license that can be found in the LICENSE file.
|
4 |
|
|
|
5 |
|
|
package asn1
|
6 |
|
|
|
7 |
|
|
import (
|
8 |
|
|
"bytes"
|
9 |
|
|
"math/big"
|
10 |
|
|
"reflect"
|
11 |
|
|
"testing"
|
12 |
|
|
"time"
|
13 |
|
|
)
|
14 |
|
|
|
15 |
|
|
type int64Test struct {
|
16 |
|
|
in []byte
|
17 |
|
|
ok bool
|
18 |
|
|
out int64
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
var int64TestData = []int64Test{
|
22 |
|
|
{[]byte{0x00}, true, 0},
|
23 |
|
|
{[]byte{0x7f}, true, 127},
|
24 |
|
|
{[]byte{0x00, 0x80}, true, 128},
|
25 |
|
|
{[]byte{0x01, 0x00}, true, 256},
|
26 |
|
|
{[]byte{0x80}, true, -128},
|
27 |
|
|
{[]byte{0xff, 0x7f}, true, -129},
|
28 |
|
|
{[]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, true, -1},
|
29 |
|
|
{[]byte{0xff}, true, -1},
|
30 |
|
|
{[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, true, -9223372036854775808},
|
31 |
|
|
{[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, false, 0},
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
func TestParseInt64(t *testing.T) {
|
35 |
|
|
for i, test := range int64TestData {
|
36 |
|
|
ret, err := parseInt64(test.in)
|
37 |
|
|
if (err == nil) != test.ok {
|
38 |
|
|
t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
|
39 |
|
|
}
|
40 |
|
|
if test.ok && ret != test.out {
|
41 |
|
|
t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
|
42 |
|
|
}
|
43 |
|
|
}
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
type int32Test struct {
|
47 |
|
|
in []byte
|
48 |
|
|
ok bool
|
49 |
|
|
out int32
|
50 |
|
|
}
|
51 |
|
|
|
52 |
|
|
var int32TestData = []int32Test{
|
53 |
|
|
{[]byte{0x00}, true, 0},
|
54 |
|
|
{[]byte{0x7f}, true, 127},
|
55 |
|
|
{[]byte{0x00, 0x80}, true, 128},
|
56 |
|
|
{[]byte{0x01, 0x00}, true, 256},
|
57 |
|
|
{[]byte{0x80}, true, -128},
|
58 |
|
|
{[]byte{0xff, 0x7f}, true, -129},
|
59 |
|
|
{[]byte{0xff, 0xff, 0xff, 0xff}, true, -1},
|
60 |
|
|
{[]byte{0xff}, true, -1},
|
61 |
|
|
{[]byte{0x80, 0x00, 0x00, 0x00}, true, -2147483648},
|
62 |
|
|
{[]byte{0x80, 0x00, 0x00, 0x00, 0x00}, false, 0},
|
63 |
|
|
}
|
64 |
|
|
|
65 |
|
|
func TestParseInt32(t *testing.T) {
|
66 |
|
|
for i, test := range int32TestData {
|
67 |
|
|
ret, err := parseInt(test.in)
|
68 |
|
|
if (err == nil) != test.ok {
|
69 |
|
|
t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
|
70 |
|
|
}
|
71 |
|
|
if test.ok && int32(ret) != test.out {
|
72 |
|
|
t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
|
73 |
|
|
}
|
74 |
|
|
}
|
75 |
|
|
}
|
76 |
|
|
|
77 |
|
|
var bigIntTests = []struct {
|
78 |
|
|
in []byte
|
79 |
|
|
base10 string
|
80 |
|
|
}{
|
81 |
|
|
{[]byte{0xff}, "-1"},
|
82 |
|
|
{[]byte{0x00}, "0"},
|
83 |
|
|
{[]byte{0x01}, "1"},
|
84 |
|
|
{[]byte{0x00, 0xff}, "255"},
|
85 |
|
|
{[]byte{0xff, 0x00}, "-256"},
|
86 |
|
|
{[]byte{0x01, 0x00}, "256"},
|
87 |
|
|
}
|
88 |
|
|
|
89 |
|
|
func TestParseBigInt(t *testing.T) {
|
90 |
|
|
for i, test := range bigIntTests {
|
91 |
|
|
ret := parseBigInt(test.in)
|
92 |
|
|
if ret.String() != test.base10 {
|
93 |
|
|
t.Errorf("#%d: bad result from %x, got %s want %s", i, test.in, ret.String(), test.base10)
|
94 |
|
|
}
|
95 |
|
|
fw := newForkableWriter()
|
96 |
|
|
marshalBigInt(fw, ret)
|
97 |
|
|
result := fw.Bytes()
|
98 |
|
|
if !bytes.Equal(result, test.in) {
|
99 |
|
|
t.Errorf("#%d: got %x from marshaling %s, want %x", i, result, ret, test.in)
|
100 |
|
|
}
|
101 |
|
|
}
|
102 |
|
|
}
|
103 |
|
|
|
104 |
|
|
type bitStringTest struct {
|
105 |
|
|
in []byte
|
106 |
|
|
ok bool
|
107 |
|
|
out []byte
|
108 |
|
|
bitLength int
|
109 |
|
|
}
|
110 |
|
|
|
111 |
|
|
var bitStringTestData = []bitStringTest{
|
112 |
|
|
{[]byte{}, false, []byte{}, 0},
|
113 |
|
|
{[]byte{0x00}, true, []byte{}, 0},
|
114 |
|
|
{[]byte{0x07, 0x00}, true, []byte{0x00}, 1},
|
115 |
|
|
{[]byte{0x07, 0x01}, false, []byte{}, 0},
|
116 |
|
|
{[]byte{0x07, 0x40}, false, []byte{}, 0},
|
117 |
|
|
{[]byte{0x08, 0x00}, false, []byte{}, 0},
|
118 |
|
|
}
|
119 |
|
|
|
120 |
|
|
func TestBitString(t *testing.T) {
|
121 |
|
|
for i, test := range bitStringTestData {
|
122 |
|
|
ret, err := parseBitString(test.in)
|
123 |
|
|
if (err == nil) != test.ok {
|
124 |
|
|
t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
|
125 |
|
|
}
|
126 |
|
|
if err == nil {
|
127 |
|
|
if test.bitLength != ret.BitLength || bytes.Compare(ret.Bytes, test.out) != 0 {
|
128 |
|
|
t.Errorf("#%d: Bad result: %v (expected %v %v)", i, ret, test.out, test.bitLength)
|
129 |
|
|
}
|
130 |
|
|
}
|
131 |
|
|
}
|
132 |
|
|
}
|
133 |
|
|
|
134 |
|
|
func TestBitStringAt(t *testing.T) {
|
135 |
|
|
bs := BitString{[]byte{0x82, 0x40}, 16}
|
136 |
|
|
if bs.At(0) != 1 {
|
137 |
|
|
t.Error("#1: Failed")
|
138 |
|
|
}
|
139 |
|
|
if bs.At(1) != 0 {
|
140 |
|
|
t.Error("#2: Failed")
|
141 |
|
|
}
|
142 |
|
|
if bs.At(6) != 1 {
|
143 |
|
|
t.Error("#3: Failed")
|
144 |
|
|
}
|
145 |
|
|
if bs.At(9) != 1 {
|
146 |
|
|
t.Error("#4: Failed")
|
147 |
|
|
}
|
148 |
|
|
}
|
149 |
|
|
|
150 |
|
|
type bitStringRightAlignTest struct {
|
151 |
|
|
in []byte
|
152 |
|
|
inlen int
|
153 |
|
|
out []byte
|
154 |
|
|
}
|
155 |
|
|
|
156 |
|
|
var bitStringRightAlignTests = []bitStringRightAlignTest{
|
157 |
|
|
{[]byte{0x80}, 1, []byte{0x01}},
|
158 |
|
|
{[]byte{0x80, 0x80}, 9, []byte{0x01, 0x01}},
|
159 |
|
|
{[]byte{}, 0, []byte{}},
|
160 |
|
|
{[]byte{0xce}, 8, []byte{0xce}},
|
161 |
|
|
{[]byte{0xce, 0x47}, 16, []byte{0xce, 0x47}},
|
162 |
|
|
{[]byte{0x34, 0x50}, 12, []byte{0x03, 0x45}},
|
163 |
|
|
}
|
164 |
|
|
|
165 |
|
|
func TestBitStringRightAlign(t *testing.T) {
|
166 |
|
|
for i, test := range bitStringRightAlignTests {
|
167 |
|
|
bs := BitString{test.in, test.inlen}
|
168 |
|
|
out := bs.RightAlign()
|
169 |
|
|
if bytes.Compare(out, test.out) != 0 {
|
170 |
|
|
t.Errorf("#%d got: %x want: %x", i, out, test.out)
|
171 |
|
|
}
|
172 |
|
|
}
|
173 |
|
|
}
|
174 |
|
|
|
175 |
|
|
type objectIdentifierTest struct {
|
176 |
|
|
in []byte
|
177 |
|
|
ok bool
|
178 |
|
|
out []int
|
179 |
|
|
}
|
180 |
|
|
|
181 |
|
|
var objectIdentifierTestData = []objectIdentifierTest{
|
182 |
|
|
{[]byte{}, false, []int{}},
|
183 |
|
|
{[]byte{85}, true, []int{2, 5}},
|
184 |
|
|
{[]byte{85, 0x02}, true, []int{2, 5, 2}},
|
185 |
|
|
{[]byte{85, 0x02, 0xc0, 0x00}, true, []int{2, 5, 2, 0x2000}},
|
186 |
|
|
{[]byte{85, 0x02, 0xc0, 0x80, 0x80, 0x80, 0x80}, false, []int{}},
|
187 |
|
|
}
|
188 |
|
|
|
189 |
|
|
func TestObjectIdentifier(t *testing.T) {
|
190 |
|
|
for i, test := range objectIdentifierTestData {
|
191 |
|
|
ret, err := parseObjectIdentifier(test.in)
|
192 |
|
|
if (err == nil) != test.ok {
|
193 |
|
|
t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
|
194 |
|
|
}
|
195 |
|
|
if err == nil {
|
196 |
|
|
if !reflect.DeepEqual(test.out, ret) {
|
197 |
|
|
t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
|
198 |
|
|
}
|
199 |
|
|
}
|
200 |
|
|
}
|
201 |
|
|
}
|
202 |
|
|
|
203 |
|
|
type timeTest struct {
|
204 |
|
|
in string
|
205 |
|
|
ok bool
|
206 |
|
|
out time.Time
|
207 |
|
|
}
|
208 |
|
|
|
209 |
|
|
var utcTestData = []timeTest{
|
210 |
|
|
{"910506164540-0700", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", -7*60*60))},
|
211 |
|
|
{"910506164540+0730", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", 7*60*60+30*60))},
|
212 |
|
|
{"910506234540Z", true, time.Date(1991, 05, 06, 23, 45, 40, 0, time.UTC)},
|
213 |
|
|
{"9105062345Z", true, time.Date(1991, 05, 06, 23, 45, 0, 0, time.UTC)},
|
214 |
|
|
{"a10506234540Z", false, time.Time{}},
|
215 |
|
|
{"91a506234540Z", false, time.Time{}},
|
216 |
|
|
{"9105a6234540Z", false, time.Time{}},
|
217 |
|
|
{"910506a34540Z", false, time.Time{}},
|
218 |
|
|
{"910506334a40Z", false, time.Time{}},
|
219 |
|
|
{"91050633444aZ", false, time.Time{}},
|
220 |
|
|
{"910506334461Z", false, time.Time{}},
|
221 |
|
|
{"910506334400Za", false, time.Time{}},
|
222 |
|
|
}
|
223 |
|
|
|
224 |
|
|
func TestUTCTime(t *testing.T) {
|
225 |
|
|
for i, test := range utcTestData {
|
226 |
|
|
ret, err := parseUTCTime([]byte(test.in))
|
227 |
|
|
if err != nil {
|
228 |
|
|
if test.ok {
|
229 |
|
|
t.Errorf("#%d: parseUTCTime(%q) = error %v", i, test.in, err)
|
230 |
|
|
}
|
231 |
|
|
continue
|
232 |
|
|
}
|
233 |
|
|
if !test.ok {
|
234 |
|
|
t.Errorf("#%d: parseUTCTime(%q) succeeded, should have failed", i, test.in)
|
235 |
|
|
continue
|
236 |
|
|
}
|
237 |
|
|
const format = "Jan _2 15:04:05 -0700 2006" // ignore zone name, just offset
|
238 |
|
|
have := ret.Format(format)
|
239 |
|
|
want := test.out.Format(format)
|
240 |
|
|
if have != want {
|
241 |
|
|
t.Errorf("#%d: parseUTCTime(%q) = %s, want %s", i, test.in, have, want)
|
242 |
|
|
}
|
243 |
|
|
}
|
244 |
|
|
}
|
245 |
|
|
|
246 |
|
|
var generalizedTimeTestData = []timeTest{
|
247 |
|
|
{"20100102030405Z", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.UTC)},
|
248 |
|
|
{"20100102030405", false, time.Time{}},
|
249 |
|
|
{"20100102030405+0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", 6*60*60+7*60))},
|
250 |
|
|
{"20100102030405-0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", -6*60*60-7*60))},
|
251 |
|
|
}
|
252 |
|
|
|
253 |
|
|
func TestGeneralizedTime(t *testing.T) {
|
254 |
|
|
for i, test := range generalizedTimeTestData {
|
255 |
|
|
ret, err := parseGeneralizedTime([]byte(test.in))
|
256 |
|
|
if (err == nil) != test.ok {
|
257 |
|
|
t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
|
258 |
|
|
}
|
259 |
|
|
if err == nil {
|
260 |
|
|
if !reflect.DeepEqual(test.out, ret) {
|
261 |
|
|
t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
|
262 |
|
|
}
|
263 |
|
|
}
|
264 |
|
|
}
|
265 |
|
|
}
|
266 |
|
|
|
267 |
|
|
type tagAndLengthTest struct {
|
268 |
|
|
in []byte
|
269 |
|
|
ok bool
|
270 |
|
|
out tagAndLength
|
271 |
|
|
}
|
272 |
|
|
|
273 |
|
|
var tagAndLengthData = []tagAndLengthTest{
|
274 |
|
|
{[]byte{0x80, 0x01}, true, tagAndLength{2, 0, 1, false}},
|
275 |
|
|
{[]byte{0xa0, 0x01}, true, tagAndLength{2, 0, 1, true}},
|
276 |
|
|
{[]byte{0x02, 0x00}, true, tagAndLength{0, 2, 0, false}},
|
277 |
|
|
{[]byte{0xfe, 0x00}, true, tagAndLength{3, 30, 0, true}},
|
278 |
|
|
{[]byte{0x1f, 0x01, 0x00}, true, tagAndLength{0, 1, 0, false}},
|
279 |
|
|
{[]byte{0x1f, 0x81, 0x00, 0x00}, true, tagAndLength{0, 128, 0, false}},
|
280 |
|
|
{[]byte{0x1f, 0x81, 0x80, 0x01, 0x00}, true, tagAndLength{0, 0x4001, 0, false}},
|
281 |
|
|
{[]byte{0x00, 0x81, 0x01}, true, tagAndLength{0, 0, 1, false}},
|
282 |
|
|
{[]byte{0x00, 0x82, 0x01, 0x00}, true, tagAndLength{0, 0, 256, false}},
|
283 |
|
|
{[]byte{0x00, 0x83, 0x01, 0x00}, false, tagAndLength{}},
|
284 |
|
|
{[]byte{0x1f, 0x85}, false, tagAndLength{}},
|
285 |
|
|
{[]byte{0x30, 0x80}, false, tagAndLength{}},
|
286 |
|
|
}
|
287 |
|
|
|
288 |
|
|
func TestParseTagAndLength(t *testing.T) {
|
289 |
|
|
for i, test := range tagAndLengthData {
|
290 |
|
|
tagAndLength, _, err := parseTagAndLength(test.in, 0)
|
291 |
|
|
if (err == nil) != test.ok {
|
292 |
|
|
t.Errorf("#%d: Incorrect error result (did pass? %v, expected: %v)", i, err == nil, test.ok)
|
293 |
|
|
}
|
294 |
|
|
if err == nil && !reflect.DeepEqual(test.out, tagAndLength) {
|
295 |
|
|
t.Errorf("#%d: Bad result: %v (expected %v)", i, tagAndLength, test.out)
|
296 |
|
|
}
|
297 |
|
|
}
|
298 |
|
|
}
|
299 |
|
|
|
300 |
|
|
type parseFieldParametersTest struct {
|
301 |
|
|
in string
|
302 |
|
|
out fieldParameters
|
303 |
|
|
}
|
304 |
|
|
|
305 |
|
|
func newInt(n int) *int { return &n }
|
306 |
|
|
|
307 |
|
|
func newInt64(n int64) *int64 { return &n }
|
308 |
|
|
|
309 |
|
|
func newString(s string) *string { return &s }
|
310 |
|
|
|
311 |
|
|
func newBool(b bool) *bool { return &b }
|
312 |
|
|
|
313 |
|
|
var parseFieldParametersTestData []parseFieldParametersTest = []parseFieldParametersTest{
|
314 |
|
|
{"", fieldParameters{}},
|
315 |
|
|
{"ia5", fieldParameters{stringType: tagIA5String}},
|
316 |
|
|
{"printable", fieldParameters{stringType: tagPrintableString}},
|
317 |
|
|
{"optional", fieldParameters{optional: true}},
|
318 |
|
|
{"explicit", fieldParameters{explicit: true, tag: new(int)}},
|
319 |
|
|
{"application", fieldParameters{application: true, tag: new(int)}},
|
320 |
|
|
{"optional,explicit", fieldParameters{optional: true, explicit: true, tag: new(int)}},
|
321 |
|
|
{"default:42", fieldParameters{defaultValue: newInt64(42)}},
|
322 |
|
|
{"tag:17", fieldParameters{tag: newInt(17)}},
|
323 |
|
|
{"optional,explicit,default:42,tag:17", fieldParameters{optional: true, explicit: true, defaultValue: newInt64(42), tag: newInt(17)}},
|
324 |
|
|
{"optional,explicit,default:42,tag:17,rubbish1", fieldParameters{true, true, false, newInt64(42), newInt(17), 0, false}},
|
325 |
|
|
{"set", fieldParameters{set: true}},
|
326 |
|
|
}
|
327 |
|
|
|
328 |
|
|
func TestParseFieldParameters(t *testing.T) {
|
329 |
|
|
for i, test := range parseFieldParametersTestData {
|
330 |
|
|
f := parseFieldParameters(test.in)
|
331 |
|
|
if !reflect.DeepEqual(f, test.out) {
|
332 |
|
|
t.Errorf("#%d: Bad result: %v (expected %v)", i, f, test.out)
|
333 |
|
|
}
|
334 |
|
|
}
|
335 |
|
|
}
|
336 |
|
|
|
337 |
|
|
type TestObjectIdentifierStruct struct {
|
338 |
|
|
OID ObjectIdentifier
|
339 |
|
|
}
|
340 |
|
|
|
341 |
|
|
type TestContextSpecificTags struct {
|
342 |
|
|
A int `asn1:"tag:1"`
|
343 |
|
|
}
|
344 |
|
|
|
345 |
|
|
type TestContextSpecificTags2 struct {
|
346 |
|
|
A int `asn1:"explicit,tag:1"`
|
347 |
|
|
B int
|
348 |
|
|
}
|
349 |
|
|
|
350 |
|
|
type TestElementsAfterString struct {
|
351 |
|
|
S string
|
352 |
|
|
A, B int
|
353 |
|
|
}
|
354 |
|
|
|
355 |
|
|
type TestBigInt struct {
|
356 |
|
|
X *big.Int
|
357 |
|
|
}
|
358 |
|
|
|
359 |
|
|
var unmarshalTestData = []struct {
|
360 |
|
|
in []byte
|
361 |
|
|
out interface{}
|
362 |
|
|
}{
|
363 |
|
|
{[]byte{0x02, 0x01, 0x42}, newInt(0x42)},
|
364 |
|
|
{[]byte{0x30, 0x08, 0x06, 0x06, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d}, &TestObjectIdentifierStruct{[]int{1, 2, 840, 113549}}},
|
365 |
|
|
{[]byte{0x03, 0x04, 0x06, 0x6e, 0x5d, 0xc0}, &BitString{[]byte{110, 93, 192}, 18}},
|
366 |
|
|
{[]byte{0x30, 0x09, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x03}, &[]int{1, 2, 3}},
|
367 |
|
|
{[]byte{0x02, 0x01, 0x10}, newInt(16)},
|
368 |
|
|
{[]byte{0x13, 0x04, 't', 'e', 's', 't'}, newString("test")},
|
369 |
|
|
{[]byte{0x16, 0x04, 't', 'e', 's', 't'}, newString("test")},
|
370 |
|
|
{[]byte{0x16, 0x04, 't', 'e', 's', 't'}, &RawValue{0, 22, false, []byte("test"), []byte("\x16\x04test")}},
|
371 |
|
|
{[]byte{0x04, 0x04, 1, 2, 3, 4}, &RawValue{0, 4, false, []byte{1, 2, 3, 4}, []byte{4, 4, 1, 2, 3, 4}}},
|
372 |
|
|
{[]byte{0x30, 0x03, 0x81, 0x01, 0x01}, &TestContextSpecificTags{1}},
|
373 |
|
|
{[]byte{0x30, 0x08, 0xa1, 0x03, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02}, &TestContextSpecificTags2{1, 2}},
|
374 |
|
|
{[]byte{0x01, 0x01, 0x00}, newBool(false)},
|
375 |
|
|
{[]byte{0x01, 0x01, 0x01}, newBool(true)},
|
376 |
|
|
{[]byte{0x30, 0x0b, 0x13, 0x03, 0x66, 0x6f, 0x6f, 0x02, 0x01, 0x22, 0x02, 0x01, 0x33}, &TestElementsAfterString{"foo", 0x22, 0x33}},
|
377 |
|
|
{[]byte{0x30, 0x05, 0x02, 0x03, 0x12, 0x34, 0x56}, &TestBigInt{big.NewInt(0x123456)}},
|
378 |
|
|
}
|
379 |
|
|
|
380 |
|
|
func TestUnmarshal(t *testing.T) {
|
381 |
|
|
for i, test := range unmarshalTestData {
|
382 |
|
|
pv := reflect.New(reflect.TypeOf(test.out).Elem())
|
383 |
|
|
val := pv.Interface()
|
384 |
|
|
_, err := Unmarshal(test.in, val)
|
385 |
|
|
if err != nil {
|
386 |
|
|
t.Errorf("Unmarshal failed at index %d %v", i, err)
|
387 |
|
|
}
|
388 |
|
|
if !reflect.DeepEqual(val, test.out) {
|
389 |
|
|
t.Errorf("#%d:\nhave %#v\nwant %#v", i, val, test.out)
|
390 |
|
|
}
|
391 |
|
|
}
|
392 |
|
|
}
|
393 |
|
|
|
394 |
|
|
type Certificate struct {
|
395 |
|
|
TBSCertificate TBSCertificate
|
396 |
|
|
SignatureAlgorithm AlgorithmIdentifier
|
397 |
|
|
SignatureValue BitString
|
398 |
|
|
}
|
399 |
|
|
|
400 |
|
|
type TBSCertificate struct {
|
401 |
|
|
Version int `asn1:"optional,explicit,default:0,tag:0"`
|
402 |
|
|
SerialNumber RawValue
|
403 |
|
|
SignatureAlgorithm AlgorithmIdentifier
|
404 |
|
|
Issuer RDNSequence
|
405 |
|
|
Validity Validity
|
406 |
|
|
Subject RDNSequence
|
407 |
|
|
PublicKey PublicKeyInfo
|
408 |
|
|
}
|
409 |
|
|
|
410 |
|
|
type AlgorithmIdentifier struct {
|
411 |
|
|
Algorithm ObjectIdentifier
|
412 |
|
|
}
|
413 |
|
|
|
414 |
|
|
type RDNSequence []RelativeDistinguishedNameSET
|
415 |
|
|
|
416 |
|
|
type RelativeDistinguishedNameSET []AttributeTypeAndValue
|
417 |
|
|
|
418 |
|
|
type AttributeTypeAndValue struct {
|
419 |
|
|
Type ObjectIdentifier
|
420 |
|
|
Value interface{}
|
421 |
|
|
}
|
422 |
|
|
|
423 |
|
|
type Validity struct {
|
424 |
|
|
NotBefore, NotAfter time.Time
|
425 |
|
|
}
|
426 |
|
|
|
427 |
|
|
type PublicKeyInfo struct {
|
428 |
|
|
Algorithm AlgorithmIdentifier
|
429 |
|
|
PublicKey BitString
|
430 |
|
|
}
|
431 |
|
|
|
432 |
|
|
func TestCertificate(t *testing.T) {
|
433 |
|
|
// This is a minimal, self-signed certificate that should parse correctly.
|
434 |
|
|
var cert Certificate
|
435 |
|
|
if _, err := Unmarshal(derEncodedSelfSignedCertBytes, &cert); err != nil {
|
436 |
|
|
t.Errorf("Unmarshal failed: %v", err)
|
437 |
|
|
}
|
438 |
|
|
if !reflect.DeepEqual(cert, derEncodedSelfSignedCert) {
|
439 |
|
|
t.Errorf("Bad result:\ngot: %+v\nwant: %+v", cert, derEncodedSelfSignedCert)
|
440 |
|
|
}
|
441 |
|
|
}
|
442 |
|
|
|
443 |
|
|
func TestCertificateWithNUL(t *testing.T) {
|
444 |
|
|
// This is the paypal NUL-hack certificate. It should fail to parse because
|
445 |
|
|
// NUL isn't a permitted character in a PrintableString.
|
446 |
|
|
|
447 |
|
|
var cert Certificate
|
448 |
|
|
if _, err := Unmarshal(derEncodedPaypalNULCertBytes, &cert); err == nil {
|
449 |
|
|
t.Error("Unmarshal succeeded, should not have")
|
450 |
|
|
}
|
451 |
|
|
}
|
452 |
|
|
|
453 |
|
|
type rawStructTest struct {
|
454 |
|
|
Raw RawContent
|
455 |
|
|
A int
|
456 |
|
|
}
|
457 |
|
|
|
458 |
|
|
func TestRawStructs(t *testing.T) {
|
459 |
|
|
var s rawStructTest
|
460 |
|
|
input := []byte{0x30, 0x03, 0x02, 0x01, 0x50}
|
461 |
|
|
|
462 |
|
|
rest, err := Unmarshal(input, &s)
|
463 |
|
|
if len(rest) != 0 {
|
464 |
|
|
t.Errorf("incomplete parse: %x", rest)
|
465 |
|
|
return
|
466 |
|
|
}
|
467 |
|
|
if err != nil {
|
468 |
|
|
t.Error(err)
|
469 |
|
|
return
|
470 |
|
|
}
|
471 |
|
|
if s.A != 0x50 {
|
472 |
|
|
t.Errorf("bad value for A: got %d want %d", s.A, 0x50)
|
473 |
|
|
}
|
474 |
|
|
if bytes.Compare([]byte(s.Raw), input) != 0 {
|
475 |
|
|
t.Errorf("bad value for Raw: got %x want %x", s.Raw, input)
|
476 |
|
|
}
|
477 |
|
|
}
|
478 |
|
|
|
479 |
|
|
var derEncodedSelfSignedCert = Certificate{
|
480 |
|
|
TBSCertificate: TBSCertificate{
|
481 |
|
|
Version: 0,
|
482 |
|
|
SerialNumber: RawValue{Class: 0, Tag: 2, IsCompound: false, Bytes: []uint8{0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}, FullBytes: []byte{2, 9, 0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}},
|
483 |
|
|
SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}},
|
484 |
|
|
Issuer: RDNSequence{
|
485 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}},
|
486 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}},
|
487 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}},
|
488 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}},
|
489 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}},
|
490 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}},
|
491 |
|
|
},
|
492 |
|
|
Validity: Validity{
|
493 |
|
|
NotBefore: time.Date(2009, 10, 8, 00, 25, 53, 0, time.UTC),
|
494 |
|
|
NotAfter: time.Date(2010, 10, 8, 00, 25, 53, 0, time.UTC),
|
495 |
|
|
},
|
496 |
|
|
Subject: RDNSequence{
|
497 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}},
|
498 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}},
|
499 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}},
|
500 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}},
|
501 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}},
|
502 |
|
|
RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}},
|
503 |
|
|
},
|
504 |
|
|
PublicKey: PublicKeyInfo{
|
505 |
|
|
Algorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1}},
|
506 |
|
|
PublicKey: BitString{
|
507 |
|
|
Bytes: []uint8{
|
508 |
|
|
0x30, 0x48, 0x2, 0x41, 0x0, 0xcd, 0xb7,
|
509 |
|
|
0x63, 0x9c, 0x32, 0x78, 0xf0, 0x6, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42,
|
510 |
|
|
0x90, 0x2b, 0x59, 0x2d, 0x8c, 0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4,
|
511 |
|
|
0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea, 0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2,
|
512 |
|
|
0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88, 0x96, 0x57, 0x72, 0x2a, 0x4f,
|
513 |
|
|
0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45, 0xdc, 0x8f, 0xde, 0xec,
|
514 |
|
|
0x35, 0x7d, 0x2, 0x3, 0x1, 0x0, 0x1,
|
515 |
|
|
},
|
516 |
|
|
BitLength: 592,
|
517 |
|
|
},
|
518 |
|
|
},
|
519 |
|
|
},
|
520 |
|
|
SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}},
|
521 |
|
|
SignatureValue: BitString{
|
522 |
|
|
Bytes: []uint8{
|
523 |
|
|
0xa6, 0x7b, 0x6, 0xec, 0x5e, 0xce,
|
524 |
|
|
0x92, 0x77, 0x2c, 0xa4, 0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c,
|
525 |
|
|
0x7b, 0x45, 0x11, 0xcd, 0x40, 0xa7, 0xf6, 0x59, 0x98, 0x4, 0x2, 0xdf, 0x2b,
|
526 |
|
|
0x99, 0x8b, 0xb9, 0xa4, 0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8,
|
527 |
|
|
0xd9, 0x1e, 0xde, 0x14, 0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa,
|
528 |
|
|
0xfa, 0x88, 0x21, 0x49, 0x4, 0x35,
|
529 |
|
|
},
|
530 |
|
|
BitLength: 512,
|
531 |
|
|
},
|
532 |
|
|
}
|
533 |
|
|
|
534 |
|
|
var derEncodedSelfSignedCertBytes = []byte{
|
535 |
|
|
0x30, 0x82, 0x02, 0x18, 0x30,
|
536 |
|
|
0x82, 0x01, 0xc2, 0x02, 0x09, 0x00, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c,
|
537 |
|
|
0x98, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
|
538 |
|
|
0x05, 0x05, 0x00, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
|
539 |
|
|
0x04, 0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
|
540 |
|
|
0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
|
541 |
|
|
0x65, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43,
|
542 |
|
|
0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
|
543 |
|
|
0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
|
544 |
|
|
0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31,
|
545 |
|
|
0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c,
|
546 |
|
|
0x73, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
|
547 |
|
|
0x6d, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
|
548 |
|
|
0x01, 0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78,
|
549 |
|
|
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d,
|
550 |
|
|
0x30, 0x39, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35, 0x33, 0x5a,
|
551 |
|
|
0x17, 0x0d, 0x31, 0x30, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35,
|
552 |
|
|
0x33, 0x5a, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
|
553 |
|
|
0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
|
554 |
|
|
0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
|
555 |
|
|
0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43, 0x69,
|
556 |
|
|
0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x18,
|
557 |
|
|
0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
|
558 |
|
|
0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31, 0x1a,
|
559 |
|
|
0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c, 0x73,
|
560 |
|
|
0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
|
561 |
|
|
0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
|
562 |
|
|
0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78, 0x61,
|
563 |
|
|
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x5c, 0x30, 0x0d, 0x06,
|
564 |
|
|
0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
|
565 |
|
|
0x4b, 0x00, 0x30, 0x48, 0x02, 0x41, 0x00, 0xcd, 0xb7, 0x63, 0x9c, 0x32, 0x78,
|
566 |
|
|
0xf0, 0x06, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42, 0x90, 0x2b, 0x59, 0x2d, 0x8c,
|
567 |
|
|
0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4, 0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea,
|
568 |
|
|
0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2, 0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88,
|
569 |
|
|
0x96, 0x57, 0x72, 0x2a, 0x4f, 0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45,
|
570 |
|
|
0xdc, 0x8f, 0xde, 0xec, 0x35, 0x7d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d,
|
571 |
|
|
0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00,
|
572 |
|
|
0x03, 0x41, 0x00, 0xa6, 0x7b, 0x06, 0xec, 0x5e, 0xce, 0x92, 0x77, 0x2c, 0xa4,
|
573 |
|
|
0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c, 0x7b, 0x45, 0x11, 0xcd,
|
574 |
|
|
0x40, 0xa7, 0xf6, 0x59, 0x98, 0x04, 0x02, 0xdf, 0x2b, 0x99, 0x8b, 0xb9, 0xa4,
|
575 |
|
|
0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8, 0xd9, 0x1e, 0xde, 0x14,
|
576 |
|
|
0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa, 0xfa, 0x88, 0x21, 0x49,
|
577 |
|
|
0x04, 0x35,
|
578 |
|
|
}
|
579 |
|
|
|
580 |
|
|
var derEncodedPaypalNULCertBytes = []byte{
|
581 |
|
|
0x30, 0x82, 0x06, 0x44, 0x30,
|
582 |
|
|
0x82, 0x05, 0xad, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x00, 0xf0, 0x9b,
|
583 |
|
|
0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05,
|
584 |
|
|
0x05, 0x00, 0x30, 0x82, 0x01, 0x12, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
|
585 |
|
|
0x04, 0x06, 0x13, 0x02, 0x45, 0x53, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55,
|
586 |
|
|
0x04, 0x08, 0x13, 0x09, 0x42, 0x61, 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61,
|
587 |
|
|
0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x42, 0x61,
|
588 |
|
|
0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03,
|
589 |
|
|
0x55, 0x04, 0x0a, 0x13, 0x20, 0x49, 0x50, 0x53, 0x20, 0x43, 0x65, 0x72, 0x74,
|
590 |
|
|
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74,
|
591 |
|
|
0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x73, 0x2e, 0x6c, 0x2e, 0x31, 0x2e,
|
592 |
|
|
0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x14, 0x25, 0x67, 0x65, 0x6e, 0x65,
|
593 |
|
|
0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d,
|
594 |
|
|
0x20, 0x43, 0x2e, 0x49, 0x2e, 0x46, 0x2e, 0x20, 0x20, 0x42, 0x2d, 0x42, 0x36,
|
595 |
|
|
0x32, 0x32, 0x31, 0x30, 0x36, 0x39, 0x35, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03,
|
596 |
|
|
0x55, 0x04, 0x0b, 0x13, 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c,
|
597 |
|
|
0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
|
598 |
|
|
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
|
599 |
|
|
0x69, 0x74, 0x79, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
|
600 |
|
|
0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41,
|
601 |
|
|
0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
|
602 |
|
|
0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31,
|
603 |
|
|
0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09,
|
604 |
|
|
0x01, 0x16, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70,
|
605 |
|
|
0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x39,
|
606 |
|
|
0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, 0x17, 0x0d,
|
607 |
|
|
0x31, 0x31, 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a,
|
608 |
|
|
0x30, 0x81, 0x94, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
|
609 |
|
|
0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
|
610 |
|
|
0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16,
|
611 |
|
|
0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x53, 0x61, 0x6e, 0x20,
|
612 |
|
|
0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x11, 0x30, 0x0f,
|
613 |
|
|
0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69,
|
614 |
|
|
0x74, 0x79, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0b,
|
615 |
|
|
0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x2f,
|
616 |
|
|
0x30, 0x2d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x26, 0x77, 0x77, 0x77, 0x2e,
|
617 |
|
|
0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x73, 0x73,
|
618 |
|
|
0x6c, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
|
619 |
|
|
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x63, 0x30, 0x81, 0x9f, 0x30, 0x0d,
|
620 |
|
|
0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00,
|
621 |
|
|
0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd2, 0x69,
|
622 |
|
|
0xfa, 0x6f, 0x3a, 0x00, 0xb4, 0x21, 0x1b, 0xc8, 0xb1, 0x02, 0xd7, 0x3f, 0x19,
|
623 |
|
|
0xb2, 0xc4, 0x6d, 0xb4, 0x54, 0xf8, 0x8b, 0x8a, 0xcc, 0xdb, 0x72, 0xc2, 0x9e,
|
624 |
|
|
0x3c, 0x60, 0xb9, 0xc6, 0x91, 0x3d, 0x82, 0xb7, 0x7d, 0x99, 0xff, 0xd1, 0x29,
|
625 |
|
|
0x84, 0xc1, 0x73, 0x53, 0x9c, 0x82, 0xdd, 0xfc, 0x24, 0x8c, 0x77, 0xd5, 0x41,
|
626 |
|
|
0xf3, 0xe8, 0x1e, 0x42, 0xa1, 0xad, 0x2d, 0x9e, 0xff, 0x5b, 0x10, 0x26, 0xce,
|
627 |
|
|
0x9d, 0x57, 0x17, 0x73, 0x16, 0x23, 0x38, 0xc8, 0xd6, 0xf1, 0xba, 0xa3, 0x96,
|
628 |
|
|
0x5b, 0x16, 0x67, 0x4a, 0x4f, 0x73, 0x97, 0x3a, 0x4d, 0x14, 0xa4, 0xf4, 0xe2,
|
629 |
|
|
0x3f, 0x8b, 0x05, 0x83, 0x42, 0xd1, 0xd0, 0xdc, 0x2f, 0x7a, 0xe5, 0xb6, 0x10,
|
630 |
|
|
0xb2, 0x11, 0xc0, 0xdc, 0x21, 0x2a, 0x90, 0xff, 0xae, 0x97, 0x71, 0x5a, 0x49,
|
631 |
|
|
0x81, 0xac, 0x40, 0xf3, 0x3b, 0xb8, 0x59, 0xb2, 0x4f, 0x02, 0x03, 0x01, 0x00,
|
632 |
|
|
0x01, 0xa3, 0x82, 0x03, 0x21, 0x30, 0x82, 0x03, 0x1d, 0x30, 0x09, 0x06, 0x03,
|
633 |
|
|
0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86,
|
634 |
|
|
0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x06, 0x40,
|
635 |
|
|
0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8,
|
636 |
|
|
0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08,
|
637 |
|
|
0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55,
|
638 |
|
|
0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x61, 0x8f, 0x61, 0x34, 0x43, 0x55, 0x14,
|
639 |
|
|
0x7f, 0x27, 0x09, 0xce, 0x4c, 0x8b, 0xea, 0x9b, 0x7b, 0x19, 0x25, 0xbc, 0x6e,
|
640 |
|
|
0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
|
641 |
|
|
0x0e, 0x07, 0x60, 0xd4, 0x39, 0xc9, 0x1b, 0x5b, 0x5d, 0x90, 0x7b, 0x23, 0xc8,
|
642 |
|
|
0xd2, 0x34, 0x9d, 0x4a, 0x9a, 0x46, 0x39, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d,
|
643 |
|
|
0x11, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x1d, 0x12, 0x04,
|
644 |
|
|
0x15, 0x30, 0x13, 0x81, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40,
|
645 |
|
|
0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x72, 0x06, 0x09,
|
646 |
|
|
0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x65, 0x16, 0x63,
|
647 |
|
|
0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
|
648 |
|
|
0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e,
|
649 |
|
|
0x4f, 0x54, 0x20, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x2e,
|
650 |
|
|
0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x53, 0x65, 0x72, 0x76,
|
651 |
|
|
0x65, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
|
652 |
|
|
0x65, 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x68,
|
653 |
|
|
0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70,
|
654 |
|
|
0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x2f, 0x06, 0x09, 0x60,
|
655 |
|
|
0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x02, 0x04, 0x22, 0x16, 0x20, 0x68,
|
656 |
|
|
0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70,
|
657 |
|
|
0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61,
|
658 |
|
|
0x32, 0x30, 0x30, 0x32, 0x2f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
|
659 |
|
|
0x86, 0xf8, 0x42, 0x01, 0x04, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70,
|
660 |
|
|
0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61,
|
661 |
|
|
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30,
|
662 |
|
|
0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c,
|
663 |
|
|
0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x46, 0x06, 0x09,
|
664 |
|
|
0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x03, 0x04, 0x39, 0x16, 0x37,
|
665 |
|
|
0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69,
|
666 |
|
|
0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63,
|
667 |
|
|
0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74,
|
668 |
|
|
0x69, 0x6f, 0x6e, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74,
|
669 |
|
|
0x6d, 0x6c, 0x3f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8,
|
670 |
|
|
0x42, 0x01, 0x07, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a,
|
671 |
|
|
0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63,
|
672 |
|
|
0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f,
|
673 |
|
|
0x72, 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41,
|
674 |
|
|
0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3f, 0x30, 0x41, 0x06, 0x09, 0x60, 0x86,
|
675 |
|
|
0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, 0x04, 0x34, 0x16, 0x32, 0x68, 0x74,
|
676 |
|
|
0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73,
|
677 |
|
|
0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32,
|
678 |
|
|
0x30, 0x30, 0x32, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4c, 0x41,
|
679 |
|
|
0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x30, 0x81, 0x83, 0x06,
|
680 |
|
|
0x03, 0x55, 0x1d, 0x1f, 0x04, 0x7c, 0x30, 0x7a, 0x30, 0x39, 0xa0, 0x37, 0xa0,
|
681 |
|
|
0x35, 0x86, 0x33, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
|
682 |
|
|
0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70,
|
683 |
|
|
0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61,
|
684 |
|
|
0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63,
|
685 |
|
|
0x72, 0x6c, 0x30, 0x3d, 0xa0, 0x3b, 0xa0, 0x39, 0x86, 0x37, 0x68, 0x74, 0x74,
|
686 |
|
|
0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x69,
|
687 |
|
|
0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63,
|
688 |
|
|
0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30,
|
689 |
|
|
0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c,
|
690 |
|
|
0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04,
|
691 |
|
|
0x26, 0x30, 0x24, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
|
692 |
|
|
0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63,
|
693 |
|
|
0x73, 0x70, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
694 |
|
|
0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05,
|
695 |
|
|
0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x68, 0xee, 0x79, 0x97, 0x97, 0xdd, 0x3b,
|
696 |
|
|
0xef, 0x16, 0x6a, 0x06, 0xf2, 0x14, 0x9a, 0x6e, 0xcd, 0x9e, 0x12, 0xf7, 0xaa,
|
697 |
|
|
0x83, 0x10, 0xbd, 0xd1, 0x7c, 0x98, 0xfa, 0xc7, 0xae, 0xd4, 0x0e, 0x2c, 0x9e,
|
698 |
|
|
0x38, 0x05, 0x9d, 0x52, 0x60, 0xa9, 0x99, 0x0a, 0x81, 0xb4, 0x98, 0x90, 0x1d,
|
699 |
|
|
0xae, 0xbb, 0x4a, 0xd7, 0xb9, 0xdc, 0x88, 0x9e, 0x37, 0x78, 0x41, 0x5b, 0xf7,
|
700 |
|
|
0x82, 0xa5, 0xf2, 0xba, 0x41, 0x25, 0x5a, 0x90, 0x1a, 0x1e, 0x45, 0x38, 0xa1,
|
701 |
|
|
0x52, 0x58, 0x75, 0x94, 0x26, 0x44, 0xfb, 0x20, 0x07, 0xba, 0x44, 0xcc, 0xe5,
|
702 |
|
|
0x4a, 0x2d, 0x72, 0x3f, 0x98, 0x47, 0xf6, 0x26, 0xdc, 0x05, 0x46, 0x05, 0x07,
|
703 |
|
|
0x63, 0x21, 0xab, 0x46, 0x9b, 0x9c, 0x78, 0xd5, 0x54, 0x5b, 0x3d, 0x0c, 0x1e,
|
704 |
|
|
0xc8, 0x64, 0x8c, 0xb5, 0x50, 0x23, 0x82, 0x6f, 0xdb, 0xb8, 0x22, 0x1c, 0x43,
|
705 |
|
|
0x96, 0x07, 0xa8, 0xbb,
|
706 |
|
|
}
|