Coverage Report

Created: 2025-08-29 06:57

/src/libtasn1/fuzz/libtasn1_pkix_der_fuzzer.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright(c) 2019 Free Software Foundation, Inc.
3
 *
4
 * This file is part of libtasn1.
5
 *
6
 * Libtasn1 is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Lesser General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * Libtasn1 is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License
17
 * along with libtasn1.  If not, see <https://www.gnu.org/licenses/>.
18
 *
19
 * This fuzzer is testing arbitrary DER input data with GnuTLS's ASN.1 definition (lib/pkix.asn).
20
 * So, any issues found here likely have a real world impact on every software using libgnutls.
21
 */
22
23
#include <config.h>
24
25
#include <assert.h>   /* assert */
26
#include <stdlib.h>   /* malloc, free */
27
#include <string.h>   /* strcmp, memcpy */
28
29
#include "libtasn1.h"
30
#include "fuzzer.h"
31
32
/*
33
 * This is the ASN.1 definition array used by GnuTLS.
34
 * It is created from lib/pkix.asn over at the GnuTLS project.
35
 */
36
static const asn1_static_node pkix_asn1_tab[] = {
37
  {"PKIX1", 536875024, NULL},
38
  {NULL, 1073741836, NULL},
39
  {"PrivateKeyUsagePeriod", 1610612741, NULL},
40
  {"notBefore", 1610637349, NULL},
41
  {NULL, 4104, "0"},
42
  {"notAfter", 536895525, NULL},
43
  {NULL, 4104, "1"},
44
  {"AuthorityKeyIdentifier", 1610612741, NULL},
45
  {"keyIdentifier", 1610637319, NULL},
46
  {NULL, 4104, "0"},
47
  {"authorityCertIssuer", 1610637314, "GeneralNames"},
48
  {NULL, 4104, "1"},
49
  {"authorityCertSerialNumber", 536895490, "CertificateSerialNumber"},
50
  {NULL, 4104, "2"},
51
  {"SubjectKeyIdentifier", 1073741831, NULL},
52
  {"KeyUsage", 1073741830, NULL},
53
  {"DirectoryString", 1610612754, NULL},
54
  {"teletexString", 1612709918, NULL},
55
  {"MAX", 524298, "1"},
56
  {"printableString", 1612709919, NULL},
57
  {"MAX", 524298, "1"},
58
  {"universalString", 1612709920, NULL},
59
  {"MAX", 524298, "1"},
60
  {"utf8String", 1612709922, NULL},
61
  {"MAX", 524298, "1"},
62
  {"bmpString", 1612709921, NULL},
63
  {"MAX", 524298, "1"},
64
  {"ia5String", 538968093, NULL},
65
  {"MAX", 524298, "1"},
66
  {"SubjectAltName", 1073741826, "GeneralNames"},
67
  {"GeneralNames", 1612709899, NULL},
68
  {"MAX", 1074266122, "1"},
69
  {NULL, 2, "GeneralName"},
70
  {"GeneralName", 1610612754, NULL},
71
  {"otherName", 1610620930, "AnotherName"},
72
  {NULL, 4104, "0"},
73
  {"rfc822Name", 1610620957, NULL},
74
  {NULL, 4104, "1"},
75
  {"dNSName", 1610620957, NULL},
76
  {NULL, 4104, "2"},
77
  {"x400Address", 1610620941, NULL},
78
  {NULL, 4104, "3"},
79
  {"directoryName", 1610620939, NULL},
80
  {NULL, 1073743880, "4"},
81
  {NULL, 2, "RelativeDistinguishedName"},
82
  {"ediPartyName", 1610620941, NULL},
83
  {NULL, 4104, "5"},
84
  {"uniformResourceIdentifier", 1610620957, NULL},
85
  {NULL, 4104, "6"},
86
  {"iPAddress", 1610620935, NULL},
87
  {NULL, 4104, "7"},
88
  {"registeredID", 536879116, NULL},
89
  {NULL, 4104, "8"},
90
  {"AnotherName", 1610612741, NULL},
91
  {"type-id", 1073741836, NULL},
92
  {"value", 541073421, NULL},
93
  {NULL, 1073743880, "0"},
94
  {"type-id", 1, NULL},
95
  {"IssuerAltName", 1073741826, "GeneralNames"},
96
  {"BasicConstraints", 1610612741, NULL},
97
  {"cA", 1610645508, NULL},
98
  {NULL, 131081, NULL},
99
  {"pathLenConstraint", 537411587, NULL},
100
  {"0", 10, "MAX"},
101
  {"CRLDistributionPoints", 1612709899, NULL},
102
  {"MAX", 1074266122, "1"},
103
  {NULL, 2, "DistributionPoint"},
104
  {"DistributionPoint", 1610612741, NULL},
105
  {"distributionPoint", 1610637314, "DistributionPointName"},
106
  {NULL, 2056, "0"},
107
  {"reasons", 1610637314, "ReasonFlags"},
108
  {NULL, 4104, "1"},
109
  {"cRLIssuer", 536895490, "GeneralNames"},
110
  {NULL, 4104, "2"},
111
  {"DistributionPointName", 1610612754, NULL},
112
  {"fullName", 1610620930, "GeneralNames"},
113
  {NULL, 4104, "0"},
114
  {"nameRelativeToCRLIssuer", 536879106, "RelativeDistinguishedName"},
115
  {NULL, 4104, "1"},
116
  {"ReasonFlags", 1073741830, NULL},
117
  {"ExtKeyUsageSyntax", 1612709899, NULL},
118
  {"MAX", 1074266122, "1"},
119
  {NULL, 12, NULL},
120
  {"AuthorityInfoAccessSyntax", 1612709899, NULL},
121
  {"MAX", 1074266122, "1"},
122
  {NULL, 2, "AccessDescription"},
123
  {"AccessDescription", 1610612741, NULL},
124
  {"accessMethod", 1073741836, NULL},
125
  {"accessLocation", 2, "GeneralName"},
126
  {"Attribute", 1610612741, NULL},
127
  {"type", 1073741836, NULL},
128
  {"values", 536870927, NULL},
129
  {NULL, 13, NULL},
130
  {"AttributeTypeAndValue", 1610612741, NULL},
131
  {"type", 1073741836, NULL},
132
  {"value", 13, NULL},
133
  {"Name", 1610612754, NULL},
134
  {"rdnSequence", 536870923, NULL},
135
  {NULL, 2, "RelativeDistinguishedName"},
136
  {"DistinguishedName", 1610612747, NULL},
137
  {NULL, 2, "RelativeDistinguishedName"},
138
  {"RelativeDistinguishedName", 1612709903, NULL},
139
  {"MAX", 1074266122, "1"},
140
  {NULL, 2, "AttributeTypeAndValue"},
141
  {"Certificate", 1610612741, NULL},
142
  {"tbsCertificate", 1073741826, "TBSCertificate"},
143
  {"signatureAlgorithm", 1073741826, "AlgorithmIdentifier"},
144
  {"signature", 6, NULL},
145
  {"TBSCertificate", 1610612741, NULL},
146
  {"version", 1610653699, NULL},
147
  {NULL, 1073741833, "0"},
148
  {NULL, 2056, "0"},
149
  {"serialNumber", 1073741826, "CertificateSerialNumber"},
150
  {"signature", 1073741826, "AlgorithmIdentifier"},
151
  {"issuer", 1073741826, "Name"},
152
  {"validity", 1073741826, "Validity"},
153
  {"subject", 1073741826, "Name"},
154
  {"subjectPublicKeyInfo", 1073741826, "SubjectPublicKeyInfo"},
155
  {"issuerUniqueID", 1610637314, "UniqueIdentifier"},
156
  {NULL, 4104, "1"},
157
  {"subjectUniqueID", 1610637314, "UniqueIdentifier"},
158
  {NULL, 4104, "2"},
159
  {"extensions", 536895490, "Extensions"},
160
  {NULL, 2056, "3"},
161
  {"CertificateSerialNumber", 1073741827, NULL},
162
  {"Validity", 1610612741, NULL},
163
  {"notBefore", 1073741826, "Time"},
164
  {"notAfter", 2, "Time"},
165
  {"Time", 1610612754, NULL},
166
  {"utcTime", 1073741860, NULL},
167
  {"generalTime", 37, NULL},
168
  {"UniqueIdentifier", 1073741830, NULL},
169
  {"SubjectPublicKeyInfo", 1610612741, NULL},
170
  {"algorithm", 1073741826, "AlgorithmIdentifier"},
171
  {"subjectPublicKey", 6, NULL},
172
  {"Extensions", 1612709899, NULL},
173
  {"MAX", 1074266122, "1"},
174
  {NULL, 2, "Extension"},
175
  {"Extension", 1610612741, NULL},
176
  {"extnID", 1073741836, NULL},
177
  {"critical", 1610645508, NULL},
178
  {NULL, 131081, NULL},
179
  {"extnValue", 7, NULL},
180
  {"CertificateList", 1610612741, NULL},
181
  {"tbsCertList", 1073741826, "TBSCertList"},
182
  {"signatureAlgorithm", 1073741826, "AlgorithmIdentifier"},
183
  {"signature", 6, NULL},
184
  {"TBSCertList", 1610612741, NULL},
185
  {"version", 1073758211, NULL},
186
  {"signature", 1073741826, "AlgorithmIdentifier"},
187
  {"issuer", 1073741826, "Name"},
188
  {"thisUpdate", 1073741826, "Time"},
189
  {"nextUpdate", 1073758210, "Time"},
190
  {"revokedCertificates", 1610629131, NULL},
191
  {NULL, 536870917, NULL},
192
  {"userCertificate", 1073741826, "CertificateSerialNumber"},
193
  {"revocationDate", 1073741826, "Time"},
194
  {"crlEntryExtensions", 16386, "Extensions"},
195
  {"crlExtensions", 536895490, "Extensions"},
196
  {NULL, 2056, "0"},
197
  {"AlgorithmIdentifier", 1610612741, NULL},
198
  {"algorithm", 1073741836, NULL},
199
  {"parameters", 541081613, NULL},
200
  {"algorithm", 1, NULL},
201
  {"Dss-Sig-Value", 1610612741, NULL},
202
  {"r", 1073741827, NULL},
203
  {"s", 3, NULL},
204
  {"Dss-Parms", 1610612741, NULL},
205
  {"p", 1073741827, NULL},
206
  {"q", 1073741827, NULL},
207
  {"g", 3, NULL},
208
  {"pkcs-7-ContentInfo", 1610612741, NULL},
209
  {"contentType", 1073741836, NULL},
210
  {"content", 541073421, NULL},
211
  {NULL, 1073743880, "0"},
212
  {"contentType", 1, NULL},
213
  {"pkcs-7-DigestInfo", 1610612741, NULL},
214
  {"digestAlgorithm", 1073741826, "AlgorithmIdentifier"},
215
  {"digest", 7, NULL},
216
  {"pkcs-7-SignedData", 1610612741, NULL},
217
  {"version", 1073741827, NULL},
218
  {"digestAlgorithms", 1073741826, "pkcs-7-DigestAlgorithmIdentifiers"},
219
  {"encapContentInfo", 1073741826, "pkcs-7-EncapsulatedContentInfo"},
220
  {"certificates", 1610637314, "pkcs-7-CertificateSet"},
221
  {NULL, 4104, "0"},
222
  {"crls", 1610637314, "pkcs-7-CertificateRevocationLists"},
223
  {NULL, 4104, "1"},
224
  {"signerInfos", 2, "pkcs-7-SignerInfos"},
225
  {"pkcs-7-DigestAlgorithmIdentifiers", 1610612751, NULL},
226
  {NULL, 2, "AlgorithmIdentifier"},
227
  {"pkcs-7-EncapsulatedContentInfo", 1610612741, NULL},
228
  {"eContentType", 1073741836, NULL},
229
  {"eContent", 536895501, NULL},
230
  {NULL, 2056, "0"},
231
  {"pkcs-7-CertificateRevocationLists", 1610612751, NULL},
232
  {NULL, 13, NULL},
233
  {"pkcs-7-CertificateChoices", 1610612754, NULL},
234
  {"certificate", 13, NULL},
235
  {"pkcs-7-CertificateSet", 1610612751, NULL},
236
  {NULL, 2, "pkcs-7-CertificateChoices"},
237
  {"IssuerAndSerialNumber", 1610612741, NULL},
238
  {"issuer", 1073741826, "Name"},
239
  {"serialNumber", 2, "CertificateSerialNumber"},
240
  {"pkcs-7-SignerInfo", 1610612741, NULL},
241
  {"version", 1073741827, NULL},
242
  {"sid", 1073741826, "SignerIdentifier"},
243
  {"digestAlgorithm", 1073741826, "AlgorithmIdentifier"},
244
  {"signedAttrs", 1610637314, "SignedAttributes"},
245
  {NULL, 4104, "0"},
246
  {"signatureAlgorithm", 1073741826, "AlgorithmIdentifier"},
247
  {"signature", 1073741831, NULL},
248
  {"unsignedAttrs", 536895490, "SignedAttributes"},
249
  {NULL, 4104, "1"},
250
  {"SignedAttributes", 1612709903, NULL},
251
  {"MAX", 1074266122, "1"},
252
  {NULL, 2, "Attribute"},
253
  {"SignerIdentifier", 1610612754, NULL},
254
  {"issuerAndSerialNumber", 1073741826, "IssuerAndSerialNumber"},
255
  {"subjectKeyIdentifier", 536879111, NULL},
256
  {NULL, 4104, "0"},
257
  {"pkcs-7-SignerInfos", 1610612751, NULL},
258
  {NULL, 2, "pkcs-7-SignerInfo"},
259
  {"pkcs-10-CertificationRequestInfo", 1610612741, NULL},
260
  {"version", 1073741827, NULL},
261
  {"subject", 1073741826, "Name"},
262
  {"subjectPKInfo", 1073741826, "SubjectPublicKeyInfo"},
263
  {"attributes", 536879106, "Attributes"},
264
  {NULL, 4104, "0"},
265
  {"Attributes", 1610612751, NULL},
266
  {NULL, 2, "Attribute"},
267
  {"pkcs-10-CertificationRequest", 1610612741, NULL},
268
  {"certificationRequestInfo", 1073741826,
269
   "pkcs-10-CertificationRequestInfo"},
270
  {"signatureAlgorithm", 1073741826, "AlgorithmIdentifier"},
271
  {"signature", 6, NULL},
272
  {"pkcs-9-at-challengePassword", 1879048204, NULL},
273
  {"iso", 1073741825, "1"},
274
  {"member-body", 1073741825, "2"},
275
  {"us", 1073741825, "840"},
276
  {"rsadsi", 1073741825, "113549"},
277
  {"pkcs", 1073741825, "1"},
278
  {NULL, 1073741825, "9"},
279
  {NULL, 1, "7"},
280
  {"pkcs-9-challengePassword", 1610612754, NULL},
281
  {"printableString", 1073741855, NULL},
282
  {"utf8String", 34, NULL},
283
  {"pkcs-9-localKeyId", 1073741831, NULL},
284
  {"pkcs-8-PrivateKeyInfo", 1610612741, NULL},
285
  {"version", 1073741827, NULL},
286
  {"privateKeyAlgorithm", 1073741826, "AlgorithmIdentifier"},
287
  {"privateKey", 1073741831, NULL},
288
  {"attributes", 536895490, "Attributes"},
289
  {NULL, 4104, "0"},
290
  {"pkcs-8-EncryptedPrivateKeyInfo", 1610612741, NULL},
291
  {"encryptionAlgorithm", 1073741826, "AlgorithmIdentifier"},
292
  {"encryptedData", 2, "pkcs-8-EncryptedData"},
293
  {"pkcs-8-EncryptedData", 1073741831, NULL},
294
  {"pkcs-5-des-CBC-params", 1612709895, NULL},
295
  {NULL, 1048586, "8"},
296
  {"pkcs-5-des-EDE3-CBC-params", 1612709895, NULL},
297
  {NULL, 1048586, "8"},
298
  {"pkcs-5-aes128-CBC-params", 1612709895, NULL},
299
  {NULL, 1048586, "16"},
300
  {"pkcs-5-aes192-CBC-params", 1612709895, NULL},
301
  {NULL, 1048586, "16"},
302
  {"pkcs-5-aes256-CBC-params", 1612709895, NULL},
303
  {NULL, 1048586, "16"},
304
  {"Gost28147-89-Parameters", 1610612741, NULL},
305
  {"iv", 1073741831, NULL},
306
  {"encryptionParamSet", 12, NULL},
307
  {"pkcs-5-PBE-params", 1610612741, NULL},
308
  {"salt", 1073741831, NULL},
309
  {"iterationCount", 3, NULL},
310
  {"pkcs-5-PBES2-params", 1610612741, NULL},
311
  {"keyDerivationFunc", 1073741826, "AlgorithmIdentifier"},
312
  {"encryptionScheme", 2, "AlgorithmIdentifier"},
313
  {"pkcs-5-PBKDF2-params", 1610612741, NULL},
314
  {"salt", 1610612754, NULL},
315
  {"specified", 1073741831, NULL},
316
  {"otherSource", 2, "AlgorithmIdentifier"},
317
  {"iterationCount", 1611137027, NULL},
318
  {"1", 10, "MAX"},
319
  {"keyLength", 1611153411, NULL},
320
  {"1", 10, "MAX"},
321
  {"prf", 16386, "AlgorithmIdentifier"},
322
  {"pkcs-12-PFX", 1610612741, NULL},
323
  {"version", 1610874883, NULL},
324
  {"v3", 1, "3"},
325
  {"authSafe", 1073741826, "pkcs-7-ContentInfo"},
326
  {"macData", 16386, "pkcs-12-MacData"},
327
  {"pkcs-12-PbeParams", 1610612741, NULL},
328
  {"salt", 1073741831, NULL},
329
  {"iterations", 3, NULL},
330
  {"pkcs-12-MacData", 1610612741, NULL},
331
  {"mac", 1073741826, "pkcs-7-DigestInfo"},
332
  {"macSalt", 1073741831, NULL},
333
  {"iterations", 536903683, NULL},
334
  {NULL, 9, "1"},
335
  {"pkcs-12-AuthenticatedSafe", 1610612747, NULL},
336
  {NULL, 2, "pkcs-7-ContentInfo"},
337
  {"pkcs-12-SafeContents", 1610612747, NULL},
338
  {NULL, 2, "pkcs-12-SafeBag"},
339
  {"pkcs-12-SafeBag", 1610612741, NULL},
340
  {"bagId", 1073741836, NULL},
341
  {"bagValue", 1614815245, NULL},
342
  {NULL, 1073743880, "0"},
343
  {"badId", 1, NULL},
344
  {"bagAttributes", 536887311, NULL},
345
  {NULL, 2, "Attribute"},
346
  {"pkcs-12-CertBag", 1610612741, NULL},
347
  {"certId", 1073741836, NULL},
348
  {"certValue", 541073421, NULL},
349
  {NULL, 1073743880, "0"},
350
  {"certId", 1, NULL},
351
  {"pkcs-12-CRLBag", 1610612741, NULL},
352
  {"crlId", 1073741836, NULL},
353
  {"crlValue", 541073421, NULL},
354
  {NULL, 1073743880, "0"},
355
  {"crlId", 1, NULL},
356
  {"pkcs-12-SecretBag", 1610612741, NULL},
357
  {"secretTypeId", 1073741836, NULL},
358
  {"secretValue", 541073421, NULL},
359
  {NULL, 1073743880, "0"},
360
  {"secretTypeId", 1, NULL},
361
  {"pkcs-7-Data", 1073741831, NULL},
362
  {"pkcs-7-EncryptedData", 1610612741, NULL},
363
  {"version", 1073741827, NULL},
364
  {"encryptedContentInfo", 1073741826, "pkcs-7-EncryptedContentInfo"},
365
  {"unprotectedAttrs", 536895490, "pkcs-7-UnprotectedAttributes"},
366
  {NULL, 4104, "1"},
367
  {"pkcs-7-EncryptedContentInfo", 1610612741, NULL},
368
  {"contentType", 1073741836, NULL},
369
  {"contentEncryptionAlgorithm", 1073741826,
370
   "pkcs-7-ContentEncryptionAlgorithmIdentifier"},
371
  {"encryptedContent", 536895495, NULL},
372
  {NULL, 4104, "0"},
373
  {"pkcs-7-ContentEncryptionAlgorithmIdentifier", 1073741826,
374
   "AlgorithmIdentifier"},
375
  {"pkcs-7-UnprotectedAttributes", 1612709903, NULL},
376
  {"MAX", 1074266122, "1"},
377
  {NULL, 2, "Attribute"},
378
  {"ProxyCertInfo", 1610612741, NULL},
379
  {"pCPathLenConstraint", 1611153411, NULL},
380
  {"0", 10, "MAX"},
381
  {"proxyPolicy", 2, "ProxyPolicy"},
382
  {"ProxyPolicy", 1610612741, NULL},
383
  {"policyLanguage", 1073741836, NULL},
384
  {"policy", 16391, NULL},
385
  {"certificatePolicies", 1612709899, NULL},
386
  {"MAX", 1074266122, "1"},
387
  {NULL, 2, "PolicyInformation"},
388
  {"PolicyInformation", 1610612741, NULL},
389
  {"policyIdentifier", 1073741836, NULL},
390
  {"policyQualifiers", 538984459, NULL},
391
  {"MAX", 1074266122, "1"},
392
  {NULL, 2, "PolicyQualifierInfo"},
393
  {"PolicyQualifierInfo", 1610612741, NULL},
394
  {"policyQualifierId", 1073741836, NULL},
395
  {"qualifier", 541065229, NULL},
396
  {"policyQualifierId", 1, NULL},
397
  {"CPSuri", 1073741853, NULL},
398
  {"UserNotice", 1610612741, NULL},
399
  {"noticeRef", 1073758210, "NoticeReference"},
400
  {"explicitText", 16386, "DisplayText"},
401
  {"NoticeReference", 1610612741, NULL},
402
  {"organization", 1073741826, "DisplayText"},
403
  {"noticeNumbers", 536870923, NULL},
404
  {NULL, 3, NULL},
405
  {"DisplayText", 1610612754, NULL},
406
  {"ia5String", 1612709917, NULL},
407
  {"200", 524298, "1"},
408
  {"visibleString", 1612709923, NULL},
409
  {"200", 524298, "1"},
410
  {"bmpString", 1612709921, NULL},
411
  {"200", 524298, "1"},
412
  {"utf8String", 538968098, NULL},
413
  {"200", 524298, "1"},
414
  {"OCSPRequest", 1610612741, NULL},
415
  {"tbsRequest", 1073741826, "TBSRequest"},
416
  {"optionalSignature", 536895490, "Signature"},
417
  {NULL, 2056, "0"},
418
  {"TBSRequest", 1610612741, NULL},
419
  {"version", 1610653699, NULL},
420
  {NULL, 1073741833, "0"},
421
  {NULL, 2056, "0"},
422
  {"requestorName", 1610637314, "GeneralName"},
423
  {NULL, 2056, "1"},
424
  {"requestList", 1610612747, NULL},
425
  {NULL, 2, "Request"},
426
  {"requestExtensions", 536895490, "Extensions"},
427
  {NULL, 2056, "2"},
428
  {"Signature", 1610612741, NULL},
429
  {"signatureAlgorithm", 1073741826, "AlgorithmIdentifier"},
430
  {"signature", 1073741830, NULL},
431
  {"certs", 536895499, NULL},
432
  {NULL, 1073743880, "0"},
433
  {NULL, 2, "Certificate"},
434
  {"Request", 1610612741, NULL},
435
  {"reqCert", 1073741826, "CertID"},
436
  {"singleRequestExtensions", 536895490, "Extensions"},
437
  {NULL, 2056, "0"},
438
  {"CertID", 1610612741, NULL},
439
  {"hashAlgorithm", 1073741826, "AlgorithmIdentifier"},
440
  {"issuerNameHash", 1073741831, NULL},
441
  {"issuerKeyHash", 1073741831, NULL},
442
  {"serialNumber", 2, "CertificateSerialNumber"},
443
  {"OCSPResponse", 1610612741, NULL},
444
  {"responseStatus", 1073741826, "OCSPResponseStatus"},
445
  {"responseBytes", 536895490, "ResponseBytes"},
446
  {NULL, 2056, "0"},
447
  {"OCSPResponseStatus", 1610874901, NULL},
448
  {"successful", 1073741825, "0"},
449
  {"malformedRequest", 1073741825, "1"},
450
  {"internalError", 1073741825, "2"},
451
  {"tryLater", 1073741825, "3"},
452
  {"sigRequired", 1073741825, "5"},
453
  {"unauthorized", 1, "6"},
454
  {"ResponseBytes", 1610612741, NULL},
455
  {"responseType", 1073741836, NULL},
456
  {"response", 7, NULL},
457
  {"BasicOCSPResponse", 1610612741, NULL},
458
  {"tbsResponseData", 1073741826, "ResponseData"},
459
  {"signatureAlgorithm", 1073741826, "AlgorithmIdentifier"},
460
  {"signature", 1073741830, NULL},
461
  {"certs", 536895499, NULL},
462
  {NULL, 1073743880, "0"},
463
  {NULL, 2, "Certificate"},
464
  {"ResponseData", 1610612741, NULL},
465
  {"version", 1610653699, NULL},
466
  {NULL, 1073741833, "0"},
467
  {NULL, 2056, "0"},
468
  {"responderID", 1073741826, "ResponderID"},
469
  {"producedAt", 1073741861, NULL},
470
  {"responses", 1610612747, NULL},
471
  {NULL, 2, "SingleResponse"},
472
  {"responseExtensions", 536895490, "Extensions"},
473
  {NULL, 2056, "1"},
474
  {"ResponderID", 1610612754, NULL},
475
  {"byName", 1610620939, NULL},
476
  {NULL, 1073743880, "1"},
477
  {NULL, 2, "RelativeDistinguishedName"},
478
  {"byKey", 536879111, NULL},
479
  {NULL, 2056, "2"},
480
  {"SingleResponse", 1610612741, NULL},
481
  {"certID", 1073741826, "CertID"},
482
  {"certStatus", 1073741826, "CertStatus"},
483
  {"thisUpdate", 1073741861, NULL},
484
  {"nextUpdate", 1610637349, NULL},
485
  {NULL, 2056, "0"},
486
  {"singleExtensions", 536895490, "Extensions"},
487
  {NULL, 2056, "1"},
488
  {"CertStatus", 1610612754, NULL},
489
  {"good", 1610620948, NULL},
490
  {NULL, 4104, "0"},
491
  {"revoked", 1610620930, "RevokedInfo"},
492
  {NULL, 4104, "1"},
493
  {"unknown", 536879106, "UnknownInfo"},
494
  {NULL, 4104, "2"},
495
  {"RevokedInfo", 1610612741, NULL},
496
  {"revocationTime", 1073741861, NULL},
497
  {"revocationReason", 537157653, NULL},
498
  {NULL, 1073743880, "0"},
499
  {"unspecified", 1, "0"},
500
  {"UnknownInfo", 1073741844, NULL},
501
  {"NameConstraints", 1610612741, NULL},
502
  {"permittedSubtrees", 1610637314, "GeneralSubtrees"},
503
  {NULL, 4104, "0"},
504
  {"excludedSubtrees", 536895490, "GeneralSubtrees"},
505
  {NULL, 4104, "1"},
506
  {"GeneralSubtrees", 1612709899, NULL},
507
  {"MAX", 1074266122, "1"},
508
  {NULL, 2, "GeneralSubtree"},
509
  {"GeneralSubtree", 1610612741, NULL},
510
  {"base", 1073741826, "GeneralName"},
511
  {"minimum", 1610653699, NULL},
512
  {NULL, 1073741833, "0"},
513
  {NULL, 4104, "0"},
514
  {"maximum", 536895491, NULL},
515
  {NULL, 4104, "1"},
516
  {"TlsFeatures", 536870923, NULL},
517
  {NULL, 3, NULL},
518
  {NULL, 0, NULL}
519
};
520
521
int
522
LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
523
3.93k
{
524
3.93k
  static asn1_node _gnutls_pkix1_asn = NULL;
525
3.93k
  static int first = 1;
526
3.93k
  asn1_node dn;
527
3.93k
  int res, start, end;
528
529
3.93k
  if (size > 10000)    /* same as max_len = 10000 in .options file */
530
5
    return 0;
531
532
3.92k
  if (first)
533
1
    {
534
1
      first = 0;
535
536
      /* from _gnutls_global_init() */
537
1
      res = asn1_array2tree (pkix_asn1_tab, &_gnutls_pkix1_asn, NULL);
538
1
      assert (res == ASN1_SUCCESS);
539
1
    }
540
541
  /* from cert_get_issuer_dn() */
542
3.92k
  if ((res =
543
3.92k
       asn1_create_element (_gnutls_pkix1_asn, "PKIX1.Certificate",
544
3.92k
          &dn)) != ASN1_SUCCESS)
545
0
    {
546
0
      goto out;
547
0
    }
548
549
  /* from cert_get_issuer_dn() */
550
3.92k
  res = asn1_der_decoding (&dn, data, size, NULL);
551
3.92k
  if (res != ASN1_SUCCESS)
552
3.84k
    {
553
3.84k
      goto out;
554
3.84k
    }
555
556
  /* from cert_get_issuer_dn() */
557
82
  res =
558
82
    asn1_der_decoding_startEnd (dn, data, size, "tbsCertificate.issuer",
559
82
        &start, &end);
560
82
  if (res != ASN1_SUCCESS)
561
20
    {
562
20
      goto out;
563
20
    }
564
565
3.92k
out:
566
3.92k
  asn1_delete_structure (&dn);
567
568
3.92k
  return 0;
569
82
}