From: Alberto Leiva Popper Date: Fri, 30 Jun 2023 18:04:05 +0000 (-0600) Subject: Merge ASID and ASId into ASId X-Git-Tag: 1.6.0~79^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84952a96c5b4923dbf754b7ec5d8a3b35ab0bd23;p=thirdparty%2FFORT-validator.git Merge ASID and ASId into ASId They are the same data type. I'm merging them into the latter because it's more widely used. Fixes #94, I think. --- diff --git a/src/asn1/asn1c/ASID.c b/src/asn1/asn1c/ASID.c deleted file mode 100644 index 457540b2..00000000 --- a/src/asn1/asn1c/ASID.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "RPKI-ROA" - * found in "rfc6482.asn1" - * `asn1c -Werror -fcompound-names -fwide-types -D asn1/asn1c -no-gen-PER -no-gen-example` - */ - -#include "ASID.h" - -/* - * This type is implemented using INTEGER, - * so here we adjust the DEF accordingly. - */ -static const ber_tlv_tag_t asn_DEF_ASID_tags_1[] = { - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) -}; -asn_TYPE_descriptor_t asn_DEF_ASID = { - "ASID", - "ASID", - &asn_OP_INTEGER, - asn_DEF_ASID_tags_1, - sizeof(asn_DEF_ASID_tags_1) - /sizeof(asn_DEF_ASID_tags_1[0]), /* 1 */ - asn_DEF_ASID_tags_1, /* Same as above */ - sizeof(asn_DEF_ASID_tags_1) - /sizeof(asn_DEF_ASID_tags_1[0]), /* 1 */ - { 0, 0, INTEGER_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - diff --git a/src/asn1/asn1c/ASID.h b/src/asn1/asn1c/ASID.h deleted file mode 100644 index 28dca0c9..00000000 --- a/src/asn1/asn1c/ASID.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "RPKI-ROA" - * found in "rfc6482.asn1" - * `asn1c -Werror -fcompound-names -fwide-types -D asn1/asn1c -no-gen-PER -no-gen-example` - */ - -#ifndef _ASID_H_ -#define _ASID_H_ - - -#include "asn1/asn1c/asn_application.h" - -/* Including external dependencies */ -#include "asn1/asn1c/INTEGER.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* ASID */ -typedef INTEGER_t ASID_t; - -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ASID; -asn_struct_free_f ASID_free; -asn_struct_print_f ASID_print; -asn_constr_check_f ASID_constraint; -ber_type_decoder_f ASID_decode_ber; -der_type_encoder_f ASID_encode_der; -xer_type_decoder_f ASID_decode_xer; -xer_type_encoder_f ASID_encode_xer; -oer_type_decoder_f ASID_decode_oer; -oer_type_encoder_f ASID_encode_oer; - -#ifdef __cplusplus -} -#endif - -#endif /* _ASID_H_ */ -#include "asn1/asn1c/asn_internal.h" diff --git a/src/asn1/asn1c/ASId.c b/src/asn1/asn1c/ASId.c index 457540b2..e64dd0f9 100644 --- a/src/asn1/asn1c/ASId.c +++ b/src/asn1/asn1c/ASId.c @@ -1,29 +1,29 @@ /* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "RPKI-ROA" - * found in "rfc6482.asn1" + * From ASN.1 module "IPAddrAndASCertExtn" + * found in "rfc3779.asn1" * `asn1c -Werror -fcompound-names -fwide-types -D asn1/asn1c -no-gen-PER -no-gen-example` */ -#include "ASID.h" +#include "ASId.h" /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ -static const ber_tlv_tag_t asn_DEF_ASID_tags_1[] = { +static const ber_tlv_tag_t asn_DEF_ASId_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_ASID = { - "ASID", - "ASID", +asn_TYPE_descriptor_t asn_DEF_ASId = { + "ASId", + "ASId", &asn_OP_INTEGER, - asn_DEF_ASID_tags_1, - sizeof(asn_DEF_ASID_tags_1) - /sizeof(asn_DEF_ASID_tags_1[0]), /* 1 */ - asn_DEF_ASID_tags_1, /* Same as above */ - sizeof(asn_DEF_ASID_tags_1) - /sizeof(asn_DEF_ASID_tags_1[0]), /* 1 */ + asn_DEF_ASId_tags_1, + sizeof(asn_DEF_ASId_tags_1) + /sizeof(asn_DEF_ASId_tags_1[0]), /* 1 */ + asn_DEF_ASId_tags_1, /* Same as above */ + sizeof(asn_DEF_ASId_tags_1) + /sizeof(asn_DEF_ASId_tags_1[0]), /* 1 */ { 0, 0, INTEGER_constraint }, 0, 0, /* No members */ 0 /* No specifics */ diff --git a/src/asn1/asn1c/ASId.h b/src/asn1/asn1c/ASId.h index 28dca0c9..f8735d9d 100644 --- a/src/asn1/asn1c/ASId.h +++ b/src/asn1/asn1c/ASId.h @@ -1,12 +1,12 @@ /* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "RPKI-ROA" - * found in "rfc6482.asn1" + * From ASN.1 module "IPAddrAndASCertExtn" + * found in "rfc3779.asn1" * `asn1c -Werror -fcompound-names -fwide-types -D asn1/asn1c -no-gen-PER -no-gen-example` */ -#ifndef _ASID_H_ -#define _ASID_H_ +#ifndef _ASId_H_ +#define _ASId_H_ #include "asn1/asn1c/asn_application.h" @@ -18,24 +18,24 @@ extern "C" { #endif -/* ASID */ -typedef INTEGER_t ASID_t; +/* ASId */ +typedef INTEGER_t ASId_t; /* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ASID; -asn_struct_free_f ASID_free; -asn_struct_print_f ASID_print; -asn_constr_check_f ASID_constraint; -ber_type_decoder_f ASID_decode_ber; -der_type_encoder_f ASID_encode_der; -xer_type_decoder_f ASID_decode_xer; -xer_type_encoder_f ASID_encode_xer; -oer_type_decoder_f ASID_decode_oer; -oer_type_encoder_f ASID_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_ASId; +asn_struct_free_f ASId_free; +asn_struct_print_f ASId_print; +asn_constr_check_f ASId_constraint; +ber_type_decoder_f ASId_decode_ber; +der_type_encoder_f ASId_encode_der; +xer_type_decoder_f ASId_decode_xer; +xer_type_encoder_f ASId_encode_xer; +oer_type_decoder_f ASId_decode_oer; +oer_type_encoder_f ASId_encode_oer; #ifdef __cplusplus } #endif -#endif /* _ASID_H_ */ +#endif /* _ASId_H_ */ #include "asn1/asn1c/asn_internal.h" diff --git a/src/asn1/asn1c/Makefile.include b/src/asn1/asn1c/Makefile.include index 9d606b59..ffe856d5 100644 --- a/src/asn1/asn1c/Makefile.include +++ b/src/asn1/asn1c/Makefile.include @@ -54,7 +54,6 @@ ASN_MODULE_SRCS= \ asn1/asn1c/SigningTime.c \ asn1/asn1c/Countersignature.c \ asn1/asn1c/RouteOriginAttestation.c \ - asn1/asn1c/ASID.c \ asn1/asn1c/ROAIPAddressFamily.c \ asn1/asn1c/ROAIPAddress.c \ asn1/asn1c/Manifest.c \ @@ -118,7 +117,6 @@ ASN_MODULE_HDRS= \ asn1/asn1c/SigningTime.h \ asn1/asn1c/Countersignature.h \ asn1/asn1c/RouteOriginAttestation.h \ - asn1/asn1c/ASID.h \ asn1/asn1c/ROAIPAddressFamily.h \ asn1/asn1c/ROAIPAddress.h \ asn1/asn1c/Manifest.h \ diff --git a/src/asn1/asn1c/RouteOriginAttestation.c b/src/asn1/asn1c/RouteOriginAttestation.c index da26f152..646964b9 100644 --- a/src/asn1/asn1c/RouteOriginAttestation.c +++ b/src/asn1/asn1c/RouteOriginAttestation.c @@ -110,14 +110,14 @@ static asn_TYPE_member_t asn_MBR_RouteOriginAttestation_1[] = { &asn_DFL_2_set_0, /* Set DEFAULT 0 */ "version" }, - { ATF_NOFLAGS, 0, offsetof(struct RouteOriginAttestation, asID), + { ATF_NOFLAGS, 0, offsetof(struct RouteOriginAttestation, asId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, - &asn_DEF_ASID, + &asn_DEF_ASId, 0, { 0, 0, 0 }, 0, 0, /* No default value */ - "asID" + "asId" }, { ATF_NOFLAGS, 0, offsetof(struct RouteOriginAttestation, ipAddrBlocks), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), @@ -134,7 +134,7 @@ static const ber_tlv_tag_t asn_DEF_RouteOriginAttestation_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static const asn_TYPE_tag2member_t asn_MAP_RouteOriginAttestation_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* asID */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* asId */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 }, /* ipAddrBlocks */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ }; diff --git a/src/asn1/asn1c/RouteOriginAttestation.h b/src/asn1/asn1c/RouteOriginAttestation.h index 39729b78..c5ae9e41 100644 --- a/src/asn1/asn1c/RouteOriginAttestation.h +++ b/src/asn1/asn1c/RouteOriginAttestation.h @@ -13,7 +13,7 @@ /* Including external dependencies */ #include "asn1/asn1c/INTEGER.h" -#include "ASID.h" +#include "ASId.h" #include "asn1/asn1c/asn_SEQUENCE_OF.h" #include "asn1/asn1c/constr_SEQUENCE_OF.h" #include "asn1/asn1c/constr_SEQUENCE.h" @@ -28,7 +28,7 @@ struct ROAIPAddressFamily; /* RouteOriginAttestation */ typedef struct RouteOriginAttestation { INTEGER_t *version /* DEFAULT 0 */; - ASID_t asID; + ASId_t asId; struct RouteOriginAttestation__ipAddrBlocks { A_SEQUENCE_OF(struct ROAIPAddressFamily) list; diff --git a/src/object/roa.c b/src/object/roa.c index fc979e54..6bdb5786 100644 --- a/src/object/roa.c +++ b/src/object/roa.c @@ -180,7 +180,7 @@ __handle_roa(struct RouteOriginAttestation *roa, struct resources *parent) } /* rfc6482#section-3.2 */ - if (asn_INTEGER2ulong(&roa->asID, &asn) != 0) { + if (asn_INTEGER2ulong(&roa->asId, &asn) != 0) { if (errno) { pr_val_err("Error casting ROA's AS ID value: %s", strerror(errno)); @@ -193,7 +193,7 @@ __handle_roa(struct RouteOriginAttestation *roa, struct resources *parent) error = pr_val_err("AS value (%lu) is out of range.", asn); goto end_error; } - pr_val_debug("asID: %lu", asn); + pr_val_debug("asId: %lu", asn); /* rfc6482#section-3.3 */