Bug Summary

File:examples/CertificateExample.c
Location:line 348, column 3
Description:Value stored to 'result' is never read

Annotated Source Code

1/*
2 * Copyright (C) 2000-2012 Free Software Foundation, Inc.
3 *
4 * This file is part of LIBTASN1.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU 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 * This program 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 General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21/*****************************************************/
22/* File: CertificateExample.c */
23/* Description: An example on how to use the ASN1 */
24/* parser with the Certificate.txt file */
25/*****************************************************/
26
27#include <stdio.h>
28#include <string.h>
29#include <stdlib.h>
30#include "libtasn1.h"
31
32
33static char *
34my_ltostr (long v, char *str)
35{
36 long d, r;
37 char temp[20];
38 int count, k, start;
39
40 if (v < 0)
41 {
42 str[0] = '-';
43 start = 1;
44 v = -v;
45 }
46 else
47 start = 0;
48
49 count = 0;
50 do
51 {
52 d = v / 10;
53 r = v - d * 10;
54 temp[start + count] = '0' + (char) r;
55 count++;
56 v = d;
57 }
58 while (v);
59
60 for (k = 0; k < count; k++)
61 str[k + start] = temp[start + count - k - 1];
62 str[count + start] = 0;
63 return str;
64}
65
66/******************************************************/
67/* Function : get_name_type */
68/* Description: analyze a structure of type Name */
69/* Parameters: */
70/* char *root: the structure identifier */
71/* char *answer: the string with elements like: */
72/* "C=US O=gov" */
73/******************************************************/
74static void
75get_Name_type (ASN1_TYPE cert_def, ASN1_TYPE cert, const char *root,
76 unsigned char *ans)
77{
78 int k, k2, result, len;
79 char name[128], str[1024], str2[1024], name2[128], counter[5], name3[128];
80 ASN1_TYPE value = ASN1_TYPE_EMPTY((void*)0);
81 char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE128];
82 char *answer = (char *) ans;
83 answer[0] = 0;
84 k = 1;
85 do
86 {
87 strcpy (name, root);
88 strcat (name, ".rdnSequence.?");
89 my_ltostr (k, counter);
90 strcat (name, counter);
91 len = sizeof (str) - 1;
92 result = asn1_read_value (cert, name, str, &len);
93 if (result == ASN1_ELEMENT_NOT_FOUND2)
94 break;
95 k2 = 1;
96 do
97 {
98 strcpy (name2, name);
99 strcat (name2, ".?");
100 my_ltostr (k2, counter);
101 strcat (name2, counter);
102 len = sizeof (str) - 1;
103 result = asn1_read_value (cert, name2, str, &len);
104 if (result == ASN1_ELEMENT_NOT_FOUND2)
105 break;
106 strcpy (name3, name2);
107 strcat (name3, ".type");
108 len = sizeof (str) - 1;
109 result = asn1_read_value (cert, name3, str, &len);
110 strcpy (name3, name2);
111 strcat (name3, ".value");
112 if (result == ASN1_SUCCESS0)
113 {
114 len = sizeof (str2) - 1;
115 result =
116 asn1_read_value (cert_def,
117 "PKIX1Implicit88.id-at-countryName", str2,
118 &len);
119 if (!strcmp (str, str2))
120 {
121 asn1_create_element (cert_def,
122 "PKIX1Implicit88.X520OrganizationName",
123 &value);
124 len = sizeof (str) - 1;
125 asn1_read_value (cert, name3, str, &len);
126 asn1_der_decoding (&value, str, len, errorDescription);
127 len = sizeof (str) - 1;
128 asn1_read_value (value, "", str, &len); /* CHOICE */
129 strcpy (name3, str);
130 len = sizeof (str) - 1;
131 asn1_read_value (value, name3, str, &len);
132 str[len] = 0;
133 strcat (answer, " C=");
134 strcat (answer, str);
135 asn1_delete_structure (&value);
136 }
137 else
138 {
139 len = sizeof (str2) - 1;
140 result =
141 asn1_read_value (cert_def,
142 "PKIX1Implicit88.id-at-organizationName",
143 str2, &len);
144 if (!strcmp (str, str2))
145 {
146 asn1_create_element (cert_def,
147 "PKIX1Implicit88.X520OrganizationName",
148 &value);
149 len = sizeof (str) - 1;
150 asn1_read_value (cert, name3, str, &len);
151 asn1_der_decoding (&value, str, len, errorDescription);
152 len = sizeof (str) - 1;
153 asn1_read_value (value, "", str, &len); /* CHOICE */
154 strcpy (name3, str);
155 len = sizeof (str) - 1;
156 asn1_read_value (value, name3, str, &len);
157 str[len] = 0;
158 strcat (answer, " O=");
159 strcat (answer, str);
160 asn1_delete_structure (&value);
161 }
162 else
163 {
164 len = sizeof (str2) - 1;
165 result =
166 asn1_read_value (cert_def,
167 "PKIX1Implicit88.id-at-organizationalUnitName",
168 str2, &len);
169 if (!strcmp (str, str2))
170 {
171 asn1_create_element (cert_def,
172 "PKIX1Implicit88.X520OrganizationalUnitName",
173 &value);
174 len = sizeof (str) - 1;
175 asn1_read_value (cert, name3, str, &len);
176 asn1_der_decoding (&value, str, len,
177 errorDescription);
178 len = sizeof (str) - 1;
179 asn1_read_value (value, "", str, &len); /* CHOICE */
180 strcpy (name3, str);
181 len = sizeof (str) - 1;
182 asn1_read_value (value, name3, str, &len);
183 str[len] = 0;
184 strcat (answer, " OU=");
185 strcat (answer, str);
186 asn1_delete_structure (&value);
187 }
188 }
189 }
190 }
191 k2++;
192 }
193 while (1);
194 k++;
195 }
196 while (1);
197}
198
199
200/******************************************************/
201/* Function : create_certificate */
202/* Description: creates a certificate named */
203/* "certificate1". Values are the same */
204/* as in rfc2459 Appendix D.1 */
205/* Parameters: */
206/* unsigned char *der: contains the der encoding */
207/* int *der_len: number of bytes of der string */
208/******************************************************/
209static void
210create_certificate (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
211{
212 int result, k, len;
213 unsigned char str[1024];
214 const unsigned char *str2;
215 ASN1_TYPE cert1 = ASN1_TYPE_EMPTY((void*)0);
216 ASN1_TYPE value = ASN1_TYPE_EMPTY((void*)0);
217 ASN1_TYPE param = ASN1_TYPE_EMPTY((void*)0);
218 ASN1_TYPE constr = ASN1_TYPE_EMPTY((void*)0);
219 char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE128];
220 int max_len;
221
222 max_len = *der_len;
223
224 result =
225 asn1_create_element (cert_def, "PKIX1Implicit88.Certificate", &cert1);
226
227 /* Use the next 3 lines to visit the empty certificate */
228 /* printf("-----------------\n");
229 asn1_visit_tree(cert1,"");
230 printf("-----------------\n"); */
231
232 /* version: v3(2) */
233 result = asn1_write_value (cert1, "tbsCertificate.version", "v3", 0);
234
235 /* serialNumber: 17 */
236 result = asn1_write_value (cert1, "tbsCertificate.serialNumber", "17", 0);
237
238 /* signature: dsa-with-sha1 */
239 len = sizeof (str) - 1;
240 result =
241 asn1_read_value (cert_def, "PKIX1Implicit88.id-dsa-with-sha1", str, &len);
242 result =
243 asn1_write_value (cert1, "tbsCertificate.signature.algorithm", str, 1);
244
245 result = asn1_write_value (cert1, "tbsCertificate.signature.parameters",
246 NULL((void*)0), 0);
247
248
249 /* issuer: Country="US" Organization="gov" OrganizationUnit="nist" */
250 result =
251 asn1_write_value (cert1, "tbsCertificate.issuer", "rdnSequence", 12);
252
253 result =
254 asn1_write_value (cert1, "tbsCertificate.issuer.rdnSequence", "NEW", 1);
255 result =
256 asn1_write_value (cert1, "tbsCertificate.issuer.rdnSequence.?LAST", "NEW",
257 1);
258 /* C */
259 len = sizeof (str) - 1;
260 result =
261 asn1_read_value (cert_def, "PKIX1Implicit88.id-at-countryName", str,
262 &len);
263 result =
264 asn1_write_value (cert1,
265 "tbsCertificate.issuer.rdnSequence.?LAST.?LAST.type",
266 str, 1);
267 result =
268 asn1_create_element (cert_def, "PKIX1Implicit88.X520countryName", &value);
269 result = asn1_write_value (value, "", "US", 2);
270 *der_len = max_len;
271 result = asn1_der_coding (value, "", der, der_len, errorDescription);
272 asn1_delete_structure (&value);
273 result =
274 asn1_write_value (cert1,
275 "tbsCertificate.issuer.rdnSequence.?LAST.?LAST.value",
276 der, *der_len);
277
278
279 result =
280 asn1_write_value (cert1, "tbsCertificate.issuer.rdnSequence", "NEW", 1);
281 result =
282 asn1_write_value (cert1, "tbsCertificate.issuer.rdnSequence.?LAST", "NEW",
283 1);
284 /* O */
285 len = sizeof (str) - 1;
286 result =
287 asn1_read_value (cert_def, "PKIX1Implicit88.id-at-organizationName", str,
288 &len);
289 result =
290 asn1_write_value (cert1,
291 "tbsCertificate.issuer.rdnSequence.?LAST.?LAST.type",
292 str, 1);
293 result =
294 asn1_create_element (cert_def, "PKIX1Implicit88.X520OrganizationName",
295 &value);
296 result = asn1_write_value (value, "", "printableString", 1);
297 result = asn1_write_value (value, "printableString", "gov", 3);
298 *der_len = max_len;
299 result = asn1_der_coding (value, "", der, der_len, errorDescription);
300 asn1_delete_structure (&value);
301 result =
302 asn1_write_value (cert1,
303 "tbsCertificate.issuer.rdnSequence.?LAST.?LAST.value",
304 der, *der_len);
305
306
307 result =
308 asn1_write_value (cert1, "tbsCertificate.issuer.rdnSequence", "NEW", 1);
309 result =
310 asn1_write_value (cert1, "tbsCertificate.issuer.rdnSequence.?LAST", "NEW",
311 1);
312
313 /* OU */
314 len = sizeof (str) - 1;
315 result =
316 asn1_read_value (cert_def, "PKIX1Implicit88.id-at-organizationalUnitName",
317 str, &len);
318 result =
319 asn1_write_value (cert1,
320 "tbsCertificate.issuer.rdnSequence.?LAST.?LAST.type",
321 str, 1);
322 result =
323 asn1_create_element (cert_def,
324 "PKIX1Implicit88.X520OrganizationalUnitName",
325 &value);
326 result = asn1_write_value (value, "", "printableString", 1);
327 result = asn1_write_value (value, "printableString", "nist", 4);
328 *der_len = max_len;
329 result = asn1_der_coding (value, "", der, der_len, errorDescription);
330 asn1_delete_structure (&value);
331 result =
332 asn1_write_value (cert1,
333 "tbsCertificate.issuer.rdnSequence.?LAST.?LAST.value",
334 der, *der_len);
335
336
337 /* validity */
338 result =
339 asn1_write_value (cert1, "tbsCertificate.validity.notBefore", "utcTime",
340 1);
341 result =
342 asn1_write_value (cert1, "tbsCertificate.validity.notBefore.utcTime",
343 "970630000000Z", 1);
344
345 result =
346 asn1_write_value (cert1, "tbsCertificate.validity.notAfter", "utcTime",
347 1);
348 result =
Value stored to 'result' is never read
349 asn1_write_value (cert1, "tbsCertificate.validity.notAfter.utcTime",
350 "971231000000Z", 1);
351
352
353
354 /* subject: Country="US" Organization="gov" OrganizationUnit="nist" */
355 result =
356 asn1_write_value (cert1, "tbsCertificate.subject", "rdnSequence", 1);
357
358 result =
359 asn1_write_value (cert1, "tbsCertificate.subject.rdnSequence", "NEW", 1);
360 result =
361 asn1_write_value (cert1, "tbsCertificate.subject.rdnSequence.?LAST",
362 "NEW", 1);
363 /* C */
364 len = sizeof (str) - 1;
365 result =
366 asn1_read_value (cert_def, "PKIX1Implicit88.id-at-countryName", str,
367 &len);
368 result =
369 asn1_write_value (cert1,
370 "tbsCertificate.subject.rdnSequence.?LAST.?LAST.type",
371 str, 1);
372 result =
373 asn1_create_element (cert_def, "PKIX1Implicit88.X520countryName", &value);
374 result = asn1_write_value (value, "", "US", 2);
375 *der_len = max_len;
376 result = asn1_der_coding (value, "", der, der_len, errorDescription);
377 asn1_delete_structure (&value);
378 result =
379 asn1_write_value (cert1,
380 "tbsCertificate.subject.rdnSequence.?LAST.?LAST.value",
381 der, *der_len);
382
383
384 result =
385 asn1_write_value (cert1, "tbsCertificate.subject.rdnSequence", "NEW", 4);
386 result =
387 asn1_write_value (cert1, "tbsCertificate.subject.rdnSequence.?LAST",
388 "NEW", 4);
389 /* O */
390 len = sizeof (str) - 1;
391 result =
392 asn1_read_value (cert_def, "PKIX1Implicit88.id-at-organizationName", str,
393 &len);
394 result =
395 asn1_write_value (cert1,
396 "tbsCertificate.subject.rdnSequence.?LAST.?LAST.type",
397 str, 1);
398 result =
399 asn1_create_element (cert_def, "PKIX1Implicit88.X520OrganizationName",
400 &value);
401 result = asn1_write_value (value, "", "printableString", 1);
402 result = asn1_write_value (value, "printableString", "gov", 3);
403 *der_len = max_len;
404 result = asn1_der_coding (value, "", der, der_len, errorDescription);
405 asn1_delete_structure (&value);
406 result =
407 asn1_write_value (cert1,
408 "tbsCertificate.subject.rdnSequence.?LAST.?LAST.value",
409 der, *der_len);
410
411
412 result =
413 asn1_write_value (cert1, "tbsCertificate.subject.rdnSequence", "NEW", 4);
414 result =
415 asn1_write_value (cert1, "tbsCertificate.subject.rdnSequence.?LAST",
416 "NEW", 4);
417 /* OU */
418 len = sizeof (str) - 1;
419 result =
420 asn1_read_value (cert_def, "PKIX1Implicit88.id-at-organizationalUnitName",
421 str, &len);
422 result =
423 asn1_write_value (cert1,
424 "tbsCertificate.subject.rdnSequence.?LAST.?LAST.type",
425 str, 1);
426 result =
427 asn1_create_element (cert_def,
428 "PKIX1Implicit88.X520OrganizationalUnitName",
429 &value);
430 result = asn1_write_value (value, "", "printableString", 1);
431 result = asn1_write_value (value, "printableString", "nist", 4);
432 *der_len = max_len;
433 result = asn1_der_coding (value, "", der, der_len, errorDescription);
434 asn1_delete_structure (&value);
435 result =
436 asn1_write_value (cert1,
437 "tbsCertificate.subject.rdnSequence.?LAST.?LAST.value",
438 der, *der_len);
439
440
441 /* subjectPublicKeyInfo: dsa with parameters=Dss-Parms */
442 len = sizeof (str) - 1;
443 result = asn1_read_value (cert_def, "PKIX1Implicit88.id-dsa", str, &len);
444 result =
445 asn1_write_value (cert1,
446 "tbsCertificate.subjectPublicKeyInfo.algorithm.algorithm",
447 str, 1);
448 result =
449 asn1_create_element (cert_def, "PKIX1Implicit88.Dss-Parms", &param);
450 str2 = (const unsigned char *) "\xd4\x38"; /* only an example */
451 result = asn1_write_value (param, "p", str2, 128);
452 str2 = (const unsigned char *) "\xd4\x38"; /* only an example */
453 result = asn1_write_value (param, "q", str2, 20);
454 str2 = (const unsigned char *) "\xd4\x38"; /* only an example */
455 result = asn1_write_value (param, "g", str2, 128);
456 *der_len = max_len;
457 result = asn1_der_coding (param, "", der, der_len, errorDescription);
458 asn1_delete_structure (&param);
459 result =
460 asn1_write_value (cert1,
461 "tbsCertificate.subjectPublicKeyInfo.algorithm.parameters",
462 der, *der_len);
463
464
465 /* subjectPublicKey */
466 str2 = (const unsigned char *) "\x02\x81"; /* only an example */
467 result =
468 asn1_write_value (cert1,
469 "tbsCertificate.subjectPublicKeyInfo.subjectPublicKey",
470 str2, 1048);
471
472 result = asn1_write_value (cert1, "tbsCertificate.issuerUniqueID", NULL((void*)0), 0); /* NO OPTION */
473 result = asn1_write_value (cert1, "tbsCertificate.subjectUniqueID", NULL((void*)0), 0); /* NO OPTION */
474
475 /* extensions */
476 result = asn1_write_value (cert1, "tbsCertificate.extensions", "NEW", 1);
477 len = sizeof (str) - 1;
478 result =
479 asn1_read_value (cert_def, "PKIX1Implicit88.id-ce-basicConstraints", str,
480 &len);
481 result = asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.extnID", str, 1); /* basicConstraints */
482 result =
483 asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.critical",
484 "TRUE", 1);
485 result =
486 asn1_create_element (cert_def, "PKIX1Implicit88.BasicConstraints",
487 &constr);
488 result = asn1_write_value (constr, "cA", "TRUE", 1);
489 result = asn1_write_value (constr, "pathLenConstraint", NULL((void*)0), 0);
490 *der_len = max_len;
491 result = asn1_der_coding (constr, "", der, der_len, errorDescription);
492 result = asn1_delete_structure (&constr);
493 result =
494 asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.extnValue", der,
495 *der_len);
496
497
498 result = asn1_write_value (cert1, "tbsCertificate.extensions", "NEW", 1);
499 len = sizeof (str) - 1;
500 result =
501 asn1_read_value (cert_def, "PKIX1Implicit88.id-ce-subjectKeyIdentifier",
502 str, &len);
503 result = asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.extnID", str, 1); /* subjectKeyIdentifier */
504 result =
505 asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.critical",
506 "FALSE", 1);
507 str2 = (const unsigned char *) "\x04\x14\xe7\x26\xc5"; /* only an example */
508 result =
509 asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.extnValue",
510 str2, 22);
511
512
513 /* signatureAlgorithm: dsa-with-sha */
514 len = sizeof (str) - 1;
515 result =
516 asn1_read_value (cert_def, "PKIX1Implicit88.id-dsa-with-sha1", str, &len);
517 result = asn1_write_value (cert1, "signatureAlgorithm.algorithm", str, 1);
518 result = asn1_write_value (cert1, "signatureAlgorithm.parameters", NULL((void*)0), 0); /* NO OPTION */
519
520
521 /* signature */
522 *der_len = max_len;
523 result =
524 asn1_der_coding (cert1, "tbsCertificate", der, der_len, errorDescription);
525 if (result != ASN1_SUCCESS0)
526 {
527 printf ("\n'tbsCertificate' encoding creation: ERROR\n");
528 }
529 /* add the lines for the signature on der[0]..der[der_len-1]: result in str2 */
530 result = asn1_write_value (cert1, "signature", str2, 368); /* dsa-with-sha */
531
532
533 /* Use the next 3 lines to visit the certificate */
534 /* printf("-----------------\n");
535 asn1_visit_tree(cert1,"");
536 printf("-----------------\n"); */
537
538 *der_len = max_len;
539 result = asn1_der_coding (cert1, "", der, der_len, errorDescription);
540 if (result != ASN1_SUCCESS0)
541 {
542 printf ("\n'certificate' encoding creation: ERROR\n");
543 return;
544 }
545
546 /* Print the 'Certificate1' DER encoding */
547 printf ("-----------------\nCertificate Encoding:\nNumber of bytes=%i\n",
548 *der_len);
549 for (k = 0; k < *der_len; k++)
550 printf ("%02x ", der[k]);
551 printf ("\n-----------------\n");
552
553 /* Clear the "certificate1" structure */
554 asn1_delete_structure (&cert1);
555}
556
557
558
559/******************************************************/
560/* Function : get_certificate */
561/* Description: creates a certificate named */
562/* "certificate2" from a der encoding */
563/* string */
564/* Parameters: */
565/* unsigned char *der: the encoding string */
566/* int der_len: number of bytes of der string */
567/******************************************************/
568static void
569get_certificate (ASN1_TYPE cert_def, unsigned char *der, int der_len)
570{
571 int result, len, start, end;
572 unsigned char str[1024], str2[1024];
573 ASN1_TYPE cert2 = ASN1_TYPE_EMPTY((void*)0);
574 char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE128];
575
576 asn1_create_element (cert_def, "PKIX1Implicit88.Certificate", &cert2);
577
578 result = asn1_der_decoding (&cert2, der, der_len, errorDescription);
579
580 if (result != ASN1_SUCCESS0)
581 {
582 printf ("Problems with DER encoding\n");
583 return;
584 }
585
586
587 /* issuer */
588 get_Name_type (cert_def, cert2, "tbsCertificate.issuer", str);
589 printf ("certificate:\nissuer :%s\n", str);
590 /* subject */
591 get_Name_type (cert_def, cert2, "tbsCertificate.subject", str);
592 printf ("subject:%s\n", str);
593
594
595 /* Verify sign */
596 len = sizeof (str) - 1;
597 result = asn1_read_value (cert2, "signatureAlgorithm.algorithm", str, &len);
598
599 len = sizeof (str2) - 1;
600 result =
601 asn1_read_value (cert_def, "PKIX1Implicit88.id-dsa-with-sha1", str2,
602 &len);
603 if (!strcmp ((char *) str, (char *) str2))
604 { /* dsa-with-sha */
605
606 result = asn1_der_decoding_startEnd (cert2, der, der_len,
607 "tbsCertificate", &start, &end);
608
609 /* add the lines to calculate the sha on der[start]..der[end] */
610
611 len = sizeof (str) - 1;
612 result = asn1_read_value (cert2, "signature", str, &len);
613
614 /* compare the previous value to signature ( with issuer public key) */
615 }
616
617 /* Use the next 3 lines to visit the certificate */
618 /* printf("-----------------\n");
619 asn1_visit_tree(cert2,"");
620 printf("-----------------\n"); */
621
622
623 /* Clear the "certificate2" structure */
624 asn1_delete_structure (&cert2);
625}
626
627extern const ASN1_ARRAY_TYPE pkix_asn1_tab[];
628
629/********************************************************/
630/* Function : main */
631/* Description: reads the certificate description. */
632/* Creates a certificate and calculate */
633/* the der encoding. After that creates */
634/* another certificate from der string */
635/********************************************************/
636int
637main (int argc, char *argv[])
638{
639 int result, der_len;
640 unsigned char der[1024];
641 ASN1_TYPE PKIX1Implicit88 = ASN1_TYPE_EMPTY((void*)0);
642 char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE128];
643
644 if (1)
645 result =
646 asn1_array2tree (pkix_asn1_tab, &PKIX1Implicit88, errorDescription);
647 else
648 result =
649 asn1_parser2tree ("pkix.asn", &PKIX1Implicit88, errorDescription);
650
651 if (result != ASN1_SUCCESS0)
652 {
653 asn1_perror (result);
654 printf ("%s", errorDescription);
655 exit (1);
656 }
657
658
659 /* Use the following 3 lines to visit the PKIX1Implicit structures */
660 /* printf("-----------------\n");
661 asn1_visit_tree(PKIX1Implicit88,"PKIX1Implicit88");
662 printf("-----------------\n"); */
663
664 der_len = 1024;
665 create_certificate (PKIX1Implicit88, der, &der_len);
666
667 get_certificate (PKIX1Implicit88, der, der_len);
668
669 /* Clear the "PKIX1Implicit88" structures */
670 asn1_delete_structure (&PKIX1Implicit88);
671
672 return 0;
673}