diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_crld.c | 153 |
1 files changed, 132 insertions, 21 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_crld.c b/src/lib/libcrypto/x509v3/v3_crld.c index b2e4370658..9c4017968d 100644 --- a/src/lib/libcrypto/x509v3/v3_crld.c +++ b/src/lib/libcrypto/x509v3/v3_crld.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: v3_crld.c,v 1.16 2015/02/14 15:19:04 miod Exp $ */ | 1 | /* $OpenBSD: v3_crld.c,v 1.17 2015/07/25 16:00:14 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -374,10 +374,34 @@ dpn_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) | |||
374 | } | 374 | } |
375 | 375 | ||
376 | 376 | ||
377 | ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) = { | 377 | static const ASN1_AUX DIST_POINT_NAME_aux = { |
378 | ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0), | 378 | .app_data = NULL, |
379 | .flags = 0, | ||
380 | .ref_offset = 0, | ||
381 | .ref_lock = 0, | ||
382 | .asn1_cb = dpn_cb, | ||
383 | .enc_offset = 0, | ||
384 | }; | ||
385 | static const ASN1_TEMPLATE DIST_POINT_NAME_ch_tt[] = { | ||
386 | { | ||
387 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_SEQUENCE_OF, | ||
388 | .tag = 0, | ||
389 | .offset = offsetof(DIST_POINT_NAME, name.fullname), | ||
390 | .field_name = "name.fullname", | ||
391 | .item = &GENERAL_NAME_it, | ||
392 | }, | ||
379 | ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1) | 393 | ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1) |
380 | } ASN1_CHOICE_END_cb(DIST_POINT_NAME, DIST_POINT_NAME, type) | 394 | }; |
395 | |||
396 | const ASN1_ITEM DIST_POINT_NAME_it = { | ||
397 | .itype = ASN1_ITYPE_CHOICE, | ||
398 | .utype = offsetof(DIST_POINT_NAME, type), | ||
399 | .templates = DIST_POINT_NAME_ch_tt, | ||
400 | .tcount = sizeof(DIST_POINT_NAME_ch_tt) / sizeof(ASN1_TEMPLATE), | ||
401 | .funcs = &DIST_POINT_NAME_aux, | ||
402 | .size = sizeof(DIST_POINT_NAME), | ||
403 | .sname = "DIST_POINT_NAME", | ||
404 | }; | ||
381 | 405 | ||
382 | 406 | ||
383 | 407 | ||
@@ -406,11 +430,39 @@ DIST_POINT_NAME_free(DIST_POINT_NAME *a) | |||
406 | ASN1_item_free((ASN1_VALUE *)a, &DIST_POINT_NAME_it); | 430 | ASN1_item_free((ASN1_VALUE *)a, &DIST_POINT_NAME_it); |
407 | } | 431 | } |
408 | 432 | ||
409 | ASN1_SEQUENCE(DIST_POINT) = { | 433 | static const ASN1_TEMPLATE DIST_POINT_seq_tt[] = { |
410 | ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0), | 434 | { |
411 | ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1), | 435 | .flags = ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL, |
412 | ASN1_IMP_SEQUENCE_OF_OPT(DIST_POINT, CRLissuer, GENERAL_NAME, 2) | 436 | .tag = 0, |
413 | } ASN1_SEQUENCE_END(DIST_POINT) | 437 | .offset = offsetof(DIST_POINT, distpoint), |
438 | .field_name = "distpoint", | ||
439 | .item = &DIST_POINT_NAME_it, | ||
440 | }, | ||
441 | { | ||
442 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_OPTIONAL, | ||
443 | .tag = 1, | ||
444 | .offset = offsetof(DIST_POINT, reasons), | ||
445 | .field_name = "reasons", | ||
446 | .item = &ASN1_BIT_STRING_it, | ||
447 | }, | ||
448 | { | ||
449 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL, | ||
450 | .tag = 2, | ||
451 | .offset = offsetof(DIST_POINT, CRLissuer), | ||
452 | .field_name = "CRLissuer", | ||
453 | .item = &GENERAL_NAME_it, | ||
454 | }, | ||
455 | }; | ||
456 | |||
457 | const ASN1_ITEM DIST_POINT_it = { | ||
458 | .itype = ASN1_ITYPE_SEQUENCE, | ||
459 | .utype = V_ASN1_SEQUENCE, | ||
460 | .templates = DIST_POINT_seq_tt, | ||
461 | .tcount = sizeof(DIST_POINT_seq_tt) / sizeof(ASN1_TEMPLATE), | ||
462 | .funcs = NULL, | ||
463 | .size = sizeof(DIST_POINT), | ||
464 | .sname = "DIST_POINT", | ||
465 | }; | ||
414 | 466 | ||
415 | 467 | ||
416 | DIST_POINT * | 468 | DIST_POINT * |
@@ -438,10 +490,23 @@ DIST_POINT_free(DIST_POINT *a) | |||
438 | ASN1_item_free((ASN1_VALUE *)a, &DIST_POINT_it); | 490 | ASN1_item_free((ASN1_VALUE *)a, &DIST_POINT_it); |
439 | } | 491 | } |
440 | 492 | ||
441 | ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) = | 493 | static const ASN1_TEMPLATE CRL_DIST_POINTS_item_tt = { |
442 | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CRLDistributionPoints, | 494 | .flags = ASN1_TFLG_SEQUENCE_OF, |
443 | DIST_POINT) | 495 | .tag = 0, |
444 | ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS) | 496 | .offset = 0, |
497 | .field_name = "CRLDistributionPoints", | ||
498 | .item = &DIST_POINT_it, | ||
499 | }; | ||
500 | |||
501 | const ASN1_ITEM CRL_DIST_POINTS_it = { | ||
502 | .itype = ASN1_ITYPE_PRIMITIVE, | ||
503 | .utype = -1, | ||
504 | .templates = &CRL_DIST_POINTS_item_tt, | ||
505 | .tcount = 0, | ||
506 | .funcs = NULL, | ||
507 | .size = 0, | ||
508 | .sname = "CRL_DIST_POINTS", | ||
509 | }; | ||
445 | 510 | ||
446 | 511 | ||
447 | CRL_DIST_POINTS * | 512 | CRL_DIST_POINTS * |
@@ -469,14 +534,60 @@ CRL_DIST_POINTS_free(CRL_DIST_POINTS *a) | |||
469 | ASN1_item_free((ASN1_VALUE *)a, &CRL_DIST_POINTS_it); | 534 | ASN1_item_free((ASN1_VALUE *)a, &CRL_DIST_POINTS_it); |
470 | } | 535 | } |
471 | 536 | ||
472 | ASN1_SEQUENCE(ISSUING_DIST_POINT) = { | 537 | static const ASN1_TEMPLATE ISSUING_DIST_POINT_seq_tt[] = { |
473 | ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0), | 538 | { |
474 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1), | 539 | .flags = ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL, |
475 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2), | 540 | .tag = 0, |
476 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3), | 541 | .offset = offsetof(ISSUING_DIST_POINT, distpoint), |
477 | ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4), | 542 | .field_name = "distpoint", |
478 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyattr, ASN1_FBOOLEAN, 5) | 543 | .item = &DIST_POINT_NAME_it, |
479 | } ASN1_SEQUENCE_END(ISSUING_DIST_POINT) | 544 | }, |
545 | { | ||
546 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_OPTIONAL, | ||
547 | .tag = 1, | ||
548 | .offset = offsetof(ISSUING_DIST_POINT, onlyuser), | ||
549 | .field_name = "onlyuser", | ||
550 | .item = &ASN1_FBOOLEAN_it, | ||
551 | }, | ||
552 | { | ||
553 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_OPTIONAL, | ||
554 | .tag = 2, | ||
555 | .offset = offsetof(ISSUING_DIST_POINT, onlyCA), | ||
556 | .field_name = "onlyCA", | ||
557 | .item = &ASN1_FBOOLEAN_it, | ||
558 | }, | ||
559 | { | ||
560 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_OPTIONAL, | ||
561 | .tag = 3, | ||
562 | .offset = offsetof(ISSUING_DIST_POINT, onlysomereasons), | ||
563 | .field_name = "onlysomereasons", | ||
564 | .item = &ASN1_BIT_STRING_it, | ||
565 | }, | ||
566 | { | ||
567 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_OPTIONAL, | ||
568 | .tag = 4, | ||
569 | .offset = offsetof(ISSUING_DIST_POINT, indirectCRL), | ||
570 | .field_name = "indirectCRL", | ||
571 | .item = &ASN1_FBOOLEAN_it, | ||
572 | }, | ||
573 | { | ||
574 | .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_OPTIONAL, | ||
575 | .tag = 5, | ||
576 | .offset = offsetof(ISSUING_DIST_POINT, onlyattr), | ||
577 | .field_name = "onlyattr", | ||
578 | .item = &ASN1_FBOOLEAN_it, | ||
579 | }, | ||
580 | }; | ||
581 | |||
582 | const ASN1_ITEM ISSUING_DIST_POINT_it = { | ||
583 | .itype = ASN1_ITYPE_SEQUENCE, | ||
584 | .utype = V_ASN1_SEQUENCE, | ||
585 | .templates = ISSUING_DIST_POINT_seq_tt, | ||
586 | .tcount = sizeof(ISSUING_DIST_POINT_seq_tt) / sizeof(ASN1_TEMPLATE), | ||
587 | .funcs = NULL, | ||
588 | .size = sizeof(ISSUING_DIST_POINT), | ||
589 | .sname = "ISSUING_DIST_POINT", | ||
590 | }; | ||
480 | 591 | ||
481 | 592 | ||
482 | ISSUING_DIST_POINT * | 593 | ISSUING_DIST_POINT * |