From bfe7f4d308ae71d2a9b210bd6f1b6a71c9b80b45 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Tue, 11 Apr 2023 15:00:50 +0200 Subject: [PATCH 1/9] support for Rel 2 and implicit certificates --- certgen/asn1certgen.xslt | 28 +- certgen/asncodec/ANY.c | 80 + certgen/asncodec/ANY.h | 84 + certgen/asncodec/ANY_xer.c | 22 + certgen/asncodec/AaEntry.c | 36 +- certgen/asncodec/AaEntry.h | 16 +- certgen/asncodec/AcaEeCertResponse.c | 183 ++ certgen/asncodec/AcaEeCertResponse.h | 50 + certgen/asncodec/AcaEeCertResponseCubkSpdu.c | 64 + certgen/asncodec/AcaEeCertResponseCubkSpdu.h | 39 + certgen/asncodec/AcaEeCertResponsePlainSpdu.c | 64 + certgen/asncodec/AcaEeCertResponsePlainSpdu.h | 39 + .../asncodec/AcaEeCertResponsePrivateSpdu.c | 64 + .../asncodec/AcaEeCertResponsePrivateSpdu.h | 39 + certgen/asncodec/AcaEeInterfacePdu.c | 68 + certgen/asncodec/AcaEeInterfacePdu.h | 55 + certgen/asncodec/AcaLaInterfacePdu.c | 39 + certgen/asncodec/AcaLaInterfacePdu.h | 39 + certgen/asncodec/AcaMaInterfacePdu.c | 39 + certgen/asncodec/AcaMaInterfacePdu.h | 39 + certgen/asncodec/AcaRaCertResponse.c | 150 + certgen/asncodec/AcaRaCertResponse.h | 50 + certgen/asncodec/AcaRaCertResponseSpdu.c | 64 + certgen/asncodec/AcaRaCertResponseSpdu.h | 39 + certgen/asncodec/AcaRaInterfacePdu.c | 86 + certgen/asncodec/AcaRaInterfacePdu.h | 58 + certgen/asncodec/AcaResponse.c | 104 + certgen/asncodec/AcaResponse.h | 61 + certgen/asncodec/AcaSsp.c | 96 + certgen/asncodec/AcaSsp.h | 44 + certgen/asncodec/AcpcNodeValue.c | 70 + certgen/asncodec/AcpcNodeValue.h | 39 + certgen/asncodec/AcpcPdu.c | 86 + certgen/asncodec/AcpcPdu.h | 56 + certgen/asncodec/AcpcPsid.c | 69 + certgen/asncodec/AcpcPsid.h | 39 + certgen/asncodec/AcpcSsp.c | 68 + certgen/asncodec/AcpcSsp.h | 53 + certgen/asncodec/AcpcTreeId.c | 70 + certgen/asncodec/AcpcTreeId.h | 39 + certgen/asncodec/AdditionalParams.c | 122 + certgen/asncodec/AdditionalParams.h | 63 + certgen/asncodec/Aes128CcmCiphertext.c | 40 + certgen/asncodec/Aes128CcmCiphertext.h | 39 + certgen/asncodec/AesCcmCiphertext.c | 89 - certgen/asncodec/AesCcmCiphertext.h | 42 - certgen/asncodec/AppExtension.c | 230 ++ certgen/asncodec/AppExtension.h | 61 + certgen/asncodec/AprvBinaryTree.c | 293 ++ certgen/asncodec/AprvBinaryTree.h | 63 + certgen/asncodec/AprvHashCalculationInput.c | 199 ++ certgen/asncodec/AprvHashCalculationInput.h | 50 + .../asncodec/AuthorizationRequestMessage.c | 20 +- .../asncodec/AuthorizationRequestMessage.h | 16 +- .../AuthorizationRequestMessageWithPop.c | 20 +- .../AuthorizationRequestMessageWithPop.h | 16 +- certgen/asncodec/AuthorizationResponseCode.c | 18 +- certgen/asncodec/AuthorizationResponseCode.h | 14 +- .../asncodec/AuthorizationResponseMessage.c | 20 +- .../asncodec/AuthorizationResponseMessage.h | 16 +- .../asncodec/AuthorizationValidationRequest.c | 36 +- .../asncodec/AuthorizationValidationRequest.h | 16 +- .../AuthorizationValidationRequestMessage.c | 20 +- .../AuthorizationValidationRequestMessage.h | 16 +- .../AuthorizationValidationResponse.c | 55 +- .../AuthorizationValidationResponse.h | 18 +- .../AuthorizationValidationResponseCode.c | 18 +- .../AuthorizationValidationResponseCode.h | 14 +- .../AuthorizationValidationResponseMessage.c | 20 +- .../AuthorizationValidationResponseMessage.h | 16 +- certgen/asncodec/BIT_STRING.c | 865 ++---- certgen/asncodec/BIT_STRING.h | 121 +- certgen/asncodec/BIT_STRING_oer.c | 342 ++- certgen/asncodec/BIT_STRING_print.c | 69 + certgen/asncodec/BIT_STRING_xer.c | 70 + certgen/asncodec/BOOLEAN.c | 562 +--- certgen/asncodec/BOOLEAN.h | 113 +- certgen/asncodec/BOOLEAN_oer.c | 54 + certgen/asncodec/BOOLEAN_print.c | 33 + certgen/asncodec/BOOLEAN_xer.c | 74 + certgen/asncodec/BasePublicEncryptionKey.c | 64 +- certgen/asncodec/BasePublicEncryptionKey.h | 23 +- certgen/asncodec/BitmapSsp.c | 20 +- certgen/asncodec/BitmapSsp.h | 16 +- certgen/asncodec/BitmapSspRange.c | 42 +- certgen/asncodec/BitmapSspRange.h | 16 +- certgen/asncodec/BlindedKey.c | 40 + certgen/asncodec/BlindedKey.h | 39 + .../ButterflyAtDownloadRequestMessage.c | 64 + .../ButterflyAtDownloadRequestMessage.h | 39 + .../ButterflyAuthorizationRequestMessage.c | 64 + .../ButterflyAuthorizationRequestMessage.h | 39 + .../ButterflyAuthorizationResponseMessage.c | 64 + .../ButterflyAuthorizationResponseMessage.h | 39 + .../asncodec/ButterflyCertRequestMessage.c | 64 + .../asncodec/ButterflyCertRequestMessage.h | 39 + .../asncodec/ButterflyCertResponseMessage.c | 64 + .../asncodec/ButterflyCertResponseMessage.h | 39 + certgen/asncodec/ButterflyExpansion.c | 99 + certgen/asncodec/ButterflyExpansion.h | 55 + certgen/asncodec/ButterflyParamsOriginal.c | 102 + certgen/asncodec/ButterflyParamsOriginal.h | 43 + .../asncodec/CaCertificateRekeyingMessage.c | 20 +- .../asncodec/CaCertificateRekeyingMessage.h | 16 +- certgen/asncodec/CaCertificateRequest.c | 36 +- certgen/asncodec/CaCertificateRequest.h | 16 +- .../asncodec/CaCertificateRequestMessage.c | 20 +- .../asncodec/CaCertificateRequestMessage.h | 16 +- certgen/asncodec/CamRaBatchResponse.c | 185 ++ certgen/asncodec/CamRaBatchResponse.h | 60 + certgen/asncodec/CamRaInterfacePdu.c | 86 + certgen/asncodec/CamRaInterfacePdu.h | 56 + certgen/asncodec/CamSsp.c | 65 + certgen/asncodec/CamSsp.h | 41 + certgen/asncodec/CertIssueExtension.c | 226 ++ certgen/asncodec/CertIssueExtension.h | 62 + certgen/asncodec/CertManagementPdu.c | 140 + certgen/asncodec/CertManagementPdu.h | 67 + certgen/asncodec/CertRequestExtension.c | 226 ++ certgen/asncodec/CertRequestExtension.h | 62 + certgen/asncodec/Certificate.c | 20 +- certgen/asncodec/Certificate.h | 16 +- certgen/asncodec/CertificateBase.c | 70 +- certgen/asncodec/CertificateBase.h | 20 +- certgen/asncodec/CertificateChain.c | 166 ++ certgen/asncodec/CertificateChain.h | 58 + certgen/asncodec/CertificateChainSpdu.c | 64 + certgen/asncodec/CertificateChainSpdu.h | 39 + certgen/asncodec/CertificateFormat.c | 18 +- certgen/asncodec/CertificateFormat.h | 14 +- certgen/asncodec/CertificateId.c | 62 +- certgen/asncodec/CertificateId.h | 18 +- .../CertificateManagementInfoStatus.c | 140 + .../CertificateManagementInfoStatus.h | 51 + ...rtificateManagementInformationStatusSpdu.c | 64 + ...rtificateManagementInformationStatusSpdu.h | 39 + .../CertificateRevocationListMessage.c | 20 +- .../CertificateRevocationListMessage.h | 16 +- .../asncodec/CertificateSubjectAttributes.c | 78 +- .../asncodec/CertificateSubjectAttributes.h | 26 +- certgen/asncodec/CertificateType.c | 20 +- certgen/asncodec/CertificateType.h | 16 +- certgen/asncodec/CircularRegion.c | 38 +- certgen/asncodec/CircularRegion.h | 18 +- certgen/asncodec/CompositeCrl.c | 166 ++ certgen/asncodec/CompositeCrl.h | 58 + certgen/asncodec/CompositeCrlSpdu.c | 64 + certgen/asncodec/CompositeCrlSpdu.h | 39 + certgen/asncodec/ContributedExtensionBlock.c | 238 ++ certgen/asncodec/ContributedExtensionBlock.h | 52 + certgen/asncodec/ContributedExtensionBlocks.c | 65 + certgen/asncodec/ContributedExtensionBlocks.h | 46 + certgen/asncodec/Countersignature.c | 20 +- certgen/asncodec/Countersignature.h | 16 +- certgen/asncodec/CountryAndRegions.c | 40 +- certgen/asncodec/CountryAndRegions.h | 20 +- certgen/asncodec/CountryAndSubregions.c | 46 +- certgen/asncodec/CountryAndSubregions.h | 20 +- certgen/asncodec/CountryOnly.c | 22 +- certgen/asncodec/CountryOnly.h | 18 +- certgen/asncodec/CrlContents.c | 204 ++ certgen/asncodec/CrlContents.h | 49 + certgen/asncodec/CrlEntry.c | 18 +- certgen/asncodec/CrlEntry.h | 14 +- certgen/asncodec/CrlInfoStatus.c | 102 + certgen/asncodec/CrlInfoStatus.h | 48 + certgen/asncodec/CrlPriorityInfo.c | 68 + certgen/asncodec/CrlPriorityInfo.h | 44 + certgen/asncodec/CrlPsid.c | 69 + certgen/asncodec/CrlPsid.h | 39 + certgen/asncodec/CrlSeries.c | 20 +- certgen/asncodec/CrlSeries.h | 16 +- certgen/asncodec/CrlSignerSsp.c | 96 + certgen/asncodec/CrlSignerSsp.h | 44 + certgen/asncodec/CtlCommand.c | 38 +- certgen/asncodec/CtlCommand.h | 16 +- certgen/asncodec/CtlDelete.c | 38 +- certgen/asncodec/CtlDelete.h | 16 +- certgen/asncodec/CtlElectorEntry.c | 70 + certgen/asncodec/CtlElectorEntry.h | 39 + certgen/asncodec/CtlEntry.c | 68 +- certgen/asncodec/CtlEntry.h | 16 +- certgen/asncodec/CtlFormat.c | 88 +- certgen/asncodec/CtlFormat.h | 16 +- certgen/asncodec/CtlInfoStatus.c | 102 + certgen/asncodec/CtlInfoStatus.h | 48 + certgen/asncodec/CtlRootCaEntry.c | 70 + certgen/asncodec/CtlRootCaEntry.h | 39 + certgen/asncodec/CtlSequenceNumber.c | 69 + certgen/asncodec/CtlSequenceNumber.h | 39 + certgen/asncodec/CtlSeriesId.c | 70 + certgen/asncodec/CtlSeriesId.h | 39 + certgen/asncodec/CtlSignatureSpdu.c | 64 + certgen/asncodec/CtlSignatureSpdu.h | 39 + certgen/asncodec/DATE-ENCODING.c | 165 ++ certgen/asncodec/DATE-ENCODING.h | 43 + certgen/asncodec/DATE.c | 40 + certgen/asncodec/DATE.h | 39 + certgen/asncodec/DcDelete.c | 16 +- certgen/asncodec/DcDelete.h | 14 +- certgen/asncodec/DcEntry.c | 56 +- certgen/asncodec/DcEntry.h | 16 +- certgen/asncodec/DcSsp.c | 96 + certgen/asncodec/DcSsp.h | 44 + certgen/asncodec/DcmSsp.c | 96 + certgen/asncodec/DcmSsp.h | 44 + certgen/asncodec/DeltaCtl.c | 18 +- certgen/asncodec/DeltaCtl.h | 14 +- certgen/asncodec/Duration.c | 90 +- certgen/asncodec/Duration.h | 16 +- certgen/asncodec/EXTERNAL.c | 221 ++ certgen/asncodec/EXTERNAL.h | 65 + certgen/asncodec/EaEntry.c | 46 +- certgen/asncodec/EaEntry.h | 18 +- certgen/asncodec/EcSignature.c | 40 +- certgen/asncodec/EcSignature.h | 18 +- certgen/asncodec/EcaEeCertResponse.c | 219 ++ certgen/asncodec/EcaEeCertResponse.h | 54 + certgen/asncodec/EcaEeCertResponseSpdu.c | 64 + certgen/asncodec/EcaEeCertResponseSpdu.h | 39 + certgen/asncodec/EcaEeInterfacePdu.c | 86 + certgen/asncodec/EcaEeInterfacePdu.h | 58 + certgen/asncodec/EcaSsp.c | 96 + certgen/asncodec/EcaSsp.h | 44 + certgen/asncodec/EccP256CurvePoint.c | 110 +- certgen/asncodec/EccP256CurvePoint.h | 18 +- certgen/asncodec/EccP384CurvePoint.c | 110 +- certgen/asncodec/EccP384CurvePoint.h | 18 +- certgen/asncodec/EcdsaP256Signature.c | 40 +- certgen/asncodec/EcdsaP256Signature.h | 18 +- certgen/asncodec/EcdsaP384Signature.c | 40 +- certgen/asncodec/EcdsaP384Signature.h | 18 +- certgen/asncodec/EcencP256EncryptedKey.c | 164 ++ certgen/asncodec/EcencP256EncryptedKey.h | 43 + certgen/asncodec/EciesP256EncryptedKey.c | 52 +- certgen/asncodec/EciesP256EncryptedKey.h | 18 +- certgen/asncodec/EcsigP256Signature.c | 146 + certgen/asncodec/EcsigP256Signature.h | 41 + certgen/asncodec/EeEcaCertRequest.c | 194 ++ certgen/asncodec/EeEcaCertRequest.h | 52 + certgen/asncodec/EeEcaCertRequestSpdu.c | 64 + certgen/asncodec/EeEcaCertRequestSpdu.h | 39 + certgen/asncodec/EeMaInterfacePdu.c | 39 + certgen/asncodec/EeMaInterfacePdu.h | 39 + ...EeRa1609Dot2AuthenticatedCertRequestSpdu.c | 64 + ...EeRa1609Dot2AuthenticatedCertRequestSpdu.h | 39 + certgen/asncodec/EeRaCertRequest.c | 194 ++ certgen/asncodec/EeRaCertRequest.h | 57 + certgen/asncodec/EeRaCertRequestSpdu.c | 64 + certgen/asncodec/EeRaCertRequestSpdu.h | 39 + certgen/asncodec/EeRaDownloadRequest.c | 121 + certgen/asncodec/EeRaDownloadRequest.h | 46 + .../asncodec/EeRaDownloadRequestPlainSpdu.c | 64 + .../asncodec/EeRaDownloadRequestPlainSpdu.h | 39 + certgen/asncodec/EeRaDownloadRequestSpdu.c | 64 + certgen/asncodec/EeRaDownloadRequestSpdu.h | 39 + certgen/asncodec/EeRaInterfacePdu.c | 140 + certgen/asncodec/EeRaInterfacePdu.h | 67 + .../EeRaSuccessorEnrollmentCertRequestSpdu.c | 64 + .../EeRaSuccessorEnrollmentCertRequestSpdu.h | 39 + .../EeRaX509AuthenticatedCertRequestSpdu.c | 64 + .../EeRaX509AuthenticatedCertRequestSpdu.h | 39 + certgen/asncodec/EeSsp.c | 96 + certgen/asncodec/EeSsp.h | 44 + certgen/asncodec/ElectorSsp.c | 96 + certgen/asncodec/ElectorSsp.h | 44 + certgen/asncodec/ElevInt.c | 59 - certgen/asncodec/ElevInt.h | 41 - certgen/asncodec/Elevation.c | 22 +- certgen/asncodec/Elevation.h | 18 +- certgen/asncodec/EncryptedData.c | 38 +- certgen/asncodec/EncryptedData.h | 18 +- certgen/asncodec/EncryptedDataEncryptionKey.c | 64 +- certgen/asncodec/EncryptedDataEncryptionKey.h | 24 +- certgen/asncodec/EncryptedIndividualPLV.c | 132 + certgen/asncodec/EncryptedIndividualPLV.h | 44 + certgen/asncodec/EncryptionKey.c | 40 +- certgen/asncodec/EncryptionKey.h | 18 +- certgen/asncodec/EndEntityType.c | 20 +- certgen/asncodec/EndEntityType.h | 16 +- certgen/asncodec/EnrolmentRequestMessage.c | 20 +- certgen/asncodec/EnrolmentRequestMessage.h | 16 +- certgen/asncodec/EnrolmentResponseCode.c | 18 +- certgen/asncodec/EnrolmentResponseCode.h | 14 +- certgen/asncodec/EnrolmentResponseMessage.c | 20 +- certgen/asncodec/EnrolmentResponseMessage.h | 16 +- .../EtsiOriginatingHeaderInfoExtension.c | 40 + .../EtsiOriginatingHeaderInfoExtension.h | 39 + ...ButterflyAuthorizationRequest-X509Signed.c | 64 + ...ButterflyAuthorizationRequest-X509Signed.h | 39 + certgen/asncodec/EtsiTs102941CrlRequest.c | 86 + certgen/asncodec/EtsiTs102941CrlRequest.h | 42 + certgen/asncodec/EtsiTs102941CtlRequest.c | 116 + certgen/asncodec/EtsiTs102941CtlRequest.h | 42 + certgen/asncodec/EtsiTs102941Data.c | 38 +- certgen/asncodec/EtsiTs102941Data.h | 16 +- certgen/asncodec/EtsiTs102941DataContent.c | 345 ++- certgen/asncodec/EtsiTs102941DataContent.h | 49 +- .../asncodec/EtsiTs102941DeltaCtlRequest.c | 40 + .../asncodec/EtsiTs102941DeltaCtlRequest.h | 39 + certgen/asncodec/EtsiTs103097Certificate.c | 20 +- certgen/asncodec/EtsiTs103097Certificate.h | 16 +- .../EtsiTs103097Data-Encrypted-Unicast.c | 87 +- .../EtsiTs103097Data-Encrypted-Unicast.h | 45 +- certgen/asncodec/EtsiTs103097Data-Encrypted.c | 102 +- certgen/asncodec/EtsiTs103097Data-Encrypted.h | 72 +- certgen/asncodec/EtsiTs103097Data-Signed.c | 102 +- certgen/asncodec/EtsiTs103097Data-Signed.h | 72 +- ...iTs103097Data-SignedAndEncrypted-Unicast.c | 42 +- ...iTs103097Data-SignedAndEncrypted-Unicast.h | 34 +- .../EtsiTs103097Data-SignedAndEncrypted.c | 6 +- .../EtsiTs103097Data-SignedAndEncrypted.h | 6 +- .../EtsiTs103097Data-SignedExternalPayload.c | 18 +- .../EtsiTs103097Data-SignedExternalPayload.h | 14 +- certgen/asncodec/EtsiTs103097Data-Unsecured.c | 9 + certgen/asncodec/EtsiTs103097Data-Unsecured.h | 23 + certgen/asncodec/EtsiTs103097Data.c | 18 +- certgen/asncodec/EtsiTs103097Data.h | 14 +- .../EtsiTs103097HeaderInfoExtensionId.c | 69 + .../EtsiTs103097HeaderInfoExtensionId.h | 39 + .../asncodec/ExpansionAlgorithmIdentifier.c | 63 + .../asncodec/ExpansionAlgorithmIdentifier.h | 48 + certgen/asncodec/ExplicitCertificate.c | 20 +- certgen/asncodec/ExplicitCertificate.h | 16 +- certgen/asncodec/ExtId.c | 69 + certgen/asncodec/ExtId.h | 40 + certgen/asncodec/Extension.c | 468 ++++ certgen/asncodec/Extension.h | 86 + certgen/asncodec/ExtensionModuleVersion.c | 69 + certgen/asncodec/ExtensionModuleVersion.h | 39 + certgen/asncodec/FullCtl.c | 18 +- certgen/asncodec/FullCtl.h | 14 +- certgen/asncodec/FullIeeeTbsCtl.c | 454 +++ certgen/asncodec/FullIeeeTbsCtl.h | 80 + certgen/asncodec/GeographicRegion.c | 60 +- certgen/asncodec/GeographicRegion.h | 18 +- certgen/asncodec/GraphicString.c | 91 + certgen/asncodec/GraphicString.h | 56 + certgen/asncodec/GroupCrlEntry.c | 138 + certgen/asncodec/GroupCrlEntry.h | 50 + certgen/asncodec/GroupLinkageValue.c | 42 +- certgen/asncodec/GroupLinkageValue.h | 16 +- certgen/asncodec/GroupSingleSeedCrlEntry.c | 102 + certgen/asncodec/GroupSingleSeedCrlEntry.h | 44 + certgen/asncodec/HashAlgorithm.c | 28 +- certgen/asncodec/HashAlgorithm.h | 19 +- certgen/asncodec/HashBasedRevocationInfo.c | 84 + certgen/asncodec/HashBasedRevocationInfo.h | 46 + certgen/asncodec/HashedData.c | 103 +- certgen/asncodec/HashedData.h | 28 +- certgen/asncodec/HashedId10.c | 20 +- certgen/asncodec/HashedId10.h | 16 +- certgen/asncodec/HashedId3.c | 20 +- certgen/asncodec/HashedId3.h | 16 +- certgen/asncodec/HashedId32.c | 70 + certgen/asncodec/HashedId32.h | 39 + certgen/asncodec/HashedId48.c | 70 + certgen/asncodec/HashedId48.h | 39 + certgen/asncodec/HashedId8.c | 20 +- certgen/asncodec/HashedId8.h | 16 +- certgen/asncodec/HeaderInfo.c | 170 +- certgen/asncodec/HeaderInfo.h | 41 +- certgen/asncodec/HeaderInfoContributorId.c | 69 + certgen/asncodec/HeaderInfoContributorId.h | 41 + certgen/asncodec/Hostname.c | 20 +- certgen/asncodec/Hostname.h | 16 +- certgen/asncodec/IA5String.c | 226 +- certgen/asncodec/IA5String.h | 97 +- certgen/asncodec/IMaxGroup.c | 104 + certgen/asncodec/IMaxGroup.h | 53 + certgen/asncodec/INTEGER.c | 2077 +++++--------- certgen/asncodec/INTEGER.h | 243 +- certgen/asncodec/INTEGER_oer.c | 353 ++- certgen/asncodec/INTEGER_print.c | 26 + certgen/asncodec/INTEGER_xer.c | 351 +++ certgen/asncodec/IValue.c | 20 +- certgen/asncodec/IValue.h | 16 +- certgen/asncodec/IcaSsp.c | 96 + certgen/asncodec/IcaSsp.h | 44 + certgen/asncodec/IdentifiedRegion.c | 52 +- certgen/asncodec/IdentifiedRegion.h | 22 +- .../Ieee1609ContributedHeaderInfoExtension.c | 40 + .../Ieee1609ContributedHeaderInfoExtension.h | 39 + certgen/asncodec/Ieee1609Dot2Content.c | 84 +- certgen/asncodec/Ieee1609Dot2Content.h | 25 +- certgen/asncodec/Ieee1609Dot2Data-Encrypted.c | 229 ++ certgen/asncodec/Ieee1609Dot2Data-Encrypted.h | 66 + .../Ieee1609Dot2Data-EncryptedSigned.c | 64 + .../Ieee1609Dot2Data-EncryptedSigned.h | 39 + certgen/asncodec/Ieee1609Dot2Data-Signed.c | 174 ++ certgen/asncodec/Ieee1609Dot2Data-Signed.h | 57 + .../Ieee1609Dot2Data-SignedCertRequest.c | 119 + .../Ieee1609Dot2Data-SignedCertRequest.h | 48 + .../Ieee1609Dot2Data-SignedEncrypted.c | 64 + .../Ieee1609Dot2Data-SignedEncrypted.h | 39 + ...e1609Dot2Data-SignedEncryptedCertRequest.c | 64 + ...e1609Dot2Data-SignedEncryptedCertRequest.h | 39 + ...2Data-SignedX509AuthenticatedCertRequest.c | 64 + ...2Data-SignedX509AuthenticatedCertRequest.h | 39 + ...609Dot2Data-SymmEncryptedSingleRecipient.c | 64 + ...609Dot2Data-SymmEncryptedSingleRecipient.h | 39 + certgen/asncodec/Ieee1609Dot2Data-Unsecured.c | 119 + certgen/asncodec/Ieee1609Dot2Data-Unsecured.h | 48 + certgen/asncodec/Ieee1609Dot2Data.c | 40 +- certgen/asncodec/Ieee1609Dot2Data.h | 16 +- .../asncodec/Ieee1609HeaderInfoExtensionId.c | 69 + .../asncodec/Ieee1609HeaderInfoExtensionId.h | 39 + certgen/asncodec/Ieee1609dot2dot1MsctlType.c | 69 + certgen/asncodec/Ieee1609dot2dot1MsctlType.h | 40 + certgen/asncodec/ImplicitCertificate.c | 20 +- certgen/asncodec/ImplicitCertificate.h | 16 +- certgen/asncodec/IndividualAprv.c | 186 ++ certgen/asncodec/IndividualAprv.h | 54 + certgen/asncodec/IndividualRevocation.c | 84 + certgen/asncodec/IndividualRevocation.h | 45 + certgen/asncodec/InnerAtRequest.c | 58 +- certgen/asncodec/InnerAtRequest.h | 16 +- certgen/asncodec/InnerAtResponse.c | 50 +- certgen/asncodec/InnerAtResponse.h | 18 +- certgen/asncodec/InnerEcRequest.c | 60 +- certgen/asncodec/InnerEcRequest.h | 20 +- certgen/asncodec/InnerEcRequestSignedForPop.c | 20 +- certgen/asncodec/InnerEcRequestSignedForPop.h | 16 +- certgen/asncodec/InnerEcResponse.c | 50 +- certgen/asncodec/InnerEcResponse.h | 18 +- certgen/asncodec/IssuerIdentifier.c | 74 +- certgen/asncodec/IssuerIdentifier.h | 24 +- certgen/asncodec/JMaxGroup.c | 84 + certgen/asncodec/JMaxGroup.h | 46 + certgen/asncodec/KnownLatitude.c | 20 +- certgen/asncodec/KnownLatitude.h | 16 +- certgen/asncodec/KnownLongitude.c | 20 +- certgen/asncodec/KnownLongitude.h | 16 +- certgen/asncodec/LAGroup.c | 102 + certgen/asncodec/LAGroup.h | 47 + certgen/asncodec/LaId.c | 20 +- certgen/asncodec/LaId.h | 16 +- certgen/asncodec/LaMaInterfacePdu.c | 39 + certgen/asncodec/LaMaInterfacePdu.h | 39 + certgen/asncodec/LaRaInterfacePdu.c | 39 + certgen/asncodec/LaRaInterfacePdu.h | 39 + certgen/asncodec/LaSsp.c | 114 + certgen/asncodec/LaSsp.h | 46 + certgen/asncodec/Latitude.c | 20 +- certgen/asncodec/Latitude.h | 16 +- certgen/asncodec/LinkageData.c | 48 +- certgen/asncodec/LinkageData.h | 20 +- certgen/asncodec/LinkageInfo.c | 84 + certgen/asncodec/LinkageInfo.h | 45 + certgen/asncodec/LinkageSeed.c | 20 +- certgen/asncodec/LinkageSeed.h | 16 +- certgen/asncodec/LinkageValue.c | 20 +- certgen/asncodec/LinkageValue.h | 16 +- certgen/asncodec/Longitude.c | 20 +- certgen/asncodec/Longitude.h | 16 +- certgen/asncodec/LopSsp.c | 96 + certgen/asncodec/LopSsp.h | 44 + .../asncodec/LvGenerationFunctionIdentifier.c | 39 + .../asncodec/LvGenerationFunctionIdentifier.h | 39 + certgen/asncodec/MaInfoStatus.c | 84 + certgen/asncodec/MaInfoStatus.h | 46 + certgen/asncodec/MaRaInterfacePdu.c | 39 + certgen/asncodec/MaRaInterfacePdu.h | 39 + certgen/asncodec/MaSsp.c | 114 + certgen/asncodec/MaSsp.h | 46 + certgen/asncodec/Makefile | 77 +- certgen/asncodec/MissingCrlIdentifier.c | 38 +- certgen/asncodec/MissingCrlIdentifier.h | 18 +- certgen/asncodec/MultiSignedCtl.c | 460 ++++ certgen/asncodec/MultiSignedCtl.h | 88 + certgen/asncodec/MultiSignedCtlSpdu.c | 64 + certgen/asncodec/MultiSignedCtlSpdu.h | 39 + certgen/asncodec/NULL.c | 363 +-- certgen/asncodec/NULL.h | 112 +- certgen/asncodec/NULL_oer.c | 48 + certgen/asncodec/NULL_print.c | 20 + certgen/asncodec/NULL_xer.c | 52 + certgen/asncodec/NativeEnumerated.c | 334 +-- certgen/asncodec/NativeEnumerated.h | 119 +- certgen/asncodec/NativeEnumerated_oer.c | 293 +- certgen/asncodec/NativeEnumerated_xer.c | 36 + certgen/asncodec/NativeInteger.c | 636 ++--- certgen/asncodec/NativeInteger.h | 115 +- certgen/asncodec/NativeInteger_oer.c | 193 +- certgen/asncodec/NativeInteger_print.c | 43 + certgen/asncodec/NativeInteger_xer.c | 78 + certgen/asncodec/NinetyDegreeInt.c | 20 +- certgen/asncodec/NinetyDegreeInt.h | 16 +- certgen/asncodec/OBJECT_IDENTIFIER.c | 532 ++++ certgen/asncodec/OBJECT_IDENTIFIER.h | 184 ++ certgen/asncodec/OBJECT_IDENTIFIER_print.c | 30 + certgen/asncodec/OBJECT_IDENTIFIER_xer.c | 80 + certgen/asncodec/OCTET_STRING.c | 2426 +++-------------- certgen/asncodec/OCTET_STRING.h | 265 +- certgen/asncodec/OCTET_STRING_oer.c | 337 ++- certgen/asncodec/OCTET_STRING_print.c | 65 + certgen/asncodec/OCTET_STRING_xer.c | 627 +++++ certgen/asncodec/OPEN_TYPE.c | 465 +--- certgen/asncodec/OPEN_TYPE.h | 180 +- certgen/asncodec/OPEN_TYPE_oer.c | 183 +- certgen/asncodec/OPEN_TYPE_xer.c | 166 ++ certgen/asncodec/ObjectDescriptor.c | 91 + certgen/asncodec/ObjectDescriptor.h | 54 + certgen/asncodec/One28BitCcmCiphertext.c | 115 + certgen/asncodec/One28BitCcmCiphertext.h | 42 + certgen/asncodec/OneEightyDegreeInt.c | 20 +- certgen/asncodec/OneEightyDegreeInt.h | 16 +- certgen/asncodec/Opaque.c | 18 +- certgen/asncodec/Opaque.h | 16 +- certgen/asncodec/OperatingOrganizationId.c | 39 + certgen/asncodec/OperatingOrganizationId.h | 39 + certgen/asncodec/PKRecipientInfo.c | 38 +- certgen/asncodec/PKRecipientInfo.h | 18 +- certgen/asncodec/PduFunctionalType.c | 69 + certgen/asncodec/PduFunctionalType.h | 42 + certgen/asncodec/PgSsp.c | 96 + certgen/asncodec/PgSsp.h | 44 + certgen/asncodec/PolygonalRegion.c | 30 +- certgen/asncodec/PolygonalRegion.h | 16 +- certgen/asncodec/PreLinkageValue.c | 70 + certgen/asncodec/PreLinkageValue.h | 39 + certgen/asncodec/PreSharedKeyRecipientInfo.c | 20 +- certgen/asncodec/PreSharedKeyRecipientInfo.h | 16 +- certgen/asncodec/Psid.c | 53 +- certgen/asncodec/Psid.h | 16 +- certgen/asncodec/PsidGroupPermissions.c | 78 +- certgen/asncodec/PsidGroupPermissions.h | 24 +- certgen/asncodec/PsidSsp.c | 80 +- certgen/asncodec/PsidSsp.h | 18 +- certgen/asncodec/PsidSspRange.c | 79 +- certgen/asncodec/PsidSspRange.h | 18 +- certgen/asncodec/PublicEncryptionKey.c | 38 +- certgen/asncodec/PublicEncryptionKey.h | 18 +- certgen/asncodec/PublicKeys.c | 36 +- certgen/asncodec/PublicKeys.h | 16 +- certgen/asncodec/PublicVerificationKey.c | 92 +- certgen/asncodec/PublicVerificationKey.h | 26 +- certgen/asncodec/RaAcaCertRequest.c | 230 ++ certgen/asncodec/RaAcaCertRequest.h | 62 + certgen/asncodec/RaAcaCertRequestFlags.c | 75 + certgen/asncodec/RaAcaCertRequestFlags.h | 45 + certgen/asncodec/RaAcaCertRequestSpdu.c | 64 + certgen/asncodec/RaAcaCertRequestSpdu.h | 39 + certgen/asncodec/RaCamBatchRequest.c | 216 ++ certgen/asncodec/RaCamBatchRequest.h | 55 + certgen/asncodec/RaEeCertAck.c | 170 ++ certgen/asncodec/RaEeCertAck.h | 51 + certgen/asncodec/RaEeCertAckSpdu.c | 64 + certgen/asncodec/RaEeCertAckSpdu.h | 39 + certgen/asncodec/RaEeCertAndAcpcInfoSpdu.c | 64 + certgen/asncodec/RaEeCertAndAcpcInfoSpdu.h | 39 + certgen/asncodec/RaEeCertInfo.c | 188 ++ certgen/asncodec/RaEeCertInfo.h | 53 + certgen/asncodec/RaEeCertInfoSpdu.c | 64 + certgen/asncodec/RaEeCertInfoSpdu.h | 39 + certgen/asncodec/RaEeEnrollmentCertAckSpdu.c | 64 + certgen/asncodec/RaEeEnrollmentCertAckSpdu.h | 39 + certgen/asncodec/RaSsp.c | 96 + certgen/asncodec/RaSsp.h | 44 + .../asncodec/RcaCertificateTrustListMessage.c | 20 +- .../asncodec/RcaCertificateTrustListMessage.h | 16 +- .../RcaDoubleSignedLinkCertificateMessage.c | 64 + .../RcaDoubleSignedLinkCertificateMessage.h | 39 + .../RcaSingleSignedLinkCertificateMessage.c | 64 + .../RcaSingleSignedLinkCertificateMessage.h | 39 + certgen/asncodec/RecipientInfo.c | 70 +- certgen/asncodec/RecipientInfo.h | 18 +- certgen/asncodec/ReconstructionValue.c | 40 + certgen/asncodec/ReconstructionValue.h | 39 + certgen/asncodec/RectangularRegion.c | 38 +- certgen/asncodec/RectangularRegion.h | 16 +- certgen/asncodec/RegionAndSubregions.c | 38 +- certgen/asncodec/RegionAndSubregions.h | 18 +- certgen/asncodec/RootCaEntry.c | 42 +- certgen/asncodec/RootCaEntry.h | 16 +- certgen/asncodec/RootCaSsp.c | 96 + certgen/asncodec/RootCaSsp.h | 44 + certgen/asncodec/ScmsPdu-EeEcaCertRequest.c | 64 + certgen/asncodec/ScmsPdu-EeEcaCertRequest.h | 39 + certgen/asncodec/ScmsPdu-EeRaCertRequest.c | 64 + certgen/asncodec/ScmsPdu-EeRaCertRequest.h | 39 + ...msPdu-EeRaSuccessorEnrollmentCertRequest.c | 64 + ...msPdu-EeRaSuccessorEnrollmentCertRequest.h | 39 + certgen/asncodec/ScmsPdu-RaAcaCertRequest.c | 64 + certgen/asncodec/ScmsPdu-RaAcaCertRequest.h | 39 + certgen/asncodec/ScmsPdu-Scoped.c | 174 ++ certgen/asncodec/ScmsPdu-Scoped.h | 57 + certgen/asncodec/ScmsPdu.c | 354 +++ certgen/asncodec/ScmsPdu.h | 93 + certgen/asncodec/ScopedCertificateRequest.c | 64 + certgen/asncodec/ScopedCertificateRequest.h | 39 + certgen/asncodec/SecuredCrl.c | 64 + certgen/asncodec/SecuredCrl.h | 39 + certgen/asncodec/SecurityMgmtPsid.c | 69 + certgen/asncodec/SecurityMgmtPsid.h | 39 + certgen/asncodec/SecurityMgmtSsp.c | 302 ++ certgen/asncodec/SecurityMgmtSsp.h | 93 + .../SeedEvolutionFunctionIdentifier.c | 39 + .../SeedEvolutionFunctionIdentifier.h | 39 + certgen/asncodec/SequenceOfAppExtensions.c | 65 + certgen/asncodec/SequenceOfAppExtensions.h | 46 + .../asncodec/SequenceOfCertIssueExtensions.c | 65 + .../asncodec/SequenceOfCertIssueExtensions.h | 46 + .../SequenceOfCertRequestExtensions.c | 65 + .../SequenceOfCertRequestExtensions.h | 46 + certgen/asncodec/SequenceOfCertificate.c | 28 +- certgen/asncodec/SequenceOfCertificate.h | 16 +- certgen/asncodec/SequenceOfCrlInfoStatus.c | 60 + certgen/asncodec/SequenceOfCrlInfoStatus.h | 46 + certgen/asncodec/SequenceOfCtlInfoStatus.c | 60 + certgen/asncodec/SequenceOfCtlInfoStatus.h | 46 + certgen/asncodec/SequenceOfGroupCrlEntry.c | 60 + certgen/asncodec/SequenceOfGroupCrlEntry.h | 46 + .../SequenceOfGroupSingleSeedCrlEntry.c | 60 + .../SequenceOfGroupSingleSeedCrlEntry.h | 46 + .../SequenceOfHashBasedRevocationInfo.c | 60 + .../SequenceOfHashBasedRevocationInfo.h | 46 + certgen/asncodec/SequenceOfHashedId3.c | 28 +- certgen/asncodec/SequenceOfHashedId3.h | 18 +- certgen/asncodec/SequenceOfIMaxGroup.c | 60 + certgen/asncodec/SequenceOfIMaxGroup.h | 46 + certgen/asncodec/SequenceOfIdentifiedRegion.c | 28 +- certgen/asncodec/SequenceOfIdentifiedRegion.h | 16 +- .../asncodec/SequenceOfIndividualRevocation.c | 65 + .../asncodec/SequenceOfIndividualRevocation.h | 46 + certgen/asncodec/SequenceOfJMaxGroup.c | 60 + certgen/asncodec/SequenceOfJMaxGroup.h | 46 + certgen/asncodec/SequenceOfLAGroup.c | 60 + certgen/asncodec/SequenceOfLAGroup.h | 46 + certgen/asncodec/SequenceOfLinkageSeed.c | 60 + certgen/asncodec/SequenceOfLinkageSeed.h | 41 + certgen/asncodec/SequenceOfMaInfoStatus.c | 60 + certgen/asncodec/SequenceOfMaInfoStatus.h | 46 + certgen/asncodec/SequenceOfOctetString.c | 32 +- certgen/asncodec/SequenceOfOctetString.h | 18 +- certgen/asncodec/SequenceOfPsid.c | 32 +- certgen/asncodec/SequenceOfPsid.h | 20 +- .../asncodec/SequenceOfPsidGroupPermissions.c | 28 +- .../asncodec/SequenceOfPsidGroupPermissions.h | 16 +- certgen/asncodec/SequenceOfPsidSsp.c | 28 +- certgen/asncodec/SequenceOfPsidSsp.h | 16 +- certgen/asncodec/SequenceOfPsidSspRange.c | 28 +- certgen/asncodec/SequenceOfPsidSspRange.h | 16 +- certgen/asncodec/SequenceOfRecipientInfo.c | 28 +- certgen/asncodec/SequenceOfRecipientInfo.h | 16 +- .../asncodec/SequenceOfRectangularRegion.c | 28 +- .../asncodec/SequenceOfRectangularRegion.h | 16 +- .../asncodec/SequenceOfRegionAndSubregions.c | 28 +- .../asncodec/SequenceOfRegionAndSubregions.h | 16 +- certgen/asncodec/SequenceOfUint16.c | 28 +- certgen/asncodec/SequenceOfUint16.h | 18 +- certgen/asncodec/SequenceOfUint8.c | 28 +- certgen/asncodec/SequenceOfUint8.h | 18 +- certgen/asncodec/SequenceOfX509Certificate.c | 65 + certgen/asncodec/SequenceOfX509Certificate.h | 41 + certgen/asncodec/ServiceSpecificPermissions.c | 42 +- certgen/asncodec/ServiceSpecificPermissions.h | 18 +- certgen/asncodec/SharedAtRequest.c | 60 +- certgen/asncodec/SharedAtRequest.h | 16 +- certgen/asncodec/Signature.c | 92 +- certgen/asncodec/Signature.h | 27 +- certgen/asncodec/SignedAprvBinaryTree.c | 64 + certgen/asncodec/SignedAprvBinaryTree.h | 39 + certgen/asncodec/SignedCertificateRequest.c | 120 + certgen/asncodec/SignedCertificateRequest.h | 44 + certgen/asncodec/SignedData.c | 58 +- certgen/asncodec/SignedData.h | 18 +- certgen/asncodec/SignedDataPayload.c | 72 +- certgen/asncodec/SignedDataPayload.h | 22 +- certgen/asncodec/SignedIndividualAprv.c | 64 + certgen/asncodec/SignedIndividualAprv.h | 39 + .../asncodec/SignedX509CertificateRequest.c | 120 + .../asncodec/SignedX509CertificateRequest.h | 44 + certgen/asncodec/SignerIdentifier.c | 50 +- certgen/asncodec/SignerIdentifier.h | 18 +- certgen/asncodec/SignerSelf.c | 59 + certgen/asncodec/SignerSelf.h | 39 + certgen/asncodec/SignerSingleCert.c | 59 + certgen/asncodec/SignerSingleCert.h | 39 + certgen/asncodec/SignerSingleX509Cert.c | 59 + certgen/asncodec/SignerSingleX509Cert.h | 39 + .../asncodec/SingleEtsiTs103097Certificate.c | 50 - .../asncodec/SingleEtsiTs103097Certificate.h | 38 - certgen/asncodec/SspRange.c | 50 +- certgen/asncodec/SspRange.h | 18 +- certgen/asncodec/SubjectAssurance.c | 20 +- certgen/asncodec/SubjectAssurance.h | 16 +- certgen/asncodec/SubjectPermissions.c | 40 +- certgen/asncodec/SubjectPermissions.h | 18 +- certgen/asncodec/SymmAlgorithm.c | 28 +- certgen/asncodec/SymmAlgorithm.h | 19 +- certgen/asncodec/SymmRecipientInfo.c | 38 +- certgen/asncodec/SymmRecipientInfo.h | 18 +- certgen/asncodec/SymmetricCiphertext.c | 56 +- certgen/asncodec/SymmetricCiphertext.h | 25 +- certgen/asncodec/SymmetricEncryptionKey.c | 87 +- certgen/asncodec/SymmetricEncryptionKey.h | 23 +- certgen/asncodec/TestCertificate.c | 64 + certgen/asncodec/TestCertificate.h | 39 + certgen/asncodec/TestSecurityMgmtSsp.c | 40 + certgen/asncodec/TestSecurityMgmtSsp.h | 39 + certgen/asncodec/ThreeDLocation.c | 48 +- certgen/asncodec/ThreeDLocation.h | 18 +- certgen/asncodec/Time32.c | 64 +- certgen/asncodec/Time32.h | 16 +- certgen/asncodec/Time64.c | 76 +- certgen/asncodec/Time64.h | 16 +- .../asncodec/TlmCertificateTrustListMessage.c | 20 +- .../asncodec/TlmCertificateTrustListMessage.h | 16 +- certgen/asncodec/TlmEntry.c | 52 +- certgen/asncodec/TlmEntry.h | 18 +- certgen/asncodec/TlmLinkCertificateMessage.c | 64 + certgen/asncodec/TlmLinkCertificateMessage.h | 39 + certgen/asncodec/ToBeSignedCertificate.c | 258 +- certgen/asncodec/ToBeSignedCertificate.h | 50 +- certgen/asncodec/ToBeSignedCrl.c | 76 +- certgen/asncodec/ToBeSignedCrl.h | 16 +- certgen/asncodec/ToBeSignedCtlSignature.c | 120 + certgen/asncodec/ToBeSignedCtlSignature.h | 46 + certgen/asncodec/ToBeSignedData.c | 38 +- certgen/asncodec/ToBeSignedData.h | 16 +- certgen/asncodec/ToBeSignedHashIdCrl.c | 84 + certgen/asncodec/ToBeSignedHashIdCrl.h | 46 + certgen/asncodec/ToBeSignedLinkCertificate.c | 84 + certgen/asncodec/ToBeSignedLinkCertificate.h | 46 + .../asncodec/ToBeSignedLinkCertificateRca.c | 40 + .../asncodec/ToBeSignedLinkCertificateRca.h | 39 + .../asncodec/ToBeSignedLinkCertificateTlm.c | 40 + .../asncodec/ToBeSignedLinkCertificateTlm.h | 39 + certgen/asncodec/ToBeSignedLinkageValueCrl.c | 145 + certgen/asncodec/ToBeSignedLinkageValueCrl.h | 59 + ...BeSignedLinkageValueCrlWithAlgIdentifier.c | 181 ++ ...BeSignedLinkageValueCrlWithAlgIdentifier.h | 63 + certgen/asncodec/ToBeSignedRcaCtl.c | 18 +- certgen/asncodec/ToBeSignedRcaCtl.h | 14 +- certgen/asncodec/ToBeSignedTlmCtl.c | 18 +- certgen/asncodec/ToBeSignedTlmCtl.h | 14 +- certgen/asncodec/TwoDLocation.c | 38 +- certgen/asncodec/TwoDLocation.h | 18 +- certgen/asncodec/TypeSpecificCrlContents.c | 158 ++ certgen/asncodec/TypeSpecificCrlContents.h | 66 + certgen/asncodec/UTF8String.c | 514 ++-- certgen/asncodec/UTF8String.h | 145 +- certgen/asncodec/UTF8String_print.c | 22 + certgen/asncodec/Uint16.c | 20 +- certgen/asncodec/Uint16.h | 16 +- certgen/asncodec/Uint3.c | 20 +- certgen/asncodec/Uint3.h | 16 +- certgen/asncodec/Uint32.c | 20 +- certgen/asncodec/Uint32.h | 16 +- certgen/asncodec/Uint64.c | 24 +- certgen/asncodec/Uint64.h | 16 +- certgen/asncodec/Uint8.c | 20 +- certgen/asncodec/Uint8.h | 16 +- certgen/asncodec/UnCountryId.c | 69 + certgen/asncodec/UnCountryId.h | 39 + certgen/asncodec/UnknownLatitude.c | 20 +- certgen/asncodec/UnknownLatitude.h | 16 +- certgen/asncodec/UnknownLongitude.c | 20 +- certgen/asncodec/UnknownLongitude.h | 16 +- certgen/asncodec/UnsecuredAprvBinaryTree.c | 64 + certgen/asncodec/UnsecuredAprvBinaryTree.h | 39 + certgen/asncodec/Url.c | 16 +- certgen/asncodec/Url.h | 14 +- certgen/asncodec/ValidityPeriod.c | 38 +- certgen/asncodec/ValidityPeriod.h | 18 +- certgen/asncodec/VerificationKeyIndicator.c | 42 +- certgen/asncodec/VerificationKeyIndicator.h | 20 +- certgen/asncodec/Version.c | 16 +- certgen/asncodec/Version.h | 14 +- certgen/asncodec/X509Certificate.c | 39 + certgen/asncodec/X509Certificate.h | 39 + ...gnedButterflyAuthorizationRequestMessage.c | 64 + ...gnedButterflyAuthorizationRequestMessage.h | 39 + certgen/asncodec/X509SignerIdentifier.c | 68 + certgen/asncodec/X509SignerIdentifier.h | 55 + certgen/asncodec/YEAR-ENCODING.c | 236 ++ certgen/asncodec/YEAR-ENCODING.h | 55 + certgen/asncodec/YEAR-MONTH-ENCODING.c | 117 + certgen/asncodec/YEAR-MONTH-ENCODING.h | 40 + .../Ieee1609Dot2Dot1AcaEeInterface.asn | 92 + .../Ieee1609Dot2Dot1AcaLaInterface.asn | 26 + .../Ieee1609Dot2Dot1AcaMaInterface.asn | 26 + .../Ieee1609Dot2Dot1AcaRaInterface.asn | 261 ++ .../ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn | 205 ++ .../Ieee1609Dot2Dot1CamRaInterface.asn | 90 + .../Ieee1609Dot2Dot1CertManagement.asn | 412 +++ .../Ieee1609Dot2Dot1EcaEeInterface.asn | 172 ++ .../Ieee1609Dot2Dot1EeMaInterface.asn | 26 + .../Ieee1609Dot2Dot1EeRaInterface.asn | 305 +++ .../Ieee1609Dot2Dot1LaMaInterface.asn | 26 + .../Ieee1609Dot2Dot1LaRaInterface.asn | 26 + .../Ieee1609Dot2Dot1MaRaInterface.asn | 26 + .../ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn | 1277 +++++++++ .../asncodec/asn1/ieee1609.2/Ieee1609Dot2.asn | 1471 ++++++++++ .../asn1/ieee1609.2/Ieee1609Dot2BaseTypes.asn | 1413 ++++++++++ .../asn1/ieee1609.2/Ieee1609Dot2Crl.asn | 72 + .../ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn | 468 ++++ certgen/asncodec/asn1/ieee1609.2/README.md | 5 + .../pki_ts102941/EtsiTs102941BaseTypes.asn | 58 + .../pki_ts102941/EtsiTs102941MessagesCa.asn | 127 + ...siTs102941MessagesItss-OptionalPrivacy.asn | 106 + .../pki_ts102941/EtsiTs102941MessagesItss.asn | 112 + .../pki_ts102941/EtsiTs102941TrustLists.asn | 143 + .../EtsiTs102941TypesAuthorization.asn | 105 + ...siTs102941TypesAuthorizationValidation.asn | 63 + .../EtsiTs102941TypesCaManagement.asn | 31 + .../EtsiTs102941TypesEnrolment.asn | 62 + .../EtsiTs102941TypesLinkCertificate.asn | 30 + .../EtsiTs103097ExtensionModule.asn | 43 + .../asn1/sec_ts103097/EtsiTs103097Module.asn | 123 + certgen/asncodec/asn1/sec_ts103097/LICENSE | 23 + certgen/asncodec/asn1/sec_ts103097/README.md | 17 + certgen/asncodec/asn_SEQUENCE_OF.c | 82 +- certgen/asncodec/asn_SEQUENCE_OF.h | 104 +- certgen/asncodec/asn_SET_OF.c | 176 +- certgen/asncodec/asn_SET_OF.h | 144 +- certgen/asncodec/asn_application.c | 978 ++++--- certgen/asncodec/asn_application.h | 342 +-- certgen/asncodec/asn_bit_data.c | 666 ++--- certgen/asncodec/asn_bit_data.h | 166 +- certgen/asncodec/asn_codecs.h | 216 +- certgen/asncodec/asn_codecs_prim.c | 348 +-- certgen/asncodec/asn_codecs_prim.h | 107 +- certgen/asncodec/asn_codecs_prim_xer.c | 184 ++ certgen/asncodec/asn_config.h | 7 + certgen/asncodec/asn_constant.h | 46 + certgen/asncodec/asn_internal.c | 95 +- certgen/asncodec/asn_internal.h | 321 ++- certgen/asncodec/asn_ioc.h | 101 +- certgen/asncodec/asn_random_fill.c | 56 - certgen/asncodec/asn_random_fill.h | 51 - certgen/asncodec/asn_system.h | 336 +-- certgen/asncodec/ber_decoder.c | 283 -- certgen/asncodec/ber_decoder.h | 66 - certgen/asncodec/ber_tlv_length.c | 336 +-- certgen/asncodec/ber_tlv_length.h | 100 +- certgen/asncodec/ber_tlv_tag.c | 288 +- certgen/asncodec/ber_tlv_tag.h | 120 +- certgen/asncodec/constr_CHOICE.c | 1696 +++--------- certgen/asncodec/constr_CHOICE.h | 197 +- certgen/asncodec/constr_CHOICE_oer.c | 757 +++-- certgen/asncodec/constr_CHOICE_print.c | 48 + certgen/asncodec/constr_CHOICE_xer.c | 316 +++ certgen/asncodec/constr_SEQUENCE.c | 1823 ++----------- certgen/asncodec/constr_SEQUENCE.h | 161 +- certgen/asncodec/constr_SEQUENCE_OF.c | 376 +-- certgen/asncodec/constr_SEQUENCE_OF.h | 106 +- certgen/asncodec/constr_SEQUENCE_OF_xer.c | 60 + certgen/asncodec/constr_SEQUENCE_oer.c | 1120 ++++---- certgen/asncodec/constr_SEQUENCE_print.c | 55 + certgen/asncodec/constr_SEQUENCE_xer.c | 348 +++ certgen/asncodec/constr_SET_OF.c | 1719 +++--------- certgen/asncodec/constr_SET_OF.h | 149 +- certgen/asncodec/constr_SET_OF_oer.c | 566 ++-- certgen/asncodec/constr_SET_OF_print.c | 39 + certgen/asncodec/constr_SET_OF_xer.c | 314 +++ certgen/asncodec/constr_TYPE.c | 160 +- certgen/asncodec/constr_TYPE.h | 556 ++-- certgen/asncodec/constraints.c | 187 +- certgen/asncodec/constraints.h | 125 +- certgen/asncodec/der_encoder.c | 194 -- certgen/asncodec/der_encoder.h | 68 - certgen/asncodec/oer_decoder.c | 304 +-- certgen/asncodec/oer_decoder.h | 144 +- certgen/asncodec/oer_encoder.c | 282 +- certgen/asncodec/oer_encoder.h | 140 +- certgen/asncodec/oer_support.c | 244 +- certgen/asncodec/oer_support.h | 94 +- certgen/asncodec/per_decoder.c | 97 - certgen/asncodec/per_decoder.h | 57 - certgen/asncodec/per_encoder.c | 165 -- certgen/asncodec/per_encoder.h | 70 - certgen/asncodec/per_opentype.c | 396 --- certgen/asncodec/per_opentype.h | 32 - certgen/asncodec/per_support.c | 295 -- certgen/asncodec/per_support.h | 112 - certgen/asncodec/xer_decoder.c | 738 ++--- certgen/asncodec/xer_decoder.h | 212 +- certgen/asncodec/xer_encoder.c | 474 ++-- certgen/asncodec/xer_encoder.h | 166 +- certgen/asncodec/xer_support.c | 454 +-- certgen/asncodec/xer_support.h | 110 +- certgen/certgen.c | 281 +- certgen/certgen.vcxproj | 456 +++- certgen/ecc_api.h | 14 +- certgen/ecc_openssl.c | 202 +- 887 files changed, 60252 insertions(+), 23913 deletions(-) create mode 100644 certgen/asncodec/ANY.c create mode 100644 certgen/asncodec/ANY.h create mode 100644 certgen/asncodec/ANY_xer.c create mode 100644 certgen/asncodec/AcaEeCertResponse.c create mode 100644 certgen/asncodec/AcaEeCertResponse.h create mode 100644 certgen/asncodec/AcaEeCertResponseCubkSpdu.c create mode 100644 certgen/asncodec/AcaEeCertResponseCubkSpdu.h create mode 100644 certgen/asncodec/AcaEeCertResponsePlainSpdu.c create mode 100644 certgen/asncodec/AcaEeCertResponsePlainSpdu.h create mode 100644 certgen/asncodec/AcaEeCertResponsePrivateSpdu.c create mode 100644 certgen/asncodec/AcaEeCertResponsePrivateSpdu.h create mode 100644 certgen/asncodec/AcaEeInterfacePdu.c create mode 100644 certgen/asncodec/AcaEeInterfacePdu.h create mode 100644 certgen/asncodec/AcaLaInterfacePdu.c create mode 100644 certgen/asncodec/AcaLaInterfacePdu.h create mode 100644 certgen/asncodec/AcaMaInterfacePdu.c create mode 100644 certgen/asncodec/AcaMaInterfacePdu.h create mode 100644 certgen/asncodec/AcaRaCertResponse.c create mode 100644 certgen/asncodec/AcaRaCertResponse.h create mode 100644 certgen/asncodec/AcaRaCertResponseSpdu.c create mode 100644 certgen/asncodec/AcaRaCertResponseSpdu.h create mode 100644 certgen/asncodec/AcaRaInterfacePdu.c create mode 100644 certgen/asncodec/AcaRaInterfacePdu.h create mode 100644 certgen/asncodec/AcaResponse.c create mode 100644 certgen/asncodec/AcaResponse.h create mode 100644 certgen/asncodec/AcaSsp.c create mode 100644 certgen/asncodec/AcaSsp.h create mode 100644 certgen/asncodec/AcpcNodeValue.c create mode 100644 certgen/asncodec/AcpcNodeValue.h create mode 100644 certgen/asncodec/AcpcPdu.c create mode 100644 certgen/asncodec/AcpcPdu.h create mode 100644 certgen/asncodec/AcpcPsid.c create mode 100644 certgen/asncodec/AcpcPsid.h create mode 100644 certgen/asncodec/AcpcSsp.c create mode 100644 certgen/asncodec/AcpcSsp.h create mode 100644 certgen/asncodec/AcpcTreeId.c create mode 100644 certgen/asncodec/AcpcTreeId.h create mode 100644 certgen/asncodec/AdditionalParams.c create mode 100644 certgen/asncodec/AdditionalParams.h create mode 100644 certgen/asncodec/Aes128CcmCiphertext.c create mode 100644 certgen/asncodec/Aes128CcmCiphertext.h delete mode 100644 certgen/asncodec/AesCcmCiphertext.c delete mode 100644 certgen/asncodec/AesCcmCiphertext.h create mode 100644 certgen/asncodec/AppExtension.c create mode 100644 certgen/asncodec/AppExtension.h create mode 100644 certgen/asncodec/AprvBinaryTree.c create mode 100644 certgen/asncodec/AprvBinaryTree.h create mode 100644 certgen/asncodec/AprvHashCalculationInput.c create mode 100644 certgen/asncodec/AprvHashCalculationInput.h create mode 100644 certgen/asncodec/BIT_STRING_print.c create mode 100644 certgen/asncodec/BIT_STRING_xer.c create mode 100644 certgen/asncodec/BOOLEAN_oer.c create mode 100644 certgen/asncodec/BOOLEAN_print.c create mode 100644 certgen/asncodec/BOOLEAN_xer.c create mode 100644 certgen/asncodec/BlindedKey.c create mode 100644 certgen/asncodec/BlindedKey.h create mode 100644 certgen/asncodec/ButterflyAtDownloadRequestMessage.c create mode 100644 certgen/asncodec/ButterflyAtDownloadRequestMessage.h create mode 100644 certgen/asncodec/ButterflyAuthorizationRequestMessage.c create mode 100644 certgen/asncodec/ButterflyAuthorizationRequestMessage.h create mode 100644 certgen/asncodec/ButterflyAuthorizationResponseMessage.c create mode 100644 certgen/asncodec/ButterflyAuthorizationResponseMessage.h create mode 100644 certgen/asncodec/ButterflyCertRequestMessage.c create mode 100644 certgen/asncodec/ButterflyCertRequestMessage.h create mode 100644 certgen/asncodec/ButterflyCertResponseMessage.c create mode 100644 certgen/asncodec/ButterflyCertResponseMessage.h create mode 100644 certgen/asncodec/ButterflyExpansion.c create mode 100644 certgen/asncodec/ButterflyExpansion.h create mode 100644 certgen/asncodec/ButterflyParamsOriginal.c create mode 100644 certgen/asncodec/ButterflyParamsOriginal.h create mode 100644 certgen/asncodec/CamRaBatchResponse.c create mode 100644 certgen/asncodec/CamRaBatchResponse.h create mode 100644 certgen/asncodec/CamRaInterfacePdu.c create mode 100644 certgen/asncodec/CamRaInterfacePdu.h create mode 100644 certgen/asncodec/CamSsp.c create mode 100644 certgen/asncodec/CamSsp.h create mode 100644 certgen/asncodec/CertIssueExtension.c create mode 100644 certgen/asncodec/CertIssueExtension.h create mode 100644 certgen/asncodec/CertManagementPdu.c create mode 100644 certgen/asncodec/CertManagementPdu.h create mode 100644 certgen/asncodec/CertRequestExtension.c create mode 100644 certgen/asncodec/CertRequestExtension.h create mode 100644 certgen/asncodec/CertificateChain.c create mode 100644 certgen/asncodec/CertificateChain.h create mode 100644 certgen/asncodec/CertificateChainSpdu.c create mode 100644 certgen/asncodec/CertificateChainSpdu.h create mode 100644 certgen/asncodec/CertificateManagementInfoStatus.c create mode 100644 certgen/asncodec/CertificateManagementInfoStatus.h create mode 100644 certgen/asncodec/CertificateManagementInformationStatusSpdu.c create mode 100644 certgen/asncodec/CertificateManagementInformationStatusSpdu.h create mode 100644 certgen/asncodec/CompositeCrl.c create mode 100644 certgen/asncodec/CompositeCrl.h create mode 100644 certgen/asncodec/CompositeCrlSpdu.c create mode 100644 certgen/asncodec/CompositeCrlSpdu.h create mode 100644 certgen/asncodec/ContributedExtensionBlock.c create mode 100644 certgen/asncodec/ContributedExtensionBlock.h create mode 100644 certgen/asncodec/ContributedExtensionBlocks.c create mode 100644 certgen/asncodec/ContributedExtensionBlocks.h create mode 100644 certgen/asncodec/CrlContents.c create mode 100644 certgen/asncodec/CrlContents.h create mode 100644 certgen/asncodec/CrlInfoStatus.c create mode 100644 certgen/asncodec/CrlInfoStatus.h create mode 100644 certgen/asncodec/CrlPriorityInfo.c create mode 100644 certgen/asncodec/CrlPriorityInfo.h create mode 100644 certgen/asncodec/CrlPsid.c create mode 100644 certgen/asncodec/CrlPsid.h create mode 100644 certgen/asncodec/CrlSignerSsp.c create mode 100644 certgen/asncodec/CrlSignerSsp.h create mode 100644 certgen/asncodec/CtlElectorEntry.c create mode 100644 certgen/asncodec/CtlElectorEntry.h create mode 100644 certgen/asncodec/CtlInfoStatus.c create mode 100644 certgen/asncodec/CtlInfoStatus.h create mode 100644 certgen/asncodec/CtlRootCaEntry.c create mode 100644 certgen/asncodec/CtlRootCaEntry.h create mode 100644 certgen/asncodec/CtlSequenceNumber.c create mode 100644 certgen/asncodec/CtlSequenceNumber.h create mode 100644 certgen/asncodec/CtlSeriesId.c create mode 100644 certgen/asncodec/CtlSeriesId.h create mode 100644 certgen/asncodec/CtlSignatureSpdu.c create mode 100644 certgen/asncodec/CtlSignatureSpdu.h create mode 100644 certgen/asncodec/DATE-ENCODING.c create mode 100644 certgen/asncodec/DATE-ENCODING.h create mode 100644 certgen/asncodec/DATE.c create mode 100644 certgen/asncodec/DATE.h create mode 100644 certgen/asncodec/DcSsp.c create mode 100644 certgen/asncodec/DcSsp.h create mode 100644 certgen/asncodec/DcmSsp.c create mode 100644 certgen/asncodec/DcmSsp.h create mode 100644 certgen/asncodec/EXTERNAL.c create mode 100644 certgen/asncodec/EXTERNAL.h create mode 100644 certgen/asncodec/EcaEeCertResponse.c create mode 100644 certgen/asncodec/EcaEeCertResponse.h create mode 100644 certgen/asncodec/EcaEeCertResponseSpdu.c create mode 100644 certgen/asncodec/EcaEeCertResponseSpdu.h create mode 100644 certgen/asncodec/EcaEeInterfacePdu.c create mode 100644 certgen/asncodec/EcaEeInterfacePdu.h create mode 100644 certgen/asncodec/EcaSsp.c create mode 100644 certgen/asncodec/EcaSsp.h create mode 100644 certgen/asncodec/EcencP256EncryptedKey.c create mode 100644 certgen/asncodec/EcencP256EncryptedKey.h create mode 100644 certgen/asncodec/EcsigP256Signature.c create mode 100644 certgen/asncodec/EcsigP256Signature.h create mode 100644 certgen/asncodec/EeEcaCertRequest.c create mode 100644 certgen/asncodec/EeEcaCertRequest.h create mode 100644 certgen/asncodec/EeEcaCertRequestSpdu.c create mode 100644 certgen/asncodec/EeEcaCertRequestSpdu.h create mode 100644 certgen/asncodec/EeMaInterfacePdu.c create mode 100644 certgen/asncodec/EeMaInterfacePdu.h create mode 100644 certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.c create mode 100644 certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.h create mode 100644 certgen/asncodec/EeRaCertRequest.c create mode 100644 certgen/asncodec/EeRaCertRequest.h create mode 100644 certgen/asncodec/EeRaCertRequestSpdu.c create mode 100644 certgen/asncodec/EeRaCertRequestSpdu.h create mode 100644 certgen/asncodec/EeRaDownloadRequest.c create mode 100644 certgen/asncodec/EeRaDownloadRequest.h create mode 100644 certgen/asncodec/EeRaDownloadRequestPlainSpdu.c create mode 100644 certgen/asncodec/EeRaDownloadRequestPlainSpdu.h create mode 100644 certgen/asncodec/EeRaDownloadRequestSpdu.c create mode 100644 certgen/asncodec/EeRaDownloadRequestSpdu.h create mode 100644 certgen/asncodec/EeRaInterfacePdu.c create mode 100644 certgen/asncodec/EeRaInterfacePdu.h create mode 100644 certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.c create mode 100644 certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.h create mode 100644 certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.c create mode 100644 certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.h create mode 100644 certgen/asncodec/EeSsp.c create mode 100644 certgen/asncodec/EeSsp.h create mode 100644 certgen/asncodec/ElectorSsp.c create mode 100644 certgen/asncodec/ElectorSsp.h delete mode 100644 certgen/asncodec/ElevInt.c delete mode 100644 certgen/asncodec/ElevInt.h create mode 100644 certgen/asncodec/EncryptedIndividualPLV.c create mode 100644 certgen/asncodec/EncryptedIndividualPLV.h create mode 100644 certgen/asncodec/EtsiOriginatingHeaderInfoExtension.c create mode 100644 certgen/asncodec/EtsiOriginatingHeaderInfoExtension.h create mode 100644 certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.c create mode 100644 certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.h create mode 100644 certgen/asncodec/EtsiTs102941CrlRequest.c create mode 100644 certgen/asncodec/EtsiTs102941CrlRequest.h create mode 100644 certgen/asncodec/EtsiTs102941CtlRequest.c create mode 100644 certgen/asncodec/EtsiTs102941CtlRequest.h create mode 100644 certgen/asncodec/EtsiTs102941DeltaCtlRequest.c create mode 100644 certgen/asncodec/EtsiTs102941DeltaCtlRequest.h create mode 100644 certgen/asncodec/EtsiTs103097Data-Unsecured.c create mode 100644 certgen/asncodec/EtsiTs103097Data-Unsecured.h create mode 100644 certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.c create mode 100644 certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.h create mode 100644 certgen/asncodec/ExpansionAlgorithmIdentifier.c create mode 100644 certgen/asncodec/ExpansionAlgorithmIdentifier.h create mode 100644 certgen/asncodec/ExtId.c create mode 100644 certgen/asncodec/ExtId.h create mode 100644 certgen/asncodec/Extension.c create mode 100644 certgen/asncodec/Extension.h create mode 100644 certgen/asncodec/ExtensionModuleVersion.c create mode 100644 certgen/asncodec/ExtensionModuleVersion.h create mode 100644 certgen/asncodec/FullIeeeTbsCtl.c create mode 100644 certgen/asncodec/FullIeeeTbsCtl.h create mode 100644 certgen/asncodec/GraphicString.c create mode 100644 certgen/asncodec/GraphicString.h create mode 100644 certgen/asncodec/GroupCrlEntry.c create mode 100644 certgen/asncodec/GroupCrlEntry.h create mode 100644 certgen/asncodec/GroupSingleSeedCrlEntry.c create mode 100644 certgen/asncodec/GroupSingleSeedCrlEntry.h create mode 100644 certgen/asncodec/HashBasedRevocationInfo.c create mode 100644 certgen/asncodec/HashBasedRevocationInfo.h create mode 100644 certgen/asncodec/HashedId32.c create mode 100644 certgen/asncodec/HashedId32.h create mode 100644 certgen/asncodec/HashedId48.c create mode 100644 certgen/asncodec/HashedId48.h create mode 100644 certgen/asncodec/HeaderInfoContributorId.c create mode 100644 certgen/asncodec/HeaderInfoContributorId.h create mode 100644 certgen/asncodec/IMaxGroup.c create mode 100644 certgen/asncodec/IMaxGroup.h create mode 100644 certgen/asncodec/INTEGER_print.c create mode 100644 certgen/asncodec/INTEGER_xer.c create mode 100644 certgen/asncodec/IcaSsp.c create mode 100644 certgen/asncodec/IcaSsp.h create mode 100644 certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.c create mode 100644 certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-Encrypted.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-Encrypted.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-Signed.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-Signed.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.h create mode 100644 certgen/asncodec/Ieee1609Dot2Data-Unsecured.c create mode 100644 certgen/asncodec/Ieee1609Dot2Data-Unsecured.h create mode 100644 certgen/asncodec/Ieee1609HeaderInfoExtensionId.c create mode 100644 certgen/asncodec/Ieee1609HeaderInfoExtensionId.h create mode 100644 certgen/asncodec/Ieee1609dot2dot1MsctlType.c create mode 100644 certgen/asncodec/Ieee1609dot2dot1MsctlType.h create mode 100644 certgen/asncodec/IndividualAprv.c create mode 100644 certgen/asncodec/IndividualAprv.h create mode 100644 certgen/asncodec/IndividualRevocation.c create mode 100644 certgen/asncodec/IndividualRevocation.h create mode 100644 certgen/asncodec/JMaxGroup.c create mode 100644 certgen/asncodec/JMaxGroup.h create mode 100644 certgen/asncodec/LAGroup.c create mode 100644 certgen/asncodec/LAGroup.h create mode 100644 certgen/asncodec/LaMaInterfacePdu.c create mode 100644 certgen/asncodec/LaMaInterfacePdu.h create mode 100644 certgen/asncodec/LaRaInterfacePdu.c create mode 100644 certgen/asncodec/LaRaInterfacePdu.h create mode 100644 certgen/asncodec/LaSsp.c create mode 100644 certgen/asncodec/LaSsp.h create mode 100644 certgen/asncodec/LinkageInfo.c create mode 100644 certgen/asncodec/LinkageInfo.h create mode 100644 certgen/asncodec/LopSsp.c create mode 100644 certgen/asncodec/LopSsp.h create mode 100644 certgen/asncodec/LvGenerationFunctionIdentifier.c create mode 100644 certgen/asncodec/LvGenerationFunctionIdentifier.h create mode 100644 certgen/asncodec/MaInfoStatus.c create mode 100644 certgen/asncodec/MaInfoStatus.h create mode 100644 certgen/asncodec/MaRaInterfacePdu.c create mode 100644 certgen/asncodec/MaRaInterfacePdu.h create mode 100644 certgen/asncodec/MaSsp.c create mode 100644 certgen/asncodec/MaSsp.h create mode 100644 certgen/asncodec/MultiSignedCtl.c create mode 100644 certgen/asncodec/MultiSignedCtl.h create mode 100644 certgen/asncodec/MultiSignedCtlSpdu.c create mode 100644 certgen/asncodec/MultiSignedCtlSpdu.h create mode 100644 certgen/asncodec/NULL_oer.c create mode 100644 certgen/asncodec/NULL_print.c create mode 100644 certgen/asncodec/NULL_xer.c create mode 100644 certgen/asncodec/NativeEnumerated_xer.c create mode 100644 certgen/asncodec/NativeInteger_print.c create mode 100644 certgen/asncodec/NativeInteger_xer.c create mode 100644 certgen/asncodec/OBJECT_IDENTIFIER.c create mode 100644 certgen/asncodec/OBJECT_IDENTIFIER.h create mode 100644 certgen/asncodec/OBJECT_IDENTIFIER_print.c create mode 100644 certgen/asncodec/OBJECT_IDENTIFIER_xer.c create mode 100644 certgen/asncodec/OCTET_STRING_print.c create mode 100644 certgen/asncodec/OCTET_STRING_xer.c create mode 100644 certgen/asncodec/OPEN_TYPE_xer.c create mode 100644 certgen/asncodec/ObjectDescriptor.c create mode 100644 certgen/asncodec/ObjectDescriptor.h create mode 100644 certgen/asncodec/One28BitCcmCiphertext.c create mode 100644 certgen/asncodec/One28BitCcmCiphertext.h create mode 100644 certgen/asncodec/OperatingOrganizationId.c create mode 100644 certgen/asncodec/OperatingOrganizationId.h create mode 100644 certgen/asncodec/PduFunctionalType.c create mode 100644 certgen/asncodec/PduFunctionalType.h create mode 100644 certgen/asncodec/PgSsp.c create mode 100644 certgen/asncodec/PgSsp.h create mode 100644 certgen/asncodec/PreLinkageValue.c create mode 100644 certgen/asncodec/PreLinkageValue.h create mode 100644 certgen/asncodec/RaAcaCertRequest.c create mode 100644 certgen/asncodec/RaAcaCertRequest.h create mode 100644 certgen/asncodec/RaAcaCertRequestFlags.c create mode 100644 certgen/asncodec/RaAcaCertRequestFlags.h create mode 100644 certgen/asncodec/RaAcaCertRequestSpdu.c create mode 100644 certgen/asncodec/RaAcaCertRequestSpdu.h create mode 100644 certgen/asncodec/RaCamBatchRequest.c create mode 100644 certgen/asncodec/RaCamBatchRequest.h create mode 100644 certgen/asncodec/RaEeCertAck.c create mode 100644 certgen/asncodec/RaEeCertAck.h create mode 100644 certgen/asncodec/RaEeCertAckSpdu.c create mode 100644 certgen/asncodec/RaEeCertAckSpdu.h create mode 100644 certgen/asncodec/RaEeCertAndAcpcInfoSpdu.c create mode 100644 certgen/asncodec/RaEeCertAndAcpcInfoSpdu.h create mode 100644 certgen/asncodec/RaEeCertInfo.c create mode 100644 certgen/asncodec/RaEeCertInfo.h create mode 100644 certgen/asncodec/RaEeCertInfoSpdu.c create mode 100644 certgen/asncodec/RaEeCertInfoSpdu.h create mode 100644 certgen/asncodec/RaEeEnrollmentCertAckSpdu.c create mode 100644 certgen/asncodec/RaEeEnrollmentCertAckSpdu.h create mode 100644 certgen/asncodec/RaSsp.c create mode 100644 certgen/asncodec/RaSsp.h create mode 100644 certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.c create mode 100644 certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.h create mode 100644 certgen/asncodec/RcaSingleSignedLinkCertificateMessage.c create mode 100644 certgen/asncodec/RcaSingleSignedLinkCertificateMessage.h create mode 100644 certgen/asncodec/ReconstructionValue.c create mode 100644 certgen/asncodec/ReconstructionValue.h create mode 100644 certgen/asncodec/RootCaSsp.c create mode 100644 certgen/asncodec/RootCaSsp.h create mode 100644 certgen/asncodec/ScmsPdu-EeEcaCertRequest.c create mode 100644 certgen/asncodec/ScmsPdu-EeEcaCertRequest.h create mode 100644 certgen/asncodec/ScmsPdu-EeRaCertRequest.c create mode 100644 certgen/asncodec/ScmsPdu-EeRaCertRequest.h create mode 100644 certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.c create mode 100644 certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.h create mode 100644 certgen/asncodec/ScmsPdu-RaAcaCertRequest.c create mode 100644 certgen/asncodec/ScmsPdu-RaAcaCertRequest.h create mode 100644 certgen/asncodec/ScmsPdu-Scoped.c create mode 100644 certgen/asncodec/ScmsPdu-Scoped.h create mode 100644 certgen/asncodec/ScmsPdu.c create mode 100644 certgen/asncodec/ScmsPdu.h create mode 100644 certgen/asncodec/ScopedCertificateRequest.c create mode 100644 certgen/asncodec/ScopedCertificateRequest.h create mode 100644 certgen/asncodec/SecuredCrl.c create mode 100644 certgen/asncodec/SecuredCrl.h create mode 100644 certgen/asncodec/SecurityMgmtPsid.c create mode 100644 certgen/asncodec/SecurityMgmtPsid.h create mode 100644 certgen/asncodec/SecurityMgmtSsp.c create mode 100644 certgen/asncodec/SecurityMgmtSsp.h create mode 100644 certgen/asncodec/SeedEvolutionFunctionIdentifier.c create mode 100644 certgen/asncodec/SeedEvolutionFunctionIdentifier.h create mode 100644 certgen/asncodec/SequenceOfAppExtensions.c create mode 100644 certgen/asncodec/SequenceOfAppExtensions.h create mode 100644 certgen/asncodec/SequenceOfCertIssueExtensions.c create mode 100644 certgen/asncodec/SequenceOfCertIssueExtensions.h create mode 100644 certgen/asncodec/SequenceOfCertRequestExtensions.c create mode 100644 certgen/asncodec/SequenceOfCertRequestExtensions.h create mode 100644 certgen/asncodec/SequenceOfCrlInfoStatus.c create mode 100644 certgen/asncodec/SequenceOfCrlInfoStatus.h create mode 100644 certgen/asncodec/SequenceOfCtlInfoStatus.c create mode 100644 certgen/asncodec/SequenceOfCtlInfoStatus.h create mode 100644 certgen/asncodec/SequenceOfGroupCrlEntry.c create mode 100644 certgen/asncodec/SequenceOfGroupCrlEntry.h create mode 100644 certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.c create mode 100644 certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.h create mode 100644 certgen/asncodec/SequenceOfHashBasedRevocationInfo.c create mode 100644 certgen/asncodec/SequenceOfHashBasedRevocationInfo.h create mode 100644 certgen/asncodec/SequenceOfIMaxGroup.c create mode 100644 certgen/asncodec/SequenceOfIMaxGroup.h create mode 100644 certgen/asncodec/SequenceOfIndividualRevocation.c create mode 100644 certgen/asncodec/SequenceOfIndividualRevocation.h create mode 100644 certgen/asncodec/SequenceOfJMaxGroup.c create mode 100644 certgen/asncodec/SequenceOfJMaxGroup.h create mode 100644 certgen/asncodec/SequenceOfLAGroup.c create mode 100644 certgen/asncodec/SequenceOfLAGroup.h create mode 100644 certgen/asncodec/SequenceOfLinkageSeed.c create mode 100644 certgen/asncodec/SequenceOfLinkageSeed.h create mode 100644 certgen/asncodec/SequenceOfMaInfoStatus.c create mode 100644 certgen/asncodec/SequenceOfMaInfoStatus.h create mode 100644 certgen/asncodec/SequenceOfX509Certificate.c create mode 100644 certgen/asncodec/SequenceOfX509Certificate.h create mode 100644 certgen/asncodec/SignedAprvBinaryTree.c create mode 100644 certgen/asncodec/SignedAprvBinaryTree.h create mode 100644 certgen/asncodec/SignedCertificateRequest.c create mode 100644 certgen/asncodec/SignedCertificateRequest.h create mode 100644 certgen/asncodec/SignedIndividualAprv.c create mode 100644 certgen/asncodec/SignedIndividualAprv.h create mode 100644 certgen/asncodec/SignedX509CertificateRequest.c create mode 100644 certgen/asncodec/SignedX509CertificateRequest.h create mode 100644 certgen/asncodec/SignerSelf.c create mode 100644 certgen/asncodec/SignerSelf.h create mode 100644 certgen/asncodec/SignerSingleCert.c create mode 100644 certgen/asncodec/SignerSingleCert.h create mode 100644 certgen/asncodec/SignerSingleX509Cert.c create mode 100644 certgen/asncodec/SignerSingleX509Cert.h delete mode 100644 certgen/asncodec/SingleEtsiTs103097Certificate.c delete mode 100644 certgen/asncodec/SingleEtsiTs103097Certificate.h create mode 100644 certgen/asncodec/TestCertificate.c create mode 100644 certgen/asncodec/TestCertificate.h create mode 100644 certgen/asncodec/TestSecurityMgmtSsp.c create mode 100644 certgen/asncodec/TestSecurityMgmtSsp.h create mode 100644 certgen/asncodec/TlmLinkCertificateMessage.c create mode 100644 certgen/asncodec/TlmLinkCertificateMessage.h create mode 100644 certgen/asncodec/ToBeSignedCtlSignature.c create mode 100644 certgen/asncodec/ToBeSignedCtlSignature.h create mode 100644 certgen/asncodec/ToBeSignedHashIdCrl.c create mode 100644 certgen/asncodec/ToBeSignedHashIdCrl.h create mode 100644 certgen/asncodec/ToBeSignedLinkCertificate.c create mode 100644 certgen/asncodec/ToBeSignedLinkCertificate.h create mode 100644 certgen/asncodec/ToBeSignedLinkCertificateRca.c create mode 100644 certgen/asncodec/ToBeSignedLinkCertificateRca.h create mode 100644 certgen/asncodec/ToBeSignedLinkCertificateTlm.c create mode 100644 certgen/asncodec/ToBeSignedLinkCertificateTlm.h create mode 100644 certgen/asncodec/ToBeSignedLinkageValueCrl.c create mode 100644 certgen/asncodec/ToBeSignedLinkageValueCrl.h create mode 100644 certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.c create mode 100644 certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.h create mode 100644 certgen/asncodec/TypeSpecificCrlContents.c create mode 100644 certgen/asncodec/TypeSpecificCrlContents.h create mode 100644 certgen/asncodec/UTF8String_print.c create mode 100644 certgen/asncodec/UnCountryId.c create mode 100644 certgen/asncodec/UnCountryId.h create mode 100644 certgen/asncodec/UnsecuredAprvBinaryTree.c create mode 100644 certgen/asncodec/UnsecuredAprvBinaryTree.h create mode 100644 certgen/asncodec/X509Certificate.c create mode 100644 certgen/asncodec/X509Certificate.h create mode 100644 certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.c create mode 100644 certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.h create mode 100644 certgen/asncodec/X509SignerIdentifier.c create mode 100644 certgen/asncodec/X509SignerIdentifier.h create mode 100644 certgen/asncodec/YEAR-ENCODING.c create mode 100644 certgen/asncodec/YEAR-ENCODING.h create mode 100644 certgen/asncodec/YEAR-MONTH-ENCODING.c create mode 100644 certgen/asncodec/YEAR-MONTH-ENCODING.h create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn create mode 100644 certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2.asn create mode 100644 certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2BaseTypes.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn create mode 100755 certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn create mode 100644 certgen/asncodec/asn1/ieee1609.2/README.md create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941BaseTypes.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesCa.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss-OptionalPrivacy.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TrustLists.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesCaManagement.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn create mode 100644 certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn create mode 100644 certgen/asncodec/asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn create mode 100644 certgen/asncodec/asn1/sec_ts103097/EtsiTs103097Module.asn create mode 100644 certgen/asncodec/asn1/sec_ts103097/LICENSE create mode 100644 certgen/asncodec/asn1/sec_ts103097/README.md create mode 100644 certgen/asncodec/asn_codecs_prim_xer.c create mode 100644 certgen/asncodec/asn_config.h create mode 100644 certgen/asncodec/asn_constant.h delete mode 100644 certgen/asncodec/asn_random_fill.c delete mode 100644 certgen/asncodec/asn_random_fill.h delete mode 100644 certgen/asncodec/ber_decoder.c delete mode 100644 certgen/asncodec/ber_decoder.h create mode 100644 certgen/asncodec/constr_CHOICE_print.c create mode 100644 certgen/asncodec/constr_CHOICE_xer.c create mode 100644 certgen/asncodec/constr_SEQUENCE_OF_xer.c create mode 100644 certgen/asncodec/constr_SEQUENCE_print.c create mode 100644 certgen/asncodec/constr_SEQUENCE_xer.c create mode 100644 certgen/asncodec/constr_SET_OF_print.c create mode 100644 certgen/asncodec/constr_SET_OF_xer.c delete mode 100644 certgen/asncodec/der_encoder.c delete mode 100644 certgen/asncodec/der_encoder.h delete mode 100644 certgen/asncodec/per_decoder.c delete mode 100644 certgen/asncodec/per_decoder.h delete mode 100644 certgen/asncodec/per_encoder.c delete mode 100644 certgen/asncodec/per_encoder.h delete mode 100644 certgen/asncodec/per_opentype.c delete mode 100644 certgen/asncodec/per_opentype.h delete mode 100644 certgen/asncodec/per_support.c delete mode 100644 certgen/asncodec/per_support.h diff --git a/certgen/asn1certgen.xslt b/certgen/asn1certgen.xslt index dbfc341..cbd6e49 100644 --- a/certgen/asn1certgen.xslt +++ b/certgen/asn1certgen.xslt @@ -45,7 +45,7 @@ - + @@ -57,6 +57,16 @@ 3 + + + + + + + + + + @@ -609,9 +619,16 @@ - - - + + + + + + + + + + @@ -637,6 +654,9 @@ + + diff --git a/certgen/asncodec/ANY.c b/certgen/asncodec/ANY.c new file mode 100644 index 0000000..bf988db --- /dev/null +++ b/certgen/asncodec/ANY.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = { + sizeof(ANY_t), + offsetof(ANY_t, _asn_ctx), + ASN_OSUBV_ANY +}; +asn_TYPE_operation_t asn_OP_ANY = { + OCTET_STRING_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + OCTET_STRING_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OCTET_STRING_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OCTET_STRING_decode_ber, + OCTET_STRING_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OCTET_STRING_decode_xer_hex, + ANY_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + ANY_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, + 0, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + ANY_decode_uper, + ANY_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + ANY_decode_aper, + ANY_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + 0, /* Random fill is not defined for ANY type */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_ANY = { + "ANY", + "ANY", + &asn_OP_ANY, + 0, 0, 0, 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, /* No constraints */ + 0, 0, /* No members */ + &asn_SPC_ANY_specs, +}; diff --git a/certgen/asncodec/ANY.h b/certgen/asncodec/ANY.h new file mode 100644 index 0000000..871ed5e --- /dev/null +++ b/certgen/asncodec/ANY.h @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_TYPE_ANY_H +#define ASN_TYPE_ANY_H + +#include /* Implemented via OCTET STRING type */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANY { + uint8_t *buf; /* BER-encoded ANY contents */ + int size; /* Size of the above buffer */ + + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ +} ANY_t; + +extern asn_TYPE_descriptor_t asn_DEF_ANY; +extern asn_TYPE_operation_t asn_OP_ANY; +extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs; + +#define ANY_free OCTET_STRING_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +#define ANY_print OCTET_STRING_print +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define ANY_compare OCTET_STRING_compare + +#define ANY_constraint asn_generic_no_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define ANY_decode_ber OCTET_STRING_decode_ber +#define ANY_encode_der OCTET_STRING_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define ANY_decode_xer OCTET_STRING_decode_xer_hex +xer_type_encoder_f ANY_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f ANY_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f ANY_decode_uper; +per_type_encoder_f ANY_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f ANY_decode_aper; +per_type_encoder_f ANY_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +/****************************** + * Handy conversion routines. * + ******************************/ + +/* Convert another ASN.1 type into the ANY. This implies DER encoding. */ +int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr); +ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr); +#if !defined(ASN_DISABLE_APER_SUPPORT) +int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr); +ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr); +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +/* Convert the contents of the ANY type into the specified type. */ +int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); +#if !defined(ASN_DISABLE_APER_SUPPORT) +int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size)) +#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \ + &asn_DEF_ANY, (buf), (size)) + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_TYPE_ANY_H */ diff --git a/certgen/asncodec/ANY_xer.c b/certgen/asncodec/ANY_xer.c new file mode 100644 index 0000000..112c213 --- /dev/null +++ b/certgen/asncodec/ANY_xer.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_enc_rval_t +ANY_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, + void *app_key) { + if(flags & XER_F_CANONICAL) { + /* + * Canonical XER-encoding of ANY type is not supported. + */ + ASN__ENCODE_FAILED; + } + + /* Dump as binary */ + return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key); +} diff --git a/certgen/asncodec/AaEntry.c b/certgen/asncodec/AaEntry.c index 2a00d60..df15bb6 100644 --- a/certgen/asncodec/AaEntry.c +++ b/certgen/asncodec/AaEntry.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AaEntry.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_AaEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "aaCertificate" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_AaEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Url, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "accessPoint" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_AaEntry = { asn_DEF_AaEntry_tags_1, /* Same as above */ sizeof(asn_DEF_AaEntry_tags_1) /sizeof(asn_DEF_AaEntry_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_AaEntry_1, 2, /* Elements count */ &asn_SPC_AaEntry_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AaEntry.h b/certgen/asncodec/AaEntry.h index ab0321a..f30344a 100644 --- a/certgen/asncodec/AaEntry.h +++ b/certgen/asncodec/AaEntry.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _AaEntry_H_ -#define _AaEntry_H_ - - -#include /* Including external dependencies */ #include "EtsiTs103097Certificate.h" #include "Url.h" #include +#ifndef _AaEntry_H_ +#define _AaEntry_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/AcaEeCertResponse.c b/certgen/asncodec/AcaEeCertResponse.c new file mode 100644 index 0000000..b3585bd --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponse.c @@ -0,0 +1,183 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaEeCertResponse.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_privateKeyInfo_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 32)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_privateKeyInfo_constr_5 CC_NOTUSED = { + { 0, 0 }, + 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_AcaEeCertResponse_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcaEeCertResponse, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaEeCertResponse, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaEeCertResponse, certificate), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Certificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certificate" + }, + { ATF_POINTER, 1, offsetof(struct AcaEeCertResponse, privateKeyInfo), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_privateKeyInfo_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_privateKeyInfo_constraint_1 + }, + 0, 0, /* No default value */ + "privateKeyInfo" + }, +}; +static const int asn_MAP_AcaEeCertResponse_oms_1[] = { 3 }; +static const ber_tlv_tag_t asn_DEF_AcaEeCertResponse_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_AcaEeCertResponse_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* certificate */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* privateKeyInfo */ +}; +asn_SEQUENCE_specifics_t asn_SPC_AcaEeCertResponse_specs_1 = { + sizeof(struct AcaEeCertResponse), + offsetof(struct AcaEeCertResponse, _asn_ctx), + asn_MAP_AcaEeCertResponse_tag2el_1, + 4, /* Count of tags in the map */ + asn_MAP_AcaEeCertResponse_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 4, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponse = { + "AcaEeCertResponse", + "AcaEeCertResponse", + &asn_OP_SEQUENCE, + asn_DEF_AcaEeCertResponse_tags_1, + sizeof(asn_DEF_AcaEeCertResponse_tags_1) + /sizeof(asn_DEF_AcaEeCertResponse_tags_1[0]), /* 1 */ + asn_DEF_AcaEeCertResponse_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaEeCertResponse_tags_1) + /sizeof(asn_DEF_AcaEeCertResponse_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_AcaEeCertResponse_1, + 4, /* Elements count */ + &asn_SPC_AcaEeCertResponse_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaEeCertResponse.h b/certgen/asncodec/AcaEeCertResponse.h new file mode 100644 index 0000000..532d0ba --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponse.h @@ -0,0 +1,50 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "Certificate.h" +#include +#include +#ifndef _AcaEeCertResponse_H_ +#define _AcaEeCertResponse_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaEeCertResponse */ +typedef struct AcaEeCertResponse { + Uint8_t version; + Time32_t generationTime; + Certificate_t certificate; + OCTET_STRING_t *privateKeyInfo; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcaEeCertResponse_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponse; +extern asn_SEQUENCE_specifics_t asn_SPC_AcaEeCertResponse_specs_1; +extern asn_TYPE_member_t asn_MBR_AcaEeCertResponse_1[4]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaEeCertResponse_H_ */ +#include diff --git a/certgen/asncodec/AcaEeCertResponseCubkSpdu.c b/certgen/asncodec/AcaEeCertResponseCubkSpdu.c new file mode 100644 index 0000000..305efa8 --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponseCubkSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaEeCertResponseCubkSpdu.h" + +int +AcaEeCertResponseCubkSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Encrypted_276P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcaEeCertResponseCubkSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_AcaEeCertResponseCubkSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponseCubkSpdu = { + "AcaEeCertResponseCubkSpdu", + "AcaEeCertResponseCubkSpdu", + &asn_OP_SEQUENCE, + asn_DEF_AcaEeCertResponseCubkSpdu_tags_1, + sizeof(asn_DEF_AcaEeCertResponseCubkSpdu_tags_1) + /sizeof(asn_DEF_AcaEeCertResponseCubkSpdu_tags_1[0]), /* 1 */ + asn_DEF_AcaEeCertResponseCubkSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaEeCertResponseCubkSpdu_tags_1) + /sizeof(asn_DEF_AcaEeCertResponseCubkSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcaEeCertResponseCubkSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AcaEeCertResponseCubkSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaEeCertResponseCubkSpdu.h b/certgen/asncodec/AcaEeCertResponseCubkSpdu.h new file mode 100644 index 0000000..b34b129 --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponseCubkSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Encrypted.h" +#ifndef _AcaEeCertResponseCubkSpdu_H_ +#define _AcaEeCertResponseCubkSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaEeCertResponseCubkSpdu */ +typedef Ieee1609Dot2Data_Encrypted_276P0_t AcaEeCertResponseCubkSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponseCubkSpdu; +asn_struct_free_f AcaEeCertResponseCubkSpdu_free; +asn_struct_print_f AcaEeCertResponseCubkSpdu_print; +asn_constr_check_f AcaEeCertResponseCubkSpdu_constraint; +xer_type_decoder_f AcaEeCertResponseCubkSpdu_decode_xer; +xer_type_encoder_f AcaEeCertResponseCubkSpdu_encode_xer; +oer_type_decoder_f AcaEeCertResponseCubkSpdu_decode_oer; +oer_type_encoder_f AcaEeCertResponseCubkSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaEeCertResponseCubkSpdu_H_ */ +#include diff --git a/certgen/asncodec/AcaEeCertResponsePlainSpdu.c b/certgen/asncodec/AcaEeCertResponsePlainSpdu.c new file mode 100644 index 0000000..ba0cf2c --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponsePlainSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaEeCertResponsePlainSpdu.h" + +int +AcaEeCertResponsePlainSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Unsecured_216P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcaEeCertResponsePlainSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_AcaEeCertResponsePlainSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponsePlainSpdu = { + "AcaEeCertResponsePlainSpdu", + "AcaEeCertResponsePlainSpdu", + &asn_OP_SEQUENCE, + asn_DEF_AcaEeCertResponsePlainSpdu_tags_1, + sizeof(asn_DEF_AcaEeCertResponsePlainSpdu_tags_1) + /sizeof(asn_DEF_AcaEeCertResponsePlainSpdu_tags_1[0]), /* 1 */ + asn_DEF_AcaEeCertResponsePlainSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaEeCertResponsePlainSpdu_tags_1) + /sizeof(asn_DEF_AcaEeCertResponsePlainSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcaEeCertResponsePlainSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AcaEeCertResponsePlainSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaEeCertResponsePlainSpdu.h b/certgen/asncodec/AcaEeCertResponsePlainSpdu.h new file mode 100644 index 0000000..449abdf --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponsePlainSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Unsecured.h" +#ifndef _AcaEeCertResponsePlainSpdu_H_ +#define _AcaEeCertResponsePlainSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaEeCertResponsePlainSpdu */ +typedef Ieee1609Dot2Data_Unsecured_216P0_t AcaEeCertResponsePlainSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponsePlainSpdu; +asn_struct_free_f AcaEeCertResponsePlainSpdu_free; +asn_struct_print_f AcaEeCertResponsePlainSpdu_print; +asn_constr_check_f AcaEeCertResponsePlainSpdu_constraint; +xer_type_decoder_f AcaEeCertResponsePlainSpdu_decode_xer; +xer_type_encoder_f AcaEeCertResponsePlainSpdu_encode_xer; +oer_type_decoder_f AcaEeCertResponsePlainSpdu_decode_oer; +oer_type_encoder_f AcaEeCertResponsePlainSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaEeCertResponsePlainSpdu_H_ */ +#include diff --git a/certgen/asncodec/AcaEeCertResponsePrivateSpdu.c b/certgen/asncodec/AcaEeCertResponsePrivateSpdu.c new file mode 100644 index 0000000..8e63864 --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponsePrivateSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaEeCertResponsePrivateSpdu.h" + +int +AcaEeCertResponsePrivateSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_EncryptedSigned_379P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcaEeCertResponsePrivateSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_AcaEeCertResponsePrivateSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponsePrivateSpdu = { + "AcaEeCertResponsePrivateSpdu", + "AcaEeCertResponsePrivateSpdu", + &asn_OP_SEQUENCE, + asn_DEF_AcaEeCertResponsePrivateSpdu_tags_1, + sizeof(asn_DEF_AcaEeCertResponsePrivateSpdu_tags_1) + /sizeof(asn_DEF_AcaEeCertResponsePrivateSpdu_tags_1[0]), /* 1 */ + asn_DEF_AcaEeCertResponsePrivateSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaEeCertResponsePrivateSpdu_tags_1) + /sizeof(asn_DEF_AcaEeCertResponsePrivateSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcaEeCertResponsePrivateSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AcaEeCertResponsePrivateSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaEeCertResponsePrivateSpdu.h b/certgen/asncodec/AcaEeCertResponsePrivateSpdu.h new file mode 100644 index 0000000..0175c0c --- /dev/null +++ b/certgen/asncodec/AcaEeCertResponsePrivateSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-EncryptedSigned.h" +#ifndef _AcaEeCertResponsePrivateSpdu_H_ +#define _AcaEeCertResponsePrivateSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaEeCertResponsePrivateSpdu */ +typedef Ieee1609Dot2Data_EncryptedSigned_379P0_t AcaEeCertResponsePrivateSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaEeCertResponsePrivateSpdu; +asn_struct_free_f AcaEeCertResponsePrivateSpdu_free; +asn_struct_print_f AcaEeCertResponsePrivateSpdu_print; +asn_constr_check_f AcaEeCertResponsePrivateSpdu_constraint; +xer_type_decoder_f AcaEeCertResponsePrivateSpdu_decode_xer; +xer_type_encoder_f AcaEeCertResponsePrivateSpdu_encode_xer; +oer_type_decoder_f AcaEeCertResponsePrivateSpdu_decode_oer; +oer_type_encoder_f AcaEeCertResponsePrivateSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaEeCertResponsePrivateSpdu_H_ */ +#include diff --git a/certgen/asncodec/AcaEeInterfacePdu.c b/certgen/asncodec/AcaEeInterfacePdu.c new file mode 100644 index 0000000..a5b07c4 --- /dev/null +++ b/certgen/asncodec/AcaEeInterfacePdu.c @@ -0,0 +1,68 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaEeInterfacePdu.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcaEeInterfacePdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_AcaEeInterfacePdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcaEeInterfacePdu, choice.acaEeCertResponse), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaEeCertResponse, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acaEeCertResponse" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_AcaEeInterfacePdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* acaEeCertResponse */ +}; +asn_CHOICE_specifics_t asn_SPC_AcaEeInterfacePdu_specs_1 = { + sizeof(struct AcaEeInterfacePdu), + offsetof(struct AcaEeInterfacePdu, _asn_ctx), + offsetof(struct AcaEeInterfacePdu, present), + sizeof(((struct AcaEeInterfacePdu *)0)->present), + asn_MAP_AcaEeInterfacePdu_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, + 1 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_AcaEeInterfacePdu = { + "AcaEeInterfacePdu", + "AcaEeInterfacePdu", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcaEeInterfacePdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_AcaEeInterfacePdu_1, + 1, /* Elements count */ + &asn_SPC_AcaEeInterfacePdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaEeInterfacePdu.h b/certgen/asncodec/AcaEeInterfacePdu.h new file mode 100644 index 0000000..2ebb133 --- /dev/null +++ b/certgen/asncodec/AcaEeInterfacePdu.h @@ -0,0 +1,55 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "AcaEeCertResponse.h" +#include +#ifndef _AcaEeInterfacePdu_H_ +#define _AcaEeInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum AcaEeInterfacePdu_PR { + AcaEeInterfacePdu_PR_NOTHING, /* No components present */ + AcaEeInterfacePdu_PR_acaEeCertResponse + /* Extensions may appear below */ + +} AcaEeInterfacePdu_PR; + +/* AcaEeInterfacePdu */ +typedef struct AcaEeInterfacePdu { + AcaEeInterfacePdu_PR present; + union AcaEeInterfacePdu_u { + AcaEeCertResponse_t acaEeCertResponse; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcaEeInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaEeInterfacePdu; +extern asn_CHOICE_specifics_t asn_SPC_AcaEeInterfacePdu_specs_1; +extern asn_TYPE_member_t asn_MBR_AcaEeInterfacePdu_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaEeInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/AcaLaInterfacePdu.c b/certgen/asncodec/AcaLaInterfacePdu.c new file mode 100644 index 0000000..9c9dbc9 --- /dev/null +++ b/certgen/asncodec/AcaLaInterfacePdu.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaLaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaLaInterfacePdu.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_AcaLaInterfacePdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcaLaInterfacePdu = { + "AcaLaInterfacePdu", + "AcaLaInterfacePdu", + &asn_OP_NULL, + asn_DEF_AcaLaInterfacePdu_tags_1, + sizeof(asn_DEF_AcaLaInterfacePdu_tags_1) + /sizeof(asn_DEF_AcaLaInterfacePdu_tags_1[0]), /* 1 */ + asn_DEF_AcaLaInterfacePdu_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaLaInterfacePdu_tags_1) + /sizeof(asn_DEF_AcaLaInterfacePdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/AcaLaInterfacePdu.h b/certgen/asncodec/AcaLaInterfacePdu.h new file mode 100644 index 0000000..703948d --- /dev/null +++ b/certgen/asncodec/AcaLaInterfacePdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaLaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _AcaLaInterfacePdu_H_ +#define _AcaLaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaLaInterfacePdu */ +typedef NULL_t AcaLaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaLaInterfacePdu; +asn_struct_free_f AcaLaInterfacePdu_free; +asn_struct_print_f AcaLaInterfacePdu_print; +asn_constr_check_f AcaLaInterfacePdu_constraint; +xer_type_decoder_f AcaLaInterfacePdu_decode_xer; +xer_type_encoder_f AcaLaInterfacePdu_encode_xer; +oer_type_decoder_f AcaLaInterfacePdu_decode_oer; +oer_type_encoder_f AcaLaInterfacePdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaLaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/AcaMaInterfacePdu.c b/certgen/asncodec/AcaMaInterfacePdu.c new file mode 100644 index 0000000..508ed96 --- /dev/null +++ b/certgen/asncodec/AcaMaInterfacePdu.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaMaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaMaInterfacePdu.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_AcaMaInterfacePdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcaMaInterfacePdu = { + "AcaMaInterfacePdu", + "AcaMaInterfacePdu", + &asn_OP_NULL, + asn_DEF_AcaMaInterfacePdu_tags_1, + sizeof(asn_DEF_AcaMaInterfacePdu_tags_1) + /sizeof(asn_DEF_AcaMaInterfacePdu_tags_1[0]), /* 1 */ + asn_DEF_AcaMaInterfacePdu_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaMaInterfacePdu_tags_1) + /sizeof(asn_DEF_AcaMaInterfacePdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/AcaMaInterfacePdu.h b/certgen/asncodec/AcaMaInterfacePdu.h new file mode 100644 index 0000000..0aba589 --- /dev/null +++ b/certgen/asncodec/AcaMaInterfacePdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaMaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _AcaMaInterfacePdu_H_ +#define _AcaMaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaMaInterfacePdu */ +typedef NULL_t AcaMaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaMaInterfacePdu; +asn_struct_free_f AcaMaInterfacePdu_free; +asn_struct_print_f AcaMaInterfacePdu_print; +asn_constr_check_f AcaMaInterfacePdu_constraint; +xer_type_decoder_f AcaMaInterfacePdu_decode_xer; +xer_type_encoder_f AcaMaInterfacePdu_encode_xer; +oer_type_decoder_f AcaMaInterfacePdu_decode_oer; +oer_type_encoder_f AcaMaInterfacePdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaMaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/AcaRaCertResponse.c b/certgen/asncodec/AcaRaCertResponse.c new file mode 100644 index 0000000..e4834a9 --- /dev/null +++ b/certgen/asncodec/AcaRaCertResponse.c @@ -0,0 +1,150 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaRaCertResponse.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_AcaRaCertResponse_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcaRaCertResponse, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaRaCertResponse, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaRaCertResponse, requestHash), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "requestHash" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaRaCertResponse, acaResponse), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_AcaResponse, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acaResponse" + }, +}; +static const ber_tlv_tag_t asn_DEF_AcaRaCertResponse_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_AcaRaCertResponse_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* requestHash */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* acaResponse */ +}; +asn_SEQUENCE_specifics_t asn_SPC_AcaRaCertResponse_specs_1 = { + sizeof(struct AcaRaCertResponse), + offsetof(struct AcaRaCertResponse, _asn_ctx), + asn_MAP_AcaRaCertResponse_tag2el_1, + 4, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 4, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_AcaRaCertResponse = { + "AcaRaCertResponse", + "AcaRaCertResponse", + &asn_OP_SEQUENCE, + asn_DEF_AcaRaCertResponse_tags_1, + sizeof(asn_DEF_AcaRaCertResponse_tags_1) + /sizeof(asn_DEF_AcaRaCertResponse_tags_1[0]), /* 1 */ + asn_DEF_AcaRaCertResponse_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaRaCertResponse_tags_1) + /sizeof(asn_DEF_AcaRaCertResponse_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_AcaRaCertResponse_1, + 4, /* Elements count */ + &asn_SPC_AcaRaCertResponse_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaRaCertResponse.h b/certgen/asncodec/AcaRaCertResponse.h new file mode 100644 index 0000000..fd3ff4c --- /dev/null +++ b/certgen/asncodec/AcaRaCertResponse.h @@ -0,0 +1,50 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "HashedId8.h" +#include "AcaResponse.h" +#include +#ifndef _AcaRaCertResponse_H_ +#define _AcaRaCertResponse_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaRaCertResponse */ +typedef struct AcaRaCertResponse { + Uint8_t version; + Time32_t generationTime; + HashedId8_t requestHash; + AcaResponse_t acaResponse; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcaRaCertResponse_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaRaCertResponse; +extern asn_SEQUENCE_specifics_t asn_SPC_AcaRaCertResponse_specs_1; +extern asn_TYPE_member_t asn_MBR_AcaRaCertResponse_1[4]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaRaCertResponse_H_ */ +#include diff --git a/certgen/asncodec/AcaRaCertResponseSpdu.c b/certgen/asncodec/AcaRaCertResponseSpdu.c new file mode 100644 index 0000000..2cf5ad7 --- /dev/null +++ b/certgen/asncodec/AcaRaCertResponseSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaRaCertResponseSpdu.h" + +int +AcaRaCertResponseSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcaRaCertResponseSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_AcaRaCertResponseSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcaRaCertResponseSpdu = { + "AcaRaCertResponseSpdu", + "AcaRaCertResponseSpdu", + &asn_OP_SEQUENCE, + asn_DEF_AcaRaCertResponseSpdu_tags_1, + sizeof(asn_DEF_AcaRaCertResponseSpdu_tags_1) + /sizeof(asn_DEF_AcaRaCertResponseSpdu_tags_1[0]), /* 1 */ + asn_DEF_AcaRaCertResponseSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaRaCertResponseSpdu_tags_1) + /sizeof(asn_DEF_AcaRaCertResponseSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcaRaCertResponseSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AcaRaCertResponseSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaRaCertResponseSpdu.h b/certgen/asncodec/AcaRaCertResponseSpdu.h new file mode 100644 index 0000000..21e04e7 --- /dev/null +++ b/certgen/asncodec/AcaRaCertResponseSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _AcaRaCertResponseSpdu_H_ +#define _AcaRaCertResponseSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaRaCertResponseSpdu */ +typedef Ieee1609Dot2Data_Signed_228P2_t AcaRaCertResponseSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaRaCertResponseSpdu; +asn_struct_free_f AcaRaCertResponseSpdu_free; +asn_struct_print_f AcaRaCertResponseSpdu_print; +asn_constr_check_f AcaRaCertResponseSpdu_constraint; +xer_type_decoder_f AcaRaCertResponseSpdu_decode_xer; +xer_type_encoder_f AcaRaCertResponseSpdu_encode_xer; +oer_type_decoder_f AcaRaCertResponseSpdu_decode_oer; +oer_type_encoder_f AcaRaCertResponseSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaRaCertResponseSpdu_H_ */ +#include diff --git a/certgen/asncodec/AcaRaInterfacePdu.c b/certgen/asncodec/AcaRaInterfacePdu.c new file mode 100644 index 0000000..25a70f1 --- /dev/null +++ b/certgen/asncodec/AcaRaInterfacePdu.c @@ -0,0 +1,86 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaRaInterfacePdu.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcaRaInterfacePdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_AcaRaInterfacePdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcaRaInterfacePdu, choice.raAcaCertRequest), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaAcaCertRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "raAcaCertRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaRaInterfacePdu, choice.acaRaCertResponse), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaRaCertResponse, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acaRaCertResponse" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_AcaRaInterfacePdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* raAcaCertRequest */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* acaRaCertResponse */ +}; +asn_CHOICE_specifics_t asn_SPC_AcaRaInterfacePdu_specs_1 = { + sizeof(struct AcaRaInterfacePdu), + offsetof(struct AcaRaInterfacePdu, _asn_ctx), + offsetof(struct AcaRaInterfacePdu, present), + sizeof(((struct AcaRaInterfacePdu *)0)->present), + asn_MAP_AcaRaInterfacePdu_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, + 2 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_AcaRaInterfacePdu = { + "AcaRaInterfacePdu", + "AcaRaInterfacePdu", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcaRaInterfacePdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_AcaRaInterfacePdu_1, + 2, /* Elements count */ + &asn_SPC_AcaRaInterfacePdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaRaInterfacePdu.h b/certgen/asncodec/AcaRaInterfacePdu.h new file mode 100644 index 0000000..b078de2 --- /dev/null +++ b/certgen/asncodec/AcaRaInterfacePdu.h @@ -0,0 +1,58 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "RaAcaCertRequest.h" +#include "AcaRaCertResponse.h" +#include +#ifndef _AcaRaInterfacePdu_H_ +#define _AcaRaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum AcaRaInterfacePdu_PR { + AcaRaInterfacePdu_PR_NOTHING, /* No components present */ + AcaRaInterfacePdu_PR_raAcaCertRequest, + AcaRaInterfacePdu_PR_acaRaCertResponse + /* Extensions may appear below */ + +} AcaRaInterfacePdu_PR; + +/* AcaRaInterfacePdu */ +typedef struct AcaRaInterfacePdu { + AcaRaInterfacePdu_PR present; + union AcaRaInterfacePdu_u { + RaAcaCertRequest_t raAcaCertRequest; + AcaRaCertResponse_t acaRaCertResponse; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcaRaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaRaInterfacePdu; +extern asn_CHOICE_specifics_t asn_SPC_AcaRaInterfacePdu_specs_1; +extern asn_TYPE_member_t asn_MBR_AcaRaInterfacePdu_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaRaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/AcaResponse.c b/certgen/asncodec/AcaResponse.c new file mode 100644 index 0000000..3ea14b7 --- /dev/null +++ b/certgen/asncodec/AcaResponse.c @@ -0,0 +1,104 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaResponse.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcaResponse_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_AcaResponse_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcaResponse, choice.plain), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaEeCertResponsePlainSpdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "plain" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaResponse, choice.Private), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaEeCertResponsePrivateSpdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "private" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcaResponse, choice.cubk), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaEeCertResponseCubkSpdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "cubk" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_AcaResponse_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plain */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* private */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* cubk */ +}; +asn_CHOICE_specifics_t asn_SPC_AcaResponse_specs_1 = { + sizeof(struct AcaResponse), + offsetof(struct AcaResponse, _asn_ctx), + offsetof(struct AcaResponse, present), + sizeof(((struct AcaResponse *)0)->present), + asn_MAP_AcaResponse_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, + 3 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_AcaResponse = { + "AcaResponse", + "AcaResponse", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcaResponse_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_AcaResponse_1, + 3, /* Elements count */ + &asn_SPC_AcaResponse_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaResponse.h b/certgen/asncodec/AcaResponse.h new file mode 100644 index 0000000..73af31d --- /dev/null +++ b/certgen/asncodec/AcaResponse.h @@ -0,0 +1,61 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "AcaEeCertResponsePlainSpdu.h" +#include "AcaEeCertResponsePrivateSpdu.h" +#include "AcaEeCertResponseCubkSpdu.h" +#include +#ifndef _AcaResponse_H_ +#define _AcaResponse_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum AcaResponse_PR { + AcaResponse_PR_NOTHING, /* No components present */ + AcaResponse_PR_plain, + AcaResponse_PR_private, + AcaResponse_PR_cubk + /* Extensions may appear below */ + +} AcaResponse_PR; + +/* AcaResponse */ +typedef struct AcaResponse { + AcaResponse_PR present; + union AcaResponse_u { + AcaEeCertResponsePlainSpdu_t plain; + AcaEeCertResponsePrivateSpdu_t Private; + AcaEeCertResponseCubkSpdu_t cubk; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcaResponse_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaResponse; +extern asn_CHOICE_specifics_t asn_SPC_AcaResponse_specs_1; +extern asn_TYPE_member_t asn_MBR_AcaResponse_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaResponse_H_ */ +#include diff --git a/certgen/asncodec/AcaSsp.c b/certgen/asncodec/AcaSsp.c new file mode 100644 index 0000000..7e85f0d --- /dev/null +++ b/certgen/asncodec/AcaSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcaSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_AcaSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcaSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_AcaSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_AcaSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_AcaSsp_specs_1 = { + sizeof(struct AcaSsp), + offsetof(struct AcaSsp, _asn_ctx), + asn_MAP_AcaSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_AcaSsp = { + "AcaSsp", + "AcaSsp", + &asn_OP_SEQUENCE, + asn_DEF_AcaSsp_tags_1, + sizeof(asn_DEF_AcaSsp_tags_1) + /sizeof(asn_DEF_AcaSsp_tags_1[0]), /* 1 */ + asn_DEF_AcaSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_AcaSsp_tags_1) + /sizeof(asn_DEF_AcaSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_AcaSsp_1, + 1, /* Elements count */ + &asn_SPC_AcaSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcaSsp.h b/certgen/asncodec/AcaSsp.h new file mode 100644 index 0000000..b5620c8 --- /dev/null +++ b/certgen/asncodec/AcaSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _AcaSsp_H_ +#define _AcaSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcaSsp */ +typedef struct AcaSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcaSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcaSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_AcaSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_AcaSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcaSsp_H_ */ +#include diff --git a/certgen/asncodec/AcpcNodeValue.c b/certgen/asncodec/AcpcNodeValue.c new file mode 100644 index 0000000..d33e2ed --- /dev/null +++ b/certgen/asncodec/AcpcNodeValue.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcpcNodeValue.h" + +int +AcpcNodeValue_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 16)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using OCTET_STRING, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcpcNodeValue_constr_1 CC_NOTUSED = { + { 0, 0 }, + 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_AcpcNodeValue_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcpcNodeValue = { + "AcpcNodeValue", + "AcpcNodeValue", + &asn_OP_OCTET_STRING, + asn_DEF_AcpcNodeValue_tags_1, + sizeof(asn_DEF_AcpcNodeValue_tags_1) + /sizeof(asn_DEF_AcpcNodeValue_tags_1[0]), /* 1 */ + asn_DEF_AcpcNodeValue_tags_1, /* Same as above */ + sizeof(asn_DEF_AcpcNodeValue_tags_1) + /sizeof(asn_DEF_AcpcNodeValue_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcpcNodeValue_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AcpcNodeValue_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcpcNodeValue.h b/certgen/asncodec/AcpcNodeValue.h new file mode 100644 index 0000000..9294d9f --- /dev/null +++ b/certgen/asncodec/AcpcNodeValue.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _AcpcNodeValue_H_ +#define _AcpcNodeValue_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcpcNodeValue */ +typedef OCTET_STRING_t AcpcNodeValue_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcpcNodeValue; +asn_struct_free_f AcpcNodeValue_free; +asn_struct_print_f AcpcNodeValue_print; +asn_constr_check_f AcpcNodeValue_constraint; +xer_type_decoder_f AcpcNodeValue_decode_xer; +xer_type_encoder_f AcpcNodeValue_encode_xer; +oer_type_decoder_f AcpcNodeValue_decode_oer; +oer_type_encoder_f AcpcNodeValue_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcpcNodeValue_H_ */ +#include diff --git a/certgen/asncodec/AcpcPdu.c b/certgen/asncodec/AcpcPdu.c new file mode 100644 index 0000000..6683301 --- /dev/null +++ b/certgen/asncodec/AcpcPdu.c @@ -0,0 +1,86 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcpcPdu.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcpcPdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_AcpcPdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcpcPdu, choice.tree), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AprvBinaryTree, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "tree" + }, + { ATF_NOFLAGS, 0, offsetof(struct AcpcPdu, choice.aprv), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IndividualAprv, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "aprv" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_AcpcPdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* tree */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* aprv */ +}; +static asn_CHOICE_specifics_t asn_SPC_AcpcPdu_specs_1 = { + sizeof(struct AcpcPdu), + offsetof(struct AcpcPdu, _asn_ctx), + offsetof(struct AcpcPdu, present), + sizeof(((struct AcpcPdu *)0)->present), + asn_MAP_AcpcPdu_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, + 2 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_AcpcPdu = { + "AcpcPdu", + "AcpcPdu", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcpcPdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_AcpcPdu_1, + 2, /* Elements count */ + &asn_SPC_AcpcPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcpcPdu.h b/certgen/asncodec/AcpcPdu.h new file mode 100644 index 0000000..883d6da --- /dev/null +++ b/certgen/asncodec/AcpcPdu.h @@ -0,0 +1,56 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "AprvBinaryTree.h" +#include "IndividualAprv.h" +#include +#ifndef _AcpcPdu_H_ +#define _AcpcPdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum AcpcPdu_PR { + AcpcPdu_PR_NOTHING, /* No components present */ + AcpcPdu_PR_tree, + AcpcPdu_PR_aprv + /* Extensions may appear below */ + +} AcpcPdu_PR; + +/* AcpcPdu */ +typedef struct AcpcPdu { + AcpcPdu_PR present; + union AcpcPdu_u { + AprvBinaryTree_t tree; + IndividualAprv_t aprv; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcpcPdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcpcPdu; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcpcPdu_H_ */ +#include diff --git a/certgen/asncodec/AcpcPsid.c b/certgen/asncodec/AcpcPsid.c new file mode 100644 index 0000000..f5572a5 --- /dev/null +++ b/certgen/asncodec/AcpcPsid.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcpcPsid.h" + +int +AcpcPsid_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const unsigned long *)sptr; + + if((value == 2113696)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using Psid, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcpcPsid_constr_1 CC_NOTUSED = { + { 4, 1 } /* (2113696..2113696) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_AcpcPsid_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcpcPsid = { + "AcpcPsid", + "AcpcPsid", + &asn_OP_NativeInteger, + asn_DEF_AcpcPsid_tags_1, + sizeof(asn_DEF_AcpcPsid_tags_1) + /sizeof(asn_DEF_AcpcPsid_tags_1[0]), /* 1 */ + asn_DEF_AcpcPsid_tags_1, /* Same as above */ + sizeof(asn_DEF_AcpcPsid_tags_1) + /sizeof(asn_DEF_AcpcPsid_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcpcPsid_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AcpcPsid_constraint + }, + 0, 0, /* No members */ + &asn_SPC_Psid_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcpcPsid.h b/certgen/asncodec/AcpcPsid.h new file mode 100644 index 0000000..de2c28b --- /dev/null +++ b/certgen/asncodec/AcpcPsid.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Psid.h" +#ifndef _AcpcPsid_H_ +#define _AcpcPsid_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcpcPsid */ +typedef Psid_t AcpcPsid_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcpcPsid; +asn_struct_free_f AcpcPsid_free; +asn_struct_print_f AcpcPsid_print; +asn_constr_check_f AcpcPsid_constraint; +xer_type_decoder_f AcpcPsid_decode_xer; +xer_type_encoder_f AcpcPsid_encode_xer; +oer_type_decoder_f AcpcPsid_decode_oer; +oer_type_encoder_f AcpcPsid_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcpcPsid_H_ */ +#include diff --git a/certgen/asncodec/AcpcSsp.c b/certgen/asncodec/AcpcSsp.c new file mode 100644 index 0000000..75d5b8a --- /dev/null +++ b/certgen/asncodec/AcpcSsp.c @@ -0,0 +1,68 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcpcSsp.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcpcSsp_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_AcpcSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AcpcSsp, choice.cam), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CamSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "cam" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_AcpcSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* cam */ +}; +static asn_CHOICE_specifics_t asn_SPC_AcpcSsp_specs_1 = { + sizeof(struct AcpcSsp), + offsetof(struct AcpcSsp, _asn_ctx), + offsetof(struct AcpcSsp, present), + sizeof(((struct AcpcSsp *)0)->present), + asn_MAP_AcpcSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, + 1 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_AcpcSsp = { + "AcpcSsp", + "AcpcSsp", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcpcSsp_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_AcpcSsp_1, + 1, /* Elements count */ + &asn_SPC_AcpcSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcpcSsp.h b/certgen/asncodec/AcpcSsp.h new file mode 100644 index 0000000..966d329 --- /dev/null +++ b/certgen/asncodec/AcpcSsp.h @@ -0,0 +1,53 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "CamSsp.h" +#include +#ifndef _AcpcSsp_H_ +#define _AcpcSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum AcpcSsp_PR { + AcpcSsp_PR_NOTHING, /* No components present */ + AcpcSsp_PR_cam + /* Extensions may appear below */ + +} AcpcSsp_PR; + +/* AcpcSsp */ +typedef struct AcpcSsp { + AcpcSsp_PR present; + union AcpcSsp_u { + CamSsp_t cam; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AcpcSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcpcSsp; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcpcSsp_H_ */ +#include diff --git a/certgen/asncodec/AcpcTreeId.c b/certgen/asncodec/AcpcTreeId.c new file mode 100644 index 0000000..203b0cb --- /dev/null +++ b/certgen/asncodec/AcpcTreeId.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AcpcTreeId.h" + +int +AcpcTreeId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 8)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using OCTET_STRING, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AcpcTreeId_constr_1 CC_NOTUSED = { + { 0, 0 }, + 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_AcpcTreeId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_AcpcTreeId = { + "AcpcTreeId", + "AcpcTreeId", + &asn_OP_OCTET_STRING, + asn_DEF_AcpcTreeId_tags_1, + sizeof(asn_DEF_AcpcTreeId_tags_1) + /sizeof(asn_DEF_AcpcTreeId_tags_1[0]), /* 1 */ + asn_DEF_AcpcTreeId_tags_1, /* Same as above */ + sizeof(asn_DEF_AcpcTreeId_tags_1) + /sizeof(asn_DEF_AcpcTreeId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AcpcTreeId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AcpcTreeId_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/AcpcTreeId.h b/certgen/asncodec/AcpcTreeId.h new file mode 100644 index 0000000..f75429b --- /dev/null +++ b/certgen/asncodec/AcpcTreeId.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _AcpcTreeId_H_ +#define _AcpcTreeId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AcpcTreeId */ +typedef OCTET_STRING_t AcpcTreeId_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AcpcTreeId; +asn_struct_free_f AcpcTreeId_free; +asn_struct_print_f AcpcTreeId_print; +asn_constr_check_f AcpcTreeId_constraint; +xer_type_decoder_f AcpcTreeId_decode_xer; +xer_type_encoder_f AcpcTreeId_encode_xer; +oer_type_decoder_f AcpcTreeId_decode_oer; +oer_type_encoder_f AcpcTreeId_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _AcpcTreeId_H_ */ +#include diff --git a/certgen/asncodec/AdditionalParams.c b/certgen/asncodec/AdditionalParams.c new file mode 100644 index 0000000..31cb215 --- /dev/null +++ b/certgen/asncodec/AdditionalParams.c @@ -0,0 +1,122 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AdditionalParams.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AdditionalParams_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_AdditionalParams_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AdditionalParams, choice.original), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ButterflyParamsOriginal, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "original" + }, + { ATF_NOFLAGS, 0, offsetof(struct AdditionalParams, choice.unified), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_ButterflyExpansion, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "unified" + }, + { ATF_NOFLAGS, 0, offsetof(struct AdditionalParams, choice.compactUnified), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_ButterflyExpansion, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "compactUnified" + }, + { ATF_NOFLAGS, 0, offsetof(struct AdditionalParams, choice.encryptionKey), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_PublicEncryptionKey, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "encryptionKey" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_AdditionalParams_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* original */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* unified */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* compactUnified */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* encryptionKey */ +}; +asn_CHOICE_specifics_t asn_SPC_AdditionalParams_specs_1 = { + sizeof(struct AdditionalParams), + offsetof(struct AdditionalParams, _asn_ctx), + offsetof(struct AdditionalParams, present), + sizeof(((struct AdditionalParams *)0)->present), + asn_MAP_AdditionalParams_tag2el_1, + 4, /* Count of tags in the map */ + 0, 0, + 4 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_AdditionalParams = { + "AdditionalParams", + "AdditionalParams", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AdditionalParams_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_AdditionalParams_1, + 4, /* Elements count */ + &asn_SPC_AdditionalParams_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AdditionalParams.h b/certgen/asncodec/AdditionalParams.h new file mode 100644 index 0000000..f31f103 --- /dev/null +++ b/certgen/asncodec/AdditionalParams.h @@ -0,0 +1,63 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ButterflyParamsOriginal.h" +#include "ButterflyExpansion.h" +#include "PublicEncryptionKey.h" +#include +#ifndef _AdditionalParams_H_ +#define _AdditionalParams_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum AdditionalParams_PR { + AdditionalParams_PR_NOTHING, /* No components present */ + AdditionalParams_PR_original, + AdditionalParams_PR_unified, + AdditionalParams_PR_compactUnified, + AdditionalParams_PR_encryptionKey + /* Extensions may appear below */ + +} AdditionalParams_PR; + +/* AdditionalParams */ +typedef struct AdditionalParams { + AdditionalParams_PR present; + union AdditionalParams_u { + ButterflyParamsOriginal_t original; + ButterflyExpansion_t unified; + ButterflyExpansion_t compactUnified; + PublicEncryptionKey_t encryptionKey; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AdditionalParams_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AdditionalParams; +extern asn_CHOICE_specifics_t asn_SPC_AdditionalParams_specs_1; +extern asn_TYPE_member_t asn_MBR_AdditionalParams_1[4]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AdditionalParams_H_ */ +#include diff --git a/certgen/asncodec/Aes128CcmCiphertext.c b/certgen/asncodec/Aes128CcmCiphertext.c new file mode 100644 index 0000000..c161304 --- /dev/null +++ b/certgen/asncodec/Aes128CcmCiphertext.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Aes128CcmCiphertext.h" + +/* + * This type is implemented using One28BitCcmCiphertext, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_Aes128CcmCiphertext_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Aes128CcmCiphertext = { + "Aes128CcmCiphertext", + "Aes128CcmCiphertext", + &asn_OP_SEQUENCE, + asn_DEF_Aes128CcmCiphertext_tags_1, + sizeof(asn_DEF_Aes128CcmCiphertext_tags_1) + /sizeof(asn_DEF_Aes128CcmCiphertext_tags_1[0]), /* 1 */ + asn_DEF_Aes128CcmCiphertext_tags_1, /* Same as above */ + sizeof(asn_DEF_Aes128CcmCiphertext_tags_1) + /sizeof(asn_DEF_Aes128CcmCiphertext_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_One28BitCcmCiphertext_1, + 2, /* Elements count */ + &asn_SPC_One28BitCcmCiphertext_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Aes128CcmCiphertext.h b/certgen/asncodec/Aes128CcmCiphertext.h new file mode 100644 index 0000000..b49e941 --- /dev/null +++ b/certgen/asncodec/Aes128CcmCiphertext.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "One28BitCcmCiphertext.h" +#ifndef _Aes128CcmCiphertext_H_ +#define _Aes128CcmCiphertext_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Aes128CcmCiphertext */ +typedef One28BitCcmCiphertext_t Aes128CcmCiphertext_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Aes128CcmCiphertext; +asn_struct_free_f Aes128CcmCiphertext_free; +asn_struct_print_f Aes128CcmCiphertext_print; +asn_constr_check_f Aes128CcmCiphertext_constraint; +xer_type_decoder_f Aes128CcmCiphertext_decode_xer; +xer_type_encoder_f Aes128CcmCiphertext_encode_xer; +oer_type_decoder_f Aes128CcmCiphertext_decode_oer; +oer_type_encoder_f Aes128CcmCiphertext_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Aes128CcmCiphertext_H_ */ +#include diff --git a/certgen/asncodec/AesCcmCiphertext.c b/certgen/asncodec/AesCcmCiphertext.c deleted file mode 100644 index 3855430..0000000 --- a/certgen/asncodec/AesCcmCiphertext.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` - */ - -#include "AesCcmCiphertext.h" - -static int -memb_nonce_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - size_t size; - - if(!sptr) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - size = st->size; - - if((size == 12)) { - /* Constraint check succeeded */ - return 0; - } else { - ASN__CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } -} - -static asn_oer_constraints_t asn_OER_memb_nonce_constr_2 CC_NOTUSED = { - { 0, 0 }, - 12 /* (SIZE(12..12)) */}; -asn_TYPE_member_t asn_MBR_AesCcmCiphertext_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AesCcmCiphertext, nonce), - (ASN_TAG_CLASS_CONTEXT | (0 << 2)), - -1, /* IMPLICIT tag at current level */ - &asn_DEF_OCTET_STRING, - 0, - { &asn_OER_memb_nonce_constr_2, 0, memb_nonce_constraint_1 }, - 0, 0, /* No default value */ - "nonce" - }, - { ATF_NOFLAGS, 0, offsetof(struct AesCcmCiphertext, ccmCiphertext), - (ASN_TAG_CLASS_CONTEXT | (1 << 2)), - -1, /* IMPLICIT tag at current level */ - &asn_DEF_Opaque, - 0, - { 0, 0, 0 }, - 0, 0, /* No default value */ - "ccmCiphertext" - }, -}; -static const ber_tlv_tag_t asn_DEF_AesCcmCiphertext_tags_1[] = { - (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) -}; -static const asn_TYPE_tag2member_t asn_MAP_AesCcmCiphertext_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nonce */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ccmCiphertext */ -}; -asn_SEQUENCE_specifics_t asn_SPC_AesCcmCiphertext_specs_1 = { - sizeof(struct AesCcmCiphertext), - offsetof(struct AesCcmCiphertext, _asn_ctx), - asn_MAP_AesCcmCiphertext_tag2el_1, - 2, /* Count of tags in the map */ - 0, 0, 0, /* Optional elements (not needed) */ - -1, /* First extension addition */ -}; -asn_TYPE_descriptor_t asn_DEF_AesCcmCiphertext = { - "AesCcmCiphertext", - "AesCcmCiphertext", - &asn_OP_SEQUENCE, - asn_DEF_AesCcmCiphertext_tags_1, - sizeof(asn_DEF_AesCcmCiphertext_tags_1) - /sizeof(asn_DEF_AesCcmCiphertext_tags_1[0]), /* 1 */ - asn_DEF_AesCcmCiphertext_tags_1, /* Same as above */ - sizeof(asn_DEF_AesCcmCiphertext_tags_1) - /sizeof(asn_DEF_AesCcmCiphertext_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, - asn_MBR_AesCcmCiphertext_1, - 2, /* Elements count */ - &asn_SPC_AesCcmCiphertext_specs_1 /* Additional specs */ -}; - diff --git a/certgen/asncodec/AesCcmCiphertext.h b/certgen/asncodec/AesCcmCiphertext.h deleted file mode 100644 index 635387d..0000000 --- a/certgen/asncodec/AesCcmCiphertext.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` - */ - -#ifndef _AesCcmCiphertext_H_ -#define _AesCcmCiphertext_H_ - - -#include - -/* Including external dependencies */ -#include -#include "Opaque.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* AesCcmCiphertext */ -typedef struct AesCcmCiphertext { - OCTET_STRING_t nonce; - Opaque_t ccmCiphertext; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AesCcmCiphertext_t; - -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AesCcmCiphertext; -extern asn_SEQUENCE_specifics_t asn_SPC_AesCcmCiphertext_specs_1; -extern asn_TYPE_member_t asn_MBR_AesCcmCiphertext_1[2]; - -#ifdef __cplusplus -} -#endif - -#endif /* _AesCcmCiphertext_H_ */ -#include diff --git a/certgen/asncodec/AppExtension.c b/certgen/asncodec/AppExtension.c new file mode 100644 index 0000000..9ea862a --- /dev/null +++ b/certgen/asncodec/AppExtension.c @@ -0,0 +1,230 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AppExtension.h" + +static const long asn_VAL_2_certExtId_OperatingOrganization = 1; +static const asn_ioc_cell_t asn_IOS_SetCertExtensions_1_rows[] = { + { "&id", aioc__value, &asn_DEF_ExtId, &asn_VAL_2_certExtId_OperatingOrganization }, + { "&App", aioc__type, &asn_DEF_OperatingOrganizationId }, + { "&Issue", aioc__type, &asn_DEF_NULL }, + { "&Req", aioc__type, &asn_DEF_NULL } +}; +static const asn_ioc_set_t asn_IOS_SetCertExtensions_1[] = { + { 1, 4, asn_IOS_SetCertExtensions_1_rows } +}; +static int +memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static asn_type_selector_result_t +select_AppExtension_content_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { + asn_type_selector_result_t result = {0, 0}; + const asn_ioc_set_t *itable = asn_IOS_SetCertExtensions_1; + size_t constraining_column = 0; /* &id */ + size_t for_column = 1; /* &App */ + size_t row, presence_index = 0; + const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct AppExtension, id)); + + for(row=0; row < itable->rows_count; row++) { + const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column]; + const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column]; + + if(type_cell->cell_kind == aioc__undefined) + continue; + + presence_index++; + if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { + result.type_descriptor = type_cell->type_descriptor; + result.presence_index = presence_index; + break; + } + } + + return result; +} + +static int +memb_content_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_id_constr_2 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_content_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_content_3[] = { + { ATF_NOFLAGS, 0, offsetof(struct AppExtension__content, choice.OperatingOrganizationId), + (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), + 0, + &asn_DEF_OperatingOrganizationId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "OperatingOrganizationId" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_content_tag2el_3[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 } /* OperatingOrganizationId */ +}; +static asn_CHOICE_specifics_t asn_SPC_content_specs_3 = { + sizeof(struct AppExtension__content), + offsetof(struct AppExtension__content, _asn_ctx), + offsetof(struct AppExtension__content, present), + sizeof(((struct AppExtension__content *)0)->present), + asn_MAP_content_tag2el_3, + 1, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_content_3 = { + "content", + "content", + &asn_OP_OPEN_TYPE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OPEN_TYPE_constraint + }, + asn_MBR_content_3, + 1, /* Elements count */ + &asn_SPC_content_specs_3 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_AppExtension_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AppExtension, id), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ExtId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_id_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_id_constraint_1 + }, + 0, 0, /* No default value */ + "id" + }, + { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct AppExtension, content), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_content_3, + select_AppExtension_content_type, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_content_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_content_constraint_1 + }, + 0, 0, /* No default value */ + "content" + }, +}; +static const ber_tlv_tag_t asn_DEF_AppExtension_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_AppExtension_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* id */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* content */ +}; +asn_SEQUENCE_specifics_t asn_SPC_AppExtension_specs_1 = { + sizeof(struct AppExtension), + offsetof(struct AppExtension, _asn_ctx), + asn_MAP_AppExtension_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_AppExtension = { + "AppExtension", + "AppExtension", + &asn_OP_SEQUENCE, + asn_DEF_AppExtension_tags_1, + sizeof(asn_DEF_AppExtension_tags_1) + /sizeof(asn_DEF_AppExtension_tags_1[0]), /* 1 */ + asn_DEF_AppExtension_tags_1, /* Same as above */ + sizeof(asn_DEF_AppExtension_tags_1) + /sizeof(asn_DEF_AppExtension_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_AppExtension_1, + 2, /* Elements count */ + &asn_SPC_AppExtension_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AppExtension.h b/certgen/asncodec/AppExtension.h new file mode 100644 index 0000000..b2991bc --- /dev/null +++ b/certgen/asncodec/AppExtension.h @@ -0,0 +1,61 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ExtId.h" +#include +#include +#include "OperatingOrganizationId.h" +#include +#include +#include +#include +#ifndef _AppExtension_H_ +#define _AppExtension_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum AppExtension__content_PR { + AppExtension__content_PR_NOTHING, /* No components present */ + AppExtension__content_PR_OperatingOrganizationId +} AppExtension__content_PR; + +/* AppExtension */ +typedef struct AppExtension { + ExtId_t id; + struct AppExtension__content { + AppExtension__content_PR present; + union AppExtension__content_u { + OperatingOrganizationId_t OperatingOrganizationId; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } content; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AppExtension_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AppExtension; +extern asn_SEQUENCE_specifics_t asn_SPC_AppExtension_specs_1; +extern asn_TYPE_member_t asn_MBR_AppExtension_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AppExtension_H_ */ +#include diff --git a/certgen/asncodec/AprvBinaryTree.c b/certgen/asncodec/AprvBinaryTree.c new file mode 100644 index 0000000..205d4a0 --- /dev/null +++ b/certgen/asncodec/AprvBinaryTree.c @@ -0,0 +1,293 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AprvBinaryTree.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_nodeValueList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + /* Determine the number of elements */ + size = _A_CSEQUENCE_FROM_VOID(sptr)->count; + + if((size >= 1)) { + /* Perform validation of the inner elements */ + return SEQUENCE_OF_constraint(td, sptr, ctfailcb, app_key); + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_nodeValueList_constr_8 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_nodeValueList_constr_8 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_nodeValueList_8[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_AcpcNodeValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_nodeValueList_tags_8[] = { + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_nodeValueList_specs_8 = { + sizeof(struct AprvBinaryTree__nodeValueList), + offsetof(struct AprvBinaryTree__nodeValueList, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_nodeValueList_8 = { + "nodeValueList", + "nodeValueList", + &asn_OP_SEQUENCE_OF, + asn_DEF_nodeValueList_tags_8, + sizeof(asn_DEF_nodeValueList_tags_8) + /sizeof(asn_DEF_nodeValueList_tags_8[0]) - 1, /* 1 */ + asn_DEF_nodeValueList_tags_8, /* Same as above */ + sizeof(asn_DEF_nodeValueList_tags_8) + /sizeof(asn_DEF_nodeValueList_tags_8[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_nodeValueList_constr_8, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_nodeValueList_8, + 1, /* Single element */ + &asn_SPC_nodeValueList_specs_8 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_AprvBinaryTree_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AprvBinaryTree, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvBinaryTree, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvBinaryTree, currentI), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "currentI" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvBinaryTree, acpcTreeId), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcpcTreeId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acpcTreeId" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvBinaryTree, hashAlgorithmId), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashAlgorithm, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "hashAlgorithmId" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvBinaryTree, tree), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_BIT_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "tree" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvBinaryTree, nodeValueList), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + 0, + &asn_DEF_nodeValueList_8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_nodeValueList_constr_8, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_nodeValueList_constraint_1 + }, + 0, 0, /* No default value */ + "nodeValueList" + }, +}; +static const ber_tlv_tag_t asn_DEF_AprvBinaryTree_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_AprvBinaryTree_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* currentI */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* acpcTreeId */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* hashAlgorithmId */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* tree */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* nodeValueList */ +}; +asn_SEQUENCE_specifics_t asn_SPC_AprvBinaryTree_specs_1 = { + sizeof(struct AprvBinaryTree), + offsetof(struct AprvBinaryTree, _asn_ctx), + asn_MAP_AprvBinaryTree_tag2el_1, + 7, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 7, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_AprvBinaryTree = { + "AprvBinaryTree", + "AprvBinaryTree", + &asn_OP_SEQUENCE, + asn_DEF_AprvBinaryTree_tags_1, + sizeof(asn_DEF_AprvBinaryTree_tags_1) + /sizeof(asn_DEF_AprvBinaryTree_tags_1[0]), /* 1 */ + asn_DEF_AprvBinaryTree_tags_1, /* Same as above */ + sizeof(asn_DEF_AprvBinaryTree_tags_1) + /sizeof(asn_DEF_AprvBinaryTree_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_AprvBinaryTree_1, + 7, /* Elements count */ + &asn_SPC_AprvBinaryTree_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AprvBinaryTree.h b/certgen/asncodec/AprvBinaryTree.h new file mode 100644 index 0000000..48919dc --- /dev/null +++ b/certgen/asncodec/AprvBinaryTree.h @@ -0,0 +1,63 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "IValue.h" +#include "AcpcTreeId.h" +#include "HashAlgorithm.h" +#include +#include "AcpcNodeValue.h" +#include +#include +#include +#ifndef _AprvBinaryTree_H_ +#define _AprvBinaryTree_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AprvBinaryTree */ +typedef struct AprvBinaryTree { + Uint8_t version; + Time32_t generationTime; + IValue_t currentI; + AcpcTreeId_t acpcTreeId; + HashAlgorithm_t hashAlgorithmId; + BIT_STRING_t tree; + struct AprvBinaryTree__nodeValueList { + A_SEQUENCE_OF(AcpcNodeValue_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } nodeValueList; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AprvBinaryTree_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AprvBinaryTree; +extern asn_SEQUENCE_specifics_t asn_SPC_AprvBinaryTree_specs_1; +extern asn_TYPE_member_t asn_MBR_AprvBinaryTree_1[7]; + +#ifdef __cplusplus +} +#endif + +#endif /* _AprvBinaryTree_H_ */ +#include diff --git a/certgen/asncodec/AprvHashCalculationInput.c b/certgen/asncodec/AprvHashCalculationInput.c new file mode 100644 index 0000000..a8dbd61 --- /dev/null +++ b/certgen/asncodec/AprvHashCalculationInput.c @@ -0,0 +1,199 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "AprvHashCalculationInput.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_parentNodeValue_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 16)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_parentNodeValue_constr_6 CC_NOTUSED = { + { 0, 0 }, + 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_AprvHashCalculationInput_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct AprvHashCalculationInput, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvHashCalculationInput, acpcTreeId), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcpcTreeId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acpcTreeId" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvHashCalculationInput, acpcPeriod), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acpcPeriod" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvHashCalculationInput, childNodeId), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_BIT_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "childNodeId" + }, + { ATF_NOFLAGS, 0, offsetof(struct AprvHashCalculationInput, parentNodeValue), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_parentNodeValue_constr_6, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_parentNodeValue_constraint_1 + }, + 0, 0, /* No default value */ + "parentNodeValue" + }, +}; +static const ber_tlv_tag_t asn_DEF_AprvHashCalculationInput_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_AprvHashCalculationInput_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* acpcTreeId */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* acpcPeriod */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* childNodeId */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* parentNodeValue */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_AprvHashCalculationInput_specs_1 = { + sizeof(struct AprvHashCalculationInput), + offsetof(struct AprvHashCalculationInput, _asn_ctx), + asn_MAP_AprvHashCalculationInput_tag2el_1, + 5, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 5, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_AprvHashCalculationInput = { + "AprvHashCalculationInput", + "AprvHashCalculationInput", + &asn_OP_SEQUENCE, + asn_DEF_AprvHashCalculationInput_tags_1, + sizeof(asn_DEF_AprvHashCalculationInput_tags_1) + /sizeof(asn_DEF_AprvHashCalculationInput_tags_1[0]), /* 1 */ + asn_DEF_AprvHashCalculationInput_tags_1, /* Same as above */ + sizeof(asn_DEF_AprvHashCalculationInput_tags_1) + /sizeof(asn_DEF_AprvHashCalculationInput_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_AprvHashCalculationInput_1, + 5, /* Elements count */ + &asn_SPC_AprvHashCalculationInput_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/AprvHashCalculationInput.h b/certgen/asncodec/AprvHashCalculationInput.h new file mode 100644 index 0000000..5f4fd31 --- /dev/null +++ b/certgen/asncodec/AprvHashCalculationInput.h @@ -0,0 +1,50 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "AcpcTreeId.h" +#include "IValue.h" +#include +#include +#include +#ifndef _AprvHashCalculationInput_H_ +#define _AprvHashCalculationInput_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* AprvHashCalculationInput */ +typedef struct AprvHashCalculationInput { + Uint8_t version; + AcpcTreeId_t acpcTreeId; + IValue_t acpcPeriod; + BIT_STRING_t childNodeId; + OCTET_STRING_t parentNodeValue; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} AprvHashCalculationInput_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_AprvHashCalculationInput; + +#ifdef __cplusplus +} +#endif + +#endif /* _AprvHashCalculationInput_H_ */ +#include diff --git a/certgen/asncodec/AuthorizationRequestMessage.c b/certgen/asncodec/AuthorizationRequestMessage.c index 863a495..8b2abbd 100644 --- a/certgen/asncodec/AuthorizationRequestMessage.c +++ b/certgen/asncodec/AuthorizationRequestMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationRequestMessage.h" @@ -27,12 +27,14 @@ AuthorizationRequestMessage_constraint(const asn_TYPE_descriptor_t *td, const vo } /* - * This type is implemented using EtsiTs103097Data_Encrypted_Unicast_52P1, + * This type is implemented using EtsiTs103097Data_Encrypted_Unicast_107P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_AuthorizationRequestMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_AuthorizationRequestMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationRequestMessage = { asn_DEF_AuthorizationRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationRequestMessage_tags_1) /sizeof(asn_DEF_AuthorizationRequestMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_AuthorizationRequestMessage_constr_1, 0, AuthorizationRequestMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AuthorizationRequestMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AuthorizationRequestMessage.h b/certgen/asncodec/AuthorizationRequestMessage.h index 1479cd2..da4769f 100644 --- a/certgen/asncodec/AuthorizationRequestMessage.h +++ b/certgen/asncodec/AuthorizationRequestMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Encrypted-Unicast.h" #ifndef _AuthorizationRequestMessage_H_ #define _AuthorizationRequestMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Encrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* AuthorizationRequestMessage */ -typedef EtsiTs103097Data_Encrypted_Unicast_52P1_t AuthorizationRequestMessage_t; +typedef EtsiTs103097Data_Encrypted_Unicast_107P0_t AuthorizationRequestMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_AuthorizationRequestMessage; asn_struct_free_f AuthorizationRequestMessage_free; asn_struct_print_f AuthorizationRequestMessage_print; asn_constr_check_f AuthorizationRequestMessage_constraint; -ber_type_decoder_f AuthorizationRequestMessage_decode_ber; -der_type_encoder_f AuthorizationRequestMessage_encode_der; xer_type_decoder_f AuthorizationRequestMessage_decode_xer; xer_type_encoder_f AuthorizationRequestMessage_encode_xer; oer_type_decoder_f AuthorizationRequestMessage_decode_oer; diff --git a/certgen/asncodec/AuthorizationRequestMessageWithPop.c b/certgen/asncodec/AuthorizationRequestMessageWithPop.c index 3238113..ebcdc11 100644 --- a/certgen/asncodec/AuthorizationRequestMessageWithPop.c +++ b/certgen/asncodec/AuthorizationRequestMessageWithPop.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationRequestMessageWithPop.h" @@ -27,12 +27,14 @@ AuthorizationRequestMessageWithPop_constraint(const asn_TYPE_descriptor_t *td, c } /* - * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0, + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_AuthorizationRequestMessageWithPop_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_AuthorizationRequestMessageWithPop_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationRequestMessageWithPop = { asn_DEF_AuthorizationRequestMessageWithPop_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationRequestMessageWithPop_tags_1) /sizeof(asn_DEF_AuthorizationRequestMessageWithPop_tags_1[0]), /* 1 */ - { &asn_OER_type_AuthorizationRequestMessageWithPop_constr_1, 0, AuthorizationRequestMessageWithPop_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationRequestMessageWithPop_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AuthorizationRequestMessageWithPop_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AuthorizationRequestMessageWithPop.h b/certgen/asncodec/AuthorizationRequestMessageWithPop.h index 302ecdc..16a2d7c 100644 --- a/certgen/asncodec/AuthorizationRequestMessageWithPop.h +++ b/certgen/asncodec/AuthorizationRequestMessageWithPop.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" #ifndef _AuthorizationRequestMessageWithPop_H_ #define _AuthorizationRequestMessageWithPop_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* AuthorizationRequestMessageWithPop */ -typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_t AuthorizationRequestMessageWithPop_t; +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t AuthorizationRequestMessageWithPop_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_AuthorizationRequestMessageWithPop; asn_struct_free_f AuthorizationRequestMessageWithPop_free; asn_struct_print_f AuthorizationRequestMessageWithPop_print; asn_constr_check_f AuthorizationRequestMessageWithPop_constraint; -ber_type_decoder_f AuthorizationRequestMessageWithPop_decode_ber; -der_type_encoder_f AuthorizationRequestMessageWithPop_encode_der; xer_type_decoder_f AuthorizationRequestMessageWithPop_decode_xer; xer_type_encoder_f AuthorizationRequestMessageWithPop_encode_xer; oer_type_decoder_f AuthorizationRequestMessageWithPop_decode_oer; diff --git a/certgen/asncodec/AuthorizationResponseCode.c b/certgen/asncodec/AuthorizationResponseCode.c index 9997f6b..0169129 100644 --- a/certgen/asncodec/AuthorizationResponseCode.c +++ b/certgen/asncodec/AuthorizationResponseCode.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationResponseCode.h" @@ -11,9 +11,11 @@ * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_AuthorizationResponseCode_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const asn_INTEGER_enum_map_t asn_MAP_AuthorizationResponseCode_value2enum_1[] = { { 0, 2, "ok" }, { 1, 16, "its-aa-cantparse" }, @@ -96,7 +98,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationResponseCode = { asn_DEF_AuthorizationResponseCode_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationResponseCode_tags_1) /sizeof(asn_DEF_AuthorizationResponseCode_tags_1[0]), /* 1 */ - { &asn_OER_type_AuthorizationResponseCode_constr_1, 0, NativeEnumerated_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationResponseCode_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeEnumerated_constraint + }, 0, 0, /* Defined elsewhere */ &asn_SPC_AuthorizationResponseCode_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/AuthorizationResponseCode.h b/certgen/asncodec/AuthorizationResponseCode.h index 7fb1d4a..1df7689 100644 --- a/certgen/asncodec/AuthorizationResponseCode.h +++ b/certgen/asncodec/AuthorizationResponseCode.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _AuthorizationResponseCode_H_ #define _AuthorizationResponseCode_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -61,8 +61,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_AuthorizationResponseCode_specs_1; asn_struct_free_f AuthorizationResponseCode_free; asn_struct_print_f AuthorizationResponseCode_print; asn_constr_check_f AuthorizationResponseCode_constraint; -ber_type_decoder_f AuthorizationResponseCode_decode_ber; -der_type_encoder_f AuthorizationResponseCode_encode_der; xer_type_decoder_f AuthorizationResponseCode_decode_xer; xer_type_encoder_f AuthorizationResponseCode_encode_xer; oer_type_decoder_f AuthorizationResponseCode_decode_oer; diff --git a/certgen/asncodec/AuthorizationResponseMessage.c b/certgen/asncodec/AuthorizationResponseMessage.c index ea582b3..2802ec1 100644 --- a/certgen/asncodec/AuthorizationResponseMessage.c +++ b/certgen/asncodec/AuthorizationResponseMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationResponseMessage.h" @@ -27,12 +27,14 @@ AuthorizationResponseMessage_constraint(const asn_TYPE_descriptor_t *td, const v } /* - * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0, + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_AuthorizationResponseMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_AuthorizationResponseMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationResponseMessage = { asn_DEF_AuthorizationResponseMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationResponseMessage_tags_1) /sizeof(asn_DEF_AuthorizationResponseMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_AuthorizationResponseMessage_constr_1, 0, AuthorizationResponseMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationResponseMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AuthorizationResponseMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AuthorizationResponseMessage.h b/certgen/asncodec/AuthorizationResponseMessage.h index 48adb10..748efe0 100644 --- a/certgen/asncodec/AuthorizationResponseMessage.h +++ b/certgen/asncodec/AuthorizationResponseMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" #ifndef _AuthorizationResponseMessage_H_ #define _AuthorizationResponseMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* AuthorizationResponseMessage */ -typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_t AuthorizationResponseMessage_t; +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t AuthorizationResponseMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_AuthorizationResponseMessage; asn_struct_free_f AuthorizationResponseMessage_free; asn_struct_print_f AuthorizationResponseMessage_print; asn_constr_check_f AuthorizationResponseMessage_constraint; -ber_type_decoder_f AuthorizationResponseMessage_decode_ber; -der_type_encoder_f AuthorizationResponseMessage_encode_der; xer_type_decoder_f AuthorizationResponseMessage_decode_xer; xer_type_encoder_f AuthorizationResponseMessage_encode_xer; oer_type_decoder_f AuthorizationResponseMessage_decode_oer; diff --git a/certgen/asncodec/AuthorizationValidationRequest.c b/certgen/asncodec/AuthorizationValidationRequest.c index 3cc1032..ebde641 100644 --- a/certgen/asncodec/AuthorizationValidationRequest.c +++ b/certgen/asncodec/AuthorizationValidationRequest.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorizationValidation" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorizationValidation.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationValidationRequest.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_AuthorizationValidationRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SharedAtRequest, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "sharedAtRequest" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_AuthorizationValidationRequest_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_EcSignature, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecSignature" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationValidationRequest = { asn_DEF_AuthorizationValidationRequest_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationValidationRequest_tags_1) /sizeof(asn_DEF_AuthorizationValidationRequest_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_AuthorizationValidationRequest_1, 2, /* Elements count */ &asn_SPC_AuthorizationValidationRequest_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AuthorizationValidationRequest.h b/certgen/asncodec/AuthorizationValidationRequest.h index f2c6b91..7bd77ec 100644 --- a/certgen/asncodec/AuthorizationValidationRequest.h +++ b/certgen/asncodec/AuthorizationValidationRequest.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorizationValidation" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorizationValidation.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _AuthorizationValidationRequest_H_ -#define _AuthorizationValidationRequest_H_ - - -#include /* Including external dependencies */ #include "SharedAtRequest.h" #include "EcSignature.h" #include +#ifndef _AuthorizationValidationRequest_H_ +#define _AuthorizationValidationRequest_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/AuthorizationValidationRequestMessage.c b/certgen/asncodec/AuthorizationValidationRequestMessage.c index 5e3694a..d398ffb 100644 --- a/certgen/asncodec/AuthorizationValidationRequestMessage.c +++ b/certgen/asncodec/AuthorizationValidationRequestMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationValidationRequestMessage.h" @@ -27,12 +27,14 @@ AuthorizationValidationRequestMessage_constraint(const asn_TYPE_descriptor_t *td } /* - * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0, + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_AuthorizationValidationRequestMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_AuthorizationValidationRequestMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationValidationRequestMessage = { asn_DEF_AuthorizationValidationRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationValidationRequestMessage_tags_1) /sizeof(asn_DEF_AuthorizationValidationRequestMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_AuthorizationValidationRequestMessage_constr_1, 0, AuthorizationValidationRequestMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationValidationRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AuthorizationValidationRequestMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AuthorizationValidationRequestMessage.h b/certgen/asncodec/AuthorizationValidationRequestMessage.h index dba520a..531213b 100644 --- a/certgen/asncodec/AuthorizationValidationRequestMessage.h +++ b/certgen/asncodec/AuthorizationValidationRequestMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" #ifndef _AuthorizationValidationRequestMessage_H_ #define _AuthorizationValidationRequestMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* AuthorizationValidationRequestMessage */ -typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_t AuthorizationValidationRequestMessage_t; +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t AuthorizationValidationRequestMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_AuthorizationValidationRequestMessage; asn_struct_free_f AuthorizationValidationRequestMessage_free; asn_struct_print_f AuthorizationValidationRequestMessage_print; asn_constr_check_f AuthorizationValidationRequestMessage_constraint; -ber_type_decoder_f AuthorizationValidationRequestMessage_decode_ber; -der_type_encoder_f AuthorizationValidationRequestMessage_encode_der; xer_type_decoder_f AuthorizationValidationRequestMessage_decode_xer; xer_type_encoder_f AuthorizationValidationRequestMessage_encode_xer; oer_type_decoder_f AuthorizationValidationRequestMessage_decode_oer; diff --git a/certgen/asncodec/AuthorizationValidationResponse.c b/certgen/asncodec/AuthorizationValidationResponse.c index 8478084..a1eb985 100644 --- a/certgen/asncodec/AuthorizationValidationResponse.c +++ b/certgen/asncodec/AuthorizationValidationResponse.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorizationValidation" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorizationValidation.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationValidationResponse.h" @@ -52,19 +52,36 @@ memb_confirmedSubjectAttributes_constraint_1(const asn_TYPE_descriptor_t *td, co return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_requestHash_constr_2 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_confirmedSubjectAttributes_constr_4 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_AuthorizationValidationResponse_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_AuthorizationValidationResponse_1[] = { { ATF_NOFLAGS, 0, offsetof(struct AuthorizationValidationResponse, requestHash), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_requestHash_constr_2, 0, memb_requestHash_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_requestHash_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_requestHash_constraint_1 + }, 0, 0, /* No default value */ "requestHash" }, @@ -73,7 +90,15 @@ asn_TYPE_member_t asn_MBR_AuthorizationValidationResponse_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthorizationValidationResponseCode, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "responseCode" }, @@ -82,7 +107,15 @@ asn_TYPE_member_t asn_MBR_AuthorizationValidationResponse_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CertificateSubjectAttributes, 0, - { &asn_OER_memb_confirmedSubjectAttributes_constr_4, 0, memb_confirmedSubjectAttributes_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_confirmedSubjectAttributes_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_confirmedSubjectAttributes_constraint_1 + }, 0, 0, /* No default value */ "confirmedSubjectAttributes" }, @@ -115,7 +148,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationValidationResponse = { asn_DEF_AuthorizationValidationResponse_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationValidationResponse_tags_1) /sizeof(asn_DEF_AuthorizationValidationResponse_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationValidationResponse_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_AuthorizationValidationResponse_1, 3, /* Elements count */ &asn_SPC_AuthorizationValidationResponse_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AuthorizationValidationResponse.h b/certgen/asncodec/AuthorizationValidationResponse.h index ca479fe..7c49103 100644 --- a/certgen/asncodec/AuthorizationValidationResponse.h +++ b/certgen/asncodec/AuthorizationValidationResponse.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorizationValidation" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorizationValidation.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _AuthorizationValidationResponse_H_ -#define _AuthorizationValidationResponse_H_ - - -#include /* Including external dependencies */ #include #include "AuthorizationValidationResponseCode.h" #include +#ifndef _AuthorizationValidationResponse_H_ +#define _AuthorizationValidationResponse_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -27,7 +27,7 @@ struct CertificateSubjectAttributes; typedef struct AuthorizationValidationResponse { OCTET_STRING_t requestHash; AuthorizationValidationResponseCode_t responseCode; - struct CertificateSubjectAttributes *confirmedSubjectAttributes /* OPTIONAL */; + struct CertificateSubjectAttributes *confirmedSubjectAttributes; /* OPTIONAL */ /* * This type is extensible, * possible extensions are below. diff --git a/certgen/asncodec/AuthorizationValidationResponseCode.c b/certgen/asncodec/AuthorizationValidationResponseCode.c index b3d8550..61dbf41 100644 --- a/certgen/asncodec/AuthorizationValidationResponseCode.c +++ b/certgen/asncodec/AuthorizationValidationResponseCode.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorizationValidation" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorizationValidation.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationValidationResponseCode.h" @@ -11,9 +11,11 @@ * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_AuthorizationValidationResponseCode_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const asn_INTEGER_enum_map_t asn_MAP_AuthorizationValidationResponseCode_value2enum_1[] = { { 0, 2, "ok" }, { 1, 9, "cantparse" }, @@ -72,7 +74,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationValidationResponseCode = { asn_DEF_AuthorizationValidationResponseCode_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationValidationResponseCode_tags_1) /sizeof(asn_DEF_AuthorizationValidationResponseCode_tags_1[0]), /* 1 */ - { &asn_OER_type_AuthorizationValidationResponseCode_constr_1, 0, NativeEnumerated_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationValidationResponseCode_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeEnumerated_constraint + }, 0, 0, /* Defined elsewhere */ &asn_SPC_AuthorizationValidationResponseCode_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/AuthorizationValidationResponseCode.h b/certgen/asncodec/AuthorizationValidationResponseCode.h index f0e2edd..b122f92 100644 --- a/certgen/asncodec/AuthorizationValidationResponseCode.h +++ b/certgen/asncodec/AuthorizationValidationResponseCode.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorizationValidation" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorizationValidation.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _AuthorizationValidationResponseCode_H_ #define _AuthorizationValidationResponseCode_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -49,8 +49,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_AuthorizationValidationResponseCode asn_struct_free_f AuthorizationValidationResponseCode_free; asn_struct_print_f AuthorizationValidationResponseCode_print; asn_constr_check_f AuthorizationValidationResponseCode_constraint; -ber_type_decoder_f AuthorizationValidationResponseCode_decode_ber; -der_type_encoder_f AuthorizationValidationResponseCode_encode_der; xer_type_decoder_f AuthorizationValidationResponseCode_decode_xer; xer_type_encoder_f AuthorizationValidationResponseCode_encode_xer; oer_type_decoder_f AuthorizationValidationResponseCode_decode_oer; diff --git a/certgen/asncodec/AuthorizationValidationResponseMessage.c b/certgen/asncodec/AuthorizationValidationResponseMessage.c index c1c5eda..8361495 100644 --- a/certgen/asncodec/AuthorizationValidationResponseMessage.c +++ b/certgen/asncodec/AuthorizationValidationResponseMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "AuthorizationValidationResponseMessage.h" @@ -27,12 +27,14 @@ AuthorizationValidationResponseMessage_constraint(const asn_TYPE_descriptor_t *t } /* - * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0, + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_AuthorizationValidationResponseMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_AuthorizationValidationResponseMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_AuthorizationValidationResponseMessage = { asn_DEF_AuthorizationValidationResponseMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AuthorizationValidationResponseMessage_tags_1) /sizeof(asn_DEF_AuthorizationValidationResponseMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_AuthorizationValidationResponseMessage_constr_1, 0, AuthorizationValidationResponseMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_AuthorizationValidationResponseMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + AuthorizationValidationResponseMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/AuthorizationValidationResponseMessage.h b/certgen/asncodec/AuthorizationValidationResponseMessage.h index fe29736..1038744 100644 --- a/certgen/asncodec/AuthorizationValidationResponseMessage.h +++ b/certgen/asncodec/AuthorizationValidationResponseMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" #ifndef _AuthorizationValidationResponseMessage_H_ #define _AuthorizationValidationResponseMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* AuthorizationValidationResponseMessage */ -typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_t AuthorizationValidationResponseMessage_t; +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t AuthorizationValidationResponseMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_AuthorizationValidationResponseMessage; asn_struct_free_f AuthorizationValidationResponseMessage_free; asn_struct_print_f AuthorizationValidationResponseMessage_print; asn_constr_check_f AuthorizationValidationResponseMessage_constraint; -ber_type_decoder_f AuthorizationValidationResponseMessage_decode_ber; -der_type_encoder_f AuthorizationValidationResponseMessage_encode_der; xer_type_decoder_f AuthorizationValidationResponseMessage_decode_xer; xer_type_encoder_f AuthorizationValidationResponseMessage_encode_xer; oer_type_decoder_f AuthorizationValidationResponseMessage_decode_oer; diff --git a/certgen/asncodec/BIT_STRING.c b/certgen/asncodec/BIT_STRING.c index 4b9b25d..b5ba940 100644 --- a/certgen/asncodec/BIT_STRING.c +++ b/certgen/asncodec/BIT_STRING.c @@ -1,652 +1,213 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * BIT STRING basic type description. - */ -static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) -}; -asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = { - sizeof(BIT_STRING_t), - offsetof(BIT_STRING_t, _asn_ctx), - ASN_OSUBV_BIT -}; -asn_TYPE_operation_t asn_OP_BIT_STRING = { - OCTET_STRING_free, /* Implemented in terms of OCTET STRING */ - BIT_STRING_print, - BIT_STRING_compare, - OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ - OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */ - OCTET_STRING_decode_xer_binary, - BIT_STRING_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - BIT_STRING_decode_oer, - BIT_STRING_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - BIT_STRING_decode_uper, /* Unaligned PER decoder */ - BIT_STRING_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - BIT_STRING_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_BIT_STRING = { - "BIT STRING", - "BIT_STRING", - &asn_OP_BIT_STRING, - asn_DEF_BIT_STRING_tags, - sizeof(asn_DEF_BIT_STRING_tags) - / sizeof(asn_DEF_BIT_STRING_tags[0]), - asn_DEF_BIT_STRING_tags, /* Same as above */ - sizeof(asn_DEF_BIT_STRING_tags) - / sizeof(asn_DEF_BIT_STRING_tags[0]), - { 0, 0, BIT_STRING_constraint }, - 0, 0, /* No members */ - &asn_SPC_BIT_STRING_specs -}; - -/* - * BIT STRING generic constraint. - */ -int -BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; - - if(st && st->buf) { - if((st->size == 0 && st->bits_unused) - || st->bits_unused < 0 || st->bits_unused > 7) { - ASN__CTFAIL(app_key, td, sptr, - "%s: invalid padding byte (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - } else { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - return 0; -} - -static const char *_bit_pattern[16] = { - "0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", - "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" -}; - -asn_enc_rval_t -BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er; - char scratch[128]; - char *p = scratch; - char *scend = scratch + (sizeof(scratch) - 10); - const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; - int xcan = (flags & XER_F_CANONICAL); - uint8_t *buf; - uint8_t *end; - - if(!st || !st->buf) - ASN__ENCODE_FAILED; - - er.encoded = 0; - - buf = st->buf; - end = buf + st->size - 1; /* Last byte is special */ - - /* - * Binary dump - */ - for(; buf < end; buf++) { - int v = *buf; - int nline = xcan?0:(((buf - st->buf) % 8) == 0); - if(p >= scend || nline) { - ASN__CALLBACK(scratch, p - scratch); - p = scratch; - if(nline) ASN__TEXT_INDENT(1, ilevel); - } - memcpy(p + 0, _bit_pattern[v >> 4], 4); - memcpy(p + 4, _bit_pattern[v & 0x0f], 4); - p += 8; - } - - if(!xcan && ((buf - st->buf) % 8) == 0) - ASN__TEXT_INDENT(1, ilevel); - ASN__CALLBACK(scratch, p - scratch); - p = scratch; - - if(buf == end) { - int v = *buf; - int ubits = st->bits_unused; - int i; - for(i = 7; i >= ubits; i--) - *p++ = (v & (1 << i)) ? 0x31 : 0x30; - ASN__CALLBACK(scratch, p - scratch); - } - - if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); - - ASN__ENCODED_OK(er); -cb_failed: - ASN__ENCODE_FAILED; -} - - -/* - * BIT STRING specific contents printer. - */ -int -BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - const char * const h2c = "0123456789ABCDEF"; - char scratch[64]; - const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; - uint8_t *buf; - uint8_t *end; - char *p = scratch; - - (void)td; /* Unused argument */ - - if(!st || !st->buf) - return (cb("", 8, app_key) < 0) ? -1 : 0; - - ilevel++; - buf = st->buf; - end = buf + st->size; - - /* - * Hexadecimal dump. - */ - for(; buf < end; buf++) { - if((buf - st->buf) % 16 == 0 && (st->size > 16) - && buf != st->buf) { - _i_INDENT(1); - /* Dump the string */ - if(cb(scratch, p - scratch, app_key) < 0) return -1; - p = scratch; - } - *p++ = h2c[*buf >> 4]; - *p++ = h2c[*buf & 0x0F]; - *p++ = 0x20; - } - - if(p > scratch) { - p--; /* Eat the tailing space */ - - if((st->size > 16)) { - _i_INDENT(1); - } - - /* Dump the incomplete 16-bytes row */ - if(cb(scratch, p - scratch, app_key) < 0) - return -1; - } - - if(st->bits_unused) { - int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)", - st->bits_unused, st->bits_unused == 1 ? "" : "s"); - assert(ret > 0 && ret < (ssize_t)sizeof(scratch)); - if(ret > 0 && ret < (ssize_t)sizeof(scratch) - && cb(scratch, ret, app_key) < 0) - return -1; - } - - return 0; -} - -/* - * Non-destructively remove the trailing 0-bits from the given bit string. - */ -static const BIT_STRING_t * -BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) { - const uint8_t *b; - union { - const uint8_t *c_buf; - uint8_t *nc_buf; - } unconst; - - if(st->size == 0) { - assert(st->bits_unused == 0); - return st; - } else { - for(b = &st->buf[st->size - 1]; b > st->buf && *b == 0; b--) { - ; - } - /* b points to the last byte which may contain data */ - if(*b) { - int unused = 7; - uint8_t v = *b; - v &= -(int8_t)v; - if(v & 0x0F) unused -= 4; - if(v & 0x33) unused -= 2; - if(v & 0x55) unused -= 1; - tmp->size = b-st->buf + 1; - tmp->bits_unused = unused; - } else { - tmp->size = b-st->buf; - tmp->bits_unused = 0; - } - - assert(b >= st->buf); - } - - unconst.c_buf = st->buf; - tmp->buf = unconst.nc_buf; - return tmp; -} - -/* - * Lexicographically compare the common prefix of both strings, - * and if it is the same return -1 for the smallest string. - */ -int -BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr, - const void *bptr) { - /* - * Remove information about trailing bits, since - * X.680 (08/2015) #22.7 "ensure that different semantics are not" - * "associated with [values that differ only in] the trailing 0 bits." - */ - BIT_STRING_t compact_a, compact_b; - const BIT_STRING_t *a = BIT_STRING__compactify(aptr, &compact_a); - const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b); - const asn_OCTET_STRING_specifics_t *specs = td->specifics; - - assert(specs && specs->subvariant == ASN_OSUBV_BIT); - - if(a && b) { - size_t common_prefix_size = a->size <= b->size ? a->size : b->size; - int ret = memcmp(a->buf, b->buf, common_prefix_size); - if(ret == 0) { - /* Figure out which string with equal prefixes is longer. */ - if(a->size < b->size) { - return -1; - } else if(a->size > b->size) { - return 1; - } else { - /* Figure out how many unused bits */ - if(a->bits_unused > b->bits_unused) { - return -1; - } else if(a->bits_unused < b->bits_unused) { - return 1; - } else { - return 0; - } - } - } else { - return ret; - } - } else if(!a && !b) { - return 0; - } else if(!a) { - return -1; - } else { - return 1; - } -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -#undef RETURN -#define RETURN(_code) \ - do { \ - asn_dec_rval_t tmprval; \ - tmprval.code = _code; \ - tmprval.consumed = consumed_myself; \ - return tmprval; \ - } while(0) - -static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = { - APC_SEMI_CONSTRAINED, -1, -1, 0, 0}; - -asn_dec_rval_t -BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - const asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_BIT_STRING_specs; - const asn_per_constraints_t *pc = - constraints ? constraints : td->encoding_constraints.per_constraints; - const asn_per_constraint_t *csiz; - asn_dec_rval_t rval = { RC_OK, 0 }; - BIT_STRING_t *st = (BIT_STRING_t *)*sptr; - ssize_t consumed_myself = 0; - int repeat; - - (void)opt_codec_ctx; - - if(pc) { - csiz = &pc->size; - } else { - csiz = &asn_DEF_BIT_STRING_constraint_size; - } - - if(specs->subvariant != ASN_OSUBV_BIT) { - ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant); - RETURN(RC_FAIL); - } - - /* - * Allocate the string. - */ - if(!st) { - st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); - if(!st) RETURN(RC_FAIL); - } - - ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d", - csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible", - csiz->lower_bound, csiz->upper_bound, csiz->effective_bits); - - if(csiz->flags & APC_EXTENSIBLE) { - int inext = per_get_few_bits(pd, 1); - if(inext < 0) RETURN(RC_WMORE); - if(inext) { - csiz = &asn_DEF_BIT_STRING_constraint_size; - } - } - - if(csiz->effective_bits >= 0) { - FREEMEM(st->buf); - st->size = (csiz->upper_bound + 7) >> 3; - st->buf = (uint8_t *)MALLOC(st->size + 1); - if(!st->buf) { st->size = 0; RETURN(RC_FAIL); } - } - - /* X.691, #16.5: zero-length encoding */ - /* X.691, #16.6: short fixed length encoding (up to 2 octets) */ - /* X.691, #16.7: long fixed length encoding (up to 64K octets) */ - if(csiz->effective_bits == 0) { - int ret; - ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound); - ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound); - if(ret < 0) RETURN(RC_WMORE); - consumed_myself += csiz->upper_bound; - st->buf[st->size] = 0; - st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7; - RETURN(RC_OK); - } - - st->size = 0; - do { - ssize_t raw_len; - ssize_t len_bytes; - ssize_t len_bits; - void *p; - int ret; - - /* Get the PER length */ - raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound, - &repeat); - if(raw_len < 0) RETURN(RC_WMORE); - if(raw_len == 0 && st->buf) break; - - ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)", - (long)csiz->effective_bits, (long)raw_len, - repeat ? "repeat" : "once", td->name); - len_bits = raw_len; - len_bytes = (len_bits + 7) >> 3; - if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7); - /* len_bits be multiple of 16K if repeat is set */ - p = REALLOC(st->buf, st->size + len_bytes + 1); - if(!p) RETURN(RC_FAIL); - st->buf = (uint8_t *)p; - - ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits); - if(ret < 0) RETURN(RC_WMORE); - st->size += len_bytes; - } while(repeat); - st->buf[st->size] = 0; /* nul-terminate */ - - return rval; -} - -asn_enc_rval_t -BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, asn_per_outp_t *po) { - const asn_OCTET_STRING_specifics_t *specs = - td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_BIT_STRING_specs; - const asn_per_constraints_t *pc = - constraints ? constraints : td->encoding_constraints.per_constraints; - const asn_per_constraint_t *csiz; - const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; - BIT_STRING_t compact_bstr; /* Do not modify this directly! */ - asn_enc_rval_t er = { 0, 0, 0 }; - int inext = 0; /* Lies not within extension root */ - size_t size_in_bits; - const uint8_t *buf; - int ret; - int ct_extensible; - - if(!st || (!st->buf && st->size)) - ASN__ENCODE_FAILED; - - if(specs->subvariant == ASN_OSUBV_BIT) { - if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7)) - ASN__ENCODE_FAILED; - } else { - ASN__ENCODE_FAILED; - } - - if(pc) { - csiz = &pc->size; - } else { - csiz = &asn_DEF_BIT_STRING_constraint_size; - } - ct_extensible = csiz->flags & APC_EXTENSIBLE; - - /* Figure out the size without the trailing bits */ - st = BIT_STRING__compactify(st, &compact_bstr); - size_in_bits = 8 * st->size - st->bits_unused; - - ASN_DEBUG( - "Encoding %s into %" ASN_PRI_SIZE " bits" - " (%ld..%ld, effective %d)%s", - td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound, - csiz->effective_bits, ct_extensible ? " EXT" : ""); - - /* Figure out whether size lies within PER visible constraint */ - - if(csiz->effective_bits >= 0) { - if((ssize_t)size_in_bits > csiz->upper_bound) { - if(ct_extensible) { - csiz = &asn_DEF_BIT_STRING_constraint_size; - inext = 1; - } else { - ASN__ENCODE_FAILED; - } - } - } else { - inext = 0; - } - - if(ct_extensible) { - /* Declare whether length is [not] within extension root */ - if(per_put_few_bits(po, inext, 1)) - ASN__ENCODE_FAILED; - } - - if(csiz->effective_bits >= 0 && !inext) { - int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound; - ASN_DEBUG( - "Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual " - "value %" ASN_PRI_SSIZE "", - st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits, - add_trailer, - add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound); - ret = per_put_few_bits( - po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound, - csiz->effective_bits); - if(ret) ASN__ENCODE_FAILED; - ret = per_put_many_bits(po, st->buf, size_in_bits); - if(ret) ASN__ENCODE_FAILED; - if(add_trailer) { - static const uint8_t zeros[16]; - size_t trailing_zero_bits = csiz->lower_bound - size_in_bits; - while(trailing_zero_bits > 0) { - if(trailing_zero_bits > 8 * sizeof(zeros)) { - ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros)); - trailing_zero_bits -= 8 * sizeof(zeros); - } else { - ret = per_put_many_bits(po, zeros, trailing_zero_bits); - trailing_zero_bits = 0; - } - if(ret) ASN__ENCODE_FAILED; - } - } - ASN__ENCODED_OK(er); - } - - ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size); - - buf = st->buf; - do { - int need_eom = 0; - ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom); - if(maySave < 0) ASN__ENCODE_FAILED; - - ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits); - - ret = per_put_many_bits(po, buf, maySave); - if(ret) ASN__ENCODE_FAILED; - - buf += maySave >> 3; - size_in_bits -= maySave; - assert(!(maySave & 0x07) || !size_in_bits); - if(need_eom && uper_put_length(po, 0, 0)) - ASN__ENCODE_FAILED; /* End of Message length */ - } while(size_in_bits); - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -asn_random_fill_result_t -BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constraints, - size_t max_length) { - const asn_OCTET_STRING_specifics_t *specs = - td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_BIT_STRING_specs; - asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - static unsigned lengths[] = {0, 1, 2, 3, 4, 8, - 126, 127, 128, 16383, 16384, 16385, - 65534, 65535, 65536, 65537}; - uint8_t *buf; - uint8_t *bend; - uint8_t *b; - size_t rnd_bits, rnd_len; - BIT_STRING_t *st; - - if(max_length == 0) return result_skipped; - - switch(specs->subvariant) { - case ASN_OSUBV_ANY: - return result_failed; - case ASN_OSUBV_BIT: - break; - default: - break; - } - - /* Figure out how far we should go */ - rnd_bits = lengths[asn_random_between( - 0, sizeof(lengths) / sizeof(lengths[0]) - 1)]; - if(!constraints || !constraints->per_constraints) - constraints = &td->encoding_constraints; - if(constraints->per_constraints) { - const asn_per_constraint_t *pc = &constraints->per_constraints->size; - if(pc->flags & APC_CONSTRAINED) { - long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length - ? pc->upper_bound - : (ssize_t)max_length; - if(max_length < (size_t)pc->lower_bound) { - return result_skipped; - } - if(pc->flags & APC_EXTENSIBLE) { - switch(asn_random_between(0, 5)) { - case 0: - if(pc->lower_bound > 0) { - rnd_bits = pc->lower_bound - 1; - break; - } - /* Fall through */ - case 1: - rnd_bits = pc->upper_bound + 1; - break; - case 2: - /* Keep rnd_bits from the table */ - if(rnd_bits < max_length) { - break; - } - /* Fall through */ - default: - rnd_bits = asn_random_between(pc->lower_bound, - suggested_upper_bound); - } - } else { - rnd_bits = - asn_random_between(pc->lower_bound, suggested_upper_bound); - } - } else { - rnd_bits = asn_random_between(0, max_length - 1); - } - } else if(rnd_bits >= max_length) { - rnd_bits = asn_random_between(0, max_length - 1); - } - - rnd_len = (rnd_bits + 7) / 8; - buf = CALLOC(1, rnd_len + 1); - if(!buf) return result_failed; - - bend = &buf[rnd_len]; - - for(b = buf; b < bend; b++) { - *(uint8_t *)b = asn_random_between(0, 255); - } - *b = 0; /* Zero-terminate just in case. */ - - if(*sptr) { - st = *sptr; - FREEMEM(st->buf); - } else { - st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); - if(!st) { - FREEMEM(buf); - return result_failed; - } - } - - st->buf = buf; - st->size = rnd_len; - st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7; - if(st->bits_unused) { - assert(st->size > 0); - st->buf[st->size-1] &= 0xff << st->bits_unused; - } - - result_ok.length = st->size; - return result_ok; -} +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * BIT STRING basic type description. + */ +static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) +}; +asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = { + sizeof(BIT_STRING_t), + offsetof(BIT_STRING_t, _asn_ctx), + ASN_OSUBV_BIT +}; +asn_TYPE_operation_t asn_OP_BIT_STRING = { + OCTET_STRING_free, /* Implemented in terms of OCTET STRING */ +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + BIT_STRING_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + BIT_STRING_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OCTET_STRING_decode_xer_binary, + BIT_STRING_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + BIT_STRING_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + BIT_STRING_decode_oer, + BIT_STRING_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + BIT_STRING_decode_uper, /* Unaligned PER decoder */ + BIT_STRING_encode_uper, /* Unaligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OCTET_STRING_decode_aper, /* Aligned PER decoder */ + OCTET_STRING_encode_aper, /* Aligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + BIT_STRING_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_BIT_STRING = { + "BIT STRING", + "BIT_STRING", + &asn_OP_BIT_STRING, + asn_DEF_BIT_STRING_tags, + sizeof(asn_DEF_BIT_STRING_tags) + / sizeof(asn_DEF_BIT_STRING_tags[0]), + asn_DEF_BIT_STRING_tags, /* Same as above */ + sizeof(asn_DEF_BIT_STRING_tags) + / sizeof(asn_DEF_BIT_STRING_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + BIT_STRING_constraint + }, + 0, 0, /* No members */ + &asn_SPC_BIT_STRING_specs +}; + +/* + * BIT STRING generic constraint. + */ +int +BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; + + if(st && st->buf) { + if((st->size == 0 && st->bits_unused) + || st->bits_unused < 0 || st->bits_unused > 7) { + ASN__CTFAIL(app_key, td, sptr, + "%s: invalid padding byte (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + return 0; +} + +/* + * Non-destructively remove the trailing 0-bits from the given bit string. + */ +const BIT_STRING_t * +BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) { + const uint8_t *b; + union { + const uint8_t *c_buf; + uint8_t *nc_buf; + } unconst; + + if(st->size == 0) { + assert(st->bits_unused == 0); + return st; + } else { + for(b = &st->buf[st->size - 1]; b > st->buf && *b == 0; b--) { + ; + } + /* b points to the last byte which may contain data */ + if(*b) { + int unused = 7; + uint8_t v = *b; + v &= -(int8_t)v; + if(v & 0x0F) unused -= 4; + if(v & 0x33) unused -= 2; + if(v & 0x55) unused -= 1; + tmp->size = b-st->buf + 1; + tmp->bits_unused = unused; + } else { + tmp->size = b-st->buf; + tmp->bits_unused = 0; + } + + assert(b >= st->buf); + } + + unconst.c_buf = st->buf; + tmp->buf = unconst.nc_buf; + return tmp; +} + +/* + * Lexicographically compare the common prefix of both strings, + * and if it is the same return -1 for the smallest string. + */ +int +BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr, + const void *bptr) { + /* + * Remove information about trailing bits, since + * X.680 (08/2015) #22.7 "ensure that different semantics are not" + * "associated with [values that differ only in] the trailing 0 bits." + */ + BIT_STRING_t compact_a, compact_b; + const BIT_STRING_t *a = BIT_STRING__compactify(aptr, &compact_a); + const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b); + const asn_OCTET_STRING_specifics_t *specs = td->specifics; + + (void)specs; + assert(specs && specs->subvariant == ASN_OSUBV_BIT); + + if(a && b) { + size_t common_prefix_size = a->size <= b->size ? a->size : b->size; + int ret = memcmp(a->buf, b->buf, common_prefix_size); + if(ret == 0) { + /* Figure out which string with equal prefixes is longer. */ + if(a->size < b->size) { + return -1; + } else if(a->size > b->size) { + return 1; + } else { + /* Figure out how many unused bits */ + if(a->bits_unused > b->bits_unused) { + return -1; + } else if(a->bits_unused < b->bits_unused) { + return 1; + } else { + return 0; + } + } + } else { + return ret; + } + } else if(!a && !b) { + return 0; + } else if(!a) { + return -1; + } else { + return 1; + } +} diff --git a/certgen/asncodec/BIT_STRING.h b/certgen/asncodec/BIT_STRING.h index a43d333..e755fe9 100644 --- a/certgen/asncodec/BIT_STRING.h +++ b/certgen/asncodec/BIT_STRING.h @@ -1,46 +1,75 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _BIT_STRING_H_ -#define _BIT_STRING_H_ - -#include /* Some help from OCTET STRING */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct BIT_STRING_s { - uint8_t *buf; /* BIT STRING body */ - size_t size; /* Size of the above buffer */ - - int bits_unused;/* Unused trailing bits in the last octet (0..7) */ - - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} BIT_STRING_t; - -extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; -extern asn_TYPE_operation_t asn_OP_BIT_STRING; -extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs; - -asn_struct_print_f BIT_STRING_print; /* Human-readable output */ -asn_struct_compare_f BIT_STRING_compare; -asn_constr_check_f BIT_STRING_constraint; -xer_type_encoder_f BIT_STRING_encode_xer; -oer_type_decoder_f BIT_STRING_decode_oer; -oer_type_encoder_f BIT_STRING_encode_oer; -per_type_decoder_f BIT_STRING_decode_uper; -per_type_encoder_f BIT_STRING_encode_uper; -asn_random_fill_f BIT_STRING_random_fill; - -#define BIT_STRING_free OCTET_STRING_free -#define BIT_STRING_decode_ber OCTET_STRING_decode_ber -#define BIT_STRING_encode_der OCTET_STRING_encode_der -#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary - -#ifdef __cplusplus -} -#endif - -#endif /* _BIT_STRING_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _BIT_STRING_H_ +#define _BIT_STRING_H_ + +#include /* Some help from OCTET STRING */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct BIT_STRING_s { + uint8_t *buf; /* BIT STRING body */ + size_t size; /* Size of the above buffer */ + + int bits_unused;/* Unused trailing bits in the last octet (0..7) */ + + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ +} BIT_STRING_t; + +extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; +extern asn_TYPE_operation_t asn_OP_BIT_STRING; +extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs; + +#define BIT_STRING_free OCTET_STRING_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f BIT_STRING_print; /* Human-readable output */ +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f BIT_STRING_compare; + +asn_constr_check_f BIT_STRING_constraint; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define BIT_STRING_decode_ber OCTET_STRING_decode_ber +#define BIT_STRING_encode_der OCTET_STRING_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary +xer_type_encoder_f BIT_STRING_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f BIT_STRING_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f BIT_STRING_decode_oer; +oer_type_encoder_f BIT_STRING_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f BIT_STRING_decode_uper; +per_type_encoder_f BIT_STRING_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#define BIT_STRING_decode_aper OCTET_STRING_decode_aper +#define BIT_STRING_encode_aper OCTET_STRING_encode_aper +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f BIT_STRING_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +const BIT_STRING_t *BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp); + +#ifdef __cplusplus +} +#endif + +#endif /* _BIT_STRING_H_ */ diff --git a/certgen/asncodec/BIT_STRING_oer.c b/certgen/asncodec/BIT_STRING_oer.c index c7d94b5..95c9558 100644 --- a/certgen/asncodec/BIT_STRING_oer.c +++ b/certgen/asncodec/BIT_STRING_oer.c @@ -1,174 +1,168 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include - -asn_dec_rval_t -BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **sptr, - const void *ptr, size_t size) { - BIT_STRING_t *st = (BIT_STRING_t *)*sptr; - const asn_oer_constraints_t *cts = - constraints ? constraints : td->encoding_constraints.oer_constraints; - ssize_t ct_size = cts ? cts->size : -1; - asn_dec_rval_t rval = {RC_OK, 0}; - size_t expected_length = 0; - - (void)opt_codec_ctx; - - if(!st) { - st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st))); - if(!st) ASN__DECODE_FAILED; - } - - if(ct_size >= 0) { - expected_length = (ct_size + 7) >> 3; - st->bits_unused = (8 - (ct_size & 7)) & 7; - } else { - /* - * X.696 (08/2015) #13.3.1 - * Encode length determinant as _number of octets_, but only - * if upper bound is not equal to lower bound. - */ - ssize_t len_len = oer_fetch_length(ptr, size, &expected_length); - if(len_len > 0) { - ptr = (const char *)ptr + len_len; - size -= len_len; - } else if(len_len == 0) { - ASN__DECODE_STARVED; - } else if(len_len < 0) { - ASN__DECODE_FAILED; - } - - if(expected_length < 1) { - ASN__DECODE_FAILED; - } else if(expected_length > size) { - ASN__DECODE_STARVED; - } - - st->bits_unused = ((const uint8_t *)ptr)[0]; - if(st->bits_unused & ~7) { - ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name); - ASN__DECODE_FAILED; - } - ptr = (const char *)ptr + 1; - size--; - expected_length--; - rval.consumed = len_len + 1; - } - - if(size < expected_length) { - ASN__DECODE_STARVED; - } else { - uint8_t *buf = MALLOC(expected_length + 1); - if(buf == NULL) { - ASN__DECODE_FAILED; - } else { - memcpy(buf, ptr, expected_length); - buf[expected_length] = '\0'; - } - FREEMEM(st->buf); - st->buf = buf; - st->size = expected_length; - if(expected_length > 0) { - buf[expected_length - 1] &= (0xff << st->bits_unused); - } - - rval.consumed += expected_length; - return rval; - } -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, - const void *sptr, asn_app_consume_bytes_f *cb, - void *app_key) { - const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; - asn_enc_rval_t erval = {0, 0, 0}; - const asn_oer_constraints_t *cts = - constraints ? constraints : td->encoding_constraints.oer_constraints; - ssize_t ct_size = cts ? cts->size : -1; - size_t trailing_zeros = 0; - int fix_last_byte = 0; - - if(!st) ASN__ENCODE_FAILED; - - if(st->bits_unused & ~7) { - ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range", - st->bits_unused); - ASN__ENCODE_FAILED; - } - if(st->bits_unused && !(st->size && st->buf)) { - ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name, - st->bits_unused); - ASN__ENCODE_FAILED; - } - - if(ct_size >= 0) { - size_t ct_bytes = (ct_size + 7) >> 3; - if(st->size > ct_bytes) { - ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "", - td->name, 8 * st->size - st->bits_unused, ct_size); - ASN__ENCODE_FAILED; - } - trailing_zeros = ct_bytes - st->size; /* Allow larger constraint */ - } else { - uint8_t ub = st->bits_unused & 7; - ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key); - if(len_len < 0) ASN__ENCODE_FAILED; - if(cb(&ub, 1, app_key) < 0) { - ASN__ENCODE_FAILED; - } - erval.encoded += len_len + 1; - } - - if(st->bits_unused) { - if(st->buf[st->size - 1] & (0xff << st->bits_unused)) { - fix_last_byte = 1; - } - } - - if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) { - ASN__ENCODE_FAILED; - } - - if(fix_last_byte) { - uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused); - if(cb(&b, 1, app_key) < 0) { - ASN__ENCODE_FAILED; - } - } - - erval.encoded += st->size; - - if(trailing_zeros) { - static uint8_t zeros[16]; - while(trailing_zeros > 0) { - int ret; - if(trailing_zeros < sizeof(zeros)) { - ret = cb(zeros, trailing_zeros, app_key); - erval.encoded += trailing_zeros; - } else { - ret = cb(zeros, sizeof(zeros), app_key); - erval.encoded += sizeof(zeros); - } - if(ret < 0) ASN__ENCODE_FAILED; - } - } - - return erval; -} - - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_dec_rval_t +BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **sptr, + const void *ptr, size_t size) { + BIT_STRING_t *st = (BIT_STRING_t *)*sptr; + const asn_oer_constraints_t *cts = + constraints ? constraints : td->encoding_constraints.oer_constraints; + ssize_t ct_size = cts ? cts->size : -1; + asn_dec_rval_t rval = {RC_OK, 0}; + size_t expected_length = 0; + + (void)opt_codec_ctx; + + if(!st) { + st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st))); + if(!st) ASN__DECODE_FAILED; + } + + if(ct_size >= 0) { + expected_length = (ct_size + 7) >> 3; + st->bits_unused = (8 - (ct_size & 7)) & 7; + } else { + /* + * X.696 (08/2015) #13.3.1 + * Encode length determinant as _number of octets_, but only + * if upper bound is not equal to lower bound. + */ + ssize_t len_len = oer_fetch_length(ptr, size, &expected_length); + if(len_len > 0) { + ptr = (const char *)ptr + len_len; + size -= len_len; + } else if(len_len == 0) { + ASN__DECODE_STARVED; + } else if(len_len < 0) { + ASN__DECODE_FAILED; + } + + if(expected_length < 1) { + ASN__DECODE_FAILED; + } else if(expected_length > size) { + ASN__DECODE_STARVED; + } + + st->bits_unused = ((const uint8_t *)ptr)[0]; + if(st->bits_unused & ~7) { + ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name); + ASN__DECODE_FAILED; + } + ptr = (const char *)ptr + 1; + size--; + expected_length--; + rval.consumed = len_len + 1; + } + + if(size < expected_length) { + ASN__DECODE_STARVED; + } else { + uint8_t *buf = MALLOC(expected_length + 1); + if(buf == NULL) { + ASN__DECODE_FAILED; + } else { + memcpy(buf, ptr, expected_length); + buf[expected_length] = '\0'; + } + FREEMEM(st->buf); + st->buf = buf; + st->size = expected_length; + if(expected_length > 0) { + buf[expected_length - 1] &= (0xff << st->bits_unused); + } + + rval.consumed += expected_length; + return rval; + } +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, + const void *sptr, asn_app_consume_bytes_f *cb, + void *app_key) { + const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; + asn_enc_rval_t erval = {0, 0, 0}; + const asn_oer_constraints_t *cts = + constraints ? constraints : td->encoding_constraints.oer_constraints; + ssize_t ct_size = cts ? cts->size : -1; + size_t trailing_zeros = 0; + int fix_last_byte = 0; + + if(!st) ASN__ENCODE_FAILED; + + if(st->bits_unused & ~7) { + ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range", + st->bits_unused); + ASN__ENCODE_FAILED; + } + if(st->bits_unused && !(st->size && st->buf)) { + ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name, + st->bits_unused); + ASN__ENCODE_FAILED; + } + + if(ct_size >= 0) { + size_t ct_bytes = (ct_size + 7) >> 3; + if(st->size > ct_bytes) { + ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "", + td->name, 8 * st->size - st->bits_unused, ct_size); + ASN__ENCODE_FAILED; + } + trailing_zeros = ct_bytes - st->size; /* Allow larger constraint */ + } else { + uint8_t ub = st->bits_unused & 7; + ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key); + if(len_len < 0) ASN__ENCODE_FAILED; + if(cb(&ub, 1, app_key) < 0) { + ASN__ENCODE_FAILED; + } + erval.encoded += len_len + 1; + } + + if(st->bits_unused) { + if(st->buf[st->size - 1] & (0xff << st->bits_unused)) { + fix_last_byte = 1; + } + } + + if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) { + ASN__ENCODE_FAILED; + } + + if(fix_last_byte) { + uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused); + if(cb(&b, 1, app_key) < 0) { + ASN__ENCODE_FAILED; + } + } + + erval.encoded += st->size; + + if(trailing_zeros) { + static uint8_t zeros[16]; + while(trailing_zeros > 0) { + int ret; + if(trailing_zeros < sizeof(zeros)) { + ret = cb(zeros, trailing_zeros, app_key); + erval.encoded += trailing_zeros; + } else { + ret = cb(zeros, sizeof(zeros), app_key); + erval.encoded += sizeof(zeros); + } + if(ret < 0) ASN__ENCODE_FAILED; + } + } + + return erval; +} diff --git a/certgen/asncodec/BIT_STRING_print.c b/certgen/asncodec/BIT_STRING_print.c new file mode 100644 index 0000000..bab1ea5 --- /dev/null +++ b/certgen/asncodec/BIT_STRING_print.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * BIT STRING specific contents printer. + */ +int +BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + const char * const h2c = "0123456789ABCDEF"; + char scratch[64]; + const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; + uint8_t *buf; + uint8_t *end; + char *p = scratch; + + (void)td; /* Unused argument */ + + if(!st || !st->buf) + return (cb("", 8, app_key) < 0) ? -1 : 0; + + ilevel++; + buf = st->buf; + end = buf + st->size; + + /* + * Hexadecimal dump. + */ + for(; buf < end; buf++) { + if((buf - st->buf) % 16 == 0 && (st->size > 16) + && buf != st->buf) { + _i_INDENT(1); + /* Dump the string */ + if(cb(scratch, p - scratch, app_key) < 0) return -1; + p = scratch; + } + *p++ = h2c[*buf >> 4]; + *p++ = h2c[*buf & 0x0F]; + *p++ = 0x20; + } + + if(p > scratch) { + p--; /* Eat the tailing space */ + + if((st->size > 16)) { + _i_INDENT(1); + } + + /* Dump the incomplete 16-bytes row */ + if(cb(scratch, p - scratch, app_key) < 0) + return -1; + } + + if(st->bits_unused) { + int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)", + st->bits_unused, st->bits_unused == 1 ? "" : "s"); + assert(ret > 0 && ret < (ssize_t)sizeof(scratch)); + if(ret > 0 && ret < (ssize_t)sizeof(scratch) + && cb(scratch, ret, app_key) < 0) + return -1; + } + + return 0; +} diff --git a/certgen/asncodec/BIT_STRING_xer.c b/certgen/asncodec/BIT_STRING_xer.c new file mode 100644 index 0000000..67d5cb8 --- /dev/null +++ b/certgen/asncodec/BIT_STRING_xer.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +static const char *_bit_pattern[16] = { + "0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", + "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" +}; + +asn_enc_rval_t +BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_enc_rval_t er = {0, 0, 0}; + char scratch[128]; + char *p = scratch; + char *scend = scratch + (sizeof(scratch) - 10); + const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; + int xcan = (flags & XER_F_CANONICAL); + uint8_t *buf; + uint8_t *end; + + if(!st || !st->buf) + ASN__ENCODE_FAILED; + + er.encoded = 0; + + buf = st->buf; + end = buf + st->size - 1; /* Last byte is special */ + + /* + * Binary dump + */ + for(; buf < end; buf++) { + int v = *buf; + int nline = xcan?0:(((buf - st->buf) % 8) == 0); + if(p >= scend || nline) { + ASN__CALLBACK(scratch, p - scratch); + p = scratch; + if(nline) ASN__TEXT_INDENT(1, ilevel); + } + memcpy(p + 0, _bit_pattern[v >> 4], 4); + memcpy(p + 4, _bit_pattern[v & 0x0f], 4); + p += 8; + } + + if(!xcan && ((buf - st->buf) % 8) == 0) + ASN__TEXT_INDENT(1, ilevel); + ASN__CALLBACK(scratch, p - scratch); + p = scratch; + + if(buf == end) { + int v = *buf; + int ubits = st->bits_unused; + int i; + for(i = 7; i >= ubits; i--) + *p++ = (v & (1 << i)) ? 0x31 : 0x30; + ASN__CALLBACK(scratch, p - scratch); + } + + if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); + + ASN__ENCODED_OK(er); +cb_failed: + ASN__ENCODE_FAILED; +} diff --git a/certgen/asncodec/BOOLEAN.c b/certgen/asncodec/BOOLEAN.c index 04741d4..1373a6f 100644 --- a/certgen/asncodec/BOOLEAN.c +++ b/certgen/asncodec/BOOLEAN.c @@ -1,434 +1,128 @@ -/*- - * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * BOOLEAN basic type description. - */ -static const ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)) -}; -asn_TYPE_operation_t asn_OP_BOOLEAN = { - BOOLEAN_free, - BOOLEAN_print, - BOOLEAN_compare, - BOOLEAN_decode_ber, - BOOLEAN_encode_der, - BOOLEAN_decode_xer, - BOOLEAN_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - BOOLEAN_decode_oer, - BOOLEAN_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - BOOLEAN_decode_uper, /* Unaligned PER decoder */ - BOOLEAN_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - BOOLEAN_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_BOOLEAN = { - "BOOLEAN", - "BOOLEAN", - &asn_OP_BOOLEAN, - asn_DEF_BOOLEAN_tags, - sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), - asn_DEF_BOOLEAN_tags, /* Same as above */ - sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), - { 0, 0, asn_generic_no_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -/* - * Decode BOOLEAN type. - */ -asn_dec_rval_t -BOOLEAN_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **bool_value, - const void *buf_ptr, size_t size, int tag_mode) { - BOOLEAN_t *st = (BOOLEAN_t *)*bool_value; - asn_dec_rval_t rval; - ber_tlv_len_t length; - ber_tlv_len_t lidx; - - if(st == NULL) { - st = (BOOLEAN_t *)(*bool_value = CALLOC(1, sizeof(*st))); - if(st == NULL) { - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; - } - } - - ASN_DEBUG("Decoding %s as BOOLEAN (tm=%d)", - td->name, tag_mode); - - /* - * Check tags. - */ - rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); - if(rval.code != RC_OK) - return rval; - - ASN_DEBUG("Boolean length is %d bytes", (int)length); - - buf_ptr = ((const char *)buf_ptr) + rval.consumed; - size -= rval.consumed; - if(length > (ber_tlv_len_t)size) { - rval.code = RC_WMORE; - rval.consumed = 0; - return rval; - } - - /* - * Compute boolean value. - */ - for(*st = 0, lidx = 0; - (lidx < length) && *st == 0; lidx++) { - /* - * Very simple approach: read bytes until the end or - * value is already TRUE. - * BOOLEAN is not supposed to contain meaningful data anyway. - */ - *st |= ((const uint8_t *)buf_ptr)[lidx]; - } - - rval.code = RC_OK; - rval.consumed += length; - - ASN_DEBUG("Took %ld/%ld bytes to encode %s, value=%d", - (long)rval.consumed, (long)length, - td->name, *st); - - return rval; -} - -asn_enc_rval_t -BOOLEAN_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr, - int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, - void *app_key) { - asn_enc_rval_t erval; - const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; - - erval.encoded = der_write_tags(td, 1, tag_mode, 0, tag, cb, app_key); - if(erval.encoded == -1) { - erval.failed_type = td; - erval.structure_ptr = sptr; - return erval; - } - - if(cb) { - uint8_t bool_value; - - bool_value = *st ? 0xff : 0; /* 0xff mandated by DER */ - - if(cb(&bool_value, 1, app_key) < 0) { - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = sptr; - return erval; - } - } - - erval.encoded += 1; - - ASN__ENCODED_OK(erval); -} - - -/* - * Decode the chunk of XML text encoding INTEGER. - */ -static enum xer_pbd_rval -BOOLEAN__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, - const void *chunk_buf, size_t chunk_size) { - BOOLEAN_t *st = (BOOLEAN_t *)sptr; - const char *p = (const char *)chunk_buf; - - (void)td; - - if(chunk_size && p[0] == 0x3c /* '<' */) { - switch(xer_check_tag(chunk_buf, chunk_size, "false")) { - case XCT_BOTH: - /* "" */ - *st = 0; - break; - case XCT_UNKNOWN_BO: - if(xer_check_tag(chunk_buf, chunk_size, "true") - != XCT_BOTH) - return XPBD_BROKEN_ENCODING; - /* "" */ - *st = 1; /* Or 0xff as in DER?.. */ - break; - default: - return XPBD_BROKEN_ENCODING; - } - return XPBD_BODY_CONSUMED; - } else { - return XPBD_BROKEN_ENCODING; - } -} - - -asn_dec_rval_t -BOOLEAN_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, size_t size) { - return xer_decode_primitive(opt_codec_ctx, td, - sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size, - BOOLEAN__xer_body_decode); -} - -asn_enc_rval_t -BOOLEAN_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; - asn_enc_rval_t er = {0, 0, 0}; - - (void)ilevel; - (void)flags; - - if(!st) ASN__ENCODE_FAILED; - - if(*st) { - ASN__CALLBACK("", 7); - } else { - ASN__CALLBACK("", 8); - } - - ASN__ENCODED_OK(er); -cb_failed: - ASN__ENCODE_FAILED; -} - -int -BOOLEAN_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; - const char *buf; - size_t buflen; - - (void)td; /* Unused argument */ - (void)ilevel; /* Unused argument */ - - if(st) { - if(*st) { - buf = "TRUE"; - buflen = 4; - } else { - buf = "FALSE"; - buflen = 5; - } - } else { - buf = ""; - buflen = 8; - } - - return (cb(buf, buflen, app_key) < 0) ? -1 : 0; -} - -void -BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr, - enum asn_struct_free_method method) { - if(td && ptr) { - switch(method) { - case ASFM_FREE_EVERYTHING: - FREEMEM(ptr); - break; - case ASFM_FREE_UNDERLYING: - break; - case ASFM_FREE_UNDERLYING_AND_RESET: - memset(ptr, 0, sizeof(BOOLEAN_t)); - break; - } - } -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_dec_rval_t -BOOLEAN_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - asn_dec_rval_t rv; - BOOLEAN_t *st = (BOOLEAN_t *)*sptr; - - (void)opt_codec_ctx; - (void)td; - (void)constraints; - - if(!st) { - st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st))); - if(!st) ASN__DECODE_FAILED; - } - - /* - * Extract a single bit - */ - switch(per_get_few_bits(pd, 1)) { - case 1: *st = 1; break; - case 0: *st = 0; break; - case -1: default: ASN__DECODE_STARVED; - } - - ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE"); - - rv.code = RC_OK; - rv.consumed = 1; - return rv; -} - - -asn_enc_rval_t -BOOLEAN_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_per_outp_t *po) { - const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; - asn_enc_rval_t er = { 0, 0, 0 }; - - (void)constraints; - - if(!st) ASN__ENCODE_FAILED; - - if(per_put_few_bits(po, *st ? 1 : 0, 1)) - ASN__ENCODE_FAILED; - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -#ifndef ASN_DISABLE_OER_SUPPORT - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -BOOLEAN_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er = { 1, 0, 0 }; - const BOOLEAN_t *st = sptr; - uint8_t bool_value = *st ? 0xff : 0; /* 0xff mandated by OER */ - - (void)td; - (void)constraints; /* Constraints are unused in OER */ - - if(cb(&bool_value, 1, app_key) < 0) { - ASN__ENCODE_FAILED; - } else { - ASN__ENCODED_OK(er); - } -} - -asn_dec_rval_t -BOOLEAN_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **sptr, - const void *ptr, size_t size) { - asn_dec_rval_t ok = {RC_OK, 1}; - BOOLEAN_t *st; - - (void)opt_codec_ctx; - (void)td; - (void)constraints; /* Constraints are unused in OER */ - - if(size < 1) { - ASN__DECODE_STARVED; - } - - if(!(st = *sptr)) { - st = (BOOLEAN_t *)(*sptr = CALLOC(1, sizeof(*st))); - if(!st) ASN__DECODE_FAILED; - } - - *st = *(const uint8_t *)ptr; - - return ok; -} - - - -#endif - -int -BOOLEAN_compare(const asn_TYPE_descriptor_t *td, const void *aptr, - const void *bptr) { - const BOOLEAN_t *a = aptr; - const BOOLEAN_t *b = bptr; - - (void)td; - - if(a && b) { - if(!*a == !*b) { /* TRUE can be encoded by any non-zero byte. */ - return 0; - } else if(!*a) { - return -1; - } else { - return 1; - } - } else if(!a) { - return -1; - } else { - return 1; - } -} - -asn_random_fill_result_t -BOOLEAN_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constraints, - size_t max_length) { - asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - BOOLEAN_t *st = *sptr; - - if(max_length == 0) return result_skipped; - - if(st == NULL) { - st = (BOOLEAN_t *)(*sptr = CALLOC(1, sizeof(*st))); - if(st == NULL) { - return result_failed; - } - } - - if(!constraints || !constraints->per_constraints) - constraints = &td->encoding_constraints; - if(constraints->per_constraints) { - const asn_per_constraint_t *pc = &constraints->per_constraints->value; - if(pc->flags & APC_CONSTRAINED) { - *st = asn_random_between(pc->lower_bound, pc->upper_bound); - return result_ok; - } - } - - /* Simulate booleans that are sloppily set and biased. */ - switch(asn_random_between(0, 7)) { - case 0: - case 1: - case 2: - *st = 0; break; - case 3: *st = -1; break; - case 4: *st = 1; break; - case 5: *st = INT_MIN; break; - case 6: *st = INT_MAX; break; - default: - *st = asn_random_between(INT_MIN, INT_MAX); - break; - } - return result_ok; -} +/*- + * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * BOOLEAN basic type description. + */ +static const ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)) +}; +asn_TYPE_operation_t asn_OP_BOOLEAN = { + BOOLEAN_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + BOOLEAN_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + BOOLEAN_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + BOOLEAN_decode_ber, + BOOLEAN_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + BOOLEAN_decode_xer, + BOOLEAN_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + BOOLEAN_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + BOOLEAN_decode_oer, + BOOLEAN_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + BOOLEAN_decode_uper, /* Unaligned PER decoder */ + BOOLEAN_encode_uper, /* Unaligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + BOOLEAN_decode_aper, /* Aligned PER decoder */ + BOOLEAN_encode_aper, /* Aligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + BOOLEAN_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_BOOLEAN = { + "BOOLEAN", + "BOOLEAN", + &asn_OP_BOOLEAN, + asn_DEF_BOOLEAN_tags, + sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), + asn_DEF_BOOLEAN_tags, /* Same as above */ + sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +void +BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr, + enum asn_struct_free_method method) { + if(td && ptr) { + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(ptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(ptr, 0, sizeof(BOOLEAN_t)); + break; + } + } +} + +int +BOOLEAN_compare(const asn_TYPE_descriptor_t *td, const void *aptr, + const void *bptr) { + const BOOLEAN_t *a = aptr; + const BOOLEAN_t *b = bptr; + + (void)td; + + if(a && b) { + if(!*a == !*b) { /* TRUE can be encoded by any non-zero byte. */ + return 0; + } else if(!*a) { + return -1; + } else { + return 1; + } + } else if(!a) { + return -1; + } else { + return 1; + } +} diff --git a/certgen/asncodec/BOOLEAN.h b/certgen/asncodec/BOOLEAN.h index 1191fde..2cbbe71 100644 --- a/certgen/asncodec/BOOLEAN.h +++ b/certgen/asncodec/BOOLEAN.h @@ -1,43 +1,70 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _BOOLEAN_H_ -#define _BOOLEAN_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The underlying integer may contain various values, but everything - * non-zero is capped to 0xff by the DER encoder. The BER decoder may - * yield non-zero values different from 1, beware. - */ -typedef int BOOLEAN_t; - -extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; -extern asn_TYPE_operation_t asn_OP_BOOLEAN; - -asn_struct_free_f BOOLEAN_free; -asn_struct_print_f BOOLEAN_print; -asn_struct_compare_f BOOLEAN_compare; -ber_type_decoder_f BOOLEAN_decode_ber; -der_type_encoder_f BOOLEAN_encode_der; -oer_type_decoder_f BOOLEAN_decode_oer; -oer_type_encoder_f BOOLEAN_encode_oer; -per_type_decoder_f BOOLEAN_decode_uper; -per_type_encoder_f BOOLEAN_encode_uper; -xer_type_decoder_f BOOLEAN_decode_xer; -xer_type_encoder_f BOOLEAN_encode_xer; -asn_random_fill_f BOOLEAN_random_fill; - -#define BOOLEAN_constraint asn_generic_no_constraint - -#ifdef __cplusplus -} -#endif - -#endif /* _BOOLEAN_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _BOOLEAN_H_ +#define _BOOLEAN_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The underlying integer may contain various values, but everything + * non-zero is capped to 0xff by the DER encoder. The BER decoder may + * yield non-zero values different from 1, beware. + */ +typedef unsigned BOOLEAN_t; + +extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; +extern asn_TYPE_operation_t asn_OP_BOOLEAN; + +asn_struct_free_f BOOLEAN_free; + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f BOOLEAN_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f BOOLEAN_compare; + +#define BOOLEAN_constraint asn_generic_no_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f BOOLEAN_decode_ber; +der_type_encoder_f BOOLEAN_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f BOOLEAN_decode_xer; +xer_type_encoder_f BOOLEAN_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f BOOLEAN_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f BOOLEAN_decode_oer; +oer_type_encoder_f BOOLEAN_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f BOOLEAN_decode_uper; +per_type_encoder_f BOOLEAN_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f BOOLEAN_decode_aper; +per_type_encoder_f BOOLEAN_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f BOOLEAN_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _BOOLEAN_H_ */ diff --git a/certgen/asncodec/BOOLEAN_oer.c b/certgen/asncodec/BOOLEAN_oer.c new file mode 100644 index 0000000..0e92e60 --- /dev/null +++ b/certgen/asncodec/BOOLEAN_oer.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +BOOLEAN_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_enc_rval_t er = { 1, 0, 0 }; + const BOOLEAN_t *st = sptr; + uint8_t bool_value = *st ? 0xff : 0; /* 0xff mandated by OER */ + + (void)td; + (void)constraints; /* Constraints are unused in OER */ + + if(cb(&bool_value, 1, app_key) < 0) { + ASN__ENCODE_FAILED; + } else { + ASN__ENCODED_OK(er); + } +} + +asn_dec_rval_t +BOOLEAN_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **sptr, + const void *ptr, size_t size) { + asn_dec_rval_t ok = {RC_OK, 1}; + BOOLEAN_t *st; + + (void)opt_codec_ctx; + (void)td; + (void)constraints; /* Constraints are unused in OER */ + + if(size < 1) { + ASN__DECODE_STARVED; + } + + if(!(st = *sptr)) { + st = (BOOLEAN_t *)(*sptr = CALLOC(1, sizeof(*st))); + if(!st) ASN__DECODE_FAILED; + } + + *st = *(const uint8_t *)ptr; + + return ok; +} diff --git a/certgen/asncodec/BOOLEAN_print.c b/certgen/asncodec/BOOLEAN_print.c new file mode 100644 index 0000000..23aaade --- /dev/null +++ b/certgen/asncodec/BOOLEAN_print.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +BOOLEAN_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; + const char *buf; + size_t buflen; + + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(st) { + if(*st) { + buf = "TRUE"; + buflen = 4; + } else { + buf = "FALSE"; + buflen = 5; + } + } else { + buf = ""; + buflen = 8; + } + + return (cb(buf, buflen, app_key) < 0) ? -1 : 0; +} diff --git a/certgen/asncodec/BOOLEAN_xer.c b/certgen/asncodec/BOOLEAN_xer.c new file mode 100644 index 0000000..7e9d8f8 --- /dev/null +++ b/certgen/asncodec/BOOLEAN_xer.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include +#include + +/* + * Decode the chunk of XML text encoding INTEGER. + */ +static enum xer_pbd_rval +BOOLEAN__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, + const void *chunk_buf, size_t chunk_size) { + BOOLEAN_t *st = (BOOLEAN_t *)sptr; + const char *p = (const char *)chunk_buf; + + (void)td; + + if(chunk_size && p[0] == 0x3c /* '<' */) { + switch(xer_check_tag(chunk_buf, chunk_size, "false")) { + case XCT_BOTH: + /* "" */ + *st = 0; + break; + case XCT_UNKNOWN_BO: + if(xer_check_tag(chunk_buf, chunk_size, "true") != XCT_BOTH) + return XPBD_BROKEN_ENCODING; + /* "" */ + *st = 1; /* Or 0xff as in DER?.. */ + break; + default: + return XPBD_BROKEN_ENCODING; + } + return XPBD_BODY_CONSUMED; + } else { + return XPBD_BROKEN_ENCODING; + } +} + + +asn_dec_rval_t +BOOLEAN_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, size_t size) { + return xer_decode_primitive(opt_codec_ctx, td, + sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size, + BOOLEAN__xer_body_decode); +} + +asn_enc_rval_t +BOOLEAN_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; + asn_enc_rval_t er = {0, 0, 0}; + + (void)ilevel; + (void)flags; + + if(!st) ASN__ENCODE_FAILED; + + if(*st) { + ASN__CALLBACK("", 7); + } else { + ASN__CALLBACK("", 8); + } + + ASN__ENCODED_OK(er); +cb_failed: + ASN__ENCODE_FAILED; +} diff --git a/certgen/asncodec/BasePublicEncryptionKey.c b/certgen/asncodec/BasePublicEncryptionKey.c index 7a6bb58..35ba5c0 100644 --- a/certgen/asncodec/BasePublicEncryptionKey.c +++ b/certgen/asncodec/BasePublicEncryptionKey.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "BasePublicEncryptionKey.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_BasePublicEncryptionKey_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_BasePublicEncryptionKey_1[] = { { ATF_NOFLAGS, 0, offsetof(struct BasePublicEncryptionKey, choice.eciesNistP256), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP256CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "eciesNistP256" }, @@ -25,14 +35,40 @@ asn_TYPE_member_t asn_MBR_BasePublicEncryptionKey_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP256CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "eciesBrainpoolP256r1" }, + { ATF_NOFLAGS, 0, offsetof(struct BasePublicEncryptionKey, choice.ecencSm2), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_EccP256CurvePoint, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ecencSm2" + }, }; static const asn_TYPE_tag2member_t asn_MAP_BasePublicEncryptionKey_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* eciesNistP256 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* eciesBrainpoolP256r1 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* eciesBrainpoolP256r1 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ecencSm2 */ }; asn_CHOICE_specifics_t asn_SPC_BasePublicEncryptionKey_specs_1 = { sizeof(struct BasePublicEncryptionKey), @@ -40,7 +76,7 @@ asn_CHOICE_specifics_t asn_SPC_BasePublicEncryptionKey_specs_1 = { offsetof(struct BasePublicEncryptionKey, present), sizeof(((struct BasePublicEncryptionKey *)0)->present), asn_MAP_BasePublicEncryptionKey_tag2el_1, - 2, /* Count of tags in the map */ + 3, /* Count of tags in the map */ 0, 0, 2 /* Extensions start */ }; @@ -52,9 +88,17 @@ asn_TYPE_descriptor_t asn_DEF_BasePublicEncryptionKey = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_BasePublicEncryptionKey_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_BasePublicEncryptionKey_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_BasePublicEncryptionKey_1, - 2, /* Elements count */ + 3, /* Elements count */ &asn_SPC_BasePublicEncryptionKey_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/BasePublicEncryptionKey.h b/certgen/asncodec/BasePublicEncryptionKey.h index c5cb3e7..f73f5eb 100644 --- a/certgen/asncodec/BasePublicEncryptionKey.h +++ b/certgen/asncodec/BasePublicEncryptionKey.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EccP256CurvePoint.h" +#include #ifndef _BasePublicEncryptionKey_H_ #define _BasePublicEncryptionKey_H_ #include -/* Including external dependencies */ -#include "EccP256CurvePoint.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -23,9 +23,9 @@ extern "C" { typedef enum BasePublicEncryptionKey_PR { BasePublicEncryptionKey_PR_NOTHING, /* No components present */ BasePublicEncryptionKey_PR_eciesNistP256, - BasePublicEncryptionKey_PR_eciesBrainpoolP256r1 + BasePublicEncryptionKey_PR_eciesBrainpoolP256r1, /* Extensions may appear below */ - + BasePublicEncryptionKey_PR_ecencSm2 } BasePublicEncryptionKey_PR; /* BasePublicEncryptionKey */ @@ -38,6 +38,7 @@ typedef struct BasePublicEncryptionKey { * This type is extensible, * possible extensions are below. */ + EccP256CurvePoint_t ecencSm2; } choice; /* Context for parsing across buffer boundaries */ @@ -47,7 +48,7 @@ typedef struct BasePublicEncryptionKey { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_BasePublicEncryptionKey; extern asn_CHOICE_specifics_t asn_SPC_BasePublicEncryptionKey_specs_1; -extern asn_TYPE_member_t asn_MBR_BasePublicEncryptionKey_1[2]; +extern asn_TYPE_member_t asn_MBR_BasePublicEncryptionKey_1[3]; #ifdef __cplusplus } diff --git a/certgen/asncodec/BitmapSsp.c b/certgen/asncodec/BitmapSsp.c index 364a63f..27be613 100644 --- a/certgen/asncodec/BitmapSsp.c +++ b/certgen/asncodec/BitmapSsp.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "BitmapSsp.h" @@ -37,9 +37,11 @@ BitmapSsp_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_BitmapSsp_constr_1 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(0..31)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_BitmapSsp_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_BitmapSsp = { asn_DEF_BitmapSsp_tags_1, /* Same as above */ sizeof(asn_DEF_BitmapSsp_tags_1) /sizeof(asn_DEF_BitmapSsp_tags_1[0]), /* 1 */ - { &asn_OER_type_BitmapSsp_constr_1, 0, BitmapSsp_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_BitmapSsp_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + BitmapSsp_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/BitmapSsp.h b/certgen/asncodec/BitmapSsp.h index dd7ff6d..592ed1b 100644 --- a/certgen/asncodec/BitmapSsp.h +++ b/certgen/asncodec/BitmapSsp.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _BitmapSsp_H_ #define _BitmapSsp_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_BitmapSsp; asn_struct_free_f BitmapSsp_free; asn_struct_print_f BitmapSsp_print; asn_constr_check_f BitmapSsp_constraint; -ber_type_decoder_f BitmapSsp_decode_ber; -der_type_encoder_f BitmapSsp_encode_der; xer_type_decoder_f BitmapSsp_decode_xer; xer_type_encoder_f BitmapSsp_encode_xer; oer_type_decoder_f BitmapSsp_decode_oer; diff --git a/certgen/asncodec/BitmapSspRange.c b/certgen/asncodec/BitmapSspRange.c index 2284a28..b02f88f 100644 --- a/certgen/asncodec/BitmapSspRange.c +++ b/certgen/asncodec/BitmapSspRange.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "BitmapSspRange.h" @@ -59,19 +59,31 @@ memb_sspBitmask_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_sspValue_constr_2 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(1..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_sspBitmask_constr_3 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(1..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_BitmapSspRange_1[] = { { ATF_NOFLAGS, 0, offsetof(struct BitmapSspRange, sspValue), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_sspValue_constr_2, 0, memb_sspValue_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_sspValue_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_sspValue_constraint_1 + }, 0, 0, /* No default value */ "sspValue" }, @@ -80,7 +92,15 @@ asn_TYPE_member_t asn_MBR_BitmapSspRange_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_sspBitmask_constr_3, 0, memb_sspBitmask_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_sspBitmask_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_sspBitmask_constraint_1 + }, 0, 0, /* No default value */ "sspBitmask" }, @@ -110,7 +130,15 @@ asn_TYPE_descriptor_t asn_DEF_BitmapSspRange = { asn_DEF_BitmapSspRange_tags_1, /* Same as above */ sizeof(asn_DEF_BitmapSspRange_tags_1) /sizeof(asn_DEF_BitmapSspRange_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_BitmapSspRange_1, 2, /* Elements count */ &asn_SPC_BitmapSspRange_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/BitmapSspRange.h b/certgen/asncodec/BitmapSspRange.h index 2c08e8a..47fd99a 100644 --- a/certgen/asncodec/BitmapSspRange.h +++ b/certgen/asncodec/BitmapSspRange.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _BitmapSspRange_H_ #define _BitmapSspRange_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/BlindedKey.c b/certgen/asncodec/BlindedKey.c new file mode 100644 index 0000000..cacbb35 --- /dev/null +++ b/certgen/asncodec/BlindedKey.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "BlindedKey.h" + +/* + * This type is implemented using EccP256CurvePoint, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_BlindedKey_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_descriptor_t asn_DEF_BlindedKey = { + "BlindedKey", + "BlindedKey", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_EccP256CurvePoint_1, + 5, /* Elements count */ + &asn_SPC_EccP256CurvePoint_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/BlindedKey.h b/certgen/asncodec/BlindedKey.h new file mode 100644 index 0000000..0d46124 --- /dev/null +++ b/certgen/asncodec/BlindedKey.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EccP256CurvePoint.h" +#ifndef _BlindedKey_H_ +#define _BlindedKey_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* BlindedKey */ +typedef EccP256CurvePoint_t BlindedKey_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_BlindedKey; +asn_struct_free_f BlindedKey_free; +asn_struct_print_f BlindedKey_print; +asn_constr_check_f BlindedKey_constraint; +xer_type_decoder_f BlindedKey_decode_xer; +xer_type_encoder_f BlindedKey_encode_xer; +oer_type_decoder_f BlindedKey_decode_oer; +oer_type_encoder_f BlindedKey_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _BlindedKey_H_ */ +#include diff --git a/certgen/asncodec/ButterflyAtDownloadRequestMessage.c b/certgen/asncodec/ButterflyAtDownloadRequestMessage.c new file mode 100644 index 0000000..2cdae21 --- /dev/null +++ b/certgen/asncodec/ButterflyAtDownloadRequestMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ButterflyAtDownloadRequestMessage.h" + +int +ButterflyAtDownloadRequestMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ButterflyAtDownloadRequestMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ButterflyAtDownloadRequestMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ButterflyAtDownloadRequestMessage = { + "ButterflyAtDownloadRequestMessage", + "ButterflyAtDownloadRequestMessage", + &asn_OP_SEQUENCE, + asn_DEF_ButterflyAtDownloadRequestMessage_tags_1, + sizeof(asn_DEF_ButterflyAtDownloadRequestMessage_tags_1) + /sizeof(asn_DEF_ButterflyAtDownloadRequestMessage_tags_1[0]), /* 1 */ + asn_DEF_ButterflyAtDownloadRequestMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_ButterflyAtDownloadRequestMessage_tags_1) + /sizeof(asn_DEF_ButterflyAtDownloadRequestMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ButterflyAtDownloadRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ButterflyAtDownloadRequestMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ButterflyAtDownloadRequestMessage.h b/certgen/asncodec/ButterflyAtDownloadRequestMessage.h new file mode 100644 index 0000000..aa2a792 --- /dev/null +++ b/certgen/asncodec/ButterflyAtDownloadRequestMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" +#ifndef _ButterflyAtDownloadRequestMessage_H_ +#define _ButterflyAtDownloadRequestMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ButterflyAtDownloadRequestMessage */ +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t ButterflyAtDownloadRequestMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ButterflyAtDownloadRequestMessage; +asn_struct_free_f ButterflyAtDownloadRequestMessage_free; +asn_struct_print_f ButterflyAtDownloadRequestMessage_print; +asn_constr_check_f ButterflyAtDownloadRequestMessage_constraint; +xer_type_decoder_f ButterflyAtDownloadRequestMessage_decode_xer; +xer_type_encoder_f ButterflyAtDownloadRequestMessage_encode_xer; +oer_type_decoder_f ButterflyAtDownloadRequestMessage_decode_oer; +oer_type_encoder_f ButterflyAtDownloadRequestMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ButterflyAtDownloadRequestMessage_H_ */ +#include diff --git a/certgen/asncodec/ButterflyAuthorizationRequestMessage.c b/certgen/asncodec/ButterflyAuthorizationRequestMessage.c new file mode 100644 index 0000000..efe2970 --- /dev/null +++ b/certgen/asncodec/ButterflyAuthorizationRequestMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ButterflyAuthorizationRequestMessage.h" + +int +ButterflyAuthorizationRequestMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ButterflyAuthorizationRequestMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ButterflyAuthorizationRequestMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ButterflyAuthorizationRequestMessage = { + "ButterflyAuthorizationRequestMessage", + "ButterflyAuthorizationRequestMessage", + &asn_OP_SEQUENCE, + asn_DEF_ButterflyAuthorizationRequestMessage_tags_1, + sizeof(asn_DEF_ButterflyAuthorizationRequestMessage_tags_1) + /sizeof(asn_DEF_ButterflyAuthorizationRequestMessage_tags_1[0]), /* 1 */ + asn_DEF_ButterflyAuthorizationRequestMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_ButterflyAuthorizationRequestMessage_tags_1) + /sizeof(asn_DEF_ButterflyAuthorizationRequestMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ButterflyAuthorizationRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ButterflyAuthorizationRequestMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ButterflyAuthorizationRequestMessage.h b/certgen/asncodec/ButterflyAuthorizationRequestMessage.h new file mode 100644 index 0000000..f05d59f --- /dev/null +++ b/certgen/asncodec/ButterflyAuthorizationRequestMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" +#ifndef _ButterflyAuthorizationRequestMessage_H_ +#define _ButterflyAuthorizationRequestMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ButterflyAuthorizationRequestMessage */ +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t ButterflyAuthorizationRequestMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ButterflyAuthorizationRequestMessage; +asn_struct_free_f ButterflyAuthorizationRequestMessage_free; +asn_struct_print_f ButterflyAuthorizationRequestMessage_print; +asn_constr_check_f ButterflyAuthorizationRequestMessage_constraint; +xer_type_decoder_f ButterflyAuthorizationRequestMessage_decode_xer; +xer_type_encoder_f ButterflyAuthorizationRequestMessage_encode_xer; +oer_type_decoder_f ButterflyAuthorizationRequestMessage_decode_oer; +oer_type_encoder_f ButterflyAuthorizationRequestMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ButterflyAuthorizationRequestMessage_H_ */ +#include diff --git a/certgen/asncodec/ButterflyAuthorizationResponseMessage.c b/certgen/asncodec/ButterflyAuthorizationResponseMessage.c new file mode 100644 index 0000000..3cc412b --- /dev/null +++ b/certgen/asncodec/ButterflyAuthorizationResponseMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ButterflyAuthorizationResponseMessage.h" + +int +ButterflyAuthorizationResponseMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_Signed_63P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ButterflyAuthorizationResponseMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ButterflyAuthorizationResponseMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ButterflyAuthorizationResponseMessage = { + "ButterflyAuthorizationResponseMessage", + "ButterflyAuthorizationResponseMessage", + &asn_OP_SEQUENCE, + asn_DEF_ButterflyAuthorizationResponseMessage_tags_1, + sizeof(asn_DEF_ButterflyAuthorizationResponseMessage_tags_1) + /sizeof(asn_DEF_ButterflyAuthorizationResponseMessage_tags_1[0]), /* 1 */ + asn_DEF_ButterflyAuthorizationResponseMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_ButterflyAuthorizationResponseMessage_tags_1) + /sizeof(asn_DEF_ButterflyAuthorizationResponseMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ButterflyAuthorizationResponseMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ButterflyAuthorizationResponseMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ButterflyAuthorizationResponseMessage.h b/certgen/asncodec/ButterflyAuthorizationResponseMessage.h new file mode 100644 index 0000000..bb4a3ee --- /dev/null +++ b/certgen/asncodec/ButterflyAuthorizationResponseMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" +#ifndef _ButterflyAuthorizationResponseMessage_H_ +#define _ButterflyAuthorizationResponseMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ButterflyAuthorizationResponseMessage */ +typedef EtsiTs103097Data_Signed_63P0_t ButterflyAuthorizationResponseMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ButterflyAuthorizationResponseMessage; +asn_struct_free_f ButterflyAuthorizationResponseMessage_free; +asn_struct_print_f ButterflyAuthorizationResponseMessage_print; +asn_constr_check_f ButterflyAuthorizationResponseMessage_constraint; +xer_type_decoder_f ButterflyAuthorizationResponseMessage_decode_xer; +xer_type_encoder_f ButterflyAuthorizationResponseMessage_encode_xer; +oer_type_decoder_f ButterflyAuthorizationResponseMessage_decode_oer; +oer_type_encoder_f ButterflyAuthorizationResponseMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ButterflyAuthorizationResponseMessage_H_ */ +#include diff --git a/certgen/asncodec/ButterflyCertRequestMessage.c b/certgen/asncodec/ButterflyCertRequestMessage.c new file mode 100644 index 0000000..6beff72 --- /dev/null +++ b/certgen/asncodec/ButterflyCertRequestMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ButterflyCertRequestMessage.h" + +int +ButterflyCertRequestMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ButterflyCertRequestMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ButterflyCertRequestMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ButterflyCertRequestMessage = { + "ButterflyCertRequestMessage", + "ButterflyCertRequestMessage", + &asn_OP_SEQUENCE, + asn_DEF_ButterflyCertRequestMessage_tags_1, + sizeof(asn_DEF_ButterflyCertRequestMessage_tags_1) + /sizeof(asn_DEF_ButterflyCertRequestMessage_tags_1[0]), /* 1 */ + asn_DEF_ButterflyCertRequestMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_ButterflyCertRequestMessage_tags_1) + /sizeof(asn_DEF_ButterflyCertRequestMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ButterflyCertRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ButterflyCertRequestMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ButterflyCertRequestMessage.h b/certgen/asncodec/ButterflyCertRequestMessage.h new file mode 100644 index 0000000..85240f1 --- /dev/null +++ b/certgen/asncodec/ButterflyCertRequestMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" +#ifndef _ButterflyCertRequestMessage_H_ +#define _ButterflyCertRequestMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ButterflyCertRequestMessage */ +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t ButterflyCertRequestMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ButterflyCertRequestMessage; +asn_struct_free_f ButterflyCertRequestMessage_free; +asn_struct_print_f ButterflyCertRequestMessage_print; +asn_constr_check_f ButterflyCertRequestMessage_constraint; +xer_type_decoder_f ButterflyCertRequestMessage_decode_xer; +xer_type_encoder_f ButterflyCertRequestMessage_encode_xer; +oer_type_decoder_f ButterflyCertRequestMessage_decode_oer; +oer_type_encoder_f ButterflyCertRequestMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ButterflyCertRequestMessage_H_ */ +#include diff --git a/certgen/asncodec/ButterflyCertResponseMessage.c b/certgen/asncodec/ButterflyCertResponseMessage.c new file mode 100644 index 0000000..ecdaff7 --- /dev/null +++ b/certgen/asncodec/ButterflyCertResponseMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ButterflyCertResponseMessage.h" + +int +ButterflyCertResponseMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ButterflyCertResponseMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ButterflyCertResponseMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ButterflyCertResponseMessage = { + "ButterflyCertResponseMessage", + "ButterflyCertResponseMessage", + &asn_OP_SEQUENCE, + asn_DEF_ButterflyCertResponseMessage_tags_1, + sizeof(asn_DEF_ButterflyCertResponseMessage_tags_1) + /sizeof(asn_DEF_ButterflyCertResponseMessage_tags_1[0]), /* 1 */ + asn_DEF_ButterflyCertResponseMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_ButterflyCertResponseMessage_tags_1) + /sizeof(asn_DEF_ButterflyCertResponseMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ButterflyCertResponseMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ButterflyCertResponseMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ButterflyCertResponseMessage.h b/certgen/asncodec/ButterflyCertResponseMessage.h new file mode 100644 index 0000000..d2aee9e --- /dev/null +++ b/certgen/asncodec/ButterflyCertResponseMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" +#ifndef _ButterflyCertResponseMessage_H_ +#define _ButterflyCertResponseMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ButterflyCertResponseMessage */ +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t ButterflyCertResponseMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ButterflyCertResponseMessage; +asn_struct_free_f ButterflyCertResponseMessage_free; +asn_struct_print_f ButterflyCertResponseMessage_print; +asn_constr_check_f ButterflyCertResponseMessage_constraint; +xer_type_decoder_f ButterflyCertResponseMessage_decode_xer; +xer_type_encoder_f ButterflyCertResponseMessage_encode_xer; +oer_type_decoder_f ButterflyCertResponseMessage_decode_oer; +oer_type_encoder_f ButterflyCertResponseMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ButterflyCertResponseMessage_H_ */ +#include diff --git a/certgen/asncodec/ButterflyExpansion.c b/certgen/asncodec/ButterflyExpansion.c new file mode 100644 index 0000000..a494a2b --- /dev/null +++ b/certgen/asncodec/ButterflyExpansion.c @@ -0,0 +1,99 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ButterflyExpansion.h" + +static int +memb_aes128_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 16)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_aes128_constr_2 CC_NOTUSED = { + { 0, 0 }, + 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ButterflyExpansion_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_ButterflyExpansion_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ButterflyExpansion, choice.aes128), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_aes128_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_aes128_constraint_1 + }, + 0, 0, /* No default value */ + "aes128" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_ButterflyExpansion_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* aes128 */ +}; +asn_CHOICE_specifics_t asn_SPC_ButterflyExpansion_specs_1 = { + sizeof(struct ButterflyExpansion), + offsetof(struct ButterflyExpansion, _asn_ctx), + offsetof(struct ButterflyExpansion, present), + sizeof(((struct ButterflyExpansion *)0)->present), + asn_MAP_ButterflyExpansion_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, + 1 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_ButterflyExpansion = { + "ButterflyExpansion", + "ButterflyExpansion", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ButterflyExpansion_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_ButterflyExpansion_1, + 1, /* Elements count */ + &asn_SPC_ButterflyExpansion_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ButterflyExpansion.h b/certgen/asncodec/ButterflyExpansion.h new file mode 100644 index 0000000..3ac2b54 --- /dev/null +++ b/certgen/asncodec/ButterflyExpansion.h @@ -0,0 +1,55 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _ButterflyExpansion_H_ +#define _ButterflyExpansion_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum ButterflyExpansion_PR { + ButterflyExpansion_PR_NOTHING, /* No components present */ + ButterflyExpansion_PR_aes128 + /* Extensions may appear below */ + +} ButterflyExpansion_PR; + +/* ButterflyExpansion */ +typedef struct ButterflyExpansion { + ButterflyExpansion_PR present; + union ButterflyExpansion_u { + OCTET_STRING_t aes128; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ButterflyExpansion_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ButterflyExpansion; +extern asn_CHOICE_specifics_t asn_SPC_ButterflyExpansion_specs_1; +extern asn_TYPE_member_t asn_MBR_ButterflyExpansion_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ButterflyExpansion_H_ */ +#include diff --git a/certgen/asncodec/ButterflyParamsOriginal.c b/certgen/asncodec/ButterflyParamsOriginal.c new file mode 100644 index 0000000..a33f2c6 --- /dev/null +++ b/certgen/asncodec/ButterflyParamsOriginal.c @@ -0,0 +1,102 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ButterflyParamsOriginal.h" + +asn_TYPE_member_t asn_MBR_ButterflyParamsOriginal_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ButterflyParamsOriginal, signingExpansion), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_ButterflyExpansion, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "signingExpansion" + }, + { ATF_NOFLAGS, 0, offsetof(struct ButterflyParamsOriginal, encryptionKey), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_PublicEncryptionKey, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "encryptionKey" + }, + { ATF_NOFLAGS, 0, offsetof(struct ButterflyParamsOriginal, encryptionExpansion), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_ButterflyExpansion, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "encryptionExpansion" + }, +}; +static const ber_tlv_tag_t asn_DEF_ButterflyParamsOriginal_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ButterflyParamsOriginal_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* signingExpansion */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* encryptionKey */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* encryptionExpansion */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ButterflyParamsOriginal_specs_1 = { + sizeof(struct ButterflyParamsOriginal), + offsetof(struct ButterflyParamsOriginal, _asn_ctx), + asn_MAP_ButterflyParamsOriginal_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ButterflyParamsOriginal = { + "ButterflyParamsOriginal", + "ButterflyParamsOriginal", + &asn_OP_SEQUENCE, + asn_DEF_ButterflyParamsOriginal_tags_1, + sizeof(asn_DEF_ButterflyParamsOriginal_tags_1) + /sizeof(asn_DEF_ButterflyParamsOriginal_tags_1[0]), /* 1 */ + asn_DEF_ButterflyParamsOriginal_tags_1, /* Same as above */ + sizeof(asn_DEF_ButterflyParamsOriginal_tags_1) + /sizeof(asn_DEF_ButterflyParamsOriginal_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ButterflyParamsOriginal_1, + 3, /* Elements count */ + &asn_SPC_ButterflyParamsOriginal_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ButterflyParamsOriginal.h b/certgen/asncodec/ButterflyParamsOriginal.h new file mode 100644 index 0000000..58dd4c8 --- /dev/null +++ b/certgen/asncodec/ButterflyParamsOriginal.h @@ -0,0 +1,43 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ButterflyExpansion.h" +#include "PublicEncryptionKey.h" +#include +#ifndef _ButterflyParamsOriginal_H_ +#define _ButterflyParamsOriginal_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ButterflyParamsOriginal */ +typedef struct ButterflyParamsOriginal { + ButterflyExpansion_t signingExpansion; + PublicEncryptionKey_t encryptionKey; + ButterflyExpansion_t encryptionExpansion; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ButterflyParamsOriginal_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ButterflyParamsOriginal; +extern asn_SEQUENCE_specifics_t asn_SPC_ButterflyParamsOriginal_specs_1; +extern asn_TYPE_member_t asn_MBR_ButterflyParamsOriginal_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ButterflyParamsOriginal_H_ */ +#include diff --git a/certgen/asncodec/CaCertificateRekeyingMessage.c b/certgen/asncodec/CaCertificateRekeyingMessage.c index 73558ca..eae16cb 100644 --- a/certgen/asncodec/CaCertificateRekeyingMessage.c +++ b/certgen/asncodec/CaCertificateRekeyingMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CaCertificateRekeyingMessage.h" @@ -27,12 +27,14 @@ CaCertificateRekeyingMessage_constraint(const asn_TYPE_descriptor_t *td, const v } /* - * This type is implemented using EtsiTs103097Data_Signed_60P1, + * This type is implemented using EtsiTs103097Data_Signed_63P1, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CaCertificateRekeyingMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_CaCertificateRekeyingMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_CaCertificateRekeyingMessage = { asn_DEF_CaCertificateRekeyingMessage_tags_1, /* Same as above */ sizeof(asn_DEF_CaCertificateRekeyingMessage_tags_1) /sizeof(asn_DEF_CaCertificateRekeyingMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_CaCertificateRekeyingMessage_constr_1, 0, CaCertificateRekeyingMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CaCertificateRekeyingMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CaCertificateRekeyingMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CaCertificateRekeyingMessage.h b/certgen/asncodec/CaCertificateRekeyingMessage.h index 14e291d..2384095 100644 --- a/certgen/asncodec/CaCertificateRekeyingMessage.h +++ b/certgen/asncodec/CaCertificateRekeyingMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" #ifndef _CaCertificateRekeyingMessage_H_ #define _CaCertificateRekeyingMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Signed.h" - #ifdef __cplusplus extern "C" { #endif /* CaCertificateRekeyingMessage */ -typedef EtsiTs103097Data_Signed_60P1_t CaCertificateRekeyingMessage_t; +typedef EtsiTs103097Data_Signed_63P1_t CaCertificateRekeyingMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CaCertificateRekeyingMessage; asn_struct_free_f CaCertificateRekeyingMessage_free; asn_struct_print_f CaCertificateRekeyingMessage_print; asn_constr_check_f CaCertificateRekeyingMessage_constraint; -ber_type_decoder_f CaCertificateRekeyingMessage_decode_ber; -der_type_encoder_f CaCertificateRekeyingMessage_encode_der; xer_type_decoder_f CaCertificateRekeyingMessage_decode_xer; xer_type_encoder_f CaCertificateRekeyingMessage_encode_xer; oer_type_decoder_f CaCertificateRekeyingMessage_decode_oer; diff --git a/certgen/asncodec/CaCertificateRequest.c b/certgen/asncodec/CaCertificateRequest.c index 83a2377..7952a89 100644 --- a/certgen/asncodec/CaCertificateRequest.c +++ b/certgen/asncodec/CaCertificateRequest.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesCaManagement" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesCaManagement.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesCaManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CaCertificateRequest.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_CaCertificateRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PublicKeys, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "publicKeys" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_CaCertificateRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CertificateSubjectAttributes, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "requestedSubjectAttributes" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_CaCertificateRequest = { asn_DEF_CaCertificateRequest_tags_1, /* Same as above */ sizeof(asn_DEF_CaCertificateRequest_tags_1) /sizeof(asn_DEF_CaCertificateRequest_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_CaCertificateRequest_1, 2, /* Elements count */ &asn_SPC_CaCertificateRequest_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CaCertificateRequest.h b/certgen/asncodec/CaCertificateRequest.h index d84ef63..3a7b22e 100644 --- a/certgen/asncodec/CaCertificateRequest.h +++ b/certgen/asncodec/CaCertificateRequest.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesCaManagement" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesCaManagement.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesCaManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CaCertificateRequest_H_ -#define _CaCertificateRequest_H_ - - -#include /* Including external dependencies */ #include "PublicKeys.h" #include "CertificateSubjectAttributes.h" #include +#ifndef _CaCertificateRequest_H_ +#define _CaCertificateRequest_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/CaCertificateRequestMessage.c b/certgen/asncodec/CaCertificateRequestMessage.c index 7b38ddc..d99bdea 100644 --- a/certgen/asncodec/CaCertificateRequestMessage.c +++ b/certgen/asncodec/CaCertificateRequestMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CaCertificateRequestMessage.h" @@ -27,12 +27,14 @@ CaCertificateRequestMessage_constraint(const asn_TYPE_descriptor_t *td, const vo } /* - * This type is implemented using EtsiTs103097Data_Signed_60P0, + * This type is implemented using EtsiTs103097Data_Signed_63P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CaCertificateRequestMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_CaCertificateRequestMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_CaCertificateRequestMessage = { asn_DEF_CaCertificateRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_CaCertificateRequestMessage_tags_1) /sizeof(asn_DEF_CaCertificateRequestMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_CaCertificateRequestMessage_constr_1, 0, CaCertificateRequestMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CaCertificateRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CaCertificateRequestMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CaCertificateRequestMessage.h b/certgen/asncodec/CaCertificateRequestMessage.h index 868430b..7fd4955 100644 --- a/certgen/asncodec/CaCertificateRequestMessage.h +++ b/certgen/asncodec/CaCertificateRequestMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" #ifndef _CaCertificateRequestMessage_H_ #define _CaCertificateRequestMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Signed.h" - #ifdef __cplusplus extern "C" { #endif /* CaCertificateRequestMessage */ -typedef EtsiTs103097Data_Signed_60P0_t CaCertificateRequestMessage_t; +typedef EtsiTs103097Data_Signed_63P0_t CaCertificateRequestMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CaCertificateRequestMessage; asn_struct_free_f CaCertificateRequestMessage_free; asn_struct_print_f CaCertificateRequestMessage_print; asn_constr_check_f CaCertificateRequestMessage_constraint; -ber_type_decoder_f CaCertificateRequestMessage_decode_ber; -der_type_encoder_f CaCertificateRequestMessage_encode_der; xer_type_decoder_f CaCertificateRequestMessage_decode_xer; xer_type_encoder_f CaCertificateRequestMessage_encode_xer; oer_type_decoder_f CaCertificateRequestMessage_decode_oer; diff --git a/certgen/asncodec/CamRaBatchResponse.c b/certgen/asncodec/CamRaBatchResponse.c new file mode 100644 index 0000000..2f52528 --- /dev/null +++ b/certgen/asncodec/CamRaBatchResponse.c @@ -0,0 +1,185 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CamRaBatchResponse.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_batch_4[] = { + { ATF_POINTER, 0, 0, + -1 /* Ambiguous tag (CHOICE?) */, + 0, + &asn_DEF_BlindedKey, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_batch_tags_4[] = { + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_batch_specs_4 = { + sizeof(struct CamRaBatchResponse__batch), + offsetof(struct CamRaBatchResponse__batch, _asn_ctx), + 2, /* XER encoding is XMLValueList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_batch_4 = { + "batch", + "batch", + &asn_OP_SEQUENCE_OF, + asn_DEF_batch_tags_4, + sizeof(asn_DEF_batch_tags_4) + /sizeof(asn_DEF_batch_tags_4[0]) - 1, /* 1 */ + asn_DEF_batch_tags_4, /* Same as above */ + sizeof(asn_DEF_batch_tags_4) + /sizeof(asn_DEF_batch_tags_4[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_batch_4, + 1, /* Single element */ + &asn_SPC_batch_specs_4 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_CamRaBatchResponse_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CamRaBatchResponse, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct CamRaBatchResponse, requestHash), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "requestHash" + }, + { ATF_NOFLAGS, 0, offsetof(struct CamRaBatchResponse, batch), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + 0, + &asn_DEF_batch_4, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "batch" + }, +}; +static const ber_tlv_tag_t asn_DEF_CamRaBatchResponse_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CamRaBatchResponse_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* requestHash */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* batch */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CamRaBatchResponse_specs_1 = { + sizeof(struct CamRaBatchResponse), + offsetof(struct CamRaBatchResponse, _asn_ctx), + asn_MAP_CamRaBatchResponse_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 3, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CamRaBatchResponse = { + "CamRaBatchResponse", + "CamRaBatchResponse", + &asn_OP_SEQUENCE, + asn_DEF_CamRaBatchResponse_tags_1, + sizeof(asn_DEF_CamRaBatchResponse_tags_1) + /sizeof(asn_DEF_CamRaBatchResponse_tags_1[0]), /* 1 */ + asn_DEF_CamRaBatchResponse_tags_1, /* Same as above */ + sizeof(asn_DEF_CamRaBatchResponse_tags_1) + /sizeof(asn_DEF_CamRaBatchResponse_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CamRaBatchResponse_1, + 3, /* Elements count */ + &asn_SPC_CamRaBatchResponse_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CamRaBatchResponse.h b/certgen/asncodec/CamRaBatchResponse.h new file mode 100644 index 0000000..0142190 --- /dev/null +++ b/certgen/asncodec/CamRaBatchResponse.h @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "HashedId8.h" +#include +#include +#include +#ifndef _CamRaBatchResponse_H_ +#define _CamRaBatchResponse_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct BlindedKey; + +/* CamRaBatchResponse */ +typedef struct CamRaBatchResponse { + Uint8_t version; + HashedId8_t requestHash; + struct CamRaBatchResponse__batch { + A_SEQUENCE_OF(struct BlindedKey) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } batch; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CamRaBatchResponse_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CamRaBatchResponse; +extern asn_SEQUENCE_specifics_t asn_SPC_CamRaBatchResponse_specs_1; +extern asn_TYPE_member_t asn_MBR_CamRaBatchResponse_1[3]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "BlindedKey.h" + +#endif /* _CamRaBatchResponse_H_ */ +#include diff --git a/certgen/asncodec/CamRaInterfacePdu.c b/certgen/asncodec/CamRaInterfacePdu.c new file mode 100644 index 0000000..a601a1d --- /dev/null +++ b/certgen/asncodec/CamRaInterfacePdu.c @@ -0,0 +1,86 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CamRaInterfacePdu.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CamRaInterfacePdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_CamRaInterfacePdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CamRaInterfacePdu, choice.raCamBatchRequest), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaCamBatchRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "raCamBatchRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct CamRaInterfacePdu, choice.camRaBatchResponse), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CamRaBatchResponse, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "camRaBatchResponse" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_CamRaInterfacePdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* raCamBatchRequest */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* camRaBatchResponse */ +}; +static asn_CHOICE_specifics_t asn_SPC_CamRaInterfacePdu_specs_1 = { + sizeof(struct CamRaInterfacePdu), + offsetof(struct CamRaInterfacePdu, _asn_ctx), + offsetof(struct CamRaInterfacePdu, present), + sizeof(((struct CamRaInterfacePdu *)0)->present), + asn_MAP_CamRaInterfacePdu_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, + 2 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_CamRaInterfacePdu = { + "CamRaInterfacePdu", + "CamRaInterfacePdu", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CamRaInterfacePdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_CamRaInterfacePdu_1, + 2, /* Elements count */ + &asn_SPC_CamRaInterfacePdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CamRaInterfacePdu.h b/certgen/asncodec/CamRaInterfacePdu.h new file mode 100644 index 0000000..42c3d80 --- /dev/null +++ b/certgen/asncodec/CamRaInterfacePdu.h @@ -0,0 +1,56 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "RaCamBatchRequest.h" +#include "CamRaBatchResponse.h" +#include +#ifndef _CamRaInterfacePdu_H_ +#define _CamRaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum CamRaInterfacePdu_PR { + CamRaInterfacePdu_PR_NOTHING, /* No components present */ + CamRaInterfacePdu_PR_raCamBatchRequest, + CamRaInterfacePdu_PR_camRaBatchResponse + /* Extensions may appear below */ + +} CamRaInterfacePdu_PR; + +/* CamRaInterfacePdu */ +typedef struct CamRaInterfacePdu { + CamRaInterfacePdu_PR present; + union CamRaInterfacePdu_u { + RaCamBatchRequest_t raCamBatchRequest; + CamRaBatchResponse_t camRaBatchResponse; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CamRaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CamRaInterfacePdu; + +#ifdef __cplusplus +} +#endif + +#endif /* _CamRaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/CamSsp.c b/certgen/asncodec/CamSsp.c new file mode 100644 index 0000000..a8c7a35 --- /dev/null +++ b/certgen/asncodec/CamSsp.c @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CamSsp.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CamSsp_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_CamSsp_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_AcpcTreeId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_CamSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_CamSsp_specs_1 = { + sizeof(struct CamSsp), + offsetof(struct CamSsp, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_CamSsp = { + "CamSsp", + "CamSsp", + &asn_OP_SEQUENCE_OF, + asn_DEF_CamSsp_tags_1, + sizeof(asn_DEF_CamSsp_tags_1) + /sizeof(asn_DEF_CamSsp_tags_1[0]), /* 1 */ + asn_DEF_CamSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_CamSsp_tags_1) + /sizeof(asn_DEF_CamSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CamSsp_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_CamSsp_1, + 1, /* Single element */ + &asn_SPC_CamSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CamSsp.h b/certgen/asncodec/CamSsp.h new file mode 100644 index 0000000..611d763 --- /dev/null +++ b/certgen/asncodec/CamSsp.h @@ -0,0 +1,41 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "AcpcTreeId.h" +#include +#include +#ifndef _CamSsp_H_ +#define _CamSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CamSsp */ +typedef struct CamSsp { + A_SEQUENCE_OF(AcpcTreeId_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CamSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CamSsp; +extern asn_SET_OF_specifics_t asn_SPC_CamSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_CamSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CamSsp_H_ */ +#include diff --git a/certgen/asncodec/CertIssueExtension.c b/certgen/asncodec/CertIssueExtension.c new file mode 100644 index 0000000..e240c65 --- /dev/null +++ b/certgen/asncodec/CertIssueExtension.c @@ -0,0 +1,226 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CertIssueExtension.h" + +static const long asn_VAL_2_certExtId_OperatingOrganization = 1; +static const asn_ioc_cell_t asn_IOS_SetCertExtensions_1_rows[] = { + { "&id", aioc__value, &asn_DEF_ExtId, &asn_VAL_2_certExtId_OperatingOrganization }, + { "&App", aioc__type, &asn_DEF_OperatingOrganizationId }, + { "&Issue", aioc__type, &asn_DEF_NULL }, + { "&Req", aioc__type, &asn_DEF_NULL } +}; +static const asn_ioc_set_t asn_IOS_SetCertExtensions_1[] = { + { 1, 4, asn_IOS_SetCertExtensions_1_rows } +}; +static int +memb_specific_constraint_3(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +static int +memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_specific_constr_4 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_permissions_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_id_constr_2 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_permissions_3[] = { + { ATF_NOFLAGS, 0, offsetof(struct CertIssueExtension__permissions, choice.specific), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_ANY, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_specific_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_specific_constraint_3 + }, + 0, 0, /* No default value */ + "specific" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertIssueExtension__permissions, choice.all), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_NULL, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "all" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_permissions_tag2el_3[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* specific */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* all */ +}; +static asn_CHOICE_specifics_t asn_SPC_permissions_specs_3 = { + sizeof(struct CertIssueExtension__permissions), + offsetof(struct CertIssueExtension__permissions, _asn_ctx), + offsetof(struct CertIssueExtension__permissions, present), + sizeof(((struct CertIssueExtension__permissions *)0)->present), + asn_MAP_permissions_tag2el_3, + 2, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_permissions_3 = { + "permissions", + "permissions", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_permissions_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_permissions_3, + 2, /* Elements count */ + &asn_SPC_permissions_specs_3 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_CertIssueExtension_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CertIssueExtension, id), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ExtId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_id_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_id_constraint_1 + }, + 0, 0, /* No default value */ + "id" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertIssueExtension, permissions), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_permissions_3, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "permissions" + }, +}; +static const ber_tlv_tag_t asn_DEF_CertIssueExtension_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CertIssueExtension_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* id */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* permissions */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CertIssueExtension_specs_1 = { + sizeof(struct CertIssueExtension), + offsetof(struct CertIssueExtension, _asn_ctx), + asn_MAP_CertIssueExtension_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CertIssueExtension = { + "CertIssueExtension", + "CertIssueExtension", + &asn_OP_SEQUENCE, + asn_DEF_CertIssueExtension_tags_1, + sizeof(asn_DEF_CertIssueExtension_tags_1) + /sizeof(asn_DEF_CertIssueExtension_tags_1[0]), /* 1 */ + asn_DEF_CertIssueExtension_tags_1, /* Same as above */ + sizeof(asn_DEF_CertIssueExtension_tags_1) + /sizeof(asn_DEF_CertIssueExtension_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CertIssueExtension_1, + 2, /* Elements count */ + &asn_SPC_CertIssueExtension_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CertIssueExtension.h b/certgen/asncodec/CertIssueExtension.h new file mode 100644 index 0000000..5a722c7 --- /dev/null +++ b/certgen/asncodec/CertIssueExtension.h @@ -0,0 +1,62 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ExtId.h" +#include +#include "OperatingOrganizationId.h" +#include +#include +#include +#include +#ifndef _CertIssueExtension_H_ +#define _CertIssueExtension_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum CertIssueExtension__permissions_PR { + CertIssueExtension__permissions_PR_NOTHING, /* No components present */ + CertIssueExtension__permissions_PR_specific, + CertIssueExtension__permissions_PR_all +} CertIssueExtension__permissions_PR; + +/* CertIssueExtension */ +typedef struct CertIssueExtension { + ExtId_t id; + struct CertIssueExtension__permissions { + CertIssueExtension__permissions_PR present; + union CertIssueExtension__permissions_u { + ANY_t specific; + NULL_t all; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } permissions; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CertIssueExtension_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CertIssueExtension; +extern asn_SEQUENCE_specifics_t asn_SPC_CertIssueExtension_specs_1; +extern asn_TYPE_member_t asn_MBR_CertIssueExtension_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CertIssueExtension_H_ */ +#include diff --git a/certgen/asncodec/CertManagementPdu.c b/certgen/asncodec/CertManagementPdu.c new file mode 100644 index 0000000..ac4cc5f --- /dev/null +++ b/certgen/asncodec/CertManagementPdu.c @@ -0,0 +1,140 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CertManagementPdu.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CertManagementPdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_CertManagementPdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CertManagementPdu, choice.compositeCrl), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CompositeCrl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "compositeCrl" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertManagementPdu, choice.certificateChain), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CertificateChain, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certificateChain" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertManagementPdu, choice.multiSignedCtl), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_MultiSignedCtl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "multiSignedCtl" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertManagementPdu, choice.tbsCtlSignature), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedCtlSignature, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "tbsCtlSignature" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertManagementPdu, choice.infoStatus), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CertificateManagementInfoStatus, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "infoStatus" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_CertManagementPdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* compositeCrl */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* certificateChain */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* multiSignedCtl */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* tbsCtlSignature */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* infoStatus */ +}; +asn_CHOICE_specifics_t asn_SPC_CertManagementPdu_specs_1 = { + sizeof(struct CertManagementPdu), + offsetof(struct CertManagementPdu, _asn_ctx), + offsetof(struct CertManagementPdu, present), + sizeof(((struct CertManagementPdu *)0)->present), + asn_MAP_CertManagementPdu_tag2el_1, + 5, /* Count of tags in the map */ + 0, 0, + 5 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_CertManagementPdu = { + "CertManagementPdu", + "CertManagementPdu", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertManagementPdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_CertManagementPdu_1, + 5, /* Elements count */ + &asn_SPC_CertManagementPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CertManagementPdu.h b/certgen/asncodec/CertManagementPdu.h new file mode 100644 index 0000000..4983217 --- /dev/null +++ b/certgen/asncodec/CertManagementPdu.h @@ -0,0 +1,67 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "CompositeCrl.h" +#include "CertificateChain.h" +#include "MultiSignedCtl.h" +#include "ToBeSignedCtlSignature.h" +#include "CertificateManagementInfoStatus.h" +#include +#ifndef _CertManagementPdu_H_ +#define _CertManagementPdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum CertManagementPdu_PR { + CertManagementPdu_PR_NOTHING, /* No components present */ + CertManagementPdu_PR_compositeCrl, + CertManagementPdu_PR_certificateChain, + CertManagementPdu_PR_multiSignedCtl, + CertManagementPdu_PR_tbsCtlSignature, + CertManagementPdu_PR_infoStatus + /* Extensions may appear below */ + +} CertManagementPdu_PR; + +/* CertManagementPdu */ +typedef struct CertManagementPdu { + CertManagementPdu_PR present; + union CertManagementPdu_u { + CompositeCrl_t compositeCrl; + CertificateChain_t certificateChain; + MultiSignedCtl_t multiSignedCtl; + ToBeSignedCtlSignature_t tbsCtlSignature; + CertificateManagementInfoStatus_t infoStatus; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CertManagementPdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CertManagementPdu; +extern asn_CHOICE_specifics_t asn_SPC_CertManagementPdu_specs_1; +extern asn_TYPE_member_t asn_MBR_CertManagementPdu_1[5]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CertManagementPdu_H_ */ +#include diff --git a/certgen/asncodec/CertRequestExtension.c b/certgen/asncodec/CertRequestExtension.c new file mode 100644 index 0000000..e8887c2 --- /dev/null +++ b/certgen/asncodec/CertRequestExtension.c @@ -0,0 +1,226 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CertRequestExtension.h" + +static const long asn_VAL_2_certExtId_OperatingOrganization = 1; +static const asn_ioc_cell_t asn_IOS_SetCertExtensions_1_rows[] = { + { "&id", aioc__value, &asn_DEF_ExtId, &asn_VAL_2_certExtId_OperatingOrganization }, + { "&App", aioc__type, &asn_DEF_OperatingOrganizationId }, + { "&Issue", aioc__type, &asn_DEF_NULL }, + { "&Req", aioc__type, &asn_DEF_NULL } +}; +static const asn_ioc_set_t asn_IOS_SetCertExtensions_1[] = { + { 1, 4, asn_IOS_SetCertExtensions_1_rows } +}; +static int +memb_content_constraint_3(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +static int +memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_content_constr_4 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_permissions_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_id_constr_2 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_permissions_3[] = { + { ATF_NOFLAGS, 0, offsetof(struct CertRequestExtension__permissions, choice.content), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_ANY, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_content_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_content_constraint_3 + }, + 0, 0, /* No default value */ + "content" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertRequestExtension__permissions, choice.all), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_NULL, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "all" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_permissions_tag2el_3[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* content */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* all */ +}; +static asn_CHOICE_specifics_t asn_SPC_permissions_specs_3 = { + sizeof(struct CertRequestExtension__permissions), + offsetof(struct CertRequestExtension__permissions, _asn_ctx), + offsetof(struct CertRequestExtension__permissions, present), + sizeof(((struct CertRequestExtension__permissions *)0)->present), + asn_MAP_permissions_tag2el_3, + 2, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_permissions_3 = { + "permissions", + "permissions", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_permissions_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_permissions_3, + 2, /* Elements count */ + &asn_SPC_permissions_specs_3 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_CertRequestExtension_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CertRequestExtension, id), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ExtId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_id_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_id_constraint_1 + }, + 0, 0, /* No default value */ + "id" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertRequestExtension, permissions), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_permissions_3, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "permissions" + }, +}; +static const ber_tlv_tag_t asn_DEF_CertRequestExtension_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CertRequestExtension_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* id */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* permissions */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CertRequestExtension_specs_1 = { + sizeof(struct CertRequestExtension), + offsetof(struct CertRequestExtension, _asn_ctx), + asn_MAP_CertRequestExtension_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CertRequestExtension = { + "CertRequestExtension", + "CertRequestExtension", + &asn_OP_SEQUENCE, + asn_DEF_CertRequestExtension_tags_1, + sizeof(asn_DEF_CertRequestExtension_tags_1) + /sizeof(asn_DEF_CertRequestExtension_tags_1[0]), /* 1 */ + asn_DEF_CertRequestExtension_tags_1, /* Same as above */ + sizeof(asn_DEF_CertRequestExtension_tags_1) + /sizeof(asn_DEF_CertRequestExtension_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CertRequestExtension_1, + 2, /* Elements count */ + &asn_SPC_CertRequestExtension_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CertRequestExtension.h b/certgen/asncodec/CertRequestExtension.h new file mode 100644 index 0000000..321d5db --- /dev/null +++ b/certgen/asncodec/CertRequestExtension.h @@ -0,0 +1,62 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ExtId.h" +#include +#include "OperatingOrganizationId.h" +#include +#include +#include +#include +#ifndef _CertRequestExtension_H_ +#define _CertRequestExtension_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum CertRequestExtension__permissions_PR { + CertRequestExtension__permissions_PR_NOTHING, /* No components present */ + CertRequestExtension__permissions_PR_content, + CertRequestExtension__permissions_PR_all +} CertRequestExtension__permissions_PR; + +/* CertRequestExtension */ +typedef struct CertRequestExtension { + ExtId_t id; + struct CertRequestExtension__permissions { + CertRequestExtension__permissions_PR present; + union CertRequestExtension__permissions_u { + ANY_t content; + NULL_t all; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } permissions; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CertRequestExtension_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CertRequestExtension; +extern asn_SEQUENCE_specifics_t asn_SPC_CertRequestExtension_specs_1; +extern asn_TYPE_member_t asn_MBR_CertRequestExtension_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CertRequestExtension_H_ */ +#include diff --git a/certgen/asncodec/Certificate.c b/certgen/asncodec/Certificate.c index 6da4c98..ffc208f 100644 --- a/certgen/asncodec/Certificate.c +++ b/certgen/asncodec/Certificate.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Certificate.h" @@ -30,9 +30,11 @@ Certificate_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using CertificateBase, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Certificate_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_Certificate = { asn_DEF_Certificate_tags_1, /* Same as above */ sizeof(asn_DEF_Certificate_tags_1) /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */ - { &asn_OER_type_Certificate_constr_1, 0, Certificate_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Certificate_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Certificate_constraint + }, asn_MBR_CertificateBase_1, 5, /* Elements count */ &asn_SPC_CertificateBase_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/Certificate.h b/certgen/asncodec/Certificate.h index b89a163..3416ab6 100644 --- a/certgen/asncodec/Certificate.h +++ b/certgen/asncodec/Certificate.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "CertificateBase.h" #ifndef _Certificate_H_ #define _Certificate_H_ #include -/* Including external dependencies */ -#include "CertificateBase.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Certificate; asn_struct_free_f Certificate_free; asn_struct_print_f Certificate_print; asn_constr_check_f Certificate_constraint; -ber_type_decoder_f Certificate_decode_ber; -der_type_encoder_f Certificate_encode_der; xer_type_decoder_f Certificate_decode_xer; xer_type_encoder_f Certificate_encode_xer; oer_type_decoder_f Certificate_decode_oer; diff --git a/certgen/asncodec/CertificateBase.c b/certgen/asncodec/CertificateBase.c index 5a4a4ac..7f82973 100644 --- a/certgen/asncodec/CertificateBase.c +++ b/certgen/asncodec/CertificateBase.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CertificateBase.h" @@ -32,16 +32,26 @@ memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { { 1, 1 } /* (3..3) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_CertificateBase_1[] = { { ATF_NOFLAGS, 0, offsetof(struct CertificateBase, version), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint8, 0, - { &asn_OER_memb_version_constr_2, 0, memb_version_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, 0, 0, /* No default value */ "version" }, @@ -50,7 +60,15 @@ asn_TYPE_member_t asn_MBR_CertificateBase_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CertificateType, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "type" }, @@ -59,7 +77,15 @@ asn_TYPE_member_t asn_MBR_CertificateBase_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_IssuerIdentifier, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "issuer" }, @@ -68,7 +94,15 @@ asn_TYPE_member_t asn_MBR_CertificateBase_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ToBeSignedCertificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "toBeSigned" }, @@ -77,7 +111,15 @@ asn_TYPE_member_t asn_MBR_CertificateBase_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_Signature, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "signature" }, @@ -112,7 +154,15 @@ asn_TYPE_descriptor_t asn_DEF_CertificateBase = { asn_DEF_CertificateBase_tags_1, /* Same as above */ sizeof(asn_DEF_CertificateBase_tags_1) /sizeof(asn_DEF_CertificateBase_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_CertificateBase_1, 5, /* Elements count */ &asn_SPC_CertificateBase_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CertificateBase.h b/certgen/asncodec/CertificateBase.h index 7c0aa8b..3cd1931 100644 --- a/certgen/asncodec/CertificateBase.h +++ b/certgen/asncodec/CertificateBase.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CertificateBase_H_ -#define _CertificateBase_H_ - - -#include /* Including external dependencies */ #include "Uint8.h" @@ -17,6 +12,11 @@ #include "IssuerIdentifier.h" #include "ToBeSignedCertificate.h" #include +#ifndef _CertificateBase_H_ +#define _CertificateBase_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -31,7 +31,7 @@ typedef struct CertificateBase { CertificateType_t type; IssuerIdentifier_t issuer; ToBeSignedCertificate_t toBeSigned; - struct Signature *signature /* OPTIONAL */; + struct Signature *signature; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/CertificateChain.c b/certgen/asncodec/CertificateChain.c new file mode 100644 index 0000000..b21bc82 --- /dev/null +++ b/certgen/asncodec/CertificateChain.c @@ -0,0 +1,166 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CertificateChain.h" + +static int +memb_others_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_others_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_others_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_others_3[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_Certificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_others_tags_3[] = { + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_others_specs_3 = { + sizeof(struct CertificateChain__others), + offsetof(struct CertificateChain__others, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_others_3 = { + "others", + "others", + &asn_OP_SEQUENCE_OF, + asn_DEF_others_tags_3, + sizeof(asn_DEF_others_tags_3) + /sizeof(asn_DEF_others_tags_3[0]) - 1, /* 1 */ + asn_DEF_others_tags_3, /* Same as above */ + sizeof(asn_DEF_others_tags_3) + /sizeof(asn_DEF_others_tags_3[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_others_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_others_3, + 1, /* Single element */ + &asn_SPC_others_specs_3 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_CertificateChain_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CertificateChain, homeCtl), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_MultiSignedCtlSpdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "homeCtl" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertificateChain, others), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + 0, + &asn_DEF_others_3, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_others_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_others_constraint_1 + }, + 0, 0, /* No default value */ + "others" + }, +}; +static const ber_tlv_tag_t asn_DEF_CertificateChain_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CertificateChain_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* homeCtl */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* others */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CertificateChain_specs_1 = { + sizeof(struct CertificateChain), + offsetof(struct CertificateChain, _asn_ctx), + asn_MAP_CertificateChain_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CertificateChain = { + "CertificateChain", + "CertificateChain", + &asn_OP_SEQUENCE, + asn_DEF_CertificateChain_tags_1, + sizeof(asn_DEF_CertificateChain_tags_1) + /sizeof(asn_DEF_CertificateChain_tags_1[0]), /* 1 */ + asn_DEF_CertificateChain_tags_1, /* Same as above */ + sizeof(asn_DEF_CertificateChain_tags_1) + /sizeof(asn_DEF_CertificateChain_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CertificateChain_1, + 2, /* Elements count */ + &asn_SPC_CertificateChain_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CertificateChain.h b/certgen/asncodec/CertificateChain.h new file mode 100644 index 0000000..c57e941 --- /dev/null +++ b/certgen/asncodec/CertificateChain.h @@ -0,0 +1,58 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "MultiSignedCtlSpdu.h" +#include +#include +#include +#ifndef _CertificateChain_H_ +#define _CertificateChain_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct Certificate; + +/* CertificateChain */ +typedef struct CertificateChain { + MultiSignedCtlSpdu_t homeCtl; + struct CertificateChain__others { + A_SEQUENCE_OF(struct Certificate) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } others; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CertificateChain_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CertificateChain; +extern asn_SEQUENCE_specifics_t asn_SPC_CertificateChain_specs_1; +extern asn_TYPE_member_t asn_MBR_CertificateChain_1[2]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "Certificate.h" + +#endif /* _CertificateChain_H_ */ +#include diff --git a/certgen/asncodec/CertificateChainSpdu.c b/certgen/asncodec/CertificateChainSpdu.c new file mode 100644 index 0000000..74731f9 --- /dev/null +++ b/certgen/asncodec/CertificateChainSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CertificateChainSpdu.h" + +int +CertificateChainSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Unsecured_216P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CertificateChainSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CertificateChainSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CertificateChainSpdu = { + "CertificateChainSpdu", + "CertificateChainSpdu", + &asn_OP_SEQUENCE, + asn_DEF_CertificateChainSpdu_tags_1, + sizeof(asn_DEF_CertificateChainSpdu_tags_1) + /sizeof(asn_DEF_CertificateChainSpdu_tags_1[0]), /* 1 */ + asn_DEF_CertificateChainSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_CertificateChainSpdu_tags_1) + /sizeof(asn_DEF_CertificateChainSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertificateChainSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CertificateChainSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CertificateChainSpdu.h b/certgen/asncodec/CertificateChainSpdu.h new file mode 100644 index 0000000..b42bca3 --- /dev/null +++ b/certgen/asncodec/CertificateChainSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Unsecured.h" +#ifndef _CertificateChainSpdu_H_ +#define _CertificateChainSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CertificateChainSpdu */ +typedef Ieee1609Dot2Data_Unsecured_216P0_t CertificateChainSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CertificateChainSpdu; +asn_struct_free_f CertificateChainSpdu_free; +asn_struct_print_f CertificateChainSpdu_print; +asn_constr_check_f CertificateChainSpdu_constraint; +xer_type_decoder_f CertificateChainSpdu_decode_xer; +xer_type_encoder_f CertificateChainSpdu_encode_xer; +oer_type_decoder_f CertificateChainSpdu_decode_oer; +oer_type_encoder_f CertificateChainSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CertificateChainSpdu_H_ */ +#include diff --git a/certgen/asncodec/CertificateFormat.c b/certgen/asncodec/CertificateFormat.c index 48c82a4..f76fbff 100644 --- a/certgen/asncodec/CertificateFormat.c +++ b/certgen/asncodec/CertificateFormat.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CertificateFormat.h" @@ -36,9 +36,11 @@ CertificateFormat_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CertificateFormat_constr_1 CC_NOTUSED = { { 1, 1 } /* (1..255) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_CertificateFormat_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_CertificateFormat = { asn_DEF_CertificateFormat_tags_1, /* Same as above */ sizeof(asn_DEF_CertificateFormat_tags_1) /sizeof(asn_DEF_CertificateFormat_tags_1[0]), /* 1 */ - { &asn_OER_type_CertificateFormat_constr_1, 0, CertificateFormat_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertificateFormat_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CertificateFormat_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/CertificateFormat.h b/certgen/asncodec/CertificateFormat.h index 011c56f..0660fd7 100644 --- a/certgen/asncodec/CertificateFormat.h +++ b/certgen/asncodec/CertificateFormat.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _CertificateFormat_H_ #define _CertificateFormat_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -31,8 +31,6 @@ extern asn_TYPE_descriptor_t asn_DEF_CertificateFormat; asn_struct_free_f CertificateFormat_free; asn_struct_print_f CertificateFormat_print; asn_constr_check_f CertificateFormat_constraint; -ber_type_decoder_f CertificateFormat_decode_ber; -der_type_encoder_f CertificateFormat_encode_der; xer_type_decoder_f CertificateFormat_decode_xer; xer_type_encoder_f CertificateFormat_encode_xer; oer_type_decoder_f CertificateFormat_decode_oer; diff --git a/certgen/asncodec/CertificateId.c b/certgen/asncodec/CertificateId.c index cbf9963..bcfaf26 100644 --- a/certgen/asncodec/CertificateId.c +++ b/certgen/asncodec/CertificateId.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CertificateId.h" @@ -33,19 +33,31 @@ memb_binaryId_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_binaryId_constr_4 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(1..64)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CertificateId_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_CertificateId_1[] = { { ATF_NOFLAGS, 0, offsetof(struct CertificateId, choice.linkageData), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_LinkageData, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "linkageData" }, @@ -54,7 +66,15 @@ asn_TYPE_member_t asn_MBR_CertificateId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Hostname, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "name" }, @@ -63,7 +83,15 @@ asn_TYPE_member_t asn_MBR_CertificateId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_binaryId_constr_4, 0, memb_binaryId_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_binaryId_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_binaryId_constraint_1 + }, 0, 0, /* No default value */ "binaryId" }, @@ -72,7 +100,15 @@ asn_TYPE_member_t asn_MBR_CertificateId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NULL, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "none" }, @@ -101,7 +137,15 @@ asn_TYPE_descriptor_t asn_DEF_CertificateId = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_CertificateId_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertificateId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_CertificateId_1, 4, /* Elements count */ &asn_SPC_CertificateId_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CertificateId.h b/certgen/asncodec/CertificateId.h index 141f236..685d9d3 100644 --- a/certgen/asncodec/CertificateId.h +++ b/certgen/asncodec/CertificateId.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CertificateId_H_ -#define _CertificateId_H_ - - -#include /* Including external dependencies */ #include "LinkageData.h" @@ -17,6 +12,11 @@ #include #include #include +#ifndef _CertificateId_H_ +#define _CertificateId_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/CertificateManagementInfoStatus.c b/certgen/asncodec/CertificateManagementInfoStatus.c new file mode 100644 index 0000000..ffa40d2 --- /dev/null +++ b/certgen/asncodec/CertificateManagementInfoStatus.c @@ -0,0 +1,140 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CertificateManagementInfoStatus.h" + +asn_TYPE_member_t asn_MBR_CertificateManagementInfoStatus_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CertificateManagementInfoStatus, crl), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfCrlInfoStatus, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "crl" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertificateManagementInfoStatus, ctl), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfCtlInfoStatus, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ctl" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertificateManagementInfoStatus, caCcf), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "caCcf" + }, + { ATF_NOFLAGS, 0, offsetof(struct CertificateManagementInfoStatus, ma), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfMaInfoStatus, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ma" + }, + { ATF_POINTER, 1, offsetof(struct CertificateManagementInfoStatus, ra), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ra" + }, +}; +static const int asn_MAP_CertificateManagementInfoStatus_oms_1[] = { 4 }; +static const ber_tlv_tag_t asn_DEF_CertificateManagementInfoStatus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CertificateManagementInfoStatus_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* crl */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ctl */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* caCcf */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ma */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* ra */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CertificateManagementInfoStatus_specs_1 = { + sizeof(struct CertificateManagementInfoStatus), + offsetof(struct CertificateManagementInfoStatus, _asn_ctx), + asn_MAP_CertificateManagementInfoStatus_tag2el_1, + 5, /* Count of tags in the map */ + asn_MAP_CertificateManagementInfoStatus_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 5, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CertificateManagementInfoStatus = { + "CertificateManagementInfoStatus", + "CertificateManagementInfoStatus", + &asn_OP_SEQUENCE, + asn_DEF_CertificateManagementInfoStatus_tags_1, + sizeof(asn_DEF_CertificateManagementInfoStatus_tags_1) + /sizeof(asn_DEF_CertificateManagementInfoStatus_tags_1[0]), /* 1 */ + asn_DEF_CertificateManagementInfoStatus_tags_1, /* Same as above */ + sizeof(asn_DEF_CertificateManagementInfoStatus_tags_1) + /sizeof(asn_DEF_CertificateManagementInfoStatus_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CertificateManagementInfoStatus_1, + 5, /* Elements count */ + &asn_SPC_CertificateManagementInfoStatus_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CertificateManagementInfoStatus.h b/certgen/asncodec/CertificateManagementInfoStatus.h new file mode 100644 index 0000000..25a7531 --- /dev/null +++ b/certgen/asncodec/CertificateManagementInfoStatus.h @@ -0,0 +1,51 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "SequenceOfCrlInfoStatus.h" +#include "SequenceOfCtlInfoStatus.h" +#include "Time32.h" +#include "SequenceOfMaInfoStatus.h" +#include +#ifndef _CertificateManagementInfoStatus_H_ +#define _CertificateManagementInfoStatus_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CertificateManagementInfoStatus */ +typedef struct CertificateManagementInfoStatus { + SequenceOfCrlInfoStatus_t crl; + SequenceOfCtlInfoStatus_t ctl; + Time32_t caCcf; + SequenceOfMaInfoStatus_t ma; + Time32_t *ra; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CertificateManagementInfoStatus_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CertificateManagementInfoStatus; +extern asn_SEQUENCE_specifics_t asn_SPC_CertificateManagementInfoStatus_specs_1; +extern asn_TYPE_member_t asn_MBR_CertificateManagementInfoStatus_1[5]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CertificateManagementInfoStatus_H_ */ +#include diff --git a/certgen/asncodec/CertificateManagementInformationStatusSpdu.c b/certgen/asncodec/CertificateManagementInformationStatusSpdu.c new file mode 100644 index 0000000..2c3aaa2 --- /dev/null +++ b/certgen/asncodec/CertificateManagementInformationStatusSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CertificateManagementInformationStatusSpdu.h" + +int +CertificateManagementInformationStatusSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CertificateManagementInformationStatusSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CertificateManagementInformationStatusSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CertificateManagementInformationStatusSpdu = { + "CertificateManagementInformationStatusSpdu", + "CertificateManagementInformationStatusSpdu", + &asn_OP_SEQUENCE, + asn_DEF_CertificateManagementInformationStatusSpdu_tags_1, + sizeof(asn_DEF_CertificateManagementInformationStatusSpdu_tags_1) + /sizeof(asn_DEF_CertificateManagementInformationStatusSpdu_tags_1[0]), /* 1 */ + asn_DEF_CertificateManagementInformationStatusSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_CertificateManagementInformationStatusSpdu_tags_1) + /sizeof(asn_DEF_CertificateManagementInformationStatusSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertificateManagementInformationStatusSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CertificateManagementInformationStatusSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CertificateManagementInformationStatusSpdu.h b/certgen/asncodec/CertificateManagementInformationStatusSpdu.h new file mode 100644 index 0000000..6081b5f --- /dev/null +++ b/certgen/asncodec/CertificateManagementInformationStatusSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _CertificateManagementInformationStatusSpdu_H_ +#define _CertificateManagementInformationStatusSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CertificateManagementInformationStatusSpdu */ +typedef Ieee1609Dot2Data_Signed_228P2_t CertificateManagementInformationStatusSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CertificateManagementInformationStatusSpdu; +asn_struct_free_f CertificateManagementInformationStatusSpdu_free; +asn_struct_print_f CertificateManagementInformationStatusSpdu_print; +asn_constr_check_f CertificateManagementInformationStatusSpdu_constraint; +xer_type_decoder_f CertificateManagementInformationStatusSpdu_decode_xer; +xer_type_encoder_f CertificateManagementInformationStatusSpdu_encode_xer; +oer_type_decoder_f CertificateManagementInformationStatusSpdu_decode_oer; +oer_type_encoder_f CertificateManagementInformationStatusSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CertificateManagementInformationStatusSpdu_H_ */ +#include diff --git a/certgen/asncodec/CertificateRevocationListMessage.c b/certgen/asncodec/CertificateRevocationListMessage.c index 77cb643..b84234e 100644 --- a/certgen/asncodec/CertificateRevocationListMessage.c +++ b/certgen/asncodec/CertificateRevocationListMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CertificateRevocationListMessage.h" @@ -27,12 +27,14 @@ CertificateRevocationListMessage_constraint(const asn_TYPE_descriptor_t *td, con } /* - * This type is implemented using EtsiTs103097Data_Signed_60P0, + * This type is implemented using EtsiTs103097Data_Signed_63P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CertificateRevocationListMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_CertificateRevocationListMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_CertificateRevocationListMessage = { asn_DEF_CertificateRevocationListMessage_tags_1, /* Same as above */ sizeof(asn_DEF_CertificateRevocationListMessage_tags_1) /sizeof(asn_DEF_CertificateRevocationListMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_CertificateRevocationListMessage_constr_1, 0, CertificateRevocationListMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertificateRevocationListMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CertificateRevocationListMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CertificateRevocationListMessage.h b/certgen/asncodec/CertificateRevocationListMessage.h index 683fcb8..29a37fd 100644 --- a/certgen/asncodec/CertificateRevocationListMessage.h +++ b/certgen/asncodec/CertificateRevocationListMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" #ifndef _CertificateRevocationListMessage_H_ #define _CertificateRevocationListMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Signed.h" - #ifdef __cplusplus extern "C" { #endif /* CertificateRevocationListMessage */ -typedef EtsiTs103097Data_Signed_60P0_t CertificateRevocationListMessage_t; +typedef EtsiTs103097Data_Signed_63P0_t CertificateRevocationListMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CertificateRevocationListMessage; asn_struct_free_f CertificateRevocationListMessage_free; asn_struct_print_f CertificateRevocationListMessage_print; asn_constr_check_f CertificateRevocationListMessage_constraint; -ber_type_decoder_f CertificateRevocationListMessage_decode_ber; -der_type_encoder_f CertificateRevocationListMessage_encode_der; xer_type_decoder_f CertificateRevocationListMessage_decode_xer; xer_type_encoder_f CertificateRevocationListMessage_encode_xer; oer_type_decoder_f CertificateRevocationListMessage_decode_oer; diff --git a/certgen/asncodec/CertificateSubjectAttributes.c b/certgen/asncodec/CertificateSubjectAttributes.c index f3e29c4..4871fda 100644 --- a/certgen/asncodec/CertificateSubjectAttributes.c +++ b/certgen/asncodec/CertificateSubjectAttributes.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CertificateSubjectAttributes.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CertificateSubjectAttributes_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_CertificateSubjectAttributes_1[] = { { ATF_POINTER, 6, offsetof(struct CertificateSubjectAttributes, id), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_CertificateId, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "id" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_CertificateSubjectAttributes_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ValidityPeriod, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "validityPeriod" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_CertificateSubjectAttributes_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_GeographicRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "region" }, @@ -43,7 +69,15 @@ asn_TYPE_member_t asn_MBR_CertificateSubjectAttributes_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SubjectAssurance, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "assuranceLevel" }, @@ -52,7 +86,15 @@ asn_TYPE_member_t asn_MBR_CertificateSubjectAttributes_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfPsidSsp, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "appPermissions" }, @@ -61,7 +103,15 @@ asn_TYPE_member_t asn_MBR_CertificateSubjectAttributes_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfPsidGroupPermissions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certIssuePermissions" }, @@ -97,7 +147,15 @@ asn_TYPE_descriptor_t asn_DEF_CertificateSubjectAttributes = { asn_DEF_CertificateSubjectAttributes_tags_1, /* Same as above */ sizeof(asn_DEF_CertificateSubjectAttributes_tags_1) /sizeof(asn_DEF_CertificateSubjectAttributes_tags_1[0]), /* 1 */ - { &asn_OER_type_CertificateSubjectAttributes_constr_1, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertificateSubjectAttributes_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_CertificateSubjectAttributes_1, 6, /* Elements count */ &asn_SPC_CertificateSubjectAttributes_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CertificateSubjectAttributes.h b/certgen/asncodec/CertificateSubjectAttributes.h index 65ca149..65d0da4 100644 --- a/certgen/asncodec/CertificateSubjectAttributes.h +++ b/certgen/asncodec/CertificateSubjectAttributes.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "SubjectAssurance.h" +#include #ifndef _CertificateSubjectAttributes_H_ #define _CertificateSubjectAttributes_H_ #include -/* Including external dependencies */ -#include "SubjectAssurance.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -28,12 +28,12 @@ struct SequenceOfPsidGroupPermissions; /* CertificateSubjectAttributes */ typedef struct CertificateSubjectAttributes { - struct CertificateId *id /* OPTIONAL */; - struct ValidityPeriod *validityPeriod /* OPTIONAL */; - struct GeographicRegion *region /* OPTIONAL */; - SubjectAssurance_t *assuranceLevel /* OPTIONAL */; - struct SequenceOfPsidSsp *appPermissions /* OPTIONAL */; - struct SequenceOfPsidGroupPermissions *certIssuePermissions /* OPTIONAL */; + struct CertificateId *id; /* OPTIONAL */ + struct ValidityPeriod *validityPeriod; /* OPTIONAL */ + struct GeographicRegion *region; /* OPTIONAL */ + SubjectAssurance_t *assuranceLevel; /* OPTIONAL */ + struct SequenceOfPsidSsp *appPermissions; /* OPTIONAL */ + struct SequenceOfPsidGroupPermissions *certIssuePermissions; /* OPTIONAL */ /* * This type is extensible, * possible extensions are below. diff --git a/certgen/asncodec/CertificateType.c b/certgen/asncodec/CertificateType.c index 2628441..ff35abf 100644 --- a/certgen/asncodec/CertificateType.c +++ b/certgen/asncodec/CertificateType.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CertificateType.h" @@ -11,9 +11,11 @@ * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CertificateType_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const asn_INTEGER_enum_map_t asn_MAP_CertificateType_value2enum_1[] = { { 0, 8, "explicit" }, { 1, 8, "implicit" } @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_CertificateType = { asn_DEF_CertificateType_tags_1, /* Same as above */ sizeof(asn_DEF_CertificateType_tags_1) /sizeof(asn_DEF_CertificateType_tags_1[0]), /* 1 */ - { &asn_OER_type_CertificateType_constr_1, 0, NativeEnumerated_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CertificateType_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeEnumerated_constraint + }, 0, 0, /* Defined elsewhere */ &asn_SPC_CertificateType_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/CertificateType.h b/certgen/asncodec/CertificateType.h index 946fec4..8223d3f 100644 --- a/certgen/asncodec/CertificateType.h +++ b/certgen/asncodec/CertificateType.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _CertificateType_H_ #define _CertificateType_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -36,8 +36,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_CertificateType_specs_1; asn_struct_free_f CertificateType_free; asn_struct_print_f CertificateType_print; asn_constr_check_f CertificateType_constraint; -ber_type_decoder_f CertificateType_decode_ber; -der_type_encoder_f CertificateType_encode_der; xer_type_decoder_f CertificateType_decode_xer; xer_type_encoder_f CertificateType_encode_xer; oer_type_decoder_f CertificateType_decode_oer; diff --git a/certgen/asncodec/CircularRegion.c b/certgen/asncodec/CircularRegion.c index bcc1199..a07c69f 100644 --- a/certgen/asncodec/CircularRegion.c +++ b/certgen/asncodec/CircularRegion.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CircularRegion.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_CircularRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_TwoDLocation, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "center" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_CircularRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "radius" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_CircularRegion = { asn_DEF_CircularRegion_tags_1, /* Same as above */ sizeof(asn_DEF_CircularRegion_tags_1) /sizeof(asn_DEF_CircularRegion_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_CircularRegion_1, 2, /* Elements count */ &asn_SPC_CircularRegion_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CircularRegion.h b/certgen/asncodec/CircularRegion.h index e277352..e616e73 100644 --- a/certgen/asncodec/CircularRegion.h +++ b/certgen/asncodec/CircularRegion.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CircularRegion_H_ -#define _CircularRegion_H_ - - -#include /* Including external dependencies */ #include "TwoDLocation.h" #include "Uint16.h" #include +#ifndef _CircularRegion_H_ +#define _CircularRegion_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/CompositeCrl.c b/certgen/asncodec/CompositeCrl.c new file mode 100644 index 0000000..28930a9 --- /dev/null +++ b/certgen/asncodec/CompositeCrl.c @@ -0,0 +1,166 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CompositeCrl.h" + +static int +memb_crl_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_crl_constr_2 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_crl_constr_2 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_crl_2[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_SecuredCrl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_crl_tags_2[] = { + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_crl_specs_2 = { + sizeof(struct CompositeCrl__crl), + offsetof(struct CompositeCrl__crl, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_crl_2 = { + "crl", + "crl", + &asn_OP_SEQUENCE_OF, + asn_DEF_crl_tags_2, + sizeof(asn_DEF_crl_tags_2) + /sizeof(asn_DEF_crl_tags_2[0]) - 1, /* 1 */ + asn_DEF_crl_tags_2, /* Same as above */ + sizeof(asn_DEF_crl_tags_2) + /sizeof(asn_DEF_crl_tags_2[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_crl_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_crl_2, + 1, /* Single element */ + &asn_SPC_crl_specs_2 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_CompositeCrl_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CompositeCrl, crl), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + 0, + &asn_DEF_crl_2, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_crl_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_crl_constraint_1 + }, + 0, 0, /* No default value */ + "crl" + }, + { ATF_NOFLAGS, 0, offsetof(struct CompositeCrl, homeCtl), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_MultiSignedCtlSpdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "homeCtl" + }, +}; +static const ber_tlv_tag_t asn_DEF_CompositeCrl_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CompositeCrl_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* crl */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* homeCtl */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CompositeCrl_specs_1 = { + sizeof(struct CompositeCrl), + offsetof(struct CompositeCrl, _asn_ctx), + asn_MAP_CompositeCrl_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CompositeCrl = { + "CompositeCrl", + "CompositeCrl", + &asn_OP_SEQUENCE, + asn_DEF_CompositeCrl_tags_1, + sizeof(asn_DEF_CompositeCrl_tags_1) + /sizeof(asn_DEF_CompositeCrl_tags_1[0]), /* 1 */ + asn_DEF_CompositeCrl_tags_1, /* Same as above */ + sizeof(asn_DEF_CompositeCrl_tags_1) + /sizeof(asn_DEF_CompositeCrl_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CompositeCrl_1, + 2, /* Elements count */ + &asn_SPC_CompositeCrl_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CompositeCrl.h b/certgen/asncodec/CompositeCrl.h new file mode 100644 index 0000000..289014a --- /dev/null +++ b/certgen/asncodec/CompositeCrl.h @@ -0,0 +1,58 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "MultiSignedCtlSpdu.h" +#include +#include +#include +#ifndef _CompositeCrl_H_ +#define _CompositeCrl_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct SecuredCrl; + +/* CompositeCrl */ +typedef struct CompositeCrl { + struct CompositeCrl__crl { + A_SEQUENCE_OF(struct SecuredCrl) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } crl; + MultiSignedCtlSpdu_t homeCtl; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CompositeCrl_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CompositeCrl; +extern asn_SEQUENCE_specifics_t asn_SPC_CompositeCrl_specs_1; +extern asn_TYPE_member_t asn_MBR_CompositeCrl_1[2]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "SecuredCrl.h" + +#endif /* _CompositeCrl_H_ */ +#include diff --git a/certgen/asncodec/CompositeCrlSpdu.c b/certgen/asncodec/CompositeCrlSpdu.c new file mode 100644 index 0000000..41c25c8 --- /dev/null +++ b/certgen/asncodec/CompositeCrlSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CompositeCrlSpdu.h" + +int +CompositeCrlSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Unsecured_216P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CompositeCrlSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CompositeCrlSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CompositeCrlSpdu = { + "CompositeCrlSpdu", + "CompositeCrlSpdu", + &asn_OP_SEQUENCE, + asn_DEF_CompositeCrlSpdu_tags_1, + sizeof(asn_DEF_CompositeCrlSpdu_tags_1) + /sizeof(asn_DEF_CompositeCrlSpdu_tags_1[0]), /* 1 */ + asn_DEF_CompositeCrlSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_CompositeCrlSpdu_tags_1) + /sizeof(asn_DEF_CompositeCrlSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CompositeCrlSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CompositeCrlSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CompositeCrlSpdu.h b/certgen/asncodec/CompositeCrlSpdu.h new file mode 100644 index 0000000..02d19dc --- /dev/null +++ b/certgen/asncodec/CompositeCrlSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Unsecured.h" +#ifndef _CompositeCrlSpdu_H_ +#define _CompositeCrlSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CompositeCrlSpdu */ +typedef Ieee1609Dot2Data_Unsecured_216P0_t CompositeCrlSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CompositeCrlSpdu; +asn_struct_free_f CompositeCrlSpdu_free; +asn_struct_print_f CompositeCrlSpdu_print; +asn_constr_check_f CompositeCrlSpdu_constraint; +xer_type_decoder_f CompositeCrlSpdu_decode_xer; +xer_type_encoder_f CompositeCrlSpdu_encode_xer; +oer_type_decoder_f CompositeCrlSpdu_decode_oer; +oer_type_encoder_f CompositeCrlSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CompositeCrlSpdu_H_ */ +#include diff --git a/certgen/asncodec/ContributedExtensionBlock.c b/certgen/asncodec/ContributedExtensionBlock.c new file mode 100644 index 0000000..024821a --- /dev/null +++ b/certgen/asncodec/ContributedExtensionBlock.c @@ -0,0 +1,238 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ContributedExtensionBlock.h" + +static const long asn_VAL_1_ieee1609HeaderInfoContributorId = 1; +static const long asn_VAL_2_etsiHeaderInfoContributorId = 2; +static const asn_ioc_cell_t asn_IOS_Ieee1609Dot2HeaderInfoContributedExtensions_1_rows[] = { + { "&id", aioc__value, &asn_DEF_HeaderInfoContributorId, &asn_VAL_1_ieee1609HeaderInfoContributorId }, + { "&Extn", aioc__type, &asn_DEF_Ieee1609ContributedHeaderInfoExtension }, + { "&id", aioc__value, &asn_DEF_HeaderInfoContributorId, &asn_VAL_2_etsiHeaderInfoContributorId }, + { "&Extn", aioc__type, &asn_DEF_EtsiOriginatingHeaderInfoExtension } +}; +static const asn_ioc_set_t asn_IOS_Ieee1609Dot2HeaderInfoContributedExtensions_1[] = { + { 2, 2, asn_IOS_Ieee1609Dot2HeaderInfoContributedExtensions_1_rows } +}; +static int +memb_ANY_constraint_3(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +static int +memb_contributorId_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_extns_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + /* Determine the number of elements */ + size = _A_CSEQUENCE_FROM_VOID(sptr)->count; + + if((size >= 1)) { + /* Perform validation of the inner elements */ + return SEQUENCE_OF_constraint(td, sptr, ctfailcb, app_key); + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_Member_constr_4 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_extns_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_contributorId_constr_2 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_extns_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_extns_3[] = { + { ATF_ANY_TYPE | ATF_POINTER, 0, 0, + -1 /* Ambiguous tag (ANY?) */, + 0, + &asn_DEF_ANY, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_Member_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_ANY_constraint_3 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_extns_tags_3[] = { + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_extns_specs_3 = { + sizeof(struct ContributedExtensionBlock__extns), + offsetof(struct ContributedExtensionBlock__extns, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_extns_3 = { + "extns", + "extns", + &asn_OP_SEQUENCE_OF, + asn_DEF_extns_tags_3, + sizeof(asn_DEF_extns_tags_3) + /sizeof(asn_DEF_extns_tags_3[0]) - 1, /* 1 */ + asn_DEF_extns_tags_3, /* Same as above */ + sizeof(asn_DEF_extns_tags_3) + /sizeof(asn_DEF_extns_tags_3[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_extns_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_extns_3, + 1, /* Single element */ + &asn_SPC_extns_specs_3 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_ContributedExtensionBlock_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ContributedExtensionBlock, contributorId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HeaderInfoContributorId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_contributorId_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_contributorId_constraint_1 + }, + 0, 0, /* No default value */ + "contributorId" + }, + { ATF_NOFLAGS, 0, offsetof(struct ContributedExtensionBlock, extns), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + 0, + &asn_DEF_extns_3, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_extns_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_extns_constraint_1 + }, + 0, 0, /* No default value */ + "extns" + }, +}; +static const ber_tlv_tag_t asn_DEF_ContributedExtensionBlock_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ContributedExtensionBlock_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* contributorId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* extns */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ContributedExtensionBlock_specs_1 = { + sizeof(struct ContributedExtensionBlock), + offsetof(struct ContributedExtensionBlock, _asn_ctx), + asn_MAP_ContributedExtensionBlock_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ContributedExtensionBlock = { + "ContributedExtensionBlock", + "ContributedExtensionBlock", + &asn_OP_SEQUENCE, + asn_DEF_ContributedExtensionBlock_tags_1, + sizeof(asn_DEF_ContributedExtensionBlock_tags_1) + /sizeof(asn_DEF_ContributedExtensionBlock_tags_1[0]), /* 1 */ + asn_DEF_ContributedExtensionBlock_tags_1, /* Same as above */ + sizeof(asn_DEF_ContributedExtensionBlock_tags_1) + /sizeof(asn_DEF_ContributedExtensionBlock_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ContributedExtensionBlock_1, + 2, /* Elements count */ + &asn_SPC_ContributedExtensionBlock_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ContributedExtensionBlock.h b/certgen/asncodec/ContributedExtensionBlock.h new file mode 100644 index 0000000..5f537da --- /dev/null +++ b/certgen/asncodec/ContributedExtensionBlock.h @@ -0,0 +1,52 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HeaderInfoContributorId.h" +#include +#include "Ieee1609ContributedHeaderInfoExtension.h" +#include "EtsiOriginatingHeaderInfoExtension.h" +#include +#include +#include +#include +#ifndef _ContributedExtensionBlock_H_ +#define _ContributedExtensionBlock_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ContributedExtensionBlock */ +typedef struct ContributedExtensionBlock { + HeaderInfoContributorId_t contributorId; + struct ContributedExtensionBlock__extns { + A_SEQUENCE_OF(ANY_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } extns; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ContributedExtensionBlock_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ContributedExtensionBlock; +extern asn_SEQUENCE_specifics_t asn_SPC_ContributedExtensionBlock_specs_1; +extern asn_TYPE_member_t asn_MBR_ContributedExtensionBlock_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ContributedExtensionBlock_H_ */ +#include diff --git a/certgen/asncodec/ContributedExtensionBlocks.c b/certgen/asncodec/ContributedExtensionBlocks.c new file mode 100644 index 0000000..9ed4a2f --- /dev/null +++ b/certgen/asncodec/ContributedExtensionBlocks.c @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ContributedExtensionBlocks.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ContributedExtensionBlocks_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_ContributedExtensionBlocks_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_ContributedExtensionBlock, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_ContributedExtensionBlocks_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_ContributedExtensionBlocks_specs_1 = { + sizeof(struct ContributedExtensionBlocks), + offsetof(struct ContributedExtensionBlocks, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_ContributedExtensionBlocks = { + "ContributedExtensionBlocks", + "ContributedExtensionBlocks", + &asn_OP_SEQUENCE_OF, + asn_DEF_ContributedExtensionBlocks_tags_1, + sizeof(asn_DEF_ContributedExtensionBlocks_tags_1) + /sizeof(asn_DEF_ContributedExtensionBlocks_tags_1[0]), /* 1 */ + asn_DEF_ContributedExtensionBlocks_tags_1, /* Same as above */ + sizeof(asn_DEF_ContributedExtensionBlocks_tags_1) + /sizeof(asn_DEF_ContributedExtensionBlocks_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ContributedExtensionBlocks_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_ContributedExtensionBlocks_1, + 1, /* Single element */ + &asn_SPC_ContributedExtensionBlocks_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ContributedExtensionBlocks.h b/certgen/asncodec/ContributedExtensionBlocks.h new file mode 100644 index 0000000..d88944d --- /dev/null +++ b/certgen/asncodec/ContributedExtensionBlocks.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _ContributedExtensionBlocks_H_ +#define _ContributedExtensionBlocks_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct ContributedExtensionBlock; + +/* ContributedExtensionBlocks */ +typedef struct ContributedExtensionBlocks { + A_SEQUENCE_OF(struct ContributedExtensionBlock) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ContributedExtensionBlocks_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ContributedExtensionBlocks; +extern asn_SET_OF_specifics_t asn_SPC_ContributedExtensionBlocks_specs_1; +extern asn_TYPE_member_t asn_MBR_ContributedExtensionBlocks_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "ContributedExtensionBlock.h" + +#endif /* _ContributedExtensionBlocks_H_ */ +#include diff --git a/certgen/asncodec/Countersignature.c b/certgen/asncodec/Countersignature.c index 2f3562a..1e0a6d7 100644 --- a/certgen/asncodec/Countersignature.c +++ b/certgen/asncodec/Countersignature.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Countersignature.h" @@ -30,9 +30,11 @@ Countersignature_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using Ieee1609Dot2Data, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Countersignature_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Countersignature_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_Countersignature = { asn_DEF_Countersignature_tags_1, /* Same as above */ sizeof(asn_DEF_Countersignature_tags_1) /sizeof(asn_DEF_Countersignature_tags_1[0]), /* 1 */ - { &asn_OER_type_Countersignature_constr_1, 0, Countersignature_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Countersignature_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Countersignature_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/Countersignature.h b/certgen/asncodec/Countersignature.h index ecbd31e..11ba142 100644 --- a/certgen/asncodec/Countersignature.h +++ b/certgen/asncodec/Countersignature.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" #ifndef _Countersignature_H_ #define _Countersignature_H_ #include -/* Including external dependencies */ -#include "Ieee1609Dot2Data.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Countersignature; asn_struct_free_f Countersignature_free; asn_struct_print_f Countersignature_print; asn_constr_check_f Countersignature_constraint; -ber_type_decoder_f Countersignature_decode_ber; -der_type_encoder_f Countersignature_encode_der; xer_type_decoder_f Countersignature_decode_xer; xer_type_encoder_f Countersignature_encode_xer; oer_type_decoder_f Countersignature_decode_oer; diff --git a/certgen/asncodec/CountryAndRegions.c b/certgen/asncodec/CountryAndRegions.c index 4562812..d6911f3 100644 --- a/certgen/asncodec/CountryAndRegions.c +++ b/certgen/asncodec/CountryAndRegions.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CountryAndRegions.h" @@ -11,9 +11,17 @@ asn_TYPE_member_t asn_MBR_CountryAndRegions_1[] = { { ATF_NOFLAGS, 0, offsetof(struct CountryAndRegions, countryOnly), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ - &asn_DEF_CountryOnly, + &asn_DEF_UnCountryId, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "countryOnly" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_CountryAndRegions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfUint8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "regions" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_CountryAndRegions = { asn_DEF_CountryAndRegions_tags_1, /* Same as above */ sizeof(asn_DEF_CountryAndRegions_tags_1) /sizeof(asn_DEF_CountryAndRegions_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_CountryAndRegions_1, 2, /* Elements count */ &asn_SPC_CountryAndRegions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CountryAndRegions.h b/certgen/asncodec/CountryAndRegions.h index fa7f799..c3c3db9 100644 --- a/certgen/asncodec/CountryAndRegions.h +++ b/certgen/asncodec/CountryAndRegions.h @@ -1,28 +1,28 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "UnCountryId.h" +#include "SequenceOfUint8.h" +#include #ifndef _CountryAndRegions_H_ #define _CountryAndRegions_H_ #include -/* Including external dependencies */ -#include "CountryOnly.h" -#include "SequenceOfUint8.h" -#include - #ifdef __cplusplus extern "C" { #endif /* CountryAndRegions */ typedef struct CountryAndRegions { - CountryOnly_t countryOnly; + UnCountryId_t countryOnly; SequenceOfUint8_t regions; /* Context for parsing across buffer boundaries */ diff --git a/certgen/asncodec/CountryAndSubregions.c b/certgen/asncodec/CountryAndSubregions.c index 22ff254..3bf11df 100644 --- a/certgen/asncodec/CountryAndSubregions.c +++ b/certgen/asncodec/CountryAndSubregions.c @@ -1,28 +1,44 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CountryAndSubregions.h" asn_TYPE_member_t asn_MBR_CountryAndSubregions_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct CountryAndSubregions, country), + { ATF_NOFLAGS, 0, offsetof(struct CountryAndSubregions, countryOnly), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ - &asn_DEF_CountryOnly, + &asn_DEF_UnCountryId, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ - "country" + "countryOnly" }, { ATF_NOFLAGS, 0, offsetof(struct CountryAndSubregions, regionAndSubregions), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfRegionAndSubregions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "regionAndSubregions" }, @@ -31,7 +47,7 @@ static const ber_tlv_tag_t asn_DEF_CountryAndSubregions_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static const asn_TYPE_tag2member_t asn_MAP_CountryAndSubregions_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* country */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* countryOnly */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* regionAndSubregions */ }; asn_SEQUENCE_specifics_t asn_SPC_CountryAndSubregions_specs_1 = { @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_CountryAndSubregions = { asn_DEF_CountryAndSubregions_tags_1, /* Same as above */ sizeof(asn_DEF_CountryAndSubregions_tags_1) /sizeof(asn_DEF_CountryAndSubregions_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_CountryAndSubregions_1, 2, /* Elements count */ &asn_SPC_CountryAndSubregions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CountryAndSubregions.h b/certgen/asncodec/CountryAndSubregions.h index fae2a9c..a0f64c8 100644 --- a/certgen/asncodec/CountryAndSubregions.h +++ b/certgen/asncodec/CountryAndSubregions.h @@ -1,28 +1,28 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "UnCountryId.h" +#include "SequenceOfRegionAndSubregions.h" +#include #ifndef _CountryAndSubregions_H_ #define _CountryAndSubregions_H_ #include -/* Including external dependencies */ -#include "CountryOnly.h" -#include "SequenceOfRegionAndSubregions.h" -#include - #ifdef __cplusplus extern "C" { #endif /* CountryAndSubregions */ typedef struct CountryAndSubregions { - CountryOnly_t country; + UnCountryId_t countryOnly; SequenceOfRegionAndSubregions_t regionAndSubregions; /* Context for parsing across buffer boundaries */ diff --git a/certgen/asncodec/CountryOnly.c b/certgen/asncodec/CountryOnly.c index 9486417..8390a19 100644 --- a/certgen/asncodec/CountryOnly.c +++ b/certgen/asncodec/CountryOnly.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CountryOnly.h" @@ -33,12 +33,14 @@ CountryOnly_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using Uint16, + * This type is implemented using UnCountryId, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CountryOnly_constr_1 CC_NOTUSED = { { 2, 1 } /* (0..65535) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_CountryOnly_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_CountryOnly = { asn_DEF_CountryOnly_tags_1, /* Same as above */ sizeof(asn_DEF_CountryOnly_tags_1) /sizeof(asn_DEF_CountryOnly_tags_1[0]), /* 1 */ - { &asn_OER_type_CountryOnly_constr_1, 0, CountryOnly_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CountryOnly_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CountryOnly_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/CountryOnly.h b/certgen/asncodec/CountryOnly.h index 24623f7..27dd375 100644 --- a/certgen/asncodec/CountryOnly.h +++ b/certgen/asncodec/CountryOnly.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "UnCountryId.h" #ifndef _CountryOnly_H_ #define _CountryOnly_H_ #include -/* Including external dependencies */ -#include "Uint16.h" - #ifdef __cplusplus extern "C" { #endif /* CountryOnly */ -typedef Uint16_t CountryOnly_t; +typedef UnCountryId_t CountryOnly_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CountryOnly; asn_struct_free_f CountryOnly_free; asn_struct_print_f CountryOnly_print; asn_constr_check_f CountryOnly_constraint; -ber_type_decoder_f CountryOnly_decode_ber; -der_type_encoder_f CountryOnly_encode_der; xer_type_decoder_f CountryOnly_decode_xer; xer_type_encoder_f CountryOnly_encode_xer; oer_type_decoder_f CountryOnly_decode_oer; diff --git a/certgen/asncodec/CrlContents.c b/certgen/asncodec/CrlContents.c new file mode 100644 index 0000000..c061056 --- /dev/null +++ b/certgen/asncodec/CrlContents.c @@ -0,0 +1,204 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CrlContents.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 1)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (1..1) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_CrlContents_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CrlContents, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlContents, crlSeries), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CrlSeries, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "crlSeries" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlContents, crlCraca), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "crlCraca" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlContents, issueDate), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "issueDate" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlContents, nextCrl), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "nextCrl" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlContents, priorityInfo), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CrlPriorityInfo, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "priorityInfo" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlContents, typeSpecific), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_TypeSpecificCrlContents, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "typeSpecific" + }, +}; +static const ber_tlv_tag_t asn_DEF_CrlContents_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CrlContents_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* crlSeries */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* crlCraca */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* issueDate */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* nextCrl */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* priorityInfo */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* typeSpecific */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_CrlContents_specs_1 = { + sizeof(struct CrlContents), + offsetof(struct CrlContents, _asn_ctx), + asn_MAP_CrlContents_tag2el_1, + 7, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CrlContents = { + "CrlContents", + "CrlContents", + &asn_OP_SEQUENCE, + asn_DEF_CrlContents_tags_1, + sizeof(asn_DEF_CrlContents_tags_1) + /sizeof(asn_DEF_CrlContents_tags_1[0]), /* 1 */ + asn_DEF_CrlContents_tags_1, /* Same as above */ + sizeof(asn_DEF_CrlContents_tags_1) + /sizeof(asn_DEF_CrlContents_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CrlContents_1, + 7, /* Elements count */ + &asn_SPC_CrlContents_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CrlContents.h b/certgen/asncodec/CrlContents.h new file mode 100644 index 0000000..15c050a --- /dev/null +++ b/certgen/asncodec/CrlContents.h @@ -0,0 +1,49 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "CrlSeries.h" +#include "HashedId8.h" +#include "Time32.h" +#include "CrlPriorityInfo.h" +#include "TypeSpecificCrlContents.h" +#include +#ifndef _CrlContents_H_ +#define _CrlContents_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CrlContents */ +typedef struct CrlContents { + Uint8_t version; + CrlSeries_t crlSeries; + HashedId8_t crlCraca; + Time32_t issueDate; + Time32_t nextCrl; + CrlPriorityInfo_t priorityInfo; + TypeSpecificCrlContents_t typeSpecific; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CrlContents_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CrlContents; + +#ifdef __cplusplus +} +#endif + +#endif /* _CrlContents_H_ */ +#include diff --git a/certgen/asncodec/CrlEntry.c b/certgen/asncodec/CrlEntry.c index 1d9a504..4a6a1e1 100644 --- a/certgen/asncodec/CrlEntry.c +++ b/certgen/asncodec/CrlEntry.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CrlEntry.h" @@ -37,9 +37,11 @@ CrlEntry_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using HashedId8, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CrlEntry_constr_1 CC_NOTUSED = { { 0, 0 }, 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_CrlEntry_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_CrlEntry = { asn_DEF_CrlEntry_tags_1, /* Same as above */ sizeof(asn_DEF_CrlEntry_tags_1) /sizeof(asn_DEF_CrlEntry_tags_1[0]), /* 1 */ - { &asn_OER_type_CrlEntry_constr_1, 0, CrlEntry_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CrlEntry_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CrlEntry_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/CrlEntry.h b/certgen/asncodec/CrlEntry.h index c35d5fd..623a008 100644 --- a/certgen/asncodec/CrlEntry.h +++ b/certgen/asncodec/CrlEntry.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "HashedId8.h" #ifndef _CrlEntry_H_ #define _CrlEntry_H_ #include -/* Including external dependencies */ -#include "HashedId8.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_CrlEntry; asn_struct_free_f CrlEntry_free; asn_struct_print_f CrlEntry_print; asn_constr_check_f CrlEntry_constraint; -ber_type_decoder_f CrlEntry_decode_ber; -der_type_encoder_f CrlEntry_encode_der; xer_type_decoder_f CrlEntry_decode_xer; xer_type_encoder_f CrlEntry_encode_xer; oer_type_decoder_f CrlEntry_decode_oer; diff --git a/certgen/asncodec/CrlInfoStatus.c b/certgen/asncodec/CrlInfoStatus.c new file mode 100644 index 0000000..dbef66e --- /dev/null +++ b/certgen/asncodec/CrlInfoStatus.c @@ -0,0 +1,102 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CrlInfoStatus.h" + +asn_TYPE_member_t asn_MBR_CrlInfoStatus_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CrlInfoStatus, cracaId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "cracaId" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlInfoStatus, series), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CrlSeries, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "series" + }, + { ATF_NOFLAGS, 0, offsetof(struct CrlInfoStatus, issueDate), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "issueDate" + }, +}; +static const ber_tlv_tag_t asn_DEF_CrlInfoStatus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CrlInfoStatus_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cracaId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* series */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* issueDate */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CrlInfoStatus_specs_1 = { + sizeof(struct CrlInfoStatus), + offsetof(struct CrlInfoStatus, _asn_ctx), + asn_MAP_CrlInfoStatus_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 3, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CrlInfoStatus = { + "CrlInfoStatus", + "CrlInfoStatus", + &asn_OP_SEQUENCE, + asn_DEF_CrlInfoStatus_tags_1, + sizeof(asn_DEF_CrlInfoStatus_tags_1) + /sizeof(asn_DEF_CrlInfoStatus_tags_1[0]), /* 1 */ + asn_DEF_CrlInfoStatus_tags_1, /* Same as above */ + sizeof(asn_DEF_CrlInfoStatus_tags_1) + /sizeof(asn_DEF_CrlInfoStatus_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CrlInfoStatus_1, + 3, /* Elements count */ + &asn_SPC_CrlInfoStatus_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CrlInfoStatus.h b/certgen/asncodec/CrlInfoStatus.h new file mode 100644 index 0000000..e9e6130 --- /dev/null +++ b/certgen/asncodec/CrlInfoStatus.h @@ -0,0 +1,48 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashedId8.h" +#include "CrlSeries.h" +#include "Time32.h" +#include +#ifndef _CrlInfoStatus_H_ +#define _CrlInfoStatus_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CrlInfoStatus */ +typedef struct CrlInfoStatus { + HashedId8_t cracaId; + CrlSeries_t series; + Time32_t issueDate; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CrlInfoStatus_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CrlInfoStatus; +extern asn_SEQUENCE_specifics_t asn_SPC_CrlInfoStatus_specs_1; +extern asn_TYPE_member_t asn_MBR_CrlInfoStatus_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CrlInfoStatus_H_ */ +#include diff --git a/certgen/asncodec/CrlPriorityInfo.c b/certgen/asncodec/CrlPriorityInfo.c new file mode 100644 index 0000000..19d72ea --- /dev/null +++ b/certgen/asncodec/CrlPriorityInfo.c @@ -0,0 +1,68 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CrlPriorityInfo.h" + +asn_TYPE_member_t asn_MBR_CrlPriorityInfo_1[] = { + { ATF_POINTER, 1, offsetof(struct CrlPriorityInfo, priority), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "priority" + }, +}; +static const int asn_MAP_CrlPriorityInfo_oms_1[] = { 0 }; +static const ber_tlv_tag_t asn_DEF_CrlPriorityInfo_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CrlPriorityInfo_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* priority */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CrlPriorityInfo_specs_1 = { + sizeof(struct CrlPriorityInfo), + offsetof(struct CrlPriorityInfo, _asn_ctx), + asn_MAP_CrlPriorityInfo_tag2el_1, + 1, /* Count of tags in the map */ + asn_MAP_CrlPriorityInfo_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CrlPriorityInfo = { + "CrlPriorityInfo", + "CrlPriorityInfo", + &asn_OP_SEQUENCE, + asn_DEF_CrlPriorityInfo_tags_1, + sizeof(asn_DEF_CrlPriorityInfo_tags_1) + /sizeof(asn_DEF_CrlPriorityInfo_tags_1[0]), /* 1 */ + asn_DEF_CrlPriorityInfo_tags_1, /* Same as above */ + sizeof(asn_DEF_CrlPriorityInfo_tags_1) + /sizeof(asn_DEF_CrlPriorityInfo_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CrlPriorityInfo_1, + 1, /* Elements count */ + &asn_SPC_CrlPriorityInfo_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CrlPriorityInfo.h b/certgen/asncodec/CrlPriorityInfo.h new file mode 100644 index 0000000..d32302b --- /dev/null +++ b/certgen/asncodec/CrlPriorityInfo.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _CrlPriorityInfo_H_ +#define _CrlPriorityInfo_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CrlPriorityInfo */ +typedef struct CrlPriorityInfo { + Uint8_t *priority; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CrlPriorityInfo_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CrlPriorityInfo; +extern asn_SEQUENCE_specifics_t asn_SPC_CrlPriorityInfo_specs_1; +extern asn_TYPE_member_t asn_MBR_CrlPriorityInfo_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CrlPriorityInfo_H_ */ +#include diff --git a/certgen/asncodec/CrlPsid.c b/certgen/asncodec/CrlPsid.c new file mode 100644 index 0000000..65d45ae --- /dev/null +++ b/certgen/asncodec/CrlPsid.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Crl" + * found in "asn1/ieee1609.2/Ieee1609Dot2Crl.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CrlPsid.h" + +int +CrlPsid_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const unsigned long *)sptr; + + if((value == 256)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using Psid, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CrlPsid_constr_1 CC_NOTUSED = { + { 2, 1 } /* (256..256) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CrlPsid_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CrlPsid = { + "CrlPsid", + "CrlPsid", + &asn_OP_NativeInteger, + asn_DEF_CrlPsid_tags_1, + sizeof(asn_DEF_CrlPsid_tags_1) + /sizeof(asn_DEF_CrlPsid_tags_1[0]), /* 1 */ + asn_DEF_CrlPsid_tags_1, /* Same as above */ + sizeof(asn_DEF_CrlPsid_tags_1) + /sizeof(asn_DEF_CrlPsid_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CrlPsid_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CrlPsid_constraint + }, + 0, 0, /* No members */ + &asn_SPC_Psid_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CrlPsid.h b/certgen/asncodec/CrlPsid.h new file mode 100644 index 0000000..63fcdea --- /dev/null +++ b/certgen/asncodec/CrlPsid.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Crl" + * found in "asn1/ieee1609.2/Ieee1609Dot2Crl.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Psid.h" +#ifndef _CrlPsid_H_ +#define _CrlPsid_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CrlPsid */ +typedef Psid_t CrlPsid_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CrlPsid; +asn_struct_free_f CrlPsid_free; +asn_struct_print_f CrlPsid_print; +asn_constr_check_f CrlPsid_constraint; +xer_type_decoder_f CrlPsid_decode_xer; +xer_type_encoder_f CrlPsid_encode_xer; +oer_type_decoder_f CrlPsid_decode_oer; +oer_type_encoder_f CrlPsid_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CrlPsid_H_ */ +#include diff --git a/certgen/asncodec/CrlSeries.c b/certgen/asncodec/CrlSeries.c index 8bb9c99..a1f72cd 100644 --- a/certgen/asncodec/CrlSeries.c +++ b/certgen/asncodec/CrlSeries.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CrlSeries.h" @@ -36,9 +36,11 @@ CrlSeries_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using Uint16, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CrlSeries_constr_1 CC_NOTUSED = { { 2, 1 } /* (0..65535) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_CrlSeries_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_CrlSeries = { asn_DEF_CrlSeries_tags_1, /* Same as above */ sizeof(asn_DEF_CrlSeries_tags_1) /sizeof(asn_DEF_CrlSeries_tags_1[0]), /* 1 */ - { &asn_OER_type_CrlSeries_constr_1, 0, CrlSeries_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CrlSeries_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CrlSeries_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/CrlSeries.h b/certgen/asncodec/CrlSeries.h index 935fe16..75de711 100644 --- a/certgen/asncodec/CrlSeries.h +++ b/certgen/asncodec/CrlSeries.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Uint16.h" #ifndef _CrlSeries_H_ #define _CrlSeries_H_ #include -/* Including external dependencies */ -#include "Uint16.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_CrlSeries; asn_struct_free_f CrlSeries_free; asn_struct_print_f CrlSeries_print; asn_constr_check_f CrlSeries_constraint; -ber_type_decoder_f CrlSeries_decode_ber; -der_type_encoder_f CrlSeries_encode_der; xer_type_decoder_f CrlSeries_decode_xer; xer_type_encoder_f CrlSeries_encode_xer; oer_type_decoder_f CrlSeries_decode_oer; diff --git a/certgen/asncodec/CrlSignerSsp.c b/certgen/asncodec/CrlSignerSsp.c new file mode 100644 index 0000000..eba8aaf --- /dev/null +++ b/certgen/asncodec/CrlSignerSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CrlSignerSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_CrlSignerSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CrlSignerSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_CrlSignerSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CrlSignerSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CrlSignerSsp_specs_1 = { + sizeof(struct CrlSignerSsp), + offsetof(struct CrlSignerSsp, _asn_ctx), + asn_MAP_CrlSignerSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CrlSignerSsp = { + "CrlSignerSsp", + "CrlSignerSsp", + &asn_OP_SEQUENCE, + asn_DEF_CrlSignerSsp_tags_1, + sizeof(asn_DEF_CrlSignerSsp_tags_1) + /sizeof(asn_DEF_CrlSignerSsp_tags_1[0]), /* 1 */ + asn_DEF_CrlSignerSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_CrlSignerSsp_tags_1) + /sizeof(asn_DEF_CrlSignerSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CrlSignerSsp_1, + 1, /* Elements count */ + &asn_SPC_CrlSignerSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CrlSignerSsp.h b/certgen/asncodec/CrlSignerSsp.h new file mode 100644 index 0000000..f0fc0e5 --- /dev/null +++ b/certgen/asncodec/CrlSignerSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _CrlSignerSsp_H_ +#define _CrlSignerSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CrlSignerSsp */ +typedef struct CrlSignerSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CrlSignerSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CrlSignerSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_CrlSignerSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_CrlSignerSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CrlSignerSsp_H_ */ +#include diff --git a/certgen/asncodec/CtlCommand.c b/certgen/asncodec/CtlCommand.c index 171966c..727fe63 100644 --- a/certgen/asncodec/CtlCommand.c +++ b/certgen/asncodec/CtlCommand.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CtlCommand.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CtlCommand_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_CtlCommand_1[] = { { ATF_NOFLAGS, 0, offsetof(struct CtlCommand, choice.add), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_CtlEntry, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "add" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_CtlCommand_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_CtlDelete, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "delete" }, @@ -52,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_CtlCommand = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_CtlCommand_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlCommand_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_CtlCommand_1, 2, /* Elements count */ &asn_SPC_CtlCommand_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CtlCommand.h b/certgen/asncodec/CtlCommand.h index 8730237..c50fc7f 100644 --- a/certgen/asncodec/CtlCommand.h +++ b/certgen/asncodec/CtlCommand.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CtlCommand_H_ -#define _CtlCommand_H_ - - -#include /* Including external dependencies */ #include "CtlEntry.h" #include "CtlDelete.h" #include +#ifndef _CtlCommand_H_ +#define _CtlCommand_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/CtlDelete.c b/certgen/asncodec/CtlDelete.c index 6a1424e..7fd3b2a 100644 --- a/certgen/asncodec/CtlDelete.c +++ b/certgen/asncodec/CtlDelete.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CtlDelete.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CtlDelete_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_CtlDelete_1[] = { { ATF_NOFLAGS, 0, offsetof(struct CtlDelete, choice.cert), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "cert" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_CtlDelete_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_DcDelete, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "dc" }, @@ -52,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_CtlDelete = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_CtlDelete_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlDelete_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_CtlDelete_1, 2, /* Elements count */ &asn_SPC_CtlDelete_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CtlDelete.h b/certgen/asncodec/CtlDelete.h index d77ecbb..0b5107d 100644 --- a/certgen/asncodec/CtlDelete.h +++ b/certgen/asncodec/CtlDelete.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CtlDelete_H_ -#define _CtlDelete_H_ - - -#include /* Including external dependencies */ #include "HashedId8.h" #include "DcDelete.h" #include +#ifndef _CtlDelete_H_ +#define _CtlDelete_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/CtlElectorEntry.c b/certgen/asncodec/CtlElectorEntry.c new file mode 100644 index 0000000..16acba7 --- /dev/null +++ b/certgen/asncodec/CtlElectorEntry.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CtlElectorEntry.h" + +int +CtlElectorEntry_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const HashedId48_t *st = (const HashedId48_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 48)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using HashedId48, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CtlElectorEntry_constr_1 CC_NOTUSED = { + { 0, 0 }, + 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CtlElectorEntry_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CtlElectorEntry = { + "CtlElectorEntry", + "CtlElectorEntry", + &asn_OP_OCTET_STRING, + asn_DEF_CtlElectorEntry_tags_1, + sizeof(asn_DEF_CtlElectorEntry_tags_1) + /sizeof(asn_DEF_CtlElectorEntry_tags_1[0]), /* 1 */ + asn_DEF_CtlElectorEntry_tags_1, /* Same as above */ + sizeof(asn_DEF_CtlElectorEntry_tags_1) + /sizeof(asn_DEF_CtlElectorEntry_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlElectorEntry_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CtlElectorEntry_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/CtlElectorEntry.h b/certgen/asncodec/CtlElectorEntry.h new file mode 100644 index 0000000..b7ac6fe --- /dev/null +++ b/certgen/asncodec/CtlElectorEntry.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashedId48.h" +#ifndef _CtlElectorEntry_H_ +#define _CtlElectorEntry_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CtlElectorEntry */ +typedef HashedId48_t CtlElectorEntry_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CtlElectorEntry; +asn_struct_free_f CtlElectorEntry_free; +asn_struct_print_f CtlElectorEntry_print; +asn_constr_check_f CtlElectorEntry_constraint; +xer_type_decoder_f CtlElectorEntry_decode_xer; +xer_type_encoder_f CtlElectorEntry_encode_xer; +oer_type_decoder_f CtlElectorEntry_decode_oer; +oer_type_encoder_f CtlElectorEntry_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CtlElectorEntry_H_ */ +#include diff --git a/certgen/asncodec/CtlEntry.c b/certgen/asncodec/CtlEntry.c index 720e388..9a9d98e 100644 --- a/certgen/asncodec/CtlEntry.c +++ b/certgen/asncodec/CtlEntry.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CtlEntry.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_CtlEntry_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_CtlEntry_1[] = { { ATF_NOFLAGS, 0, offsetof(struct CtlEntry, choice.rca), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_RootCaEntry, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "rca" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_CtlEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EaEntry, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ea" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_CtlEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_AaEntry, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "aa" }, @@ -43,7 +69,15 @@ asn_TYPE_member_t asn_MBR_CtlEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_DcEntry, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "dc" }, @@ -52,7 +86,15 @@ asn_TYPE_member_t asn_MBR_CtlEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_TlmEntry, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "tlm" }, @@ -82,7 +124,15 @@ asn_TYPE_descriptor_t asn_DEF_CtlEntry = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_CtlEntry_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlEntry_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_CtlEntry_1, 5, /* Elements count */ &asn_SPC_CtlEntry_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CtlEntry.h b/certgen/asncodec/CtlEntry.h index ba47328..e9be59e 100644 --- a/certgen/asncodec/CtlEntry.h +++ b/certgen/asncodec/CtlEntry.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CtlEntry_H_ -#define _CtlEntry_H_ - - -#include /* Including external dependencies */ #include "RootCaEntry.h" @@ -18,6 +13,11 @@ #include "DcEntry.h" #include "TlmEntry.h" #include +#ifndef _CtlEntry_H_ +#define _CtlEntry_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/CtlFormat.c b/certgen/asncodec/CtlFormat.c index 0184943..33bad27 100644 --- a/certgen/asncodec/CtlFormat.c +++ b/certgen/asncodec/CtlFormat.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "CtlFormat.h" @@ -32,16 +32,26 @@ memb_ctlSequence_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_ctlSequence_constr_5 CC_NOTUSED = { { 1, 1 } /* (0..255) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static asn_TYPE_member_t asn_MBR_ctlCommands_6[] = { { ATF_POINTER, 0, 0, -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_CtlCommand, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -66,7 +76,15 @@ asn_TYPE_descriptor_t asn_DEF_ctlCommands_6 = { asn_DEF_ctlCommands_tags_6, /* Same as above */ sizeof(asn_DEF_ctlCommands_tags_6) /sizeof(asn_DEF_ctlCommands_tags_6[0]), /* 2 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_ctlCommands_6, 1, /* Single element */ &asn_SPC_ctlCommands_specs_6 /* Additional specs */ @@ -78,7 +96,15 @@ asn_TYPE_member_t asn_MBR_CtlFormat_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Version, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "version" }, @@ -87,7 +113,15 @@ asn_TYPE_member_t asn_MBR_CtlFormat_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Time32, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "nextUpdate" }, @@ -96,7 +130,15 @@ asn_TYPE_member_t asn_MBR_CtlFormat_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BOOLEAN, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "isFullCtl" }, @@ -105,7 +147,15 @@ asn_TYPE_member_t asn_MBR_CtlFormat_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, 0, - { &asn_OER_memb_ctlSequence_constr_5, 0, memb_ctlSequence_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_ctlSequence_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_ctlSequence_constraint_1 + }, 0, 0, /* No default value */ "ctlSequence" }, @@ -114,7 +164,15 @@ asn_TYPE_member_t asn_MBR_CtlFormat_1[] = { 0, &asn_DEF_ctlCommands_6, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ctlCommands" }, @@ -147,7 +205,15 @@ asn_TYPE_descriptor_t asn_DEF_CtlFormat = { asn_DEF_CtlFormat_tags_1, /* Same as above */ sizeof(asn_DEF_CtlFormat_tags_1) /sizeof(asn_DEF_CtlFormat_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_CtlFormat_1, 5, /* Elements count */ &asn_SPC_CtlFormat_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/CtlFormat.h b/certgen/asncodec/CtlFormat.h index 0cbf880..49728ee 100644 --- a/certgen/asncodec/CtlFormat.h +++ b/certgen/asncodec/CtlFormat.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _CtlFormat_H_ -#define _CtlFormat_H_ - - -#include /* Including external dependencies */ #include "Version.h" @@ -19,6 +14,11 @@ #include #include #include +#ifndef _CtlFormat_H_ +#define _CtlFormat_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/CtlInfoStatus.c b/certgen/asncodec/CtlInfoStatus.c new file mode 100644 index 0000000..b4f4c53 --- /dev/null +++ b/certgen/asncodec/CtlInfoStatus.c @@ -0,0 +1,102 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CtlInfoStatus.h" + +asn_TYPE_member_t asn_MBR_CtlInfoStatus_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct CtlInfoStatus, ctlSeriesId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CtlSeriesId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ctlSeriesId" + }, + { ATF_NOFLAGS, 0, offsetof(struct CtlInfoStatus, sequenceNumber), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CtlSequenceNumber, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sequenceNumber" + }, + { ATF_NOFLAGS, 0, offsetof(struct CtlInfoStatus, lastUpdate), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "lastUpdate" + }, +}; +static const ber_tlv_tag_t asn_DEF_CtlInfoStatus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_CtlInfoStatus_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ctlSeriesId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* sequenceNumber */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* lastUpdate */ +}; +asn_SEQUENCE_specifics_t asn_SPC_CtlInfoStatus_specs_1 = { + sizeof(struct CtlInfoStatus), + offsetof(struct CtlInfoStatus, _asn_ctx), + asn_MAP_CtlInfoStatus_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 3, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_CtlInfoStatus = { + "CtlInfoStatus", + "CtlInfoStatus", + &asn_OP_SEQUENCE, + asn_DEF_CtlInfoStatus_tags_1, + sizeof(asn_DEF_CtlInfoStatus_tags_1) + /sizeof(asn_DEF_CtlInfoStatus_tags_1[0]), /* 1 */ + asn_DEF_CtlInfoStatus_tags_1, /* Same as above */ + sizeof(asn_DEF_CtlInfoStatus_tags_1) + /sizeof(asn_DEF_CtlInfoStatus_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_CtlInfoStatus_1, + 3, /* Elements count */ + &asn_SPC_CtlInfoStatus_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CtlInfoStatus.h b/certgen/asncodec/CtlInfoStatus.h new file mode 100644 index 0000000..fcd47ae --- /dev/null +++ b/certgen/asncodec/CtlInfoStatus.h @@ -0,0 +1,48 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "CtlSeriesId.h" +#include "CtlSequenceNumber.h" +#include "Time32.h" +#include +#ifndef _CtlInfoStatus_H_ +#define _CtlInfoStatus_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CtlInfoStatus */ +typedef struct CtlInfoStatus { + CtlSeriesId_t ctlSeriesId; + CtlSequenceNumber_t sequenceNumber; + Time32_t lastUpdate; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} CtlInfoStatus_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CtlInfoStatus; +extern asn_SEQUENCE_specifics_t asn_SPC_CtlInfoStatus_specs_1; +extern asn_TYPE_member_t asn_MBR_CtlInfoStatus_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _CtlInfoStatus_H_ */ +#include diff --git a/certgen/asncodec/CtlRootCaEntry.c b/certgen/asncodec/CtlRootCaEntry.c new file mode 100644 index 0000000..a30b067 --- /dev/null +++ b/certgen/asncodec/CtlRootCaEntry.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CtlRootCaEntry.h" + +int +CtlRootCaEntry_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const HashedId32_t *st = (const HashedId32_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 32)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using HashedId32, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CtlRootCaEntry_constr_1 CC_NOTUSED = { + { 0, 0 }, + 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CtlRootCaEntry_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CtlRootCaEntry = { + "CtlRootCaEntry", + "CtlRootCaEntry", + &asn_OP_OCTET_STRING, + asn_DEF_CtlRootCaEntry_tags_1, + sizeof(asn_DEF_CtlRootCaEntry_tags_1) + /sizeof(asn_DEF_CtlRootCaEntry_tags_1[0]), /* 1 */ + asn_DEF_CtlRootCaEntry_tags_1, /* Same as above */ + sizeof(asn_DEF_CtlRootCaEntry_tags_1) + /sizeof(asn_DEF_CtlRootCaEntry_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlRootCaEntry_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CtlRootCaEntry_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/CtlRootCaEntry.h b/certgen/asncodec/CtlRootCaEntry.h new file mode 100644 index 0000000..6d04240 --- /dev/null +++ b/certgen/asncodec/CtlRootCaEntry.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashedId32.h" +#ifndef _CtlRootCaEntry_H_ +#define _CtlRootCaEntry_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CtlRootCaEntry */ +typedef HashedId32_t CtlRootCaEntry_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CtlRootCaEntry; +asn_struct_free_f CtlRootCaEntry_free; +asn_struct_print_f CtlRootCaEntry_print; +asn_constr_check_f CtlRootCaEntry_constraint; +xer_type_decoder_f CtlRootCaEntry_decode_xer; +xer_type_encoder_f CtlRootCaEntry_encode_xer; +oer_type_decoder_f CtlRootCaEntry_decode_oer; +oer_type_encoder_f CtlRootCaEntry_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CtlRootCaEntry_H_ */ +#include diff --git a/certgen/asncodec/CtlSequenceNumber.c b/certgen/asncodec/CtlSequenceNumber.c new file mode 100644 index 0000000..9e85e30 --- /dev/null +++ b/certgen/asncodec/CtlSequenceNumber.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CtlSequenceNumber.h" + +int +CtlSequenceNumber_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 65535)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using NativeInteger, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CtlSequenceNumber_constr_1 CC_NOTUSED = { + { 2, 1 } /* (0..65535) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CtlSequenceNumber_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CtlSequenceNumber = { + "CtlSequenceNumber", + "CtlSequenceNumber", + &asn_OP_NativeInteger, + asn_DEF_CtlSequenceNumber_tags_1, + sizeof(asn_DEF_CtlSequenceNumber_tags_1) + /sizeof(asn_DEF_CtlSequenceNumber_tags_1[0]), /* 1 */ + asn_DEF_CtlSequenceNumber_tags_1, /* Same as above */ + sizeof(asn_DEF_CtlSequenceNumber_tags_1) + /sizeof(asn_DEF_CtlSequenceNumber_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlSequenceNumber_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CtlSequenceNumber_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/CtlSequenceNumber.h b/certgen/asncodec/CtlSequenceNumber.h new file mode 100644 index 0000000..c7f2fa6 --- /dev/null +++ b/certgen/asncodec/CtlSequenceNumber.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _CtlSequenceNumber_H_ +#define _CtlSequenceNumber_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CtlSequenceNumber */ +typedef long CtlSequenceNumber_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CtlSequenceNumber; +asn_struct_free_f CtlSequenceNumber_free; +asn_struct_print_f CtlSequenceNumber_print; +asn_constr_check_f CtlSequenceNumber_constraint; +xer_type_decoder_f CtlSequenceNumber_decode_xer; +xer_type_encoder_f CtlSequenceNumber_encode_xer; +oer_type_decoder_f CtlSequenceNumber_decode_oer; +oer_type_encoder_f CtlSequenceNumber_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CtlSequenceNumber_H_ */ +#include diff --git a/certgen/asncodec/CtlSeriesId.c b/certgen/asncodec/CtlSeriesId.c new file mode 100644 index 0000000..9f97ef6 --- /dev/null +++ b/certgen/asncodec/CtlSeriesId.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CtlSeriesId.h" + +int +CtlSeriesId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 8)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using OCTET_STRING, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CtlSeriesId_constr_1 CC_NOTUSED = { + { 0, 0 }, + 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CtlSeriesId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CtlSeriesId = { + "CtlSeriesId", + "CtlSeriesId", + &asn_OP_OCTET_STRING, + asn_DEF_CtlSeriesId_tags_1, + sizeof(asn_DEF_CtlSeriesId_tags_1) + /sizeof(asn_DEF_CtlSeriesId_tags_1[0]), /* 1 */ + asn_DEF_CtlSeriesId_tags_1, /* Same as above */ + sizeof(asn_DEF_CtlSeriesId_tags_1) + /sizeof(asn_DEF_CtlSeriesId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlSeriesId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CtlSeriesId_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/CtlSeriesId.h b/certgen/asncodec/CtlSeriesId.h new file mode 100644 index 0000000..97f74a8 --- /dev/null +++ b/certgen/asncodec/CtlSeriesId.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _CtlSeriesId_H_ +#define _CtlSeriesId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CtlSeriesId */ +typedef OCTET_STRING_t CtlSeriesId_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CtlSeriesId; +asn_struct_free_f CtlSeriesId_free; +asn_struct_print_f CtlSeriesId_print; +asn_constr_check_f CtlSeriesId_constraint; +xer_type_decoder_f CtlSeriesId_decode_xer; +xer_type_encoder_f CtlSeriesId_encode_xer; +oer_type_decoder_f CtlSeriesId_decode_oer; +oer_type_encoder_f CtlSeriesId_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CtlSeriesId_H_ */ +#include diff --git a/certgen/asncodec/CtlSignatureSpdu.c b/certgen/asncodec/CtlSignatureSpdu.c new file mode 100644 index 0000000..7aadf7d --- /dev/null +++ b/certgen/asncodec/CtlSignatureSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "CtlSignatureSpdu.h" + +int +CtlSignatureSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_CtlSignatureSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_CtlSignatureSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_CtlSignatureSpdu = { + "CtlSignatureSpdu", + "CtlSignatureSpdu", + &asn_OP_SEQUENCE, + asn_DEF_CtlSignatureSpdu_tags_1, + sizeof(asn_DEF_CtlSignatureSpdu_tags_1) + /sizeof(asn_DEF_CtlSignatureSpdu_tags_1[0]), /* 1 */ + asn_DEF_CtlSignatureSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_CtlSignatureSpdu_tags_1) + /sizeof(asn_DEF_CtlSignatureSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_CtlSignatureSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CtlSignatureSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/CtlSignatureSpdu.h b/certgen/asncodec/CtlSignatureSpdu.h new file mode 100644 index 0000000..7517af3 --- /dev/null +++ b/certgen/asncodec/CtlSignatureSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _CtlSignatureSpdu_H_ +#define _CtlSignatureSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* CtlSignatureSpdu */ +typedef Ieee1609Dot2Data_Signed_228P2_t CtlSignatureSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_CtlSignatureSpdu; +asn_struct_free_f CtlSignatureSpdu_free; +asn_struct_print_f CtlSignatureSpdu_print; +asn_constr_check_f CtlSignatureSpdu_constraint; +xer_type_decoder_f CtlSignatureSpdu_decode_xer; +xer_type_encoder_f CtlSignatureSpdu_encode_xer; +oer_type_decoder_f CtlSignatureSpdu_decode_oer; +oer_type_encoder_f CtlSignatureSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _CtlSignatureSpdu_H_ */ +#include diff --git a/certgen/asncodec/DATE-ENCODING.c b/certgen/asncodec/DATE-ENCODING.c new file mode 100644 index 0000000..63102f4 --- /dev/null +++ b/certgen/asncodec/DATE-ENCODING.c @@ -0,0 +1,165 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "DATE-ENCODING.h" + +static int +memb_month_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 1 && value <= 12)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_day_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 1 && value <= 31)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_month_constr_3 CC_NOTUSED = { + { 1, 1 } /* (1..12) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_day_constr_4 CC_NOTUSED = { + { 1, 1 } /* (1..31) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_DATE_ENCODING_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct DATE_ENCODING, year), + -1 /* Ambiguous tag (CHOICE?) */, + 0, + &asn_DEF_YEAR_ENCODING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "year" + }, + { ATF_NOFLAGS, 0, offsetof(struct DATE_ENCODING, month), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_month_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_month_constraint_1 + }, + 0, 0, /* No default value */ + "month" + }, + { ATF_NOFLAGS, 0, offsetof(struct DATE_ENCODING, day), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_day_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_day_constraint_1 + }, + 0, 0, /* No default value */ + "day" + }, +}; +static const ber_tlv_tag_t asn_DEF_DATE_ENCODING_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_DATE_ENCODING_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 1 }, /* month */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* day */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* immediate */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* near-future */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* near-past */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* remainder */ +}; +asn_SEQUENCE_specifics_t asn_SPC_DATE_ENCODING_specs_1 = { + sizeof(struct DATE_ENCODING), + offsetof(struct DATE_ENCODING, _asn_ctx), + asn_MAP_DATE_ENCODING_tag2el_1, + 6, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_DATE_ENCODING = { + "DATE-ENCODING", + "DATE-ENCODING", + &asn_OP_SEQUENCE, + asn_DEF_DATE_ENCODING_tags_1, + sizeof(asn_DEF_DATE_ENCODING_tags_1) + /sizeof(asn_DEF_DATE_ENCODING_tags_1[0]), /* 1 */ + asn_DEF_DATE_ENCODING_tags_1, /* Same as above */ + sizeof(asn_DEF_DATE_ENCODING_tags_1) + /sizeof(asn_DEF_DATE_ENCODING_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_DATE_ENCODING_1, + 3, /* Elements count */ + &asn_SPC_DATE_ENCODING_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/DATE-ENCODING.h b/certgen/asncodec/DATE-ENCODING.h new file mode 100644 index 0000000..f40ab52 --- /dev/null +++ b/certgen/asncodec/DATE-ENCODING.h @@ -0,0 +1,43 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "YEAR-ENCODING.h" +#include +#include +#ifndef _DATE_ENCODING_H_ +#define _DATE_ENCODING_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* DATE-ENCODING */ +typedef struct DATE_ENCODING { + YEAR_ENCODING_t year; + long month; + long day; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} DATE_ENCODING_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_DATE_ENCODING; +extern asn_SEQUENCE_specifics_t asn_SPC_DATE_ENCODING_specs_1; +extern asn_TYPE_member_t asn_MBR_DATE_ENCODING_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _DATE_ENCODING_H_ */ +#include diff --git a/certgen/asncodec/DATE.c b/certgen/asncodec/DATE.c new file mode 100644 index 0000000..895f88c --- /dev/null +++ b/certgen/asncodec/DATE.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "DATE.h" + +/* + * This type is implemented using DATE_ENCODING, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_DATE_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_DATE = { + "DATE", + "DATE", + &asn_OP_SEQUENCE, + asn_DEF_DATE_tags_1, + sizeof(asn_DEF_DATE_tags_1) + /sizeof(asn_DEF_DATE_tags_1[0]), /* 1 */ + asn_DEF_DATE_tags_1, /* Same as above */ + sizeof(asn_DEF_DATE_tags_1) + /sizeof(asn_DEF_DATE_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_DATE_ENCODING_1, + 3, /* Elements count */ + &asn_SPC_DATE_ENCODING_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/DATE.h b/certgen/asncodec/DATE.h new file mode 100644 index 0000000..88f55e0 --- /dev/null +++ b/certgen/asncodec/DATE.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "DATE-ENCODING.h" +#ifndef _DATE_H_ +#define _DATE_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* DATE */ +typedef DATE_ENCODING_t DATE_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_DATE; +asn_struct_free_f DATE_free; +asn_struct_print_f DATE_print; +asn_constr_check_f DATE_constraint; +xer_type_decoder_f DATE_decode_xer; +xer_type_encoder_f DATE_encode_xer; +oer_type_decoder_f DATE_decode_oer; +oer_type_encoder_f DATE_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _DATE_H_ */ +#include diff --git a/certgen/asncodec/DcDelete.c b/certgen/asncodec/DcDelete.c index 4e97cf9..726be28 100644 --- a/certgen/asncodec/DcDelete.c +++ b/certgen/asncodec/DcDelete.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "DcDelete.h" @@ -24,7 +24,15 @@ asn_TYPE_descriptor_t asn_DEF_DcDelete = { asn_DEF_DcDelete_tags_1, /* Same as above */ sizeof(asn_DEF_DcDelete_tags_1) /sizeof(asn_DEF_DcDelete_tags_1[0]), /* 1 */ - { 0, 0, IA5String_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + IA5String_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/DcDelete.h b/certgen/asncodec/DcDelete.h index 46afb09..37aaae1 100644 --- a/certgen/asncodec/DcDelete.h +++ b/certgen/asncodec/DcDelete.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Url.h" #ifndef _DcDelete_H_ #define _DcDelete_H_ #include -/* Including external dependencies */ -#include "Url.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_DcDelete; asn_struct_free_f DcDelete_free; asn_struct_print_f DcDelete_print; asn_constr_check_f DcDelete_constraint; -ber_type_decoder_f DcDelete_decode_ber; -der_type_encoder_f DcDelete_encode_der; xer_type_decoder_f DcDelete_decode_xer; xer_type_encoder_f DcDelete_encode_xer; oer_type_decoder_f DcDelete_decode_oer; diff --git a/certgen/asncodec/DcEntry.c b/certgen/asncodec/DcEntry.c index bd8fe0b..3d77f01 100644 --- a/certgen/asncodec/DcEntry.c +++ b/certgen/asncodec/DcEntry.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "DcEntry.h" @@ -13,7 +13,15 @@ static asn_TYPE_member_t asn_MBR_cert_3[] = { 0, &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -38,7 +46,15 @@ asn_TYPE_descriptor_t asn_DEF_cert_3 = { asn_DEF_cert_tags_3, /* Same as above */ sizeof(asn_DEF_cert_tags_3) /sizeof(asn_DEF_cert_tags_3[0]), /* 2 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_cert_3, 1, /* Single element */ &asn_SPC_cert_specs_3 /* Additional specs */ @@ -50,7 +66,15 @@ asn_TYPE_member_t asn_MBR_DcEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Url, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "url" }, @@ -59,7 +83,15 @@ asn_TYPE_member_t asn_MBR_DcEntry_1[] = { 0, &asn_DEF_cert_3, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "cert" }, @@ -89,7 +121,15 @@ asn_TYPE_descriptor_t asn_DEF_DcEntry = { asn_DEF_DcEntry_tags_1, /* Same as above */ sizeof(asn_DEF_DcEntry_tags_1) /sizeof(asn_DEF_DcEntry_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_DcEntry_1, 2, /* Elements count */ &asn_SPC_DcEntry_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/DcEntry.h b/certgen/asncodec/DcEntry.h index 106ccae..2036095 100644 --- a/certgen/asncodec/DcEntry.h +++ b/certgen/asncodec/DcEntry.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _DcEntry_H_ -#define _DcEntry_H_ - - -#include /* Including external dependencies */ #include "Url.h" @@ -17,6 +12,11 @@ #include #include #include +#ifndef _DcEntry_H_ +#define _DcEntry_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/DcSsp.c b/certgen/asncodec/DcSsp.c new file mode 100644 index 0000000..2afa859 --- /dev/null +++ b/certgen/asncodec/DcSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "DcSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_DcSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct DcSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_DcSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_DcSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_DcSsp_specs_1 = { + sizeof(struct DcSsp), + offsetof(struct DcSsp, _asn_ctx), + asn_MAP_DcSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_DcSsp = { + "DcSsp", + "DcSsp", + &asn_OP_SEQUENCE, + asn_DEF_DcSsp_tags_1, + sizeof(asn_DEF_DcSsp_tags_1) + /sizeof(asn_DEF_DcSsp_tags_1[0]), /* 1 */ + asn_DEF_DcSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_DcSsp_tags_1) + /sizeof(asn_DEF_DcSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_DcSsp_1, + 1, /* Elements count */ + &asn_SPC_DcSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/DcSsp.h b/certgen/asncodec/DcSsp.h new file mode 100644 index 0000000..1997fa5 --- /dev/null +++ b/certgen/asncodec/DcSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _DcSsp_H_ +#define _DcSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* DcSsp */ +typedef struct DcSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} DcSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_DcSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_DcSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_DcSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _DcSsp_H_ */ +#include diff --git a/certgen/asncodec/DcmSsp.c b/certgen/asncodec/DcmSsp.c new file mode 100644 index 0000000..593231d --- /dev/null +++ b/certgen/asncodec/DcmSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "DcmSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_DcmSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct DcmSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_DcmSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_DcmSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_DcmSsp_specs_1 = { + sizeof(struct DcmSsp), + offsetof(struct DcmSsp, _asn_ctx), + asn_MAP_DcmSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_DcmSsp = { + "DcmSsp", + "DcmSsp", + &asn_OP_SEQUENCE, + asn_DEF_DcmSsp_tags_1, + sizeof(asn_DEF_DcmSsp_tags_1) + /sizeof(asn_DEF_DcmSsp_tags_1[0]), /* 1 */ + asn_DEF_DcmSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_DcmSsp_tags_1) + /sizeof(asn_DEF_DcmSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_DcmSsp_1, + 1, /* Elements count */ + &asn_SPC_DcmSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/DcmSsp.h b/certgen/asncodec/DcmSsp.h new file mode 100644 index 0000000..30235b1 --- /dev/null +++ b/certgen/asncodec/DcmSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _DcmSsp_H_ +#define _DcmSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* DcmSsp */ +typedef struct DcmSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} DcmSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_DcmSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_DcmSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_DcmSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _DcmSsp_H_ */ +#include diff --git a/certgen/asncodec/DeltaCtl.c b/certgen/asncodec/DeltaCtl.c index ce2ca98..6eeb628 100644 --- a/certgen/asncodec/DeltaCtl.c +++ b/certgen/asncodec/DeltaCtl.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "DeltaCtl.h" @@ -30,9 +30,11 @@ DeltaCtl_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using CtlFormat, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_DeltaCtl_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_DeltaCtl_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_DeltaCtl = { asn_DEF_DeltaCtl_tags_1, /* Same as above */ sizeof(asn_DEF_DeltaCtl_tags_1) /sizeof(asn_DEF_DeltaCtl_tags_1[0]), /* 1 */ - { &asn_OER_type_DeltaCtl_constr_1, 0, DeltaCtl_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_DeltaCtl_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + DeltaCtl_constraint + }, asn_MBR_CtlFormat_1, 5, /* Elements count */ &asn_SPC_CtlFormat_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/DeltaCtl.h b/certgen/asncodec/DeltaCtl.h index fda632e..6959c5b 100644 --- a/certgen/asncodec/DeltaCtl.h +++ b/certgen/asncodec/DeltaCtl.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "CtlFormat.h" #ifndef _DeltaCtl_H_ #define _DeltaCtl_H_ #include -/* Including external dependencies */ -#include "CtlFormat.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_DeltaCtl; asn_struct_free_f DeltaCtl_free; asn_struct_print_f DeltaCtl_print; asn_constr_check_f DeltaCtl_constraint; -ber_type_decoder_f DeltaCtl_decode_ber; -der_type_encoder_f DeltaCtl_encode_der; xer_type_decoder_f DeltaCtl_decode_xer; xer_type_encoder_f DeltaCtl_encode_xer; oer_type_decoder_f DeltaCtl_decode_oer; diff --git a/certgen/asncodec/Duration.c b/certgen/asncodec/Duration.c index 1a75b0f..70a0104 100644 --- a/certgen/asncodec/Duration.c +++ b/certgen/asncodec/Duration.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Duration.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Duration_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_Duration_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Duration, choice.microseconds), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "microseconds" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_Duration_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "milliseconds" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_Duration_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "seconds" }, @@ -43,7 +69,15 @@ asn_TYPE_member_t asn_MBR_Duration_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "minutes" }, @@ -52,7 +86,15 @@ asn_TYPE_member_t asn_MBR_Duration_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "hours" }, @@ -61,7 +103,15 @@ asn_TYPE_member_t asn_MBR_Duration_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "sixtyHours" }, @@ -70,7 +120,15 @@ asn_TYPE_member_t asn_MBR_Duration_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "years" }, @@ -102,7 +160,15 @@ asn_TYPE_descriptor_t asn_DEF_Duration = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_Duration_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Duration_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_Duration_1, 7, /* Elements count */ &asn_SPC_Duration_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/Duration.h b/certgen/asncodec/Duration.h index d805a2b..bbd9ce5 100644 --- a/certgen/asncodec/Duration.h +++ b/certgen/asncodec/Duration.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Uint16.h" +#include #ifndef _Duration_H_ #define _Duration_H_ #include -/* Including external dependencies */ -#include "Uint16.h" -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/EXTERNAL.c b/certgen/asncodec/EXTERNAL.c new file mode 100644 index 0000000..d81c2ea --- /dev/null +++ b/certgen/asncodec/EXTERNAL.c @@ -0,0 +1,221 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-UsefulInformationObjectClasses" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/ASN1C-UsefulInformationObjectClasses.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EXTERNAL.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_encoding_constr_5 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_encoding_5[] = { + { ATF_NOFLAGS, 0, offsetof(struct EXTERNAL__encoding, choice.single_ASN1_type), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_ANY, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "single-ASN1-type" + }, + { ATF_NOFLAGS, 0, offsetof(struct EXTERNAL__encoding, choice.octet_aligned), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "octet-aligned" + }, + { ATF_NOFLAGS, 0, offsetof(struct EXTERNAL__encoding, choice.arbitrary), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_BIT_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "arbitrary" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_encoding_tag2el_5[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* single-ASN1-type */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* octet-aligned */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* arbitrary */ +}; +static asn_CHOICE_specifics_t asn_SPC_encoding_specs_5 = { + sizeof(struct EXTERNAL__encoding), + offsetof(struct EXTERNAL__encoding, _asn_ctx), + offsetof(struct EXTERNAL__encoding, present), + sizeof(((struct EXTERNAL__encoding *)0)->present), + asn_MAP_encoding_tag2el_5, + 3, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_encoding_5 = { + "encoding", + "encoding", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_encoding_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_encoding_5, + 3, /* Elements count */ + &asn_SPC_encoding_specs_5 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_EXTERNAL_1[] = { + { ATF_POINTER, 3, offsetof(struct EXTERNAL, direct_reference), + (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), + 0, + &asn_DEF_OBJECT_IDENTIFIER, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "direct-reference" + }, + { ATF_POINTER, 2, offsetof(struct EXTERNAL, indirect_reference), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "indirect-reference" + }, + { ATF_POINTER, 1, offsetof(struct EXTERNAL, data_value_descriptor), + (ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), + 0, + &asn_DEF_ObjectDescriptor, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "data-value-descriptor" + }, + { ATF_NOFLAGS, 0, offsetof(struct EXTERNAL, encoding), + -1 /* Ambiguous tag (CHOICE?) */, + 0, + &asn_DEF_encoding_5, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "encoding" + }, +}; +static const int asn_MAP_EXTERNAL_oms_1[] = { 0, 1, 2 }; +static const ber_tlv_tag_t asn_DEF_EXTERNAL_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (8 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EXTERNAL_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* indirect-reference */ + { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 }, /* direct-reference */ + { (ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), 2, 0, 0 }, /* data-value-descriptor */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* single-ASN1-type */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* octet-aligned */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 3, 0, 0 } /* arbitrary */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_EXTERNAL_specs_1 = { + sizeof(struct EXTERNAL), + offsetof(struct EXTERNAL, _asn_ctx), + asn_MAP_EXTERNAL_tag2el_1, + 6, /* Count of tags in the map */ + asn_MAP_EXTERNAL_oms_1, /* Optional members */ + 3, 0, /* Root/Additions */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EXTERNAL = { + "EXTERNAL", + "EXTERNAL", + &asn_OP_SEQUENCE, + asn_DEF_EXTERNAL_tags_1, + sizeof(asn_DEF_EXTERNAL_tags_1) + /sizeof(asn_DEF_EXTERNAL_tags_1[0]) - 1, /* 1 */ + asn_DEF_EXTERNAL_tags_1, /* Same as above */ + sizeof(asn_DEF_EXTERNAL_tags_1) + /sizeof(asn_DEF_EXTERNAL_tags_1[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EXTERNAL_1, + 4, /* Elements count */ + &asn_SPC_EXTERNAL_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EXTERNAL.h b/certgen/asncodec/EXTERNAL.h new file mode 100644 index 0000000..667ec00 --- /dev/null +++ b/certgen/asncodec/EXTERNAL.h @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-UsefulInformationObjectClasses" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/ASN1C-UsefulInformationObjectClasses.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _EXTERNAL_H_ +#define _EXTERNAL_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum EXTERNAL__encoding_PR { + EXTERNAL__encoding_PR_NOTHING, /* No components present */ + EXTERNAL__encoding_PR_single_ASN1_type, + EXTERNAL__encoding_PR_octet_aligned, + EXTERNAL__encoding_PR_arbitrary +} EXTERNAL__encoding_PR; + +/* EXTERNAL */ +typedef struct EXTERNAL { + OBJECT_IDENTIFIER_t *direct_reference; /* OPTIONAL */ + long *indirect_reference; /* OPTIONAL */ + ObjectDescriptor_t *data_value_descriptor; /* OPTIONAL */ + struct EXTERNAL__encoding { + EXTERNAL__encoding_PR present; + union EXTERNAL__encoding_u { + ANY_t single_ASN1_type; + OCTET_STRING_t octet_aligned; + BIT_STRING_t arbitrary; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } encoding; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EXTERNAL_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EXTERNAL; + +#ifdef __cplusplus +} +#endif + +#endif /* _EXTERNAL_H_ */ +#include diff --git a/certgen/asncodec/EaEntry.c b/certgen/asncodec/EaEntry.c index 9b90822..4ba5bc2 100644 --- a/certgen/asncodec/EaEntry.c +++ b/certgen/asncodec/EaEntry.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EaEntry.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_EaEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "eaCertificate" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_EaEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Url, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "aaAccessPoint" }, @@ -31,7 +47,15 @@ asn_TYPE_member_t asn_MBR_EaEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Url, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "itsAccessPoint" }, @@ -64,7 +88,15 @@ asn_TYPE_descriptor_t asn_DEF_EaEntry = { asn_DEF_EaEntry_tags_1, /* Same as above */ sizeof(asn_DEF_EaEntry_tags_1) /sizeof(asn_DEF_EaEntry_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_EaEntry_1, 3, /* Elements count */ &asn_SPC_EaEntry_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EaEntry.h b/certgen/asncodec/EaEntry.h index a19fd23..aa43b44 100644 --- a/certgen/asncodec/EaEntry.h +++ b/certgen/asncodec/EaEntry.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EaEntry_H_ -#define _EaEntry_H_ - - -#include /* Including external dependencies */ #include "EtsiTs103097Certificate.h" #include "Url.h" #include +#ifndef _EaEntry_H_ +#define _EaEntry_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -24,7 +24,7 @@ extern "C" { typedef struct EaEntry { EtsiTs103097Certificate_t eaCertificate; Url_t aaAccessPoint; - Url_t *itsAccessPoint /* OPTIONAL */; + Url_t *itsAccessPoint; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/EcSignature.c b/certgen/asncodec/EcSignature.c index fd413bd..bd68776 100644 --- a/certgen/asncodec/EcSignature.c +++ b/certgen/asncodec/EcSignature.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EcSignature.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EcSignature_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_EcSignature_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EcSignature, choice.encryptedEcSignature), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ - &asn_DEF_EtsiTs103097Data_Encrypted_90P2, + &asn_DEF_EtsiTs103097Data_Encrypted_93P2, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "encryptedEcSignature" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_EcSignature_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Data_SignedExternalPayload, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecSignature" }, @@ -52,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_EcSignature = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_EcSignature_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EcSignature_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_EcSignature_1, 2, /* Elements count */ &asn_SPC_EcSignature_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EcSignature.h b/certgen/asncodec/EcSignature.h index 98b17e1..c33c3c6 100644 --- a/certgen/asncodec/EcSignature.h +++ b/certgen/asncodec/EcSignature.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EcSignature_H_ -#define _EcSignature_H_ - - -#include /* Including external dependencies */ #include "EtsiTs103097Data-Encrypted.h" #include "EtsiTs103097Data-SignedExternalPayload.h" #include +#ifndef _EcSignature_H_ +#define _EcSignature_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -31,7 +31,7 @@ typedef enum EcSignature_PR { typedef struct EcSignature { EcSignature_PR present; union EcSignature_u { - EtsiTs103097Data_Encrypted_90P2_t encryptedEcSignature; + EtsiTs103097Data_Encrypted_93P2_t encryptedEcSignature; EtsiTs103097Data_SignedExternalPayload_t ecSignature; } choice; diff --git a/certgen/asncodec/EcaEeCertResponse.c b/certgen/asncodec/EcaEeCertResponse.c new file mode 100644 index 0000000..b429b20 --- /dev/null +++ b/certgen/asncodec/EcaEeCertResponse.c @@ -0,0 +1,219 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EcaEeCertResponse.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_privateKeyInfo_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 32)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_privateKeyInfo_constr_7 CC_NOTUSED = { + { 0, 0 }, + 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EcaEeCertResponse_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EcaEeCertResponse, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcaEeCertResponse, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcaEeCertResponse, requestHash), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "requestHash" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcaEeCertResponse, ecaCertChain), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfCertificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ecaCertChain" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcaEeCertResponse, certificate), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Certificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certificate" + }, + { ATF_POINTER, 1, offsetof(struct EcaEeCertResponse, privateKeyInfo), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_privateKeyInfo_constr_7, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_privateKeyInfo_constraint_1 + }, + 0, 0, /* No default value */ + "privateKeyInfo" + }, +}; +static const int asn_MAP_EcaEeCertResponse_oms_1[] = { 5 }; +static const ber_tlv_tag_t asn_DEF_EcaEeCertResponse_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EcaEeCertResponse_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* requestHash */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ecaCertChain */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* certificate */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* privateKeyInfo */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EcaEeCertResponse_specs_1 = { + sizeof(struct EcaEeCertResponse), + offsetof(struct EcaEeCertResponse, _asn_ctx), + asn_MAP_EcaEeCertResponse_tag2el_1, + 6, /* Count of tags in the map */ + asn_MAP_EcaEeCertResponse_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 6, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EcaEeCertResponse = { + "EcaEeCertResponse", + "EcaEeCertResponse", + &asn_OP_SEQUENCE, + asn_DEF_EcaEeCertResponse_tags_1, + sizeof(asn_DEF_EcaEeCertResponse_tags_1) + /sizeof(asn_DEF_EcaEeCertResponse_tags_1[0]), /* 1 */ + asn_DEF_EcaEeCertResponse_tags_1, /* Same as above */ + sizeof(asn_DEF_EcaEeCertResponse_tags_1) + /sizeof(asn_DEF_EcaEeCertResponse_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EcaEeCertResponse_1, + 6, /* Elements count */ + &asn_SPC_EcaEeCertResponse_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EcaEeCertResponse.h b/certgen/asncodec/EcaEeCertResponse.h new file mode 100644 index 0000000..ab10d10 --- /dev/null +++ b/certgen/asncodec/EcaEeCertResponse.h @@ -0,0 +1,54 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "HashedId8.h" +#include "SequenceOfCertificate.h" +#include "Certificate.h" +#include +#include +#ifndef _EcaEeCertResponse_H_ +#define _EcaEeCertResponse_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EcaEeCertResponse */ +typedef struct EcaEeCertResponse { + Uint8_t version; + Time32_t generationTime; + HashedId8_t requestHash; + SequenceOfCertificate_t ecaCertChain; + Certificate_t certificate; + OCTET_STRING_t *privateKeyInfo; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EcaEeCertResponse_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EcaEeCertResponse; +extern asn_SEQUENCE_specifics_t asn_SPC_EcaEeCertResponse_specs_1; +extern asn_TYPE_member_t asn_MBR_EcaEeCertResponse_1[6]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EcaEeCertResponse_H_ */ +#include diff --git a/certgen/asncodec/EcaEeCertResponseSpdu.c b/certgen/asncodec/EcaEeCertResponseSpdu.c new file mode 100644 index 0000000..49e1a99 --- /dev/null +++ b/certgen/asncodec/EcaEeCertResponseSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EcaEeCertResponseSpdu.h" + +int +EcaEeCertResponseSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EcaEeCertResponseSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EcaEeCertResponseSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EcaEeCertResponseSpdu = { + "EcaEeCertResponseSpdu", + "EcaEeCertResponseSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EcaEeCertResponseSpdu_tags_1, + sizeof(asn_DEF_EcaEeCertResponseSpdu_tags_1) + /sizeof(asn_DEF_EcaEeCertResponseSpdu_tags_1[0]), /* 1 */ + asn_DEF_EcaEeCertResponseSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EcaEeCertResponseSpdu_tags_1) + /sizeof(asn_DEF_EcaEeCertResponseSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EcaEeCertResponseSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EcaEeCertResponseSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EcaEeCertResponseSpdu.h b/certgen/asncodec/EcaEeCertResponseSpdu.h new file mode 100644 index 0000000..a84aec3 --- /dev/null +++ b/certgen/asncodec/EcaEeCertResponseSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _EcaEeCertResponseSpdu_H_ +#define _EcaEeCertResponseSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EcaEeCertResponseSpdu */ +typedef Ieee1609Dot2Data_Signed_228P2_t EcaEeCertResponseSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EcaEeCertResponseSpdu; +asn_struct_free_f EcaEeCertResponseSpdu_free; +asn_struct_print_f EcaEeCertResponseSpdu_print; +asn_constr_check_f EcaEeCertResponseSpdu_constraint; +xer_type_decoder_f EcaEeCertResponseSpdu_decode_xer; +xer_type_encoder_f EcaEeCertResponseSpdu_encode_xer; +oer_type_decoder_f EcaEeCertResponseSpdu_decode_oer; +oer_type_encoder_f EcaEeCertResponseSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EcaEeCertResponseSpdu_H_ */ +#include diff --git a/certgen/asncodec/EcaEeInterfacePdu.c b/certgen/asncodec/EcaEeInterfacePdu.c new file mode 100644 index 0000000..362ed2d --- /dev/null +++ b/certgen/asncodec/EcaEeInterfacePdu.c @@ -0,0 +1,86 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EcaEeInterfacePdu.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EcaEeInterfacePdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EcaEeInterfacePdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EcaEeInterfacePdu, choice.eeEcaCertRequest), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeEcaCertRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "eeEcaCertRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcaEeInterfacePdu, choice.ecaEeCertResponse), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EcaEeCertResponse, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ecaEeCertResponse" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_EcaEeInterfacePdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* eeEcaCertRequest */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ecaEeCertResponse */ +}; +asn_CHOICE_specifics_t asn_SPC_EcaEeInterfacePdu_specs_1 = { + sizeof(struct EcaEeInterfacePdu), + offsetof(struct EcaEeInterfacePdu, _asn_ctx), + offsetof(struct EcaEeInterfacePdu, present), + sizeof(((struct EcaEeInterfacePdu *)0)->present), + asn_MAP_EcaEeInterfacePdu_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, + 2 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_EcaEeInterfacePdu = { + "EcaEeInterfacePdu", + "EcaEeInterfacePdu", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EcaEeInterfacePdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_EcaEeInterfacePdu_1, + 2, /* Elements count */ + &asn_SPC_EcaEeInterfacePdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EcaEeInterfacePdu.h b/certgen/asncodec/EcaEeInterfacePdu.h new file mode 100644 index 0000000..1aebcdc --- /dev/null +++ b/certgen/asncodec/EcaEeInterfacePdu.h @@ -0,0 +1,58 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EeEcaCertRequest.h" +#include "EcaEeCertResponse.h" +#include +#ifndef _EcaEeInterfacePdu_H_ +#define _EcaEeInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum EcaEeInterfacePdu_PR { + EcaEeInterfacePdu_PR_NOTHING, /* No components present */ + EcaEeInterfacePdu_PR_eeEcaCertRequest, + EcaEeInterfacePdu_PR_ecaEeCertResponse + /* Extensions may appear below */ + +} EcaEeInterfacePdu_PR; + +/* EcaEeInterfacePdu */ +typedef struct EcaEeInterfacePdu { + EcaEeInterfacePdu_PR present; + union EcaEeInterfacePdu_u { + EeEcaCertRequest_t eeEcaCertRequest; + EcaEeCertResponse_t ecaEeCertResponse; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EcaEeInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EcaEeInterfacePdu; +extern asn_CHOICE_specifics_t asn_SPC_EcaEeInterfacePdu_specs_1; +extern asn_TYPE_member_t asn_MBR_EcaEeInterfacePdu_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EcaEeInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/EcaSsp.c b/certgen/asncodec/EcaSsp.c new file mode 100644 index 0000000..1f2d702 --- /dev/null +++ b/certgen/asncodec/EcaSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EcaSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EcaSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EcaSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_EcaSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EcaSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EcaSsp_specs_1 = { + sizeof(struct EcaSsp), + offsetof(struct EcaSsp, _asn_ctx), + asn_MAP_EcaSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EcaSsp = { + "EcaSsp", + "EcaSsp", + &asn_OP_SEQUENCE, + asn_DEF_EcaSsp_tags_1, + sizeof(asn_DEF_EcaSsp_tags_1) + /sizeof(asn_DEF_EcaSsp_tags_1[0]), /* 1 */ + asn_DEF_EcaSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_EcaSsp_tags_1) + /sizeof(asn_DEF_EcaSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EcaSsp_1, + 1, /* Elements count */ + &asn_SPC_EcaSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EcaSsp.h b/certgen/asncodec/EcaSsp.h new file mode 100644 index 0000000..d943d85 --- /dev/null +++ b/certgen/asncodec/EcaSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _EcaSsp_H_ +#define _EcaSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EcaSsp */ +typedef struct EcaSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EcaSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EcaSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_EcaSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_EcaSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EcaSsp_H_ */ +#include diff --git a/certgen/asncodec/EccP256CurvePoint.c b/certgen/asncodec/EccP256CurvePoint.c index d76a36f..f183427 100644 --- a/certgen/asncodec/EccP256CurvePoint.c +++ b/certgen/asncodec/EccP256CurvePoint.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EccP256CurvePoint.h" @@ -137,31 +137,51 @@ memb_compressed_y_1_constraint_1(const asn_TYPE_descriptor_t *td, const void *sp } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_x_constr_7 CC_NOTUSED = { { 0, 0 }, 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_y_constr_8 CC_NOTUSED = { { 0, 0 }, 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_x_only_constr_2 CC_NOTUSED = { { 0, 0 }, 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_compressed_y_0_constr_4 CC_NOTUSED = { { 0, 0 }, 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_compressed_y_1_constr_5 CC_NOTUSED = { { 0, 0 }, 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EccP256CurvePoint_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static asn_TYPE_member_t asn_MBR_uncompressedP256_6[] = { { ATF_NOFLAGS, 0, offsetof(struct EccP256CurvePoint__uncompressedP256, x), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_x_constr_7, 0, memb_x_constraint_6 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_x_constr_7, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_x_constraint_6 + }, 0, 0, /* No default value */ "x" }, @@ -170,7 +190,15 @@ static asn_TYPE_member_t asn_MBR_uncompressedP256_6[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_y_constr_8, 0, memb_y_constraint_6 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_y_constr_8, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_y_constraint_6 + }, 0, 0, /* No default value */ "y" }, @@ -202,7 +230,15 @@ asn_TYPE_descriptor_t asn_DEF_uncompressedP256_6 = { asn_DEF_uncompressedP256_tags_6, /* Same as above */ sizeof(asn_DEF_uncompressedP256_tags_6) /sizeof(asn_DEF_uncompressedP256_tags_6[0]), /* 2 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_uncompressedP256_6, 2, /* Elements count */ &asn_SPC_uncompressedP256_specs_6 /* Additional specs */ @@ -214,7 +250,15 @@ asn_TYPE_member_t asn_MBR_EccP256CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_x_only_constr_2, 0, memb_x_only_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_x_only_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_x_only_constraint_1 + }, 0, 0, /* No default value */ "x-only" }, @@ -223,7 +267,15 @@ asn_TYPE_member_t asn_MBR_EccP256CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NULL, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "fill" }, @@ -232,7 +284,15 @@ asn_TYPE_member_t asn_MBR_EccP256CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_compressed_y_0_constr_4, 0, memb_compressed_y_0_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_compressed_y_0_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_compressed_y_0_constraint_1 + }, 0, 0, /* No default value */ "compressed-y-0" }, @@ -241,7 +301,15 @@ asn_TYPE_member_t asn_MBR_EccP256CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_compressed_y_1_constr_5, 0, memb_compressed_y_1_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_compressed_y_1_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_compressed_y_1_constraint_1 + }, 0, 0, /* No default value */ "compressed-y-1" }, @@ -250,7 +318,15 @@ asn_TYPE_member_t asn_MBR_EccP256CurvePoint_1[] = { 0, &asn_DEF_uncompressedP256_6, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "uncompressedP256" }, @@ -280,7 +356,15 @@ asn_TYPE_descriptor_t asn_DEF_EccP256CurvePoint = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_EccP256CurvePoint_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EccP256CurvePoint_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_EccP256CurvePoint_1, 5, /* Elements count */ &asn_SPC_EccP256CurvePoint_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EccP256CurvePoint.h b/certgen/asncodec/EccP256CurvePoint.h index 1da0fc4..09dda86 100644 --- a/certgen/asncodec/EccP256CurvePoint.h +++ b/certgen/asncodec/EccP256CurvePoint.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EccP256CurvePoint_H_ -#define _EccP256CurvePoint_H_ - - -#include /* Including external dependencies */ #include #include #include #include +#ifndef _EccP256CurvePoint_H_ +#define _EccP256CurvePoint_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EccP384CurvePoint.c b/certgen/asncodec/EccP384CurvePoint.c index 311f806..dbbaf63 100644 --- a/certgen/asncodec/EccP384CurvePoint.c +++ b/certgen/asncodec/EccP384CurvePoint.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EccP384CurvePoint.h" @@ -137,31 +137,51 @@ memb_compressed_y_1_constraint_1(const asn_TYPE_descriptor_t *td, const void *sp } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_x_constr_7 CC_NOTUSED = { { 0, 0 }, 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_y_constr_8 CC_NOTUSED = { { 0, 0 }, 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_x_only_constr_2 CC_NOTUSED = { { 0, 0 }, 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_compressed_y_0_constr_4 CC_NOTUSED = { { 0, 0 }, 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_compressed_y_1_constr_5 CC_NOTUSED = { { 0, 0 }, 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EccP384CurvePoint_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static asn_TYPE_member_t asn_MBR_uncompressedP384_6[] = { { ATF_NOFLAGS, 0, offsetof(struct EccP384CurvePoint__uncompressedP384, x), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_x_constr_7, 0, memb_x_constraint_6 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_x_constr_7, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_x_constraint_6 + }, 0, 0, /* No default value */ "x" }, @@ -170,7 +190,15 @@ static asn_TYPE_member_t asn_MBR_uncompressedP384_6[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_y_constr_8, 0, memb_y_constraint_6 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_y_constr_8, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_y_constraint_6 + }, 0, 0, /* No default value */ "y" }, @@ -202,7 +230,15 @@ asn_TYPE_descriptor_t asn_DEF_uncompressedP384_6 = { asn_DEF_uncompressedP384_tags_6, /* Same as above */ sizeof(asn_DEF_uncompressedP384_tags_6) /sizeof(asn_DEF_uncompressedP384_tags_6[0]), /* 2 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_uncompressedP384_6, 2, /* Elements count */ &asn_SPC_uncompressedP384_specs_6 /* Additional specs */ @@ -214,7 +250,15 @@ asn_TYPE_member_t asn_MBR_EccP384CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_x_only_constr_2, 0, memb_x_only_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_x_only_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_x_only_constraint_1 + }, 0, 0, /* No default value */ "x-only" }, @@ -223,7 +267,15 @@ asn_TYPE_member_t asn_MBR_EccP384CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NULL, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "fill" }, @@ -232,7 +284,15 @@ asn_TYPE_member_t asn_MBR_EccP384CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_compressed_y_0_constr_4, 0, memb_compressed_y_0_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_compressed_y_0_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_compressed_y_0_constraint_1 + }, 0, 0, /* No default value */ "compressed-y-0" }, @@ -241,7 +301,15 @@ asn_TYPE_member_t asn_MBR_EccP384CurvePoint_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_compressed_y_1_constr_5, 0, memb_compressed_y_1_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_compressed_y_1_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_compressed_y_1_constraint_1 + }, 0, 0, /* No default value */ "compressed-y-1" }, @@ -250,7 +318,15 @@ asn_TYPE_member_t asn_MBR_EccP384CurvePoint_1[] = { 0, &asn_DEF_uncompressedP384_6, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "uncompressedP384" }, @@ -280,7 +356,15 @@ asn_TYPE_descriptor_t asn_DEF_EccP384CurvePoint = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_EccP384CurvePoint_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EccP384CurvePoint_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_EccP384CurvePoint_1, 5, /* Elements count */ &asn_SPC_EccP384CurvePoint_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EccP384CurvePoint.h b/certgen/asncodec/EccP384CurvePoint.h index 04e2714..cfeb6db 100644 --- a/certgen/asncodec/EccP384CurvePoint.h +++ b/certgen/asncodec/EccP384CurvePoint.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EccP384CurvePoint_H_ -#define _EccP384CurvePoint_H_ - - -#include /* Including external dependencies */ #include #include #include #include +#ifndef _EccP384CurvePoint_H_ +#define _EccP384CurvePoint_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EcdsaP256Signature.c b/certgen/asncodec/EcdsaP256Signature.c index 9e10a0f..8f66576 100644 --- a/certgen/asncodec/EcdsaP256Signature.c +++ b/certgen/asncodec/EcdsaP256Signature.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EcdsaP256Signature.h" @@ -33,16 +33,26 @@ memb_sSig_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_sSig_constr_3 CC_NOTUSED = { { 0, 0 }, 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_EcdsaP256Signature_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EcdsaP256Signature, rSig), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP256CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "rSig" }, @@ -51,7 +61,15 @@ asn_TYPE_member_t asn_MBR_EcdsaP256Signature_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_sSig_constr_3, 0, memb_sSig_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_sSig_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_sSig_constraint_1 + }, 0, 0, /* No default value */ "sSig" }, @@ -81,7 +99,15 @@ asn_TYPE_descriptor_t asn_DEF_EcdsaP256Signature = { asn_DEF_EcdsaP256Signature_tags_1, /* Same as above */ sizeof(asn_DEF_EcdsaP256Signature_tags_1) /sizeof(asn_DEF_EcdsaP256Signature_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_EcdsaP256Signature_1, 2, /* Elements count */ &asn_SPC_EcdsaP256Signature_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EcdsaP256Signature.h b/certgen/asncodec/EcdsaP256Signature.h index ead489b..f9962ed 100644 --- a/certgen/asncodec/EcdsaP256Signature.h +++ b/certgen/asncodec/EcdsaP256Signature.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EcdsaP256Signature_H_ -#define _EcdsaP256Signature_H_ - - -#include /* Including external dependencies */ #include "EccP256CurvePoint.h" #include #include +#ifndef _EcdsaP256Signature_H_ +#define _EcdsaP256Signature_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EcdsaP384Signature.c b/certgen/asncodec/EcdsaP384Signature.c index 5c1e9a7..16f6a41 100644 --- a/certgen/asncodec/EcdsaP384Signature.c +++ b/certgen/asncodec/EcdsaP384Signature.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EcdsaP384Signature.h" @@ -33,16 +33,26 @@ memb_sSig_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_sSig_constr_3 CC_NOTUSED = { { 0, 0 }, 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_EcdsaP384Signature_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EcdsaP384Signature, rSig), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP384CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "rSig" }, @@ -51,7 +61,15 @@ asn_TYPE_member_t asn_MBR_EcdsaP384Signature_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_sSig_constr_3, 0, memb_sSig_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_sSig_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_sSig_constraint_1 + }, 0, 0, /* No default value */ "sSig" }, @@ -81,7 +99,15 @@ asn_TYPE_descriptor_t asn_DEF_EcdsaP384Signature = { asn_DEF_EcdsaP384Signature_tags_1, /* Same as above */ sizeof(asn_DEF_EcdsaP384Signature_tags_1) /sizeof(asn_DEF_EcdsaP384Signature_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_EcdsaP384Signature_1, 2, /* Elements count */ &asn_SPC_EcdsaP384Signature_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EcdsaP384Signature.h b/certgen/asncodec/EcdsaP384Signature.h index 1c56685..9263439 100644 --- a/certgen/asncodec/EcdsaP384Signature.h +++ b/certgen/asncodec/EcdsaP384Signature.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EcdsaP384Signature_H_ -#define _EcdsaP384Signature_H_ - - -#include /* Including external dependencies */ #include "EccP384CurvePoint.h" #include #include +#ifndef _EcdsaP384Signature_H_ +#define _EcdsaP384Signature_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EcencP256EncryptedKey.c b/certgen/asncodec/EcencP256EncryptedKey.c new file mode 100644 index 0000000..ada2c99 --- /dev/null +++ b/certgen/asncodec/EcencP256EncryptedKey.c @@ -0,0 +1,164 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EcencP256EncryptedKey.h" + +static int +memb_c_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 16)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_t_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 32)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_c_constr_3 CC_NOTUSED = { + { 0, 0 }, + 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_t_constr_4 CC_NOTUSED = { + { 0, 0 }, + 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EcencP256EncryptedKey_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EcencP256EncryptedKey, v), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_EccP256CurvePoint, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "v" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcencP256EncryptedKey, c), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_c_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_c_constraint_1 + }, + 0, 0, /* No default value */ + "c" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcencP256EncryptedKey, t), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_t_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_t_constraint_1 + }, + 0, 0, /* No default value */ + "t" + }, +}; +static const ber_tlv_tag_t asn_DEF_EcencP256EncryptedKey_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EcencP256EncryptedKey_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* v */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* c */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* t */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EcencP256EncryptedKey_specs_1 = { + sizeof(struct EcencP256EncryptedKey), + offsetof(struct EcencP256EncryptedKey, _asn_ctx), + asn_MAP_EcencP256EncryptedKey_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EcencP256EncryptedKey = { + "EcencP256EncryptedKey", + "EcencP256EncryptedKey", + &asn_OP_SEQUENCE, + asn_DEF_EcencP256EncryptedKey_tags_1, + sizeof(asn_DEF_EcencP256EncryptedKey_tags_1) + /sizeof(asn_DEF_EcencP256EncryptedKey_tags_1[0]), /* 1 */ + asn_DEF_EcencP256EncryptedKey_tags_1, /* Same as above */ + sizeof(asn_DEF_EcencP256EncryptedKey_tags_1) + /sizeof(asn_DEF_EcencP256EncryptedKey_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EcencP256EncryptedKey_1, + 3, /* Elements count */ + &asn_SPC_EcencP256EncryptedKey_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EcencP256EncryptedKey.h b/certgen/asncodec/EcencP256EncryptedKey.h new file mode 100644 index 0000000..e3c4589 --- /dev/null +++ b/certgen/asncodec/EcencP256EncryptedKey.h @@ -0,0 +1,43 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EccP256CurvePoint.h" +#include +#include +#ifndef _EcencP256EncryptedKey_H_ +#define _EcencP256EncryptedKey_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EcencP256EncryptedKey */ +typedef struct EcencP256EncryptedKey { + EccP256CurvePoint_t v; + OCTET_STRING_t c; + OCTET_STRING_t t; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EcencP256EncryptedKey_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EcencP256EncryptedKey; +extern asn_SEQUENCE_specifics_t asn_SPC_EcencP256EncryptedKey_specs_1; +extern asn_TYPE_member_t asn_MBR_EcencP256EncryptedKey_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EcencP256EncryptedKey_H_ */ +#include diff --git a/certgen/asncodec/EciesP256EncryptedKey.c b/certgen/asncodec/EciesP256EncryptedKey.c index dd5a7ad..755e67d 100644 --- a/certgen/asncodec/EciesP256EncryptedKey.c +++ b/certgen/asncodec/EciesP256EncryptedKey.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EciesP256EncryptedKey.h" @@ -59,19 +59,31 @@ memb_t_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_c_constr_3 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_t_constr_4 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_EciesP256EncryptedKey_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EciesP256EncryptedKey, v), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP256CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "v" }, @@ -80,7 +92,15 @@ asn_TYPE_member_t asn_MBR_EciesP256EncryptedKey_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_c_constr_3, 0, memb_c_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_c_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_c_constraint_1 + }, 0, 0, /* No default value */ "c" }, @@ -89,7 +109,15 @@ asn_TYPE_member_t asn_MBR_EciesP256EncryptedKey_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_t_constr_4, 0, memb_t_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_t_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_t_constraint_1 + }, 0, 0, /* No default value */ "t" }, @@ -120,7 +148,15 @@ asn_TYPE_descriptor_t asn_DEF_EciesP256EncryptedKey = { asn_DEF_EciesP256EncryptedKey_tags_1, /* Same as above */ sizeof(asn_DEF_EciesP256EncryptedKey_tags_1) /sizeof(asn_DEF_EciesP256EncryptedKey_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_EciesP256EncryptedKey_1, 3, /* Elements count */ &asn_SPC_EciesP256EncryptedKey_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EciesP256EncryptedKey.h b/certgen/asncodec/EciesP256EncryptedKey.h index 918323b..628c864 100644 --- a/certgen/asncodec/EciesP256EncryptedKey.h +++ b/certgen/asncodec/EciesP256EncryptedKey.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EciesP256EncryptedKey_H_ -#define _EciesP256EncryptedKey_H_ - - -#include /* Including external dependencies */ #include "EccP256CurvePoint.h" #include #include +#ifndef _EciesP256EncryptedKey_H_ +#define _EciesP256EncryptedKey_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EcsigP256Signature.c b/certgen/asncodec/EcsigP256Signature.c new file mode 100644 index 0000000..aa100fc --- /dev/null +++ b/certgen/asncodec/EcsigP256Signature.c @@ -0,0 +1,146 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EcsigP256Signature.h" + +static int +memb_rSig_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 32)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_sSig_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 32)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_rSig_constr_2 CC_NOTUSED = { + { 0, 0 }, + 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_sSig_constr_3 CC_NOTUSED = { + { 0, 0 }, + 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EcsigP256Signature_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EcsigP256Signature, rSig), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_rSig_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_rSig_constraint_1 + }, + 0, 0, /* No default value */ + "rSig" + }, + { ATF_NOFLAGS, 0, offsetof(struct EcsigP256Signature, sSig), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_sSig_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_sSig_constraint_1 + }, + 0, 0, /* No default value */ + "sSig" + }, +}; +static const ber_tlv_tag_t asn_DEF_EcsigP256Signature_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EcsigP256Signature_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* rSig */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sSig */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EcsigP256Signature_specs_1 = { + sizeof(struct EcsigP256Signature), + offsetof(struct EcsigP256Signature, _asn_ctx), + asn_MAP_EcsigP256Signature_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EcsigP256Signature = { + "EcsigP256Signature", + "EcsigP256Signature", + &asn_OP_SEQUENCE, + asn_DEF_EcsigP256Signature_tags_1, + sizeof(asn_DEF_EcsigP256Signature_tags_1) + /sizeof(asn_DEF_EcsigP256Signature_tags_1[0]), /* 1 */ + asn_DEF_EcsigP256Signature_tags_1, /* Same as above */ + sizeof(asn_DEF_EcsigP256Signature_tags_1) + /sizeof(asn_DEF_EcsigP256Signature_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EcsigP256Signature_1, + 2, /* Elements count */ + &asn_SPC_EcsigP256Signature_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EcsigP256Signature.h b/certgen/asncodec/EcsigP256Signature.h new file mode 100644 index 0000000..901c3a0 --- /dev/null +++ b/certgen/asncodec/EcsigP256Signature.h @@ -0,0 +1,41 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _EcsigP256Signature_H_ +#define _EcsigP256Signature_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EcsigP256Signature */ +typedef struct EcsigP256Signature { + OCTET_STRING_t rSig; + OCTET_STRING_t sSig; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EcsigP256Signature_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EcsigP256Signature; +extern asn_SEQUENCE_specifics_t asn_SPC_EcsigP256Signature_specs_1; +extern asn_TYPE_member_t asn_MBR_EcsigP256Signature_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EcsigP256Signature_H_ */ +#include diff --git a/certgen/asncodec/EeEcaCertRequest.c b/certgen/asncodec/EeEcaCertRequest.c new file mode 100644 index 0000000..644b720 --- /dev/null +++ b/certgen/asncodec/EeEcaCertRequest.c @@ -0,0 +1,194 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeEcaCertRequest.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_tbsCert_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_tbsCert_constr_5 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EeEcaCertRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EeEcaCertRequest, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeEcaCertRequest, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeEcaCertRequest, type), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CertificateType, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "type" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeEcaCertRequest, tbsCert), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedCertificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_tbsCert_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_tbsCert_constraint_1 + }, + 0, 0, /* No default value */ + "tbsCert" + }, + { ATF_POINTER, 1, offsetof(struct EeEcaCertRequest, canonicalId), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IA5String, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "canonicalId" + }, +}; +static const int asn_MAP_EeEcaCertRequest_oms_1[] = { 4 }; +static const ber_tlv_tag_t asn_DEF_EeEcaCertRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EeEcaCertRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* type */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* tbsCert */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* canonicalId */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EeEcaCertRequest_specs_1 = { + sizeof(struct EeEcaCertRequest), + offsetof(struct EeEcaCertRequest, _asn_ctx), + asn_MAP_EeEcaCertRequest_tag2el_1, + 5, /* Count of tags in the map */ + asn_MAP_EeEcaCertRequest_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 5, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EeEcaCertRequest = { + "EeEcaCertRequest", + "EeEcaCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_EeEcaCertRequest_tags_1, + sizeof(asn_DEF_EeEcaCertRequest_tags_1) + /sizeof(asn_DEF_EeEcaCertRequest_tags_1[0]), /* 1 */ + asn_DEF_EeEcaCertRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_EeEcaCertRequest_tags_1) + /sizeof(asn_DEF_EeEcaCertRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EeEcaCertRequest_1, + 5, /* Elements count */ + &asn_SPC_EeEcaCertRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeEcaCertRequest.h b/certgen/asncodec/EeEcaCertRequest.h new file mode 100644 index 0000000..7f404cc --- /dev/null +++ b/certgen/asncodec/EeEcaCertRequest.h @@ -0,0 +1,52 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EcaEeInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "CertificateType.h" +#include "ToBeSignedCertificate.h" +#include +#include +#ifndef _EeEcaCertRequest_H_ +#define _EeEcaCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeEcaCertRequest */ +typedef struct EeEcaCertRequest { + Uint8_t version; + Time32_t generationTime; + CertificateType_t type; + ToBeSignedCertificate_t tbsCert; + IA5String_t *canonicalId; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EeEcaCertRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeEcaCertRequest; +extern asn_SEQUENCE_specifics_t asn_SPC_EeEcaCertRequest_specs_1; +extern asn_TYPE_member_t asn_MBR_EeEcaCertRequest_1[5]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeEcaCertRequest_H_ */ +#include diff --git a/certgen/asncodec/EeEcaCertRequestSpdu.c b/certgen/asncodec/EeEcaCertRequestSpdu.c new file mode 100644 index 0000000..25177dc --- /dev/null +++ b/certgen/asncodec/EeEcaCertRequestSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeEcaCertRequestSpdu.h" + +int +EeEcaCertRequestSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_SignedCertRequest_290P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeEcaCertRequestSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EeEcaCertRequestSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeEcaCertRequestSpdu = { + "EeEcaCertRequestSpdu", + "EeEcaCertRequestSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EeEcaCertRequestSpdu_tags_1, + sizeof(asn_DEF_EeEcaCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeEcaCertRequestSpdu_tags_1[0]), /* 1 */ + asn_DEF_EeEcaCertRequestSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeEcaCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeEcaCertRequestSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeEcaCertRequestSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EeEcaCertRequestSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeEcaCertRequestSpdu.h b/certgen/asncodec/EeEcaCertRequestSpdu.h new file mode 100644 index 0000000..fd09e0b --- /dev/null +++ b/certgen/asncodec/EeEcaCertRequestSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-SignedCertRequest.h" +#ifndef _EeEcaCertRequestSpdu_H_ +#define _EeEcaCertRequestSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeEcaCertRequestSpdu */ +typedef Ieee1609Dot2Data_SignedCertRequest_290P0_t EeEcaCertRequestSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeEcaCertRequestSpdu; +asn_struct_free_f EeEcaCertRequestSpdu_free; +asn_struct_print_f EeEcaCertRequestSpdu_print; +asn_constr_check_f EeEcaCertRequestSpdu_constraint; +xer_type_decoder_f EeEcaCertRequestSpdu_decode_xer; +xer_type_encoder_f EeEcaCertRequestSpdu_encode_xer; +oer_type_decoder_f EeEcaCertRequestSpdu_decode_oer; +oer_type_encoder_f EeEcaCertRequestSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeEcaCertRequestSpdu_H_ */ +#include diff --git a/certgen/asncodec/EeMaInterfacePdu.c b/certgen/asncodec/EeMaInterfacePdu.c new file mode 100644 index 0000000..b2a491d --- /dev/null +++ b/certgen/asncodec/EeMaInterfacePdu.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeMaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeMaInterfacePdu.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_EeMaInterfacePdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeMaInterfacePdu = { + "EeMaInterfacePdu", + "EeMaInterfacePdu", + &asn_OP_NULL, + asn_DEF_EeMaInterfacePdu_tags_1, + sizeof(asn_DEF_EeMaInterfacePdu_tags_1) + /sizeof(asn_DEF_EeMaInterfacePdu_tags_1[0]), /* 1 */ + asn_DEF_EeMaInterfacePdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeMaInterfacePdu_tags_1) + /sizeof(asn_DEF_EeMaInterfacePdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/EeMaInterfacePdu.h b/certgen/asncodec/EeMaInterfacePdu.h new file mode 100644 index 0000000..8bfe507 --- /dev/null +++ b/certgen/asncodec/EeMaInterfacePdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeMaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _EeMaInterfacePdu_H_ +#define _EeMaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeMaInterfacePdu */ +typedef NULL_t EeMaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeMaInterfacePdu; +asn_struct_free_f EeMaInterfacePdu_free; +asn_struct_print_f EeMaInterfacePdu_print; +asn_constr_check_f EeMaInterfacePdu_constraint; +xer_type_decoder_f EeMaInterfacePdu_decode_xer; +xer_type_encoder_f EeMaInterfacePdu_encode_xer; +oer_type_decoder_f EeMaInterfacePdu_decode_oer; +oer_type_encoder_f EeMaInterfacePdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeMaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.c b/certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.c new file mode 100644 index 0000000..7d578d9 --- /dev/null +++ b/certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRa1609Dot2AuthenticatedCertRequestSpdu.h" + +int +EeRa1609Dot2AuthenticatedCertRequestSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeRa1609Dot2AuthenticatedCertRequestSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu = { + "EeRa1609Dot2AuthenticatedCertRequestSpdu", + "EeRa1609Dot2AuthenticatedCertRequestSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu_tags_1, + sizeof(asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu_tags_1[0]), /* 1 */ + asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeRa1609Dot2AuthenticatedCertRequestSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EeRa1609Dot2AuthenticatedCertRequestSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.h b/certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.h new file mode 100644 index 0000000..58de1a0 --- /dev/null +++ b/certgen/asncodec/EeRa1609Dot2AuthenticatedCertRequestSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-SignedEncryptedCertRequest.h" +#ifndef _EeRa1609Dot2AuthenticatedCertRequestSpdu_H_ +#define _EeRa1609Dot2AuthenticatedCertRequestSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeRa1609Dot2AuthenticatedCertRequestSpdu */ +typedef Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_t EeRa1609Dot2AuthenticatedCertRequestSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRa1609Dot2AuthenticatedCertRequestSpdu; +asn_struct_free_f EeRa1609Dot2AuthenticatedCertRequestSpdu_free; +asn_struct_print_f EeRa1609Dot2AuthenticatedCertRequestSpdu_print; +asn_constr_check_f EeRa1609Dot2AuthenticatedCertRequestSpdu_constraint; +xer_type_decoder_f EeRa1609Dot2AuthenticatedCertRequestSpdu_decode_xer; +xer_type_encoder_f EeRa1609Dot2AuthenticatedCertRequestSpdu_encode_xer; +oer_type_decoder_f EeRa1609Dot2AuthenticatedCertRequestSpdu_decode_oer; +oer_type_encoder_f EeRa1609Dot2AuthenticatedCertRequestSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRa1609Dot2AuthenticatedCertRequestSpdu_H_ */ +#include diff --git a/certgen/asncodec/EeRaCertRequest.c b/certgen/asncodec/EeRaCertRequest.c new file mode 100644 index 0000000..c1a695e --- /dev/null +++ b/certgen/asncodec/EeRaCertRequest.c @@ -0,0 +1,194 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaCertRequest.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_tbsCert_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_tbsCert_constr_5 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EeRaCertRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EeRaCertRequest, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaCertRequest, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaCertRequest, type), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CertificateType, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "type" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaCertRequest, tbsCert), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedCertificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_tbsCert_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_tbsCert_constraint_1 + }, + 0, 0, /* No default value */ + "tbsCert" + }, + { ATF_POINTER, 1, offsetof(struct EeRaCertRequest, additionalParams), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_AdditionalParams, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "additionalParams" + }, +}; +static const int asn_MAP_EeRaCertRequest_oms_1[] = { 4 }; +static const ber_tlv_tag_t asn_DEF_EeRaCertRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EeRaCertRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* type */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* tbsCert */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* additionalParams */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EeRaCertRequest_specs_1 = { + sizeof(struct EeRaCertRequest), + offsetof(struct EeRaCertRequest, _asn_ctx), + asn_MAP_EeRaCertRequest_tag2el_1, + 5, /* Count of tags in the map */ + asn_MAP_EeRaCertRequest_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 5, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EeRaCertRequest = { + "EeRaCertRequest", + "EeRaCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_EeRaCertRequest_tags_1, + sizeof(asn_DEF_EeRaCertRequest_tags_1) + /sizeof(asn_DEF_EeRaCertRequest_tags_1[0]), /* 1 */ + asn_DEF_EeRaCertRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRaCertRequest_tags_1) + /sizeof(asn_DEF_EeRaCertRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EeRaCertRequest_1, + 5, /* Elements count */ + &asn_SPC_EeRaCertRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaCertRequest.h b/certgen/asncodec/EeRaCertRequest.h new file mode 100644 index 0000000..9b3567e --- /dev/null +++ b/certgen/asncodec/EeRaCertRequest.h @@ -0,0 +1,57 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "CertificateType.h" +#include "ToBeSignedCertificate.h" +#include +#ifndef _EeRaCertRequest_H_ +#define _EeRaCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct AdditionalParams; + +/* EeRaCertRequest */ +typedef struct EeRaCertRequest { + Uint8_t version; + Time32_t generationTime; + CertificateType_t type; + ToBeSignedCertificate_t tbsCert; + struct AdditionalParams *additionalParams; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EeRaCertRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaCertRequest; +extern asn_SEQUENCE_specifics_t asn_SPC_EeRaCertRequest_specs_1; +extern asn_TYPE_member_t asn_MBR_EeRaCertRequest_1[5]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "AdditionalParams.h" + +#endif /* _EeRaCertRequest_H_ */ +#include diff --git a/certgen/asncodec/EeRaCertRequestSpdu.c b/certgen/asncodec/EeRaCertRequestSpdu.c new file mode 100644 index 0000000..8bde0c0 --- /dev/null +++ b/certgen/asncodec/EeRaCertRequestSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaCertRequestSpdu.h" + +int +EeRaCertRequestSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeRaCertRequestSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EeRaCertRequestSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeRaCertRequestSpdu = { + "EeRaCertRequestSpdu", + "EeRaCertRequestSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EeRaCertRequestSpdu_tags_1, + sizeof(asn_DEF_EeRaCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaCertRequestSpdu_tags_1[0]), /* 1 */ + asn_DEF_EeRaCertRequestSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRaCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaCertRequestSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeRaCertRequestSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EeRaCertRequestSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaCertRequestSpdu.h b/certgen/asncodec/EeRaCertRequestSpdu.h new file mode 100644 index 0000000..30ac7f8 --- /dev/null +++ b/certgen/asncodec/EeRaCertRequestSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _EeRaCertRequestSpdu_H_ +#define _EeRaCertRequestSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeRaCertRequestSpdu */ +typedef Ieee1609Dot2Data_t EeRaCertRequestSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaCertRequestSpdu; +asn_struct_free_f EeRaCertRequestSpdu_free; +asn_struct_print_f EeRaCertRequestSpdu_print; +asn_constr_check_f EeRaCertRequestSpdu_constraint; +xer_type_decoder_f EeRaCertRequestSpdu_decode_xer; +xer_type_encoder_f EeRaCertRequestSpdu_encode_xer; +oer_type_decoder_f EeRaCertRequestSpdu_decode_oer; +oer_type_encoder_f EeRaCertRequestSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRaCertRequestSpdu_H_ */ +#include diff --git a/certgen/asncodec/EeRaDownloadRequest.c b/certgen/asncodec/EeRaDownloadRequest.c new file mode 100644 index 0000000..ea1759f --- /dev/null +++ b/certgen/asncodec/EeRaDownloadRequest.c @@ -0,0 +1,121 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaDownloadRequest.h" + +static int +memb_filename_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const UTF8String_t *st = (const UTF8String_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = UTF8String_length(st); + if((ssize_t)size < 0) { + ASN__CTFAIL(app_key, td, sptr, + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + if((size <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_filename_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EeRaDownloadRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EeRaDownloadRequest, generationTime), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaDownloadRequest, filename), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_UTF8String, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_filename_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_filename_constraint_1 + }, + 0, 0, /* No default value */ + "filename" + }, +}; +static const ber_tlv_tag_t asn_DEF_EeRaDownloadRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EeRaDownloadRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* filename */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EeRaDownloadRequest_specs_1 = { + sizeof(struct EeRaDownloadRequest), + offsetof(struct EeRaDownloadRequest, _asn_ctx), + asn_MAP_EeRaDownloadRequest_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EeRaDownloadRequest = { + "EeRaDownloadRequest", + "EeRaDownloadRequest", + &asn_OP_SEQUENCE, + asn_DEF_EeRaDownloadRequest_tags_1, + sizeof(asn_DEF_EeRaDownloadRequest_tags_1) + /sizeof(asn_DEF_EeRaDownloadRequest_tags_1[0]), /* 1 */ + asn_DEF_EeRaDownloadRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRaDownloadRequest_tags_1) + /sizeof(asn_DEF_EeRaDownloadRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EeRaDownloadRequest_1, + 2, /* Elements count */ + &asn_SPC_EeRaDownloadRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaDownloadRequest.h b/certgen/asncodec/EeRaDownloadRequest.h new file mode 100644 index 0000000..a4c4cb3 --- /dev/null +++ b/certgen/asncodec/EeRaDownloadRequest.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Time32.h" +#include +#include +#ifndef _EeRaDownloadRequest_H_ +#define _EeRaDownloadRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeRaDownloadRequest */ +typedef struct EeRaDownloadRequest { + Time32_t generationTime; + UTF8String_t filename; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EeRaDownloadRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaDownloadRequest; +extern asn_SEQUENCE_specifics_t asn_SPC_EeRaDownloadRequest_specs_1; +extern asn_TYPE_member_t asn_MBR_EeRaDownloadRequest_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRaDownloadRequest_H_ */ +#include diff --git a/certgen/asncodec/EeRaDownloadRequestPlainSpdu.c b/certgen/asncodec/EeRaDownloadRequestPlainSpdu.c new file mode 100644 index 0000000..f2307dd --- /dev/null +++ b/certgen/asncodec/EeRaDownloadRequestPlainSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaDownloadRequestPlainSpdu.h" + +int +EeRaDownloadRequestPlainSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Unsecured_216P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeRaDownloadRequestPlainSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EeRaDownloadRequestPlainSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeRaDownloadRequestPlainSpdu = { + "EeRaDownloadRequestPlainSpdu", + "EeRaDownloadRequestPlainSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EeRaDownloadRequestPlainSpdu_tags_1, + sizeof(asn_DEF_EeRaDownloadRequestPlainSpdu_tags_1) + /sizeof(asn_DEF_EeRaDownloadRequestPlainSpdu_tags_1[0]), /* 1 */ + asn_DEF_EeRaDownloadRequestPlainSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRaDownloadRequestPlainSpdu_tags_1) + /sizeof(asn_DEF_EeRaDownloadRequestPlainSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeRaDownloadRequestPlainSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EeRaDownloadRequestPlainSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaDownloadRequestPlainSpdu.h b/certgen/asncodec/EeRaDownloadRequestPlainSpdu.h new file mode 100644 index 0000000..27c81c0 --- /dev/null +++ b/certgen/asncodec/EeRaDownloadRequestPlainSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Unsecured.h" +#ifndef _EeRaDownloadRequestPlainSpdu_H_ +#define _EeRaDownloadRequestPlainSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeRaDownloadRequestPlainSpdu */ +typedef Ieee1609Dot2Data_Unsecured_216P0_t EeRaDownloadRequestPlainSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaDownloadRequestPlainSpdu; +asn_struct_free_f EeRaDownloadRequestPlainSpdu_free; +asn_struct_print_f EeRaDownloadRequestPlainSpdu_print; +asn_constr_check_f EeRaDownloadRequestPlainSpdu_constraint; +xer_type_decoder_f EeRaDownloadRequestPlainSpdu_decode_xer; +xer_type_encoder_f EeRaDownloadRequestPlainSpdu_encode_xer; +oer_type_decoder_f EeRaDownloadRequestPlainSpdu_decode_oer; +oer_type_encoder_f EeRaDownloadRequestPlainSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRaDownloadRequestPlainSpdu_H_ */ +#include diff --git a/certgen/asncodec/EeRaDownloadRequestSpdu.c b/certgen/asncodec/EeRaDownloadRequestSpdu.c new file mode 100644 index 0000000..b61a010 --- /dev/null +++ b/certgen/asncodec/EeRaDownloadRequestSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaDownloadRequestSpdu.h" + +int +EeRaDownloadRequestSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_SignedEncrypted_358P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeRaDownloadRequestSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EeRaDownloadRequestSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeRaDownloadRequestSpdu = { + "EeRaDownloadRequestSpdu", + "EeRaDownloadRequestSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EeRaDownloadRequestSpdu_tags_1, + sizeof(asn_DEF_EeRaDownloadRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaDownloadRequestSpdu_tags_1[0]), /* 1 */ + asn_DEF_EeRaDownloadRequestSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRaDownloadRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaDownloadRequestSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeRaDownloadRequestSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EeRaDownloadRequestSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaDownloadRequestSpdu.h b/certgen/asncodec/EeRaDownloadRequestSpdu.h new file mode 100644 index 0000000..b9bec02 --- /dev/null +++ b/certgen/asncodec/EeRaDownloadRequestSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-SignedEncrypted.h" +#ifndef _EeRaDownloadRequestSpdu_H_ +#define _EeRaDownloadRequestSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeRaDownloadRequestSpdu */ +typedef Ieee1609Dot2Data_SignedEncrypted_358P0_t EeRaDownloadRequestSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaDownloadRequestSpdu; +asn_struct_free_f EeRaDownloadRequestSpdu_free; +asn_struct_print_f EeRaDownloadRequestSpdu_print; +asn_constr_check_f EeRaDownloadRequestSpdu_constraint; +xer_type_decoder_f EeRaDownloadRequestSpdu_decode_xer; +xer_type_encoder_f EeRaDownloadRequestSpdu_encode_xer; +oer_type_decoder_f EeRaDownloadRequestSpdu_decode_oer; +oer_type_encoder_f EeRaDownloadRequestSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRaDownloadRequestSpdu_H_ */ +#include diff --git a/certgen/asncodec/EeRaInterfacePdu.c b/certgen/asncodec/EeRaInterfacePdu.c new file mode 100644 index 0000000..802f2c8 --- /dev/null +++ b/certgen/asncodec/EeRaInterfacePdu.c @@ -0,0 +1,140 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaInterfacePdu.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeRaInterfacePdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EeRaInterfacePdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EeRaInterfacePdu, choice.eeRaCertRequest), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeRaCertRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "eeRaCertRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaInterfacePdu, choice.raEeCertAck), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaEeCertAck, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "raEeCertAck" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaInterfacePdu, choice.raEeCertInfo), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaEeCertInfo, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "raEeCertInfo" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaInterfacePdu, choice.eeRaDownloadRequest), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeRaDownloadRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "eeRaDownloadRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct EeRaInterfacePdu, choice.eeRaSuccessorEnrollmentCertRequest), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeEcaCertRequestSpdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "eeRaSuccessorEnrollmentCertRequest" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_EeRaInterfacePdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* eeRaCertRequest */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* raEeCertAck */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* raEeCertInfo */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* eeRaDownloadRequest */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* eeRaSuccessorEnrollmentCertRequest */ +}; +asn_CHOICE_specifics_t asn_SPC_EeRaInterfacePdu_specs_1 = { + sizeof(struct EeRaInterfacePdu), + offsetof(struct EeRaInterfacePdu, _asn_ctx), + offsetof(struct EeRaInterfacePdu, present), + sizeof(((struct EeRaInterfacePdu *)0)->present), + asn_MAP_EeRaInterfacePdu_tag2el_1, + 5, /* Count of tags in the map */ + 0, 0, + 5 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_EeRaInterfacePdu = { + "EeRaInterfacePdu", + "EeRaInterfacePdu", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeRaInterfacePdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_EeRaInterfacePdu_1, + 5, /* Elements count */ + &asn_SPC_EeRaInterfacePdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaInterfacePdu.h b/certgen/asncodec/EeRaInterfacePdu.h new file mode 100644 index 0000000..5e380fa --- /dev/null +++ b/certgen/asncodec/EeRaInterfacePdu.h @@ -0,0 +1,67 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EeRaCertRequest.h" +#include "RaEeCertAck.h" +#include "RaEeCertInfo.h" +#include "EeRaDownloadRequest.h" +#include "EeEcaCertRequestSpdu.h" +#include +#ifndef _EeRaInterfacePdu_H_ +#define _EeRaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum EeRaInterfacePdu_PR { + EeRaInterfacePdu_PR_NOTHING, /* No components present */ + EeRaInterfacePdu_PR_eeRaCertRequest, + EeRaInterfacePdu_PR_raEeCertAck, + EeRaInterfacePdu_PR_raEeCertInfo, + EeRaInterfacePdu_PR_eeRaDownloadRequest, + EeRaInterfacePdu_PR_eeRaSuccessorEnrollmentCertRequest + /* Extensions may appear below */ + +} EeRaInterfacePdu_PR; + +/* EeRaInterfacePdu */ +typedef struct EeRaInterfacePdu { + EeRaInterfacePdu_PR present; + union EeRaInterfacePdu_u { + EeRaCertRequest_t eeRaCertRequest; + RaEeCertAck_t raEeCertAck; + RaEeCertInfo_t raEeCertInfo; + EeRaDownloadRequest_t eeRaDownloadRequest; + EeEcaCertRequestSpdu_t eeRaSuccessorEnrollmentCertRequest; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EeRaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaInterfacePdu; +extern asn_CHOICE_specifics_t asn_SPC_EeRaInterfacePdu_specs_1; +extern asn_TYPE_member_t asn_MBR_EeRaInterfacePdu_1[5]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.c b/certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.c new file mode 100644 index 0000000..77d58fc --- /dev/null +++ b/certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaSuccessorEnrollmentCertRequestSpdu.h" + +int +EeRaSuccessorEnrollmentCertRequestSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeRaSuccessorEnrollmentCertRequestSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu = { + "EeRaSuccessorEnrollmentCertRequestSpdu", + "EeRaSuccessorEnrollmentCertRequestSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu_tags_1, + sizeof(asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu_tags_1[0]), /* 1 */ + asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeRaSuccessorEnrollmentCertRequestSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EeRaSuccessorEnrollmentCertRequestSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.h b/certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.h new file mode 100644 index 0000000..1aa4b5c --- /dev/null +++ b/certgen/asncodec/EeRaSuccessorEnrollmentCertRequestSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-SignedEncryptedCertRequest.h" +#ifndef _EeRaSuccessorEnrollmentCertRequestSpdu_H_ +#define _EeRaSuccessorEnrollmentCertRequestSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeRaSuccessorEnrollmentCertRequestSpdu */ +typedef Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_t EeRaSuccessorEnrollmentCertRequestSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaSuccessorEnrollmentCertRequestSpdu; +asn_struct_free_f EeRaSuccessorEnrollmentCertRequestSpdu_free; +asn_struct_print_f EeRaSuccessorEnrollmentCertRequestSpdu_print; +asn_constr_check_f EeRaSuccessorEnrollmentCertRequestSpdu_constraint; +xer_type_decoder_f EeRaSuccessorEnrollmentCertRequestSpdu_decode_xer; +xer_type_encoder_f EeRaSuccessorEnrollmentCertRequestSpdu_encode_xer; +oer_type_decoder_f EeRaSuccessorEnrollmentCertRequestSpdu_decode_oer; +oer_type_encoder_f EeRaSuccessorEnrollmentCertRequestSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRaSuccessorEnrollmentCertRequestSpdu_H_ */ +#include diff --git a/certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.c b/certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.c new file mode 100644 index 0000000..e5f2869 --- /dev/null +++ b/certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeRaX509AuthenticatedCertRequestSpdu.h" + +int +EeRaX509AuthenticatedCertRequestSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Encrypted_276P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EeRaX509AuthenticatedCertRequestSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EeRaX509AuthenticatedCertRequestSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EeRaX509AuthenticatedCertRequestSpdu = { + "EeRaX509AuthenticatedCertRequestSpdu", + "EeRaX509AuthenticatedCertRequestSpdu", + &asn_OP_SEQUENCE, + asn_DEF_EeRaX509AuthenticatedCertRequestSpdu_tags_1, + sizeof(asn_DEF_EeRaX509AuthenticatedCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaX509AuthenticatedCertRequestSpdu_tags_1[0]), /* 1 */ + asn_DEF_EeRaX509AuthenticatedCertRequestSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_EeRaX509AuthenticatedCertRequestSpdu_tags_1) + /sizeof(asn_DEF_EeRaX509AuthenticatedCertRequestSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EeRaX509AuthenticatedCertRequestSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EeRaX509AuthenticatedCertRequestSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.h b/certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.h new file mode 100644 index 0000000..7e01bb5 --- /dev/null +++ b/certgen/asncodec/EeRaX509AuthenticatedCertRequestSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Encrypted.h" +#ifndef _EeRaX509AuthenticatedCertRequestSpdu_H_ +#define _EeRaX509AuthenticatedCertRequestSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeRaX509AuthenticatedCertRequestSpdu */ +typedef Ieee1609Dot2Data_Encrypted_276P2_t EeRaX509AuthenticatedCertRequestSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeRaX509AuthenticatedCertRequestSpdu; +asn_struct_free_f EeRaX509AuthenticatedCertRequestSpdu_free; +asn_struct_print_f EeRaX509AuthenticatedCertRequestSpdu_print; +asn_constr_check_f EeRaX509AuthenticatedCertRequestSpdu_constraint; +xer_type_decoder_f EeRaX509AuthenticatedCertRequestSpdu_decode_xer; +xer_type_encoder_f EeRaX509AuthenticatedCertRequestSpdu_encode_xer; +oer_type_decoder_f EeRaX509AuthenticatedCertRequestSpdu_decode_oer; +oer_type_encoder_f EeRaX509AuthenticatedCertRequestSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeRaX509AuthenticatedCertRequestSpdu_H_ */ +#include diff --git a/certgen/asncodec/EeSsp.c b/certgen/asncodec/EeSsp.c new file mode 100644 index 0000000..c15516c --- /dev/null +++ b/certgen/asncodec/EeSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EeSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EeSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EeSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_EeSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EeSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EeSsp_specs_1 = { + sizeof(struct EeSsp), + offsetof(struct EeSsp, _asn_ctx), + asn_MAP_EeSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EeSsp = { + "EeSsp", + "EeSsp", + &asn_OP_SEQUENCE, + asn_DEF_EeSsp_tags_1, + sizeof(asn_DEF_EeSsp_tags_1) + /sizeof(asn_DEF_EeSsp_tags_1[0]), /* 1 */ + asn_DEF_EeSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_EeSsp_tags_1) + /sizeof(asn_DEF_EeSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EeSsp_1, + 1, /* Elements count */ + &asn_SPC_EeSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EeSsp.h b/certgen/asncodec/EeSsp.h new file mode 100644 index 0000000..2f5922d --- /dev/null +++ b/certgen/asncodec/EeSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _EeSsp_H_ +#define _EeSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EeSsp */ +typedef struct EeSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EeSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EeSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_EeSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_EeSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EeSsp_H_ */ +#include diff --git a/certgen/asncodec/ElectorSsp.c b/certgen/asncodec/ElectorSsp.c new file mode 100644 index 0000000..4dc6807 --- /dev/null +++ b/certgen/asncodec/ElectorSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ElectorSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_ElectorSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ElectorSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_ElectorSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ElectorSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ElectorSsp_specs_1 = { + sizeof(struct ElectorSsp), + offsetof(struct ElectorSsp, _asn_ctx), + asn_MAP_ElectorSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ElectorSsp = { + "ElectorSsp", + "ElectorSsp", + &asn_OP_SEQUENCE, + asn_DEF_ElectorSsp_tags_1, + sizeof(asn_DEF_ElectorSsp_tags_1) + /sizeof(asn_DEF_ElectorSsp_tags_1[0]), /* 1 */ + asn_DEF_ElectorSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_ElectorSsp_tags_1) + /sizeof(asn_DEF_ElectorSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ElectorSsp_1, + 1, /* Elements count */ + &asn_SPC_ElectorSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ElectorSsp.h b/certgen/asncodec/ElectorSsp.h new file mode 100644 index 0000000..c59679e --- /dev/null +++ b/certgen/asncodec/ElectorSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _ElectorSsp_H_ +#define _ElectorSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ElectorSsp */ +typedef struct ElectorSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ElectorSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ElectorSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_ElectorSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_ElectorSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ElectorSsp_H_ */ +#include diff --git a/certgen/asncodec/ElevInt.c b/certgen/asncodec/ElevInt.c deleted file mode 100644 index 5555986..0000000 --- a/certgen/asncodec/ElevInt.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` - */ - -#include "ElevInt.h" - -int -ElevInt_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - long value; - - if(!sptr) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - value = *(const long *)sptr; - - if((value >= 0 && value <= 65535)) { - /* Constraint check succeeded */ - return 0; - } else { - ASN__CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } -} - -/* - * This type is implemented using Uint16, - * so here we adjust the DEF accordingly. - */ -static asn_oer_constraints_t asn_OER_type_ElevInt_constr_1 CC_NOTUSED = { - { 2, 1 } /* (0..65535) */, - -1}; -static const ber_tlv_tag_t asn_DEF_ElevInt_tags_1[] = { - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) -}; -asn_TYPE_descriptor_t asn_DEF_ElevInt = { - "ElevInt", - "ElevInt", - &asn_OP_NativeInteger, - asn_DEF_ElevInt_tags_1, - sizeof(asn_DEF_ElevInt_tags_1) - /sizeof(asn_DEF_ElevInt_tags_1[0]), /* 1 */ - asn_DEF_ElevInt_tags_1, /* Same as above */ - sizeof(asn_DEF_ElevInt_tags_1) - /sizeof(asn_DEF_ElevInt_tags_1[0]), /* 1 */ - { &asn_OER_type_ElevInt_constr_1, 0, ElevInt_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - diff --git a/certgen/asncodec/ElevInt.h b/certgen/asncodec/ElevInt.h deleted file mode 100644 index 000b365..0000000 --- a/certgen/asncodec/ElevInt.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` - */ - -#ifndef _ElevInt_H_ -#define _ElevInt_H_ - - -#include - -/* Including external dependencies */ -#include "Uint16.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* ElevInt */ -typedef Uint16_t ElevInt_t; - -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ElevInt; -asn_struct_free_f ElevInt_free; -asn_struct_print_f ElevInt_print; -asn_constr_check_f ElevInt_constraint; -ber_type_decoder_f ElevInt_decode_ber; -der_type_encoder_f ElevInt_encode_der; -xer_type_decoder_f ElevInt_decode_xer; -xer_type_encoder_f ElevInt_encode_xer; -oer_type_decoder_f ElevInt_decode_oer; -oer_type_encoder_f ElevInt_encode_oer; - -#ifdef __cplusplus -} -#endif - -#endif /* _ElevInt_H_ */ -#include diff --git a/certgen/asncodec/Elevation.c b/certgen/asncodec/Elevation.c index 4643ab7..1b73534 100644 --- a/certgen/asncodec/Elevation.c +++ b/certgen/asncodec/Elevation.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Elevation.h" @@ -33,12 +33,14 @@ Elevation_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using ElevInt, + * This type is implemented using Uint16, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Elevation_constr_1 CC_NOTUSED = { { 2, 1 } /* (0..65535) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Elevation_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_Elevation = { asn_DEF_Elevation_tags_1, /* Same as above */ sizeof(asn_DEF_Elevation_tags_1) /sizeof(asn_DEF_Elevation_tags_1[0]), /* 1 */ - { &asn_OER_type_Elevation_constr_1, 0, Elevation_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Elevation_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Elevation_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Elevation.h b/certgen/asncodec/Elevation.h index e71e10b..513a88a 100644 --- a/certgen/asncodec/Elevation.h +++ b/certgen/asncodec/Elevation.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Uint16.h" #ifndef _Elevation_H_ #define _Elevation_H_ #include -/* Including external dependencies */ -#include "ElevInt.h" - #ifdef __cplusplus extern "C" { #endif /* Elevation */ -typedef ElevInt_t Elevation_t; +typedef Uint16_t Elevation_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Elevation; asn_struct_free_f Elevation_free; asn_struct_print_f Elevation_print; asn_constr_check_f Elevation_constraint; -ber_type_decoder_f Elevation_decode_ber; -der_type_encoder_f Elevation_encode_der; xer_type_decoder_f Elevation_decode_xer; xer_type_encoder_f Elevation_encode_xer; oer_type_decoder_f Elevation_decode_oer; diff --git a/certgen/asncodec/EncryptedData.c b/certgen/asncodec/EncryptedData.c index 5e5e5e1..e160c12 100644 --- a/certgen/asncodec/EncryptedData.c +++ b/certgen/asncodec/EncryptedData.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EncryptedData.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_EncryptedData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfRecipientInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "recipients" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_EncryptedData_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_SymmetricCiphertext, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ciphertext" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_EncryptedData = { asn_DEF_EncryptedData_tags_1, /* Same as above */ sizeof(asn_DEF_EncryptedData_tags_1) /sizeof(asn_DEF_EncryptedData_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_EncryptedData_1, 2, /* Elements count */ &asn_SPC_EncryptedData_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EncryptedData.h b/certgen/asncodec/EncryptedData.h index 7998b97..22f9f14 100644 --- a/certgen/asncodec/EncryptedData.h +++ b/certgen/asncodec/EncryptedData.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EncryptedData_H_ -#define _EncryptedData_H_ - - -#include /* Including external dependencies */ #include "SequenceOfRecipientInfo.h" #include "SymmetricCiphertext.h" #include +#ifndef _EncryptedData_H_ +#define _EncryptedData_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EncryptedDataEncryptionKey.c b/certgen/asncodec/EncryptedDataEncryptionKey.c index 90556a5..a76afed 100644 --- a/certgen/asncodec/EncryptedDataEncryptionKey.c +++ b/certgen/asncodec/EncryptedDataEncryptionKey.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EncryptedDataEncryptionKey.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EncryptedDataEncryptionKey_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_EncryptedDataEncryptionKey_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EncryptedDataEncryptionKey, choice.eciesNistP256), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EciesP256EncryptedKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "eciesNistP256" }, @@ -25,14 +35,40 @@ asn_TYPE_member_t asn_MBR_EncryptedDataEncryptionKey_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EciesP256EncryptedKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "eciesBrainpoolP256r1" }, + { ATF_NOFLAGS, 0, offsetof(struct EncryptedDataEncryptionKey, choice.ecencSm2256), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EcencP256EncryptedKey, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ecencSm2256" + }, }; static const asn_TYPE_tag2member_t asn_MAP_EncryptedDataEncryptionKey_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* eciesNistP256 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* eciesBrainpoolP256r1 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* eciesBrainpoolP256r1 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ecencSm2256 */ }; asn_CHOICE_specifics_t asn_SPC_EncryptedDataEncryptionKey_specs_1 = { sizeof(struct EncryptedDataEncryptionKey), @@ -40,7 +76,7 @@ asn_CHOICE_specifics_t asn_SPC_EncryptedDataEncryptionKey_specs_1 = { offsetof(struct EncryptedDataEncryptionKey, present), sizeof(((struct EncryptedDataEncryptionKey *)0)->present), asn_MAP_EncryptedDataEncryptionKey_tag2el_1, - 2, /* Count of tags in the map */ + 3, /* Count of tags in the map */ 0, 0, 2 /* Extensions start */ }; @@ -52,9 +88,17 @@ asn_TYPE_descriptor_t asn_DEF_EncryptedDataEncryptionKey = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_EncryptedDataEncryptionKey_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EncryptedDataEncryptionKey_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_EncryptedDataEncryptionKey_1, - 2, /* Elements count */ + 3, /* Elements count */ &asn_SPC_EncryptedDataEncryptionKey_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/EncryptedDataEncryptionKey.h b/certgen/asncodec/EncryptedDataEncryptionKey.h index a339560..418d6c1 100644 --- a/certgen/asncodec/EncryptedDataEncryptionKey.h +++ b/certgen/asncodec/EncryptedDataEncryptionKey.h @@ -1,20 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EciesP256EncryptedKey.h" +#include "EcencP256EncryptedKey.h" +#include #ifndef _EncryptedDataEncryptionKey_H_ #define _EncryptedDataEncryptionKey_H_ #include -/* Including external dependencies */ -#include "EciesP256EncryptedKey.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -23,9 +24,9 @@ extern "C" { typedef enum EncryptedDataEncryptionKey_PR { EncryptedDataEncryptionKey_PR_NOTHING, /* No components present */ EncryptedDataEncryptionKey_PR_eciesNistP256, - EncryptedDataEncryptionKey_PR_eciesBrainpoolP256r1 + EncryptedDataEncryptionKey_PR_eciesBrainpoolP256r1, /* Extensions may appear below */ - + EncryptedDataEncryptionKey_PR_ecencSm2256 } EncryptedDataEncryptionKey_PR; /* EncryptedDataEncryptionKey */ @@ -38,6 +39,7 @@ typedef struct EncryptedDataEncryptionKey { * This type is extensible, * possible extensions are below. */ + EcencP256EncryptedKey_t ecencSm2256; } choice; /* Context for parsing across buffer boundaries */ @@ -47,7 +49,7 @@ typedef struct EncryptedDataEncryptionKey { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_EncryptedDataEncryptionKey; extern asn_CHOICE_specifics_t asn_SPC_EncryptedDataEncryptionKey_specs_1; -extern asn_TYPE_member_t asn_MBR_EncryptedDataEncryptionKey_1[2]; +extern asn_TYPE_member_t asn_MBR_EncryptedDataEncryptionKey_1[3]; #ifdef __cplusplus } diff --git a/certgen/asncodec/EncryptedIndividualPLV.c b/certgen/asncodec/EncryptedIndividualPLV.c new file mode 100644 index 0000000..ed11956 --- /dev/null +++ b/certgen/asncodec/EncryptedIndividualPLV.c @@ -0,0 +1,132 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EncryptedIndividualPLV.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EncryptedIndividualPLV_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EncryptedIndividualPLV, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct EncryptedIndividualPLV, laId), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "laId" + }, + { ATF_NOFLAGS, 0, offsetof(struct EncryptedIndividualPLV, encPlv), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "encPlv" + }, +}; +static const ber_tlv_tag_t asn_DEF_EncryptedIndividualPLV_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EncryptedIndividualPLV_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* laId */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* encPlv */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EncryptedIndividualPLV_specs_1 = { + sizeof(struct EncryptedIndividualPLV), + offsetof(struct EncryptedIndividualPLV, _asn_ctx), + asn_MAP_EncryptedIndividualPLV_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EncryptedIndividualPLV = { + "EncryptedIndividualPLV", + "EncryptedIndividualPLV", + &asn_OP_SEQUENCE, + asn_DEF_EncryptedIndividualPLV_tags_1, + sizeof(asn_DEF_EncryptedIndividualPLV_tags_1) + /sizeof(asn_DEF_EncryptedIndividualPLV_tags_1[0]), /* 1 */ + asn_DEF_EncryptedIndividualPLV_tags_1, /* Same as above */ + sizeof(asn_DEF_EncryptedIndividualPLV_tags_1) + /sizeof(asn_DEF_EncryptedIndividualPLV_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EncryptedIndividualPLV_1, + 3, /* Elements count */ + &asn_SPC_EncryptedIndividualPLV_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EncryptedIndividualPLV.h b/certgen/asncodec/EncryptedIndividualPLV.h new file mode 100644 index 0000000..d267fef --- /dev/null +++ b/certgen/asncodec/EncryptedIndividualPLV.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "LaId.h" +#include "Ieee1609Dot2Data-SymmEncryptedSingleRecipient.h" +#include +#ifndef _EncryptedIndividualPLV_H_ +#define _EncryptedIndividualPLV_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EncryptedIndividualPLV */ +typedef struct EncryptedIndividualPLV { + Uint8_t version; + LaId_t laId; + Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_t encPlv; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EncryptedIndividualPLV_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EncryptedIndividualPLV; +extern asn_SEQUENCE_specifics_t asn_SPC_EncryptedIndividualPLV_specs_1; +extern asn_TYPE_member_t asn_MBR_EncryptedIndividualPLV_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EncryptedIndividualPLV_H_ */ +#include diff --git a/certgen/asncodec/EncryptionKey.c b/certgen/asncodec/EncryptionKey.c index cbef524..9a04c65 100644 --- a/certgen/asncodec/EncryptionKey.c +++ b/certgen/asncodec/EncryptionKey.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EncryptionKey.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EncryptionKey_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_EncryptionKey_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EncryptionKey, choice.Public), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_PublicEncryptionKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "public" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_EncryptionKey_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_SymmetricEncryptionKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "symmetric" }, @@ -52,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_EncryptionKey = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_EncryptionKey_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EncryptionKey_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_EncryptionKey_1, 2, /* Elements count */ &asn_SPC_EncryptionKey_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EncryptionKey.h b/certgen/asncodec/EncryptionKey.h index 35334ce..73fdc2b 100644 --- a/certgen/asncodec/EncryptionKey.h +++ b/certgen/asncodec/EncryptionKey.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EncryptionKey_H_ -#define _EncryptionKey_H_ - - -#include /* Including external dependencies */ #include "PublicEncryptionKey.h" #include "SymmetricEncryptionKey.h" #include +#ifndef _EncryptionKey_H_ +#define _EncryptionKey_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EndEntityType.c b/certgen/asncodec/EndEntityType.c index c25b0e8..2d6b9fc 100644 --- a/certgen/asncodec/EndEntityType.c +++ b/certgen/asncodec/EndEntityType.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EndEntityType.h" @@ -42,9 +42,11 @@ EndEntityType_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using BIT_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EndEntityType_constr_1 CC_NOTUSED = { { 0, 0 }, 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_EndEntityType_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) }; @@ -58,7 +60,15 @@ asn_TYPE_descriptor_t asn_DEF_EndEntityType = { asn_DEF_EndEntityType_tags_1, /* Same as above */ sizeof(asn_DEF_EndEntityType_tags_1) /sizeof(asn_DEF_EndEntityType_tags_1[0]), /* 1 */ - { &asn_OER_type_EndEntityType_constr_1, 0, EndEntityType_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EndEntityType_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EndEntityType_constraint + }, 0, 0, /* Defined elsewhere */ &asn_SPC_BIT_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/EndEntityType.h b/certgen/asncodec/EndEntityType.h index 003664b..0105176 100644 --- a/certgen/asncodec/EndEntityType.h +++ b/certgen/asncodec/EndEntityType.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _EndEntityType_H_ #define _EndEntityType_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -32,8 +32,6 @@ extern asn_TYPE_descriptor_t asn_DEF_EndEntityType; asn_struct_free_f EndEntityType_free; asn_struct_print_f EndEntityType_print; asn_constr_check_f EndEntityType_constraint; -ber_type_decoder_f EndEntityType_decode_ber; -der_type_encoder_f EndEntityType_encode_der; xer_type_decoder_f EndEntityType_decode_xer; xer_type_encoder_f EndEntityType_encode_xer; oer_type_decoder_f EndEntityType_decode_oer; diff --git a/certgen/asncodec/EnrolmentRequestMessage.c b/certgen/asncodec/EnrolmentRequestMessage.c index ca09e62..3e2b006 100644 --- a/certgen/asncodec/EnrolmentRequestMessage.c +++ b/certgen/asncodec/EnrolmentRequestMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EnrolmentRequestMessage.h" @@ -27,12 +27,14 @@ EnrolmentRequestMessage_constraint(const asn_TYPE_descriptor_t *td, const void * } /* - * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0, + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EnrolmentRequestMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_EnrolmentRequestMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_EnrolmentRequestMessage = { asn_DEF_EnrolmentRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_EnrolmentRequestMessage_tags_1) /sizeof(asn_DEF_EnrolmentRequestMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_EnrolmentRequestMessage_constr_1, 0, EnrolmentRequestMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EnrolmentRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EnrolmentRequestMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EnrolmentRequestMessage.h b/certgen/asncodec/EnrolmentRequestMessage.h index dbdb214..00b587c 100644 --- a/certgen/asncodec/EnrolmentRequestMessage.h +++ b/certgen/asncodec/EnrolmentRequestMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" #ifndef _EnrolmentRequestMessage_H_ #define _EnrolmentRequestMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* EnrolmentRequestMessage */ -typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_t EnrolmentRequestMessage_t; +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t EnrolmentRequestMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_EnrolmentRequestMessage; asn_struct_free_f EnrolmentRequestMessage_free; asn_struct_print_f EnrolmentRequestMessage_print; asn_constr_check_f EnrolmentRequestMessage_constraint; -ber_type_decoder_f EnrolmentRequestMessage_decode_ber; -der_type_encoder_f EnrolmentRequestMessage_encode_der; xer_type_decoder_f EnrolmentRequestMessage_decode_xer; xer_type_encoder_f EnrolmentRequestMessage_encode_xer; oer_type_decoder_f EnrolmentRequestMessage_decode_oer; diff --git a/certgen/asncodec/EnrolmentResponseCode.c b/certgen/asncodec/EnrolmentResponseCode.c index 591fb1d..fd1fc66 100644 --- a/certgen/asncodec/EnrolmentResponseCode.c +++ b/certgen/asncodec/EnrolmentResponseCode.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EnrolmentResponseCode.h" @@ -11,9 +11,11 @@ * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EnrolmentResponseCode_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const asn_INTEGER_enum_map_t asn_MAP_EnrolmentResponseCode_value2enum_1[] = { { 0, 2, "ok" }, { 1, 9, "cantparse" }, @@ -70,7 +72,15 @@ asn_TYPE_descriptor_t asn_DEF_EnrolmentResponseCode = { asn_DEF_EnrolmentResponseCode_tags_1, /* Same as above */ sizeof(asn_DEF_EnrolmentResponseCode_tags_1) /sizeof(asn_DEF_EnrolmentResponseCode_tags_1[0]), /* 1 */ - { &asn_OER_type_EnrolmentResponseCode_constr_1, 0, NativeEnumerated_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EnrolmentResponseCode_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeEnumerated_constraint + }, 0, 0, /* Defined elsewhere */ &asn_SPC_EnrolmentResponseCode_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/EnrolmentResponseCode.h b/certgen/asncodec/EnrolmentResponseCode.h index 8ff437c..ac981a7 100644 --- a/certgen/asncodec/EnrolmentResponseCode.h +++ b/certgen/asncodec/EnrolmentResponseCode.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _EnrolmentResponseCode_H_ #define _EnrolmentResponseCode_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -48,8 +48,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_EnrolmentResponseCode_specs_1; asn_struct_free_f EnrolmentResponseCode_free; asn_struct_print_f EnrolmentResponseCode_print; asn_constr_check_f EnrolmentResponseCode_constraint; -ber_type_decoder_f EnrolmentResponseCode_decode_ber; -der_type_encoder_f EnrolmentResponseCode_encode_der; xer_type_decoder_f EnrolmentResponseCode_decode_xer; xer_type_encoder_f EnrolmentResponseCode_encode_xer; oer_type_decoder_f EnrolmentResponseCode_decode_oer; diff --git a/certgen/asncodec/EnrolmentResponseMessage.c b/certgen/asncodec/EnrolmentResponseMessage.c index 2815197..c61550e 100644 --- a/certgen/asncodec/EnrolmentResponseMessage.c +++ b/certgen/asncodec/EnrolmentResponseMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EnrolmentResponseMessage.h" @@ -27,12 +27,14 @@ EnrolmentResponseMessage_constraint(const asn_TYPE_descriptor_t *td, const void } /* - * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0, + * This type is implemented using EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EnrolmentResponseMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_EnrolmentResponseMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_EnrolmentResponseMessage = { asn_DEF_EnrolmentResponseMessage_tags_1, /* Same as above */ sizeof(asn_DEF_EnrolmentResponseMessage_tags_1) /sizeof(asn_DEF_EnrolmentResponseMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_EnrolmentResponseMessage_constr_1, 0, EnrolmentResponseMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EnrolmentResponseMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EnrolmentResponseMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EnrolmentResponseMessage.h b/certgen/asncodec/EnrolmentResponseMessage.h index aaae378..130a707 100644 --- a/certgen/asncodec/EnrolmentResponseMessage.h +++ b/certgen/asncodec/EnrolmentResponseMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" #ifndef _EnrolmentResponseMessage_H_ #define _EnrolmentResponseMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* EnrolmentResponseMessage */ -typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_t EnrolmentResponseMessage_t; +typedef EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t EnrolmentResponseMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_EnrolmentResponseMessage; asn_struct_free_f EnrolmentResponseMessage_free; asn_struct_print_f EnrolmentResponseMessage_print; asn_constr_check_f EnrolmentResponseMessage_constraint; -ber_type_decoder_f EnrolmentResponseMessage_decode_ber; -der_type_encoder_f EnrolmentResponseMessage_encode_der; xer_type_decoder_f EnrolmentResponseMessage_decode_xer; xer_type_encoder_f EnrolmentResponseMessage_encode_xer; oer_type_decoder_f EnrolmentResponseMessage_decode_oer; diff --git a/certgen/asncodec/EtsiOriginatingHeaderInfoExtension.c b/certgen/asncodec/EtsiOriginatingHeaderInfoExtension.c new file mode 100644 index 0000000..a8a4215 --- /dev/null +++ b/certgen/asncodec/EtsiOriginatingHeaderInfoExtension.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EtsiOriginatingHeaderInfoExtension.h" + +/* + * This type is implemented using EtsiTs103097HeaderInfoExtensions, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_EtsiOriginatingHeaderInfoExtension_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EtsiOriginatingHeaderInfoExtension = { + "EtsiOriginatingHeaderInfoExtension", + "EtsiOriginatingHeaderInfoExtension", + &asn_OP_SEQUENCE, + asn_DEF_EtsiOriginatingHeaderInfoExtension_tags_1, + sizeof(asn_DEF_EtsiOriginatingHeaderInfoExtension_tags_1) + /sizeof(asn_DEF_EtsiOriginatingHeaderInfoExtension_tags_1[0]), /* 1 */ + asn_DEF_EtsiOriginatingHeaderInfoExtension_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiOriginatingHeaderInfoExtension_tags_1) + /sizeof(asn_DEF_EtsiOriginatingHeaderInfoExtension_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EtsiTs103097HeaderInfoExtensions_1, + 2, /* Elements count */ + &asn_SPC_EtsiTs103097HeaderInfoExtensions_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EtsiOriginatingHeaderInfoExtension.h b/certgen/asncodec/EtsiOriginatingHeaderInfoExtension.h new file mode 100644 index 0000000..cea855d --- /dev/null +++ b/certgen/asncodec/EtsiOriginatingHeaderInfoExtension.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Extension.h" +#ifndef _EtsiOriginatingHeaderInfoExtension_H_ +#define _EtsiOriginatingHeaderInfoExtension_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EtsiOriginatingHeaderInfoExtension */ +typedef EtsiTs103097HeaderInfoExtensions_t EtsiOriginatingHeaderInfoExtension_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EtsiOriginatingHeaderInfoExtension; +asn_struct_free_f EtsiOriginatingHeaderInfoExtension_free; +asn_struct_print_f EtsiOriginatingHeaderInfoExtension_print; +asn_constr_check_f EtsiOriginatingHeaderInfoExtension_constraint; +xer_type_decoder_f EtsiOriginatingHeaderInfoExtension_decode_xer; +xer_type_encoder_f EtsiOriginatingHeaderInfoExtension_encode_xer; +oer_type_decoder_f EtsiOriginatingHeaderInfoExtension_decode_oer; +oer_type_encoder_f EtsiOriginatingHeaderInfoExtension_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EtsiOriginatingHeaderInfoExtension_H_ */ +#include diff --git a/certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.c b/certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.c new file mode 100644 index 0000000..6085118 --- /dev/null +++ b/certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesAuthorization" + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EtsiTs102941ButterflyAuthorizationRequest-X509Signed.h" + +int +EtsiTs102941ButterflyAuthorizationRequest_X509Signed_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed = { + "EtsiTs102941ButterflyAuthorizationRequest-X509Signed", + "EtsiTs102941ButterflyAuthorizationRequest-X509Signed", + &asn_OP_SEQUENCE, + asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_tags_1, + sizeof(asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_tags_1) + /sizeof(asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_tags_1) + /sizeof(asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs102941ButterflyAuthorizationRequest_X509Signed_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs102941ButterflyAuthorizationRequest_X509Signed_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.h b/certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.h new file mode 100644 index 0000000..017b18f --- /dev/null +++ b/certgen/asncodec/EtsiTs102941ButterflyAuthorizationRequest-X509Signed.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesAuthorization" + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.h" +#ifndef _EtsiTs102941ButterflyAuthorizationRequest_X509Signed_H_ +#define _EtsiTs102941ButterflyAuthorizationRequest_X509Signed_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EtsiTs102941ButterflyAuthorizationRequest-X509Signed */ +typedef Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_t EtsiTs102941ButterflyAuthorizationRequest_X509Signed_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed; +asn_struct_free_f EtsiTs102941ButterflyAuthorizationRequest_X509Signed_free; +asn_struct_print_f EtsiTs102941ButterflyAuthorizationRequest_X509Signed_print; +asn_constr_check_f EtsiTs102941ButterflyAuthorizationRequest_X509Signed_constraint; +xer_type_decoder_f EtsiTs102941ButterflyAuthorizationRequest_X509Signed_decode_xer; +xer_type_encoder_f EtsiTs102941ButterflyAuthorizationRequest_X509Signed_encode_xer; +oer_type_decoder_f EtsiTs102941ButterflyAuthorizationRequest_X509Signed_decode_oer; +oer_type_encoder_f EtsiTs102941ButterflyAuthorizationRequest_X509Signed_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EtsiTs102941ButterflyAuthorizationRequest_X509Signed_H_ */ +#include diff --git a/certgen/asncodec/EtsiTs102941CrlRequest.c b/certgen/asncodec/EtsiTs102941CrlRequest.c new file mode 100644 index 0000000..5906228 --- /dev/null +++ b/certgen/asncodec/EtsiTs102941CrlRequest.c @@ -0,0 +1,86 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EtsiTs102941CrlRequest.h" + +asn_TYPE_member_t asn_MBR_EtsiTs102941CrlRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941CrlRequest, issuerId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "issuerId" + }, + { ATF_POINTER, 1, offsetof(struct EtsiTs102941CrlRequest, lastKnownUpdate), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "lastKnownUpdate" + }, +}; +static const int asn_MAP_EtsiTs102941CrlRequest_oms_1[] = { 1 }; +static const ber_tlv_tag_t asn_DEF_EtsiTs102941CrlRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EtsiTs102941CrlRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* issuerId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* lastKnownUpdate */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EtsiTs102941CrlRequest_specs_1 = { + sizeof(struct EtsiTs102941CrlRequest), + offsetof(struct EtsiTs102941CrlRequest, _asn_ctx), + asn_MAP_EtsiTs102941CrlRequest_tag2el_1, + 2, /* Count of tags in the map */ + asn_MAP_EtsiTs102941CrlRequest_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EtsiTs102941CrlRequest = { + "EtsiTs102941CrlRequest", + "EtsiTs102941CrlRequest", + &asn_OP_SEQUENCE, + asn_DEF_EtsiTs102941CrlRequest_tags_1, + sizeof(asn_DEF_EtsiTs102941CrlRequest_tags_1) + /sizeof(asn_DEF_EtsiTs102941CrlRequest_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs102941CrlRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs102941CrlRequest_tags_1) + /sizeof(asn_DEF_EtsiTs102941CrlRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EtsiTs102941CrlRequest_1, + 2, /* Elements count */ + &asn_SPC_EtsiTs102941CrlRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EtsiTs102941CrlRequest.h b/certgen/asncodec/EtsiTs102941CrlRequest.h new file mode 100644 index 0000000..54073d4 --- /dev/null +++ b/certgen/asncodec/EtsiTs102941CrlRequest.h @@ -0,0 +1,42 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashedId8.h" +#include "Time32.h" +#include +#ifndef _EtsiTs102941CrlRequest_H_ +#define _EtsiTs102941CrlRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EtsiTs102941CrlRequest */ +typedef struct EtsiTs102941CrlRequest { + HashedId8_t issuerId; + Time32_t *lastKnownUpdate; /* OPTIONAL */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EtsiTs102941CrlRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs102941CrlRequest; +extern asn_SEQUENCE_specifics_t asn_SPC_EtsiTs102941CrlRequest_specs_1; +extern asn_TYPE_member_t asn_MBR_EtsiTs102941CrlRequest_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EtsiTs102941CrlRequest_H_ */ +#include diff --git a/certgen/asncodec/EtsiTs102941CtlRequest.c b/certgen/asncodec/EtsiTs102941CtlRequest.c new file mode 100644 index 0000000..9eef90e --- /dev/null +++ b/certgen/asncodec/EtsiTs102941CtlRequest.c @@ -0,0 +1,116 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EtsiTs102941CtlRequest.h" + +static int +memb_lastKnownCtlSequence_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_lastKnownCtlSequence_constr_3 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_EtsiTs102941CtlRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941CtlRequest, issuerId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "issuerId" + }, + { ATF_POINTER, 1, offsetof(struct EtsiTs102941CtlRequest, lastKnownCtlSequence), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_lastKnownCtlSequence_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_lastKnownCtlSequence_constraint_1 + }, + 0, 0, /* No default value */ + "lastKnownCtlSequence" + }, +}; +static const int asn_MAP_EtsiTs102941CtlRequest_oms_1[] = { 1 }; +static const ber_tlv_tag_t asn_DEF_EtsiTs102941CtlRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EtsiTs102941CtlRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* issuerId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* lastKnownCtlSequence */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EtsiTs102941CtlRequest_specs_1 = { + sizeof(struct EtsiTs102941CtlRequest), + offsetof(struct EtsiTs102941CtlRequest, _asn_ctx), + asn_MAP_EtsiTs102941CtlRequest_tag2el_1, + 2, /* Count of tags in the map */ + asn_MAP_EtsiTs102941CtlRequest_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EtsiTs102941CtlRequest = { + "EtsiTs102941CtlRequest", + "EtsiTs102941CtlRequest", + &asn_OP_SEQUENCE, + asn_DEF_EtsiTs102941CtlRequest_tags_1, + sizeof(asn_DEF_EtsiTs102941CtlRequest_tags_1) + /sizeof(asn_DEF_EtsiTs102941CtlRequest_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs102941CtlRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs102941CtlRequest_tags_1) + /sizeof(asn_DEF_EtsiTs102941CtlRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EtsiTs102941CtlRequest_1, + 2, /* Elements count */ + &asn_SPC_EtsiTs102941CtlRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EtsiTs102941CtlRequest.h b/certgen/asncodec/EtsiTs102941CtlRequest.h new file mode 100644 index 0000000..f7e751a --- /dev/null +++ b/certgen/asncodec/EtsiTs102941CtlRequest.h @@ -0,0 +1,42 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashedId8.h" +#include +#include +#ifndef _EtsiTs102941CtlRequest_H_ +#define _EtsiTs102941CtlRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EtsiTs102941CtlRequest */ +typedef struct EtsiTs102941CtlRequest { + HashedId8_t issuerId; + long *lastKnownCtlSequence; /* OPTIONAL */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EtsiTs102941CtlRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs102941CtlRequest; +extern asn_SEQUENCE_specifics_t asn_SPC_EtsiTs102941CtlRequest_specs_1; +extern asn_TYPE_member_t asn_MBR_EtsiTs102941CtlRequest_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _EtsiTs102941CtlRequest_H_ */ +#include diff --git a/certgen/asncodec/EtsiTs102941Data.c b/certgen/asncodec/EtsiTs102941Data.c index 603abc9..da0d209 100644 --- a/certgen/asncodec/EtsiTs102941Data.c +++ b/certgen/asncodec/EtsiTs102941Data.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs102941Data.h" @@ -32,16 +32,26 @@ memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { { 1, 1 } /* (1..1) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static asn_TYPE_member_t asn_MBR_EtsiTs102941Data_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941Data, version), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Version, 0, - { &asn_OER_memb_version_constr_2, 0, memb_version_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, 0, 0, /* No default value */ "version" }, @@ -50,7 +60,15 @@ static asn_TYPE_member_t asn_MBR_EtsiTs102941Data_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_EtsiTs102941DataContent, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "content" }, @@ -80,7 +98,15 @@ asn_TYPE_descriptor_t asn_DEF_EtsiTs102941Data = { asn_DEF_EtsiTs102941Data_tags_1, /* Same as above */ sizeof(asn_DEF_EtsiTs102941Data_tags_1) /sizeof(asn_DEF_EtsiTs102941Data_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_EtsiTs102941Data_1, 2, /* Elements count */ &asn_SPC_EtsiTs102941Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs102941Data.h b/certgen/asncodec/EtsiTs102941Data.h index f0d199e..d92b31e 100644 --- a/certgen/asncodec/EtsiTs102941Data.h +++ b/certgen/asncodec/EtsiTs102941Data.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EtsiTs102941Data_H_ -#define _EtsiTs102941Data_H_ - - -#include /* Including external dependencies */ #include "Version.h" #include "EtsiTs102941DataContent.h" #include +#ifndef _EtsiTs102941Data_H_ +#define _EtsiTs102941Data_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/EtsiTs102941DataContent.c b/certgen/asncodec/EtsiTs102941DataContent.c index 48e439b..d53e47a 100644 --- a/certgen/asncodec/EtsiTs102941DataContent.c +++ b/certgen/asncodec/EtsiTs102941DataContent.c @@ -1,22 +1,181 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs102941DataContent.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EtsiTs102941DataContent_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_ext1_16[] = { + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent__ext1, butterflyAuthorizationRequest), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeRaCertRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "butterflyAuthorizationRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent__ext1, x509SignedbutterflyAuthorizationRequest), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EtsiTs102941ButterflyAuthorizationRequest_X509Signed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "x509SignedbutterflyAuthorizationRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent__ext1, butterflyAuthorizationResponse), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaEeCertInfo, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "butterflyAuthorizationResponse" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent__ext1, butterflyCertificateRequest), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaAcaCertRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "butterflyCertificateRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent__ext1, butterflyCertificateResponse), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaRaCertResponse, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "butterflyCertificateResponse" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent__ext1, butterflyAtDownloadRequest), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeRaDownloadRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "butterflyAtDownloadRequest" + }, +}; +static const ber_tlv_tag_t asn_DEF_ext1_tags_16[] = { + (ASN_TAG_CLASS_CONTEXT | (13 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ext1_tag2el_16[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* butterflyAuthorizationRequest */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* x509SignedbutterflyAuthorizationRequest */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* butterflyAuthorizationResponse */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* butterflyCertificateRequest */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* butterflyCertificateResponse */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* butterflyAtDownloadRequest */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_ext1_specs_16 = { + sizeof(struct EtsiTs102941DataContent__ext1), + offsetof(struct EtsiTs102941DataContent__ext1, _asn_ctx), + asn_MAP_ext1_tag2el_16, + 6, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_ext1_16 = { + "ext1", + "ext1", + &asn_OP_SEQUENCE, + asn_DEF_ext1_tags_16, + sizeof(asn_DEF_ext1_tags_16) + /sizeof(asn_DEF_ext1_tags_16[0]) - 1, /* 1 */ + asn_DEF_ext1_tags_16, /* Same as above */ + sizeof(asn_DEF_ext1_tags_16) + /sizeof(asn_DEF_ext1_tags_16[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ext1_16, + 6, /* Elements count */ + &asn_SPC_ext1_specs_16 /* Additional specs */ +}; + asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent, choice.enrolmentRequest), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_InnerEcRequestSignedForPop, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "enrolmentRequest" }, @@ -25,7 +184,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_InnerEcResponse, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "enrolmentResponse" }, @@ -34,7 +201,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_InnerAtRequest, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "authorizationRequest" }, @@ -43,7 +218,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_InnerAtResponse, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "authorizationResponse" }, @@ -52,7 +235,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ToBeSignedCrl, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificateRevocationList" }, @@ -61,7 +252,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ToBeSignedTlmCtl, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificateTrustListTlm" }, @@ -70,7 +269,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ToBeSignedRcaCtl, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificateTrustListRca" }, @@ -79,7 +286,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthorizationValidationRequest, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "authorizationValidationRequest" }, @@ -88,7 +303,15 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthorizationValidationResponse, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "authorizationValidationResponse" }, @@ -97,10 +320,86 @@ asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CaCertificateRequest, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "caCertificateRequest" }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent, choice.linkCertificateTlm), + (ASN_TAG_CLASS_CONTEXT | (10 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedLinkCertificateTlm, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "linkCertificateTlm" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent, choice.singleSignedLinkCertificateRca), + (ASN_TAG_CLASS_CONTEXT | (11 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedLinkCertificateRca, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "singleSignedLinkCertificateRca" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs102941DataContent, choice.doubleSignedlinkCertificateRca), + (ASN_TAG_CLASS_CONTEXT | (12 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RcaSingleSignedLinkCertificateMessage, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "doubleSignedlinkCertificateRca" + }, + { ATF_POINTER, 1, offsetof(struct EtsiTs102941DataContent, choice.ext1), + (ASN_TAG_CLASS_CONTEXT | (13 << 2)), + 0, + &asn_DEF_ext1_16, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ext1" + }, }; static const asn_TYPE_tag2member_t asn_MAP_EtsiTs102941DataContent_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* enrolmentRequest */ @@ -112,7 +411,11 @@ static const asn_TYPE_tag2member_t asn_MAP_EtsiTs102941DataContent_tag2el_1[] = { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* certificateTrustListRca */ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* authorizationValidationRequest */ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* authorizationValidationResponse */ - { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 } /* caCertificateRequest */ + { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* caCertificateRequest */ + { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 }, /* linkCertificateTlm */ + { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 }, /* singleSignedLinkCertificateRca */ + { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 12, 0, 0 }, /* doubleSignedlinkCertificateRca */ + { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 13, 0, 0 } /* ext1 */ }; asn_CHOICE_specifics_t asn_SPC_EtsiTs102941DataContent_specs_1 = { sizeof(struct EtsiTs102941DataContent), @@ -120,7 +423,7 @@ asn_CHOICE_specifics_t asn_SPC_EtsiTs102941DataContent_specs_1 = { offsetof(struct EtsiTs102941DataContent, present), sizeof(((struct EtsiTs102941DataContent *)0)->present), asn_MAP_EtsiTs102941DataContent_tag2el_1, - 10, /* Count of tags in the map */ + 14, /* Count of tags in the map */ 0, 0, 10 /* Extensions start */ }; @@ -132,9 +435,17 @@ asn_TYPE_descriptor_t asn_DEF_EtsiTs102941DataContent = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_EtsiTs102941DataContent_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs102941DataContent_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_EtsiTs102941DataContent_1, - 10, /* Elements count */ + 14, /* Elements count */ &asn_SPC_EtsiTs102941DataContent_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/EtsiTs102941DataContent.h b/certgen/asncodec/EtsiTs102941DataContent.h index cbccd1f..c5da275 100644 --- a/certgen/asncodec/EtsiTs102941DataContent.h +++ b/certgen/asncodec/EtsiTs102941DataContent.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _EtsiTs102941DataContent_H_ -#define _EtsiTs102941DataContent_H_ - - -#include /* Including external dependencies */ #include "InnerEcRequestSignedForPop.h" @@ -22,7 +17,22 @@ #include "AuthorizationValidationRequest.h" #include "AuthorizationValidationResponse.h" #include "CaCertificateRequest.h" +#include "ToBeSignedLinkCertificateTlm.h" +#include "ToBeSignedLinkCertificateRca.h" +#include "RcaSingleSignedLinkCertificateMessage.h" +#include "EeRaCertRequest.h" +#include "EtsiTs102941ButterflyAuthorizationRequest-X509Signed.h" +#include "RaEeCertInfo.h" +#include "RaAcaCertRequest.h" +#include "AcaRaCertResponse.h" +#include "EeRaDownloadRequest.h" +#include #include +#ifndef _EtsiTs102941DataContent_H_ +#define _EtsiTs102941DataContent_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -40,9 +50,12 @@ typedef enum EtsiTs102941DataContent_PR { EtsiTs102941DataContent_PR_certificateTrustListRca, EtsiTs102941DataContent_PR_authorizationValidationRequest, EtsiTs102941DataContent_PR_authorizationValidationResponse, - EtsiTs102941DataContent_PR_caCertificateRequest + EtsiTs102941DataContent_PR_caCertificateRequest, /* Extensions may appear below */ - + EtsiTs102941DataContent_PR_linkCertificateTlm, + EtsiTs102941DataContent_PR_singleSignedLinkCertificateRca, + EtsiTs102941DataContent_PR_doubleSignedlinkCertificateRca, + EtsiTs102941DataContent_PR_ext1 } EtsiTs102941DataContent_PR; /* EtsiTs102941DataContent */ @@ -63,6 +76,20 @@ typedef struct EtsiTs102941DataContent { * This type is extensible, * possible extensions are below. */ + ToBeSignedLinkCertificateTlm_t linkCertificateTlm; + ToBeSignedLinkCertificateRca_t singleSignedLinkCertificateRca; + RcaSingleSignedLinkCertificateMessage_t doubleSignedlinkCertificateRca; + struct EtsiTs102941DataContent__ext1 { + EeRaCertRequest_t butterflyAuthorizationRequest; + EtsiTs102941ButterflyAuthorizationRequest_X509Signed_t x509SignedbutterflyAuthorizationRequest; + RaEeCertInfo_t butterflyAuthorizationResponse; + RaAcaCertRequest_t butterflyCertificateRequest; + AcaRaCertResponse_t butterflyCertificateResponse; + EeRaDownloadRequest_t butterflyAtDownloadRequest; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } *ext1; } choice; /* Context for parsing across buffer boundaries */ @@ -72,7 +99,7 @@ typedef struct EtsiTs102941DataContent { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_EtsiTs102941DataContent; extern asn_CHOICE_specifics_t asn_SPC_EtsiTs102941DataContent_specs_1; -extern asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[10]; +extern asn_TYPE_member_t asn_MBR_EtsiTs102941DataContent_1[14]; #ifdef __cplusplus } diff --git a/certgen/asncodec/EtsiTs102941DeltaCtlRequest.c b/certgen/asncodec/EtsiTs102941DeltaCtlRequest.c new file mode 100644 index 0000000..034fa03 --- /dev/null +++ b/certgen/asncodec/EtsiTs102941DeltaCtlRequest.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EtsiTs102941DeltaCtlRequest.h" + +/* + * This type is implemented using EtsiTs102941CtlRequest, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_EtsiTs102941DeltaCtlRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EtsiTs102941DeltaCtlRequest = { + "EtsiTs102941DeltaCtlRequest", + "EtsiTs102941DeltaCtlRequest", + &asn_OP_SEQUENCE, + asn_DEF_EtsiTs102941DeltaCtlRequest_tags_1, + sizeof(asn_DEF_EtsiTs102941DeltaCtlRequest_tags_1) + /sizeof(asn_DEF_EtsiTs102941DeltaCtlRequest_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs102941DeltaCtlRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs102941DeltaCtlRequest_tags_1) + /sizeof(asn_DEF_EtsiTs102941DeltaCtlRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EtsiTs102941CtlRequest_1, + 2, /* Elements count */ + &asn_SPC_EtsiTs102941CtlRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/EtsiTs102941DeltaCtlRequest.h b/certgen/asncodec/EtsiTs102941DeltaCtlRequest.h new file mode 100644 index 0000000..881bfdf --- /dev/null +++ b/certgen/asncodec/EtsiTs102941DeltaCtlRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs102941CtlRequest.h" +#ifndef _EtsiTs102941DeltaCtlRequest_H_ +#define _EtsiTs102941DeltaCtlRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EtsiTs102941DeltaCtlRequest */ +typedef EtsiTs102941CtlRequest_t EtsiTs102941DeltaCtlRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs102941DeltaCtlRequest; +asn_struct_free_f EtsiTs102941DeltaCtlRequest_free; +asn_struct_print_f EtsiTs102941DeltaCtlRequest_print; +asn_constr_check_f EtsiTs102941DeltaCtlRequest_constraint; +xer_type_decoder_f EtsiTs102941DeltaCtlRequest_decode_xer; +xer_type_encoder_f EtsiTs102941DeltaCtlRequest_encode_xer; +oer_type_decoder_f EtsiTs102941DeltaCtlRequest_decode_oer; +oer_type_encoder_f EtsiTs102941DeltaCtlRequest_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EtsiTs102941DeltaCtlRequest_H_ */ +#include diff --git a/certgen/asncodec/EtsiTs103097Certificate.c b/certgen/asncodec/EtsiTs103097Certificate.c index f8c20cb..7dad2cf 100644 --- a/certgen/asncodec/EtsiTs103097Certificate.c +++ b/certgen/asncodec/EtsiTs103097Certificate.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Certificate.h" @@ -27,12 +27,14 @@ EtsiTs103097Certificate_constraint(const asn_TYPE_descriptor_t *td, const void * } /* - * This type is implemented using ExplicitCertificate, + * This type is implemented using Certificate, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EtsiTs103097Certificate_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_EtsiTs103097Certificate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Certificate = { asn_DEF_EtsiTs103097Certificate_tags_1, /* Same as above */ sizeof(asn_DEF_EtsiTs103097Certificate_tags_1) /sizeof(asn_DEF_EtsiTs103097Certificate_tags_1[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Certificate_constr_1, 0, EtsiTs103097Certificate_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Certificate_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Certificate_constraint + }, asn_MBR_CertificateBase_1, 5, /* Elements count */ &asn_SPC_CertificateBase_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs103097Certificate.h b/certgen/asncodec/EtsiTs103097Certificate.h index 4bbeb26..c940034 100644 --- a/certgen/asncodec/EtsiTs103097Certificate.h +++ b/certgen/asncodec/EtsiTs103097Certificate.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Certificate.h" #ifndef _EtsiTs103097Certificate_H_ #define _EtsiTs103097Certificate_H_ #include -/* Including external dependencies */ -#include "ExplicitCertificate.h" - #ifdef __cplusplus extern "C" { #endif /* EtsiTs103097Certificate */ -typedef ExplicitCertificate_t EtsiTs103097Certificate_t; +typedef Certificate_t EtsiTs103097Certificate_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Certificate; asn_struct_free_f EtsiTs103097Certificate_free; asn_struct_print_f EtsiTs103097Certificate_print; asn_constr_check_f EtsiTs103097Certificate_constraint; -ber_type_decoder_f EtsiTs103097Certificate_decode_ber; -der_type_encoder_f EtsiTs103097Certificate_encode_der; xer_type_decoder_f EtsiTs103097Certificate_decode_xer; xer_type_encoder_f EtsiTs103097Certificate_encode_xer; oer_type_decoder_f EtsiTs103097Certificate_decode_oer; diff --git a/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.c b/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.c index cf5f2f1..8eecbcf 100644 --- a/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.c +++ b/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.c @@ -1,14 +1,14 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097Module" + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Data-Encrypted-Unicast.h" int -EtsiTs103097Data_Encrypted_Unicast_52P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_Encrypted_Unicast_107P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -27,71 +27,36 @@ EtsiTs103097Data_Encrypted_Unicast_52P0_constraint(const asn_TYPE_descriptor_t * } /* - * This type is implemented using EtsiTs103097Data_Encrypted_90P0, + * This type is implemented using EtsiTs103097Data_Encrypted_93P1, * so here we adjust the DEF accordingly. */ -int -EtsiTs103097Data_Encrypted_Unicast_52P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - - if(!sptr) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - - if(1 /* No applicable constraints whatsoever */) { - /* Nothing is here. See below */ - } - - return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); -} - -/* - * This type is implemented using EtsiTs103097Data_Encrypted_90P1, - * so here we adjust the DEF accordingly. - */ -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_Unicast_52P0_constr_1 CC_NOTUSED = { +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_Unicast_107P0_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_Unicast_52P1_constr_2 CC_NOTUSED = { - { 0, 0 }, - -1}; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0_tags_1[] = { - (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) -}; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0 = { - "EtsiTs103097Data-Encrypted-Unicast", - "EtsiTs103097Data-Encrypted-Unicast", - &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0_tags_1, - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0_tags_1[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0_tags_1, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0_tags_1[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Encrypted_Unicast_52P0_constr_1, 0, EtsiTs103097Data_Encrypted_Unicast_52P0_constraint }, - asn_MBR_Ieee1609Dot2Data_1, - 2, /* Elements count */ - &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ -}; - -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1_tags_2[] = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0 = { "EtsiTs103097Data-Encrypted-Unicast", "EtsiTs103097Data-Encrypted-Unicast", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1_tags_2, - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1_tags_2) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1_tags_2[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1_tags_2, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1_tags_2) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1_tags_2[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Encrypted_Unicast_52P1_constr_2, 0, EtsiTs103097Data_Encrypted_Unicast_52P1_constraint }, + asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0_tags_1, + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_Encrypted_Unicast_107P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_Encrypted_Unicast_107P0_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.h b/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.h index f0043fc..585f452 100644 --- a/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.h +++ b/certgen/asncodec/EtsiTs103097Data-Encrypted-Unicast.h @@ -1,48 +1,35 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097Module" + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Encrypted.h" #ifndef _EtsiTs103097Data_Encrypted_Unicast_H_ #define _EtsiTs103097Data_Encrypted_Unicast_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Encrypted.h" - #ifdef __cplusplus extern "C" { #endif /* EtsiTs103097Data-Encrypted-Unicast */ -typedef EtsiTs103097Data_Encrypted_90P0_t EtsiTs103097Data_Encrypted_Unicast_52P0_t; -typedef EtsiTs103097Data_Encrypted_90P1_t EtsiTs103097Data_Encrypted_Unicast_52P1_t; +typedef EtsiTs103097Data_Encrypted_93P1_t EtsiTs103097Data_Encrypted_Unicast_107P0_t; /* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P0; -asn_struct_free_f EtsiTs103097Data_Encrypted_Unicast_52P0_free; -asn_struct_print_f EtsiTs103097Data_Encrypted_Unicast_52P0_print; -asn_constr_check_f EtsiTs103097Data_Encrypted_Unicast_52P0_constraint; -ber_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_52P0_decode_ber; -der_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_52P0_encode_der; -xer_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_52P0_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_52P0_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_52P0_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_52P0_encode_oer; -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_52P1; -asn_struct_free_f EtsiTs103097Data_Encrypted_Unicast_52P1_free; -asn_struct_print_f EtsiTs103097Data_Encrypted_Unicast_52P1_print; -asn_constr_check_f EtsiTs103097Data_Encrypted_Unicast_52P1_constraint; -ber_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_52P1_decode_ber; -der_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_52P1_encode_der; -xer_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_52P1_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_52P1_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_52P1_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_52P1_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_Unicast_107P0; +asn_struct_free_f EtsiTs103097Data_Encrypted_Unicast_107P0_free; +asn_struct_print_f EtsiTs103097Data_Encrypted_Unicast_107P0_print; +asn_constr_check_f EtsiTs103097Data_Encrypted_Unicast_107P0_constraint; +xer_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_107P0_decode_xer; +xer_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_107P0_encode_xer; +oer_type_decoder_f EtsiTs103097Data_Encrypted_Unicast_107P0_decode_oer; +oer_type_encoder_f EtsiTs103097Data_Encrypted_Unicast_107P0_encode_oer; #ifdef __cplusplus } diff --git a/certgen/asncodec/EtsiTs103097Data-Encrypted.c b/certgen/asncodec/EtsiTs103097Data-Encrypted.c index 0c4ba17..2a8524e 100644 --- a/certgen/asncodec/EtsiTs103097Data-Encrypted.c +++ b/certgen/asncodec/EtsiTs103097Data-Encrypted.c @@ -1,14 +1,14 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Data-Encrypted.h" int -EtsiTs103097Data_Encrypted_90P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_Encrypted_93P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -31,7 +31,7 @@ EtsiTs103097Data_Encrypted_90P0_constraint(const asn_TYPE_descriptor_t *td, cons * so here we adjust the DEF accordingly. */ int -EtsiTs103097Data_Encrypted_90P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_Encrypted_93P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -54,7 +54,7 @@ EtsiTs103097Data_Encrypted_90P1_constraint(const asn_TYPE_descriptor_t *td, cons * so here we adjust the DEF accordingly. */ int -EtsiTs103097Data_Encrypted_90P2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_Encrypted_93P2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -76,67 +76,97 @@ EtsiTs103097Data_Encrypted_90P2_constraint(const asn_TYPE_descriptor_t *td, cons * This type is implemented using EtsiTs103097Data, * so here we adjust the DEF accordingly. */ -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_90P0_constr_1 CC_NOTUSED = { +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_93P0_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_90P1_constr_2 CC_NOTUSED = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_93P1_constr_2 CC_NOTUSED = { { 0, 0 }, -1}; -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_90P2_constr_3 CC_NOTUSED = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Encrypted_93P2_constr_3 CC_NOTUSED = { { 0, 0 }, -1}; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_90P0_tags_1[] = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_93P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_90P0 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_93P0 = { "EtsiTs103097Data-Encrypted", "EtsiTs103097Data-Encrypted", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Encrypted_90P0_tags_1, - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P0_tags_1[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Encrypted_90P0_tags_1, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P0_tags_1[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Encrypted_90P0_constr_1, 0, EtsiTs103097Data_Encrypted_90P0_constraint }, + asn_DEF_EtsiTs103097Data_Encrypted_93P0_tags_1, + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P0_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_Encrypted_93P0_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_Encrypted_93P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_Encrypted_93P0_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ }; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_90P1_tags_2[] = { +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_93P1_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_90P1 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_93P1 = { "EtsiTs103097Data-Encrypted", "EtsiTs103097Data-Encrypted", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Encrypted_90P1_tags_2, - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P1_tags_2) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P1_tags_2[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Encrypted_90P1_tags_2, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P1_tags_2) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P1_tags_2[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Encrypted_90P1_constr_2, 0, EtsiTs103097Data_Encrypted_90P1_constraint }, + asn_DEF_EtsiTs103097Data_Encrypted_93P1_tags_2, + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P1_tags_2) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P1_tags_2[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_Encrypted_93P1_tags_2, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P1_tags_2) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P1_tags_2[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_Encrypted_93P1_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_Encrypted_93P1_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ }; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_90P2_tags_3[] = { +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Encrypted_93P2_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_90P2 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_93P2 = { "EtsiTs103097Data-Encrypted", "EtsiTs103097Data-Encrypted", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Encrypted_90P2_tags_3, - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P2_tags_3) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P2_tags_3[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Encrypted_90P2_tags_3, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P2_tags_3) - /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_90P2_tags_3[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Encrypted_90P2_constr_3, 0, EtsiTs103097Data_Encrypted_90P2_constraint }, + asn_DEF_EtsiTs103097Data_Encrypted_93P2_tags_3, + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P2_tags_3) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P2_tags_3[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_Encrypted_93P2_tags_3, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P2_tags_3) + /sizeof(asn_DEF_EtsiTs103097Data_Encrypted_93P2_tags_3[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_Encrypted_93P2_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_Encrypted_93P2_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs103097Data-Encrypted.h b/certgen/asncodec/EtsiTs103097Data-Encrypted.h index 0027a1d..4c40a65 100644 --- a/certgen/asncodec/EtsiTs103097Data-Encrypted.h +++ b/certgen/asncodec/EtsiTs103097Data-Encrypted.h @@ -1,59 +1,53 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data.h" #ifndef _EtsiTs103097Data_Encrypted_H_ #define _EtsiTs103097Data_Encrypted_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data.h" - #ifdef __cplusplus extern "C" { #endif /* EtsiTs103097Data-Encrypted */ -typedef EtsiTs103097Data_t EtsiTs103097Data_Encrypted_90P0_t; -typedef EtsiTs103097Data_t EtsiTs103097Data_Encrypted_90P1_t; -typedef EtsiTs103097Data_t EtsiTs103097Data_Encrypted_90P2_t; +typedef EtsiTs103097Data_t EtsiTs103097Data_Encrypted_93P0_t; +typedef EtsiTs103097Data_t EtsiTs103097Data_Encrypted_93P1_t; +typedef EtsiTs103097Data_t EtsiTs103097Data_Encrypted_93P2_t; /* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_90P0; -asn_struct_free_f EtsiTs103097Data_Encrypted_90P0_free; -asn_struct_print_f EtsiTs103097Data_Encrypted_90P0_print; -asn_constr_check_f EtsiTs103097Data_Encrypted_90P0_constraint; -ber_type_decoder_f EtsiTs103097Data_Encrypted_90P0_decode_ber; -der_type_encoder_f EtsiTs103097Data_Encrypted_90P0_encode_der; -xer_type_decoder_f EtsiTs103097Data_Encrypted_90P0_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Encrypted_90P0_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Encrypted_90P0_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Encrypted_90P0_encode_oer; -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_90P1; -asn_struct_free_f EtsiTs103097Data_Encrypted_90P1_free; -asn_struct_print_f EtsiTs103097Data_Encrypted_90P1_print; -asn_constr_check_f EtsiTs103097Data_Encrypted_90P1_constraint; -ber_type_decoder_f EtsiTs103097Data_Encrypted_90P1_decode_ber; -der_type_encoder_f EtsiTs103097Data_Encrypted_90P1_encode_der; -xer_type_decoder_f EtsiTs103097Data_Encrypted_90P1_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Encrypted_90P1_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Encrypted_90P1_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Encrypted_90P1_encode_oer; -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_90P2; -asn_struct_free_f EtsiTs103097Data_Encrypted_90P2_free; -asn_struct_print_f EtsiTs103097Data_Encrypted_90P2_print; -asn_constr_check_f EtsiTs103097Data_Encrypted_90P2_constraint; -ber_type_decoder_f EtsiTs103097Data_Encrypted_90P2_decode_ber; -der_type_encoder_f EtsiTs103097Data_Encrypted_90P2_encode_der; -xer_type_decoder_f EtsiTs103097Data_Encrypted_90P2_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Encrypted_90P2_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Encrypted_90P2_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Encrypted_90P2_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_93P0; +asn_struct_free_f EtsiTs103097Data_Encrypted_93P0_free; +asn_struct_print_f EtsiTs103097Data_Encrypted_93P0_print; +asn_constr_check_f EtsiTs103097Data_Encrypted_93P0_constraint; +xer_type_decoder_f EtsiTs103097Data_Encrypted_93P0_decode_xer; +xer_type_encoder_f EtsiTs103097Data_Encrypted_93P0_encode_xer; +oer_type_decoder_f EtsiTs103097Data_Encrypted_93P0_decode_oer; +oer_type_encoder_f EtsiTs103097Data_Encrypted_93P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_93P1; +asn_struct_free_f EtsiTs103097Data_Encrypted_93P1_free; +asn_struct_print_f EtsiTs103097Data_Encrypted_93P1_print; +asn_constr_check_f EtsiTs103097Data_Encrypted_93P1_constraint; +xer_type_decoder_f EtsiTs103097Data_Encrypted_93P1_decode_xer; +xer_type_encoder_f EtsiTs103097Data_Encrypted_93P1_encode_xer; +oer_type_decoder_f EtsiTs103097Data_Encrypted_93P1_decode_oer; +oer_type_encoder_f EtsiTs103097Data_Encrypted_93P1_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Encrypted_93P2; +asn_struct_free_f EtsiTs103097Data_Encrypted_93P2_free; +asn_struct_print_f EtsiTs103097Data_Encrypted_93P2_print; +asn_constr_check_f EtsiTs103097Data_Encrypted_93P2_constraint; +xer_type_decoder_f EtsiTs103097Data_Encrypted_93P2_decode_xer; +xer_type_encoder_f EtsiTs103097Data_Encrypted_93P2_encode_xer; +oer_type_decoder_f EtsiTs103097Data_Encrypted_93P2_decode_oer; +oer_type_encoder_f EtsiTs103097Data_Encrypted_93P2_encode_oer; #ifdef __cplusplus } diff --git a/certgen/asncodec/EtsiTs103097Data-Signed.c b/certgen/asncodec/EtsiTs103097Data-Signed.c index 1584f51..106ce3c 100644 --- a/certgen/asncodec/EtsiTs103097Data-Signed.c +++ b/certgen/asncodec/EtsiTs103097Data-Signed.c @@ -1,14 +1,14 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Data-Signed.h" int -EtsiTs103097Data_Signed_60P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_Signed_63P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -31,7 +31,7 @@ EtsiTs103097Data_Signed_60P0_constraint(const asn_TYPE_descriptor_t *td, const v * so here we adjust the DEF accordingly. */ int -EtsiTs103097Data_Signed_60P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_Signed_63P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -54,7 +54,7 @@ EtsiTs103097Data_Signed_60P1_constraint(const asn_TYPE_descriptor_t *td, const v * so here we adjust the DEF accordingly. */ int -EtsiTs103097Data_Signed_60P2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_Signed_63P2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -76,67 +76,97 @@ EtsiTs103097Data_Signed_60P2_constraint(const asn_TYPE_descriptor_t *td, const v * This type is implemented using EtsiTs103097Data, * so here we adjust the DEF accordingly. */ -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Signed_60P0_constr_1 CC_NOTUSED = { +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Signed_63P0_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Signed_60P1_constr_2 CC_NOTUSED = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Signed_63P1_constr_2 CC_NOTUSED = { { 0, 0 }, -1}; -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Signed_60P2_constr_3 CC_NOTUSED = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_Signed_63P2_constr_3 CC_NOTUSED = { { 0, 0 }, -1}; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Signed_60P0_tags_1[] = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Signed_63P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_60P0 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_63P0 = { "EtsiTs103097Data-Signed", "EtsiTs103097Data-Signed", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Signed_60P0_tags_1, - sizeof(asn_DEF_EtsiTs103097Data_Signed_60P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_Signed_60P0_tags_1[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Signed_60P0_tags_1, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Signed_60P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_Signed_60P0_tags_1[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Signed_60P0_constr_1, 0, EtsiTs103097Data_Signed_60P0_constraint }, + asn_DEF_EtsiTs103097Data_Signed_63P0_tags_1, + sizeof(asn_DEF_EtsiTs103097Data_Signed_63P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_Signed_63P0_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_Signed_63P0_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_Signed_63P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_Signed_63P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_Signed_63P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_Signed_63P0_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ }; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Signed_60P1_tags_2[] = { +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Signed_63P1_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_60P1 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_63P1 = { "EtsiTs103097Data-Signed", "EtsiTs103097Data-Signed", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Signed_60P1_tags_2, - sizeof(asn_DEF_EtsiTs103097Data_Signed_60P1_tags_2) - /sizeof(asn_DEF_EtsiTs103097Data_Signed_60P1_tags_2[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Signed_60P1_tags_2, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Signed_60P1_tags_2) - /sizeof(asn_DEF_EtsiTs103097Data_Signed_60P1_tags_2[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Signed_60P1_constr_2, 0, EtsiTs103097Data_Signed_60P1_constraint }, + asn_DEF_EtsiTs103097Data_Signed_63P1_tags_2, + sizeof(asn_DEF_EtsiTs103097Data_Signed_63P1_tags_2) + /sizeof(asn_DEF_EtsiTs103097Data_Signed_63P1_tags_2[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_Signed_63P1_tags_2, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_Signed_63P1_tags_2) + /sizeof(asn_DEF_EtsiTs103097Data_Signed_63P1_tags_2[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_Signed_63P1_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_Signed_63P1_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ }; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Signed_60P2_tags_3[] = { +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_Signed_63P2_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_60P2 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_63P2 = { "EtsiTs103097Data-Signed", "EtsiTs103097Data-Signed", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_Signed_60P2_tags_3, - sizeof(asn_DEF_EtsiTs103097Data_Signed_60P2_tags_3) - /sizeof(asn_DEF_EtsiTs103097Data_Signed_60P2_tags_3[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_Signed_60P2_tags_3, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_Signed_60P2_tags_3) - /sizeof(asn_DEF_EtsiTs103097Data_Signed_60P2_tags_3[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_Signed_60P2_constr_3, 0, EtsiTs103097Data_Signed_60P2_constraint }, + asn_DEF_EtsiTs103097Data_Signed_63P2_tags_3, + sizeof(asn_DEF_EtsiTs103097Data_Signed_63P2_tags_3) + /sizeof(asn_DEF_EtsiTs103097Data_Signed_63P2_tags_3[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_Signed_63P2_tags_3, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_Signed_63P2_tags_3) + /sizeof(asn_DEF_EtsiTs103097Data_Signed_63P2_tags_3[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_Signed_63P2_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_Signed_63P2_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs103097Data-Signed.h b/certgen/asncodec/EtsiTs103097Data-Signed.h index 0972894..ee8ae8a 100644 --- a/certgen/asncodec/EtsiTs103097Data-Signed.h +++ b/certgen/asncodec/EtsiTs103097Data-Signed.h @@ -1,59 +1,53 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data.h" #ifndef _EtsiTs103097Data_Signed_H_ #define _EtsiTs103097Data_Signed_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data.h" - #ifdef __cplusplus extern "C" { #endif /* EtsiTs103097Data-Signed */ -typedef EtsiTs103097Data_t EtsiTs103097Data_Signed_60P0_t; -typedef EtsiTs103097Data_t EtsiTs103097Data_Signed_60P1_t; -typedef EtsiTs103097Data_t EtsiTs103097Data_Signed_60P2_t; +typedef EtsiTs103097Data_t EtsiTs103097Data_Signed_63P0_t; +typedef EtsiTs103097Data_t EtsiTs103097Data_Signed_63P1_t; +typedef EtsiTs103097Data_t EtsiTs103097Data_Signed_63P2_t; /* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_60P0; -asn_struct_free_f EtsiTs103097Data_Signed_60P0_free; -asn_struct_print_f EtsiTs103097Data_Signed_60P0_print; -asn_constr_check_f EtsiTs103097Data_Signed_60P0_constraint; -ber_type_decoder_f EtsiTs103097Data_Signed_60P0_decode_ber; -der_type_encoder_f EtsiTs103097Data_Signed_60P0_encode_der; -xer_type_decoder_f EtsiTs103097Data_Signed_60P0_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Signed_60P0_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Signed_60P0_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Signed_60P0_encode_oer; -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_60P1; -asn_struct_free_f EtsiTs103097Data_Signed_60P1_free; -asn_struct_print_f EtsiTs103097Data_Signed_60P1_print; -asn_constr_check_f EtsiTs103097Data_Signed_60P1_constraint; -ber_type_decoder_f EtsiTs103097Data_Signed_60P1_decode_ber; -der_type_encoder_f EtsiTs103097Data_Signed_60P1_encode_der; -xer_type_decoder_f EtsiTs103097Data_Signed_60P1_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Signed_60P1_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Signed_60P1_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Signed_60P1_encode_oer; -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_60P2; -asn_struct_free_f EtsiTs103097Data_Signed_60P2_free; -asn_struct_print_f EtsiTs103097Data_Signed_60P2_print; -asn_constr_check_f EtsiTs103097Data_Signed_60P2_constraint; -ber_type_decoder_f EtsiTs103097Data_Signed_60P2_decode_ber; -der_type_encoder_f EtsiTs103097Data_Signed_60P2_encode_der; -xer_type_decoder_f EtsiTs103097Data_Signed_60P2_decode_xer; -xer_type_encoder_f EtsiTs103097Data_Signed_60P2_encode_xer; -oer_type_decoder_f EtsiTs103097Data_Signed_60P2_decode_oer; -oer_type_encoder_f EtsiTs103097Data_Signed_60P2_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_63P0; +asn_struct_free_f EtsiTs103097Data_Signed_63P0_free; +asn_struct_print_f EtsiTs103097Data_Signed_63P0_print; +asn_constr_check_f EtsiTs103097Data_Signed_63P0_constraint; +xer_type_decoder_f EtsiTs103097Data_Signed_63P0_decode_xer; +xer_type_encoder_f EtsiTs103097Data_Signed_63P0_encode_xer; +oer_type_decoder_f EtsiTs103097Data_Signed_63P0_decode_oer; +oer_type_encoder_f EtsiTs103097Data_Signed_63P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_63P1; +asn_struct_free_f EtsiTs103097Data_Signed_63P1_free; +asn_struct_print_f EtsiTs103097Data_Signed_63P1_print; +asn_constr_check_f EtsiTs103097Data_Signed_63P1_constraint; +xer_type_decoder_f EtsiTs103097Data_Signed_63P1_decode_xer; +xer_type_encoder_f EtsiTs103097Data_Signed_63P1_encode_xer; +oer_type_decoder_f EtsiTs103097Data_Signed_63P1_decode_oer; +oer_type_encoder_f EtsiTs103097Data_Signed_63P1_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_Signed_63P2; +asn_struct_free_f EtsiTs103097Data_Signed_63P2_free; +asn_struct_print_f EtsiTs103097Data_Signed_63P2_print; +asn_constr_check_f EtsiTs103097Data_Signed_63P2_constraint; +xer_type_decoder_f EtsiTs103097Data_Signed_63P2_decode_xer; +xer_type_encoder_f EtsiTs103097Data_Signed_63P2_encode_xer; +oer_type_decoder_f EtsiTs103097Data_Signed_63P2_decode_oer; +oer_type_encoder_f EtsiTs103097Data_Signed_63P2_encode_oer; #ifdef __cplusplus } diff --git a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.c b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.c index 52d0ea6..78b8d80 100644 --- a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.c +++ b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.c @@ -1,14 +1,14 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097Module" + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Data-SignedAndEncrypted-Unicast.h" int -EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, +EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { @@ -27,26 +27,36 @@ EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_constraint(const asn_TYPE_descr } /* - * This type is implemented using EtsiTs103097Data_Encrypted_Unicast_52P0, + * This type is implemented using EtsiTs103097Data_Encrypted_93P0, * so here we adjust the DEF accordingly. */ -static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_constr_1 CC_NOTUSED = { +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; -static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_tags_1[] = { +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0 = { +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0 = { "EtsiTs103097Data-SignedAndEncrypted-Unicast", "EtsiTs103097Data-SignedAndEncrypted-Unicast", &asn_OP_SEQUENCE, - asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_tags_1, - sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_tags_1[0]), /* 1 */ - asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_tags_1, /* Same as above */ - sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_tags_1) - /sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_tags_1[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_constr_1, 0, EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_constraint }, + asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_tags_1, + sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_tags_1) + /sizeof(asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.h b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.h index 6e8494a..bba4c68 100644 --- a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.h +++ b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted-Unicast.h @@ -1,37 +1,35 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097Module" + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Encrypted.h" #ifndef _EtsiTs103097Data_SignedAndEncrypted_Unicast_H_ #define _EtsiTs103097Data_SignedAndEncrypted_Unicast_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Encrypted-Unicast.h" - #ifdef __cplusplus extern "C" { #endif /* EtsiTs103097Data-SignedAndEncrypted-Unicast */ -typedef EtsiTs103097Data_Encrypted_Unicast_52P0_t EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_t; +typedef EtsiTs103097Data_Encrypted_93P0_t EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_t; /* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0; -asn_struct_free_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_free; -asn_struct_print_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_print; -asn_constr_check_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_constraint; -ber_type_decoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_decode_ber; -der_type_encoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_encode_der; -xer_type_decoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_decode_xer; -xer_type_encoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_encode_xer; -oer_type_decoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_decode_oer; -oer_type_encoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_61P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0; +asn_struct_free_f EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_free; +asn_struct_print_f EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_print; +asn_constr_check_f EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_constraint; +xer_type_decoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_decode_xer; +xer_type_encoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_encode_xer; +oer_type_decoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_decode_oer; +oer_type_encoder_f EtsiTs103097Data_SignedAndEncrypted_Unicast_115P0_encode_oer; #ifdef __cplusplus } diff --git a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.c b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.c index 0e64b74..f71605d 100644 --- a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.c +++ b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Data-SignedAndEncrypted.h" diff --git a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.h b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.h index bb248a4..19d6530 100644 --- a/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.h +++ b/certgen/asncodec/EtsiTs103097Data-SignedAndEncrypted.h @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #ifndef _EtsiTs103097Data_SignedAndEncrypted_H_ diff --git a/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.c b/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.c index e077cfb..3140b60 100644 --- a/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.c +++ b/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Data-SignedExternalPayload.h" @@ -30,9 +30,11 @@ EtsiTs103097Data_SignedExternalPayload_constraint(const asn_TYPE_descriptor_t *t * This type is implemented using EtsiTs103097Data, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_SignedExternalPayload_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_SignedExternalPayload_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_SignedExternalPayload = { asn_DEF_EtsiTs103097Data_SignedExternalPayload_tags_1, /* Same as above */ sizeof(asn_DEF_EtsiTs103097Data_SignedExternalPayload_tags_1) /sizeof(asn_DEF_EtsiTs103097Data_SignedExternalPayload_tags_1[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_SignedExternalPayload_constr_1, 0, EtsiTs103097Data_SignedExternalPayload_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_SignedExternalPayload_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_SignedExternalPayload_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.h b/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.h index d5dfbf6..3b0a6c7 100644 --- a/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.h +++ b/certgen/asncodec/EtsiTs103097Data-SignedExternalPayload.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data.h" #ifndef _EtsiTs103097Data_SignedExternalPayload_H_ #define _EtsiTs103097Data_SignedExternalPayload_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data_SignedExternalPayload; asn_struct_free_f EtsiTs103097Data_SignedExternalPayload_free; asn_struct_print_f EtsiTs103097Data_SignedExternalPayload_print; asn_constr_check_f EtsiTs103097Data_SignedExternalPayload_constraint; -ber_type_decoder_f EtsiTs103097Data_SignedExternalPayload_decode_ber; -der_type_encoder_f EtsiTs103097Data_SignedExternalPayload_encode_der; xer_type_decoder_f EtsiTs103097Data_SignedExternalPayload_decode_xer; xer_type_encoder_f EtsiTs103097Data_SignedExternalPayload_encode_xer; oer_type_decoder_f EtsiTs103097Data_SignedExternalPayload_decode_oer; diff --git a/certgen/asncodec/EtsiTs103097Data-Unsecured.c b/certgen/asncodec/EtsiTs103097Data-Unsecured.c new file mode 100644 index 0000000..8f387a2 --- /dev/null +++ b/certgen/asncodec/EtsiTs103097Data-Unsecured.c @@ -0,0 +1,9 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097Module" + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EtsiTs103097Data-Unsecured.h" + diff --git a/certgen/asncodec/EtsiTs103097Data-Unsecured.h b/certgen/asncodec/EtsiTs103097Data-Unsecured.h new file mode 100644 index 0000000..be45d34 --- /dev/null +++ b/certgen/asncodec/EtsiTs103097Data-Unsecured.h @@ -0,0 +1,23 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097Module" + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#ifndef _EtsiTs103097Data_Unsecured_H_ +#define _EtsiTs103097Data_Unsecured_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _EtsiTs103097Data_Unsecured_H_ */ +#include diff --git a/certgen/asncodec/EtsiTs103097Data.c b/certgen/asncodec/EtsiTs103097Data.c index 96cc70a..950ef91 100644 --- a/certgen/asncodec/EtsiTs103097Data.c +++ b/certgen/asncodec/EtsiTs103097Data.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "EtsiTs103097Data.h" @@ -30,9 +30,11 @@ EtsiTs103097Data_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using Ieee1609Dot2Data, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_EtsiTs103097Data_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_EtsiTs103097Data_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data = { asn_DEF_EtsiTs103097Data_tags_1, /* Same as above */ sizeof(asn_DEF_EtsiTs103097Data_tags_1) /sizeof(asn_DEF_EtsiTs103097Data_tags_1[0]), /* 1 */ - { &asn_OER_type_EtsiTs103097Data_constr_1, 0, EtsiTs103097Data_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097Data_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097Data_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/EtsiTs103097Data.h b/certgen/asncodec/EtsiTs103097Data.h index 49374cf..cbdf09a 100644 --- a/certgen/asncodec/EtsiTs103097Data.h +++ b/certgen/asncodec/EtsiTs103097Data.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/sec_ts103097/EtsiTs103097Module.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" #ifndef _EtsiTs103097Data_H_ #define _EtsiTs103097Data_H_ #include -/* Including external dependencies */ -#include "Ieee1609Dot2Data.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097Data; asn_struct_free_f EtsiTs103097Data_free; asn_struct_print_f EtsiTs103097Data_print; asn_constr_check_f EtsiTs103097Data_constraint; -ber_type_decoder_f EtsiTs103097Data_decode_ber; -der_type_encoder_f EtsiTs103097Data_encode_der; xer_type_decoder_f EtsiTs103097Data_decode_xer; xer_type_encoder_f EtsiTs103097Data_encode_xer; oer_type_decoder_f EtsiTs103097Data_decode_oer; diff --git a/certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.c b/certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.c new file mode 100644 index 0000000..c6a5c8b --- /dev/null +++ b/certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "EtsiTs103097HeaderInfoExtensionId.h" + +int +EtsiTs103097HeaderInfoExtensionId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using ExtId, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_EtsiTs103097HeaderInfoExtensionId_constr_1 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_EtsiTs103097HeaderInfoExtensionId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097HeaderInfoExtensionId = { + "EtsiTs103097HeaderInfoExtensionId", + "EtsiTs103097HeaderInfoExtensionId", + &asn_OP_NativeInteger, + asn_DEF_EtsiTs103097HeaderInfoExtensionId_tags_1, + sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensionId_tags_1) + /sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensionId_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs103097HeaderInfoExtensionId_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensionId_tags_1) + /sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensionId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_EtsiTs103097HeaderInfoExtensionId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + EtsiTs103097HeaderInfoExtensionId_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.h b/certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.h new file mode 100644 index 0000000..ed34827 --- /dev/null +++ b/certgen/asncodec/EtsiTs103097HeaderInfoExtensionId.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ExtId.h" +#ifndef _EtsiTs103097HeaderInfoExtensionId_H_ +#define _EtsiTs103097HeaderInfoExtensionId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EtsiTs103097HeaderInfoExtensionId */ +typedef ExtId_t EtsiTs103097HeaderInfoExtensionId_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097HeaderInfoExtensionId; +asn_struct_free_f EtsiTs103097HeaderInfoExtensionId_free; +asn_struct_print_f EtsiTs103097HeaderInfoExtensionId_print; +asn_constr_check_f EtsiTs103097HeaderInfoExtensionId_constraint; +xer_type_decoder_f EtsiTs103097HeaderInfoExtensionId_decode_xer; +xer_type_encoder_f EtsiTs103097HeaderInfoExtensionId_encode_xer; +oer_type_decoder_f EtsiTs103097HeaderInfoExtensionId_decode_oer; +oer_type_encoder_f EtsiTs103097HeaderInfoExtensionId_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _EtsiTs103097HeaderInfoExtensionId_H_ */ +#include diff --git a/certgen/asncodec/ExpansionAlgorithmIdentifier.c b/certgen/asncodec/ExpansionAlgorithmIdentifier.c new file mode 100644 index 0000000..97d6b6c --- /dev/null +++ b/certgen/asncodec/ExpansionAlgorithmIdentifier.c @@ -0,0 +1,63 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ExpansionAlgorithmIdentifier.h" + +/* + * This type is implemented using NativeEnumerated, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ExpansionAlgorithmIdentifier_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const asn_INTEGER_enum_map_t asn_MAP_ExpansionAlgorithmIdentifier_value2enum_1[] = { + { 0, 18, "sha256ForI-aesForJ" }, + { 1, 15, "sm3ForI-sm4ForJ" } + /* This list is extensible */ +}; +static const unsigned int asn_MAP_ExpansionAlgorithmIdentifier_enum2value_1[] = { + 0, /* sha256ForI-aesForJ(0) */ + 1 /* sm3ForI-sm4ForJ(1) */ + /* This list is extensible */ +}; +static const asn_INTEGER_specifics_t asn_SPC_ExpansionAlgorithmIdentifier_specs_1 = { + asn_MAP_ExpansionAlgorithmIdentifier_value2enum_1, /* "tag" => N; sorted by tag */ + asn_MAP_ExpansionAlgorithmIdentifier_enum2value_1, /* N => "tag"; sorted by N */ + 2, /* Number of elements in the maps */ + 3, /* Extensions before this member */ + 1, /* Strict enumeration */ + 0, /* Native long size */ + 0 +}; +static const ber_tlv_tag_t asn_DEF_ExpansionAlgorithmIdentifier_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ExpansionAlgorithmIdentifier = { + "ExpansionAlgorithmIdentifier", + "ExpansionAlgorithmIdentifier", + &asn_OP_NativeEnumerated, + asn_DEF_ExpansionAlgorithmIdentifier_tags_1, + sizeof(asn_DEF_ExpansionAlgorithmIdentifier_tags_1) + /sizeof(asn_DEF_ExpansionAlgorithmIdentifier_tags_1[0]), /* 1 */ + asn_DEF_ExpansionAlgorithmIdentifier_tags_1, /* Same as above */ + sizeof(asn_DEF_ExpansionAlgorithmIdentifier_tags_1) + /sizeof(asn_DEF_ExpansionAlgorithmIdentifier_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ExpansionAlgorithmIdentifier_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeEnumerated_constraint + }, + 0, 0, /* Defined elsewhere */ + &asn_SPC_ExpansionAlgorithmIdentifier_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ExpansionAlgorithmIdentifier.h b/certgen/asncodec/ExpansionAlgorithmIdentifier.h new file mode 100644 index 0000000..837d3ff --- /dev/null +++ b/certgen/asncodec/ExpansionAlgorithmIdentifier.h @@ -0,0 +1,48 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _ExpansionAlgorithmIdentifier_H_ +#define _ExpansionAlgorithmIdentifier_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum ExpansionAlgorithmIdentifier { + ExpansionAlgorithmIdentifier_sha256ForI_aesForJ = 0, + ExpansionAlgorithmIdentifier_sm3ForI_sm4ForJ = 1 + /* + * Enumeration is extensible + */ +} e_ExpansionAlgorithmIdentifier; + +/* ExpansionAlgorithmIdentifier */ +typedef long ExpansionAlgorithmIdentifier_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ExpansionAlgorithmIdentifier; +asn_struct_free_f ExpansionAlgorithmIdentifier_free; +asn_struct_print_f ExpansionAlgorithmIdentifier_print; +asn_constr_check_f ExpansionAlgorithmIdentifier_constraint; +xer_type_decoder_f ExpansionAlgorithmIdentifier_decode_xer; +xer_type_encoder_f ExpansionAlgorithmIdentifier_encode_xer; +oer_type_decoder_f ExpansionAlgorithmIdentifier_decode_oer; +oer_type_encoder_f ExpansionAlgorithmIdentifier_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ExpansionAlgorithmIdentifier_H_ */ +#include diff --git a/certgen/asncodec/ExplicitCertificate.c b/certgen/asncodec/ExplicitCertificate.c index 8482271..165283c 100644 --- a/certgen/asncodec/ExplicitCertificate.c +++ b/certgen/asncodec/ExplicitCertificate.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ExplicitCertificate.h" @@ -30,9 +30,11 @@ ExplicitCertificate_constraint(const asn_TYPE_descriptor_t *td, const void *sptr * This type is implemented using CertificateBase, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_ExplicitCertificate_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_ExplicitCertificate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_ExplicitCertificate = { asn_DEF_ExplicitCertificate_tags_1, /* Same as above */ sizeof(asn_DEF_ExplicitCertificate_tags_1) /sizeof(asn_DEF_ExplicitCertificate_tags_1[0]), /* 1 */ - { &asn_OER_type_ExplicitCertificate_constr_1, 0, ExplicitCertificate_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ExplicitCertificate_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ExplicitCertificate_constraint + }, asn_MBR_CertificateBase_1, 5, /* Elements count */ &asn_SPC_CertificateBase_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ExplicitCertificate.h b/certgen/asncodec/ExplicitCertificate.h index 4711e85..4ccc68a 100644 --- a/certgen/asncodec/ExplicitCertificate.h +++ b/certgen/asncodec/ExplicitCertificate.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "CertificateBase.h" #ifndef _ExplicitCertificate_H_ #define _ExplicitCertificate_H_ #include -/* Including external dependencies */ -#include "CertificateBase.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_ExplicitCertificate; asn_struct_free_f ExplicitCertificate_free; asn_struct_print_f ExplicitCertificate_print; asn_constr_check_f ExplicitCertificate_constraint; -ber_type_decoder_f ExplicitCertificate_decode_ber; -der_type_encoder_f ExplicitCertificate_encode_der; xer_type_decoder_f ExplicitCertificate_decode_xer; xer_type_encoder_f ExplicitCertificate_encode_xer; oer_type_decoder_f ExplicitCertificate_decode_oer; diff --git a/certgen/asncodec/ExtId.c b/certgen/asncodec/ExtId.c new file mode 100644 index 0000000..efdf872 --- /dev/null +++ b/certgen/asncodec/ExtId.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ExtId.h" + +int +ExtId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using NativeInteger, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ExtId_constr_1 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ExtId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ExtId = { + "ExtId", + "ExtId", + &asn_OP_NativeInteger, + asn_DEF_ExtId_tags_1, + sizeof(asn_DEF_ExtId_tags_1) + /sizeof(asn_DEF_ExtId_tags_1[0]), /* 1 */ + asn_DEF_ExtId_tags_1, /* Same as above */ + sizeof(asn_DEF_ExtId_tags_1) + /sizeof(asn_DEF_ExtId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ExtId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ExtId_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/ExtId.h b/certgen/asncodec/ExtId.h new file mode 100644 index 0000000..cadc8e5 --- /dev/null +++ b/certgen/asncodec/ExtId.h @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _ExtId_H_ +#define _ExtId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ExtId */ +typedef long ExtId_t; + +/* Implementation */ +#define ExtId_certExtId_OperatingOrganization ((ExtId_t)1) +extern asn_TYPE_descriptor_t asn_DEF_ExtId; +asn_struct_free_f ExtId_free; +asn_struct_print_f ExtId_print; +asn_constr_check_f ExtId_constraint; +xer_type_decoder_f ExtId_decode_xer; +xer_type_encoder_f ExtId_encode_xer; +oer_type_decoder_f ExtId_decode_oer; +oer_type_encoder_f ExtId_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ExtId_H_ */ +#include diff --git a/certgen/asncodec/Extension.c b/certgen/asncodec/Extension.c new file mode 100644 index 0000000..4d651b9 --- /dev/null +++ b/certgen/asncodec/Extension.c @@ -0,0 +1,468 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Extension.h" + +static const long asn_VAL_1_etsiTs102941CrlRequestId = 1; +static const long asn_VAL_2_etsiTs102941DeltaCtlRequestId = 2; +static const asn_ioc_cell_t asn_IOS_EtsiTs103097HeaderInfoExtensions_1_rows[] = { + { "&extId", aioc__value, &asn_DEF_ExtId, &asn_VAL_1_etsiTs102941CrlRequestId }, + { "&ExtContent", aioc__type, &asn_DEF_EtsiTs102941CrlRequest }, + { "&extId", aioc__value, &asn_DEF_ExtId, &asn_VAL_2_etsiTs102941DeltaCtlRequestId }, + { "&ExtContent", aioc__type, &asn_DEF_EtsiTs102941DeltaCtlRequest } +}; +static const asn_ioc_set_t asn_IOS_EtsiTs103097HeaderInfoExtensions_1[] = { + { 2, 2, asn_IOS_EtsiTs103097HeaderInfoExtensions_1_rows } +}; +static const long asn_VAL_3_p2pcd8ByteLearningRequestId = 1; +static const asn_ioc_cell_t asn_IOS_Ieee1609HeaderInfoExtensions_1_rows[] = { + { "&extId", aioc__value, &asn_DEF_ExtId, &asn_VAL_3_p2pcd8ByteLearningRequestId }, + { "&ExtContent", aioc__type, &asn_DEF_HashedId8 } +}; +static const asn_ioc_set_t asn_IOS_Ieee1609HeaderInfoExtensions_1[] = { + { 1, 2, asn_IOS_Ieee1609HeaderInfoExtensions_1_rows } +}; +static int +memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static asn_type_selector_result_t +select_EtsiTs103097HeaderInfoExtensions_content_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { + asn_type_selector_result_t result = {0, 0}; + const asn_ioc_set_t *itable = asn_IOS_EtsiTs103097HeaderInfoExtensions_1; + size_t constraining_column = 0; /* &extId */ + size_t for_column = 1; /* &ExtContent */ + size_t row, presence_index = 0; + const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct EtsiTs103097HeaderInfoExtensions, id)); + + for(row=0; row < itable->rows_count; row++) { + const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column]; + const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column]; + + if(type_cell->cell_kind == aioc__undefined) + continue; + + presence_index++; + if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { + result.type_descriptor = type_cell->type_descriptor; + result.presence_index = presence_index; + break; + } + } + + return result; +} + +static int +memb_content_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +static int +memb_id_constraint_4(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static asn_type_selector_result_t +select_Ieee1609HeaderInfoExtensions_content_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { + asn_type_selector_result_t result = {0, 0}; + const asn_ioc_set_t *itable = asn_IOS_Ieee1609HeaderInfoExtensions_1; + size_t constraining_column = 0; /* &extId */ + size_t for_column = 1; /* &ExtContent */ + size_t row, presence_index = 0; + const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Ieee1609HeaderInfoExtensions, id)); + + for(row=0; row < itable->rows_count; row++) { + const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column]; + const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column]; + + if(type_cell->cell_kind == aioc__undefined) + continue; + + presence_index++; + if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { + result.type_descriptor = type_cell->type_descriptor; + result.presence_index = presence_index; + break; + } + } + + return result; +} + +static int +memb_content_constraint_4(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_id_constr_2 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_content_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_id_constr_5 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_content_constr_6 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_content_3[] = { + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs103097HeaderInfoExtensions__content, choice.EtsiTs102941CrlRequest), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_EtsiTs102941CrlRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "EtsiTs102941CrlRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs103097HeaderInfoExtensions__content, choice.EtsiTs102941DeltaCtlRequest), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_EtsiTs102941DeltaCtlRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "EtsiTs102941DeltaCtlRequest" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_content_tag2el_3[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* EtsiTs102941CrlRequest */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* EtsiTs102941DeltaCtlRequest */ +}; +static asn_CHOICE_specifics_t asn_SPC_content_specs_3 = { + sizeof(struct EtsiTs103097HeaderInfoExtensions__content), + offsetof(struct EtsiTs103097HeaderInfoExtensions__content, _asn_ctx), + offsetof(struct EtsiTs103097HeaderInfoExtensions__content, present), + sizeof(((struct EtsiTs103097HeaderInfoExtensions__content *)0)->present), + asn_MAP_content_tag2el_3, + 2, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_content_3 = { + "content", + "content", + &asn_OP_OPEN_TYPE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OPEN_TYPE_constraint + }, + asn_MBR_content_3, + 2, /* Elements count */ + &asn_SPC_content_specs_3 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_EtsiTs103097HeaderInfoExtensions_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct EtsiTs103097HeaderInfoExtensions, id), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ExtId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_id_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_id_constraint_1 + }, + 0, 0, /* No default value */ + "id" + }, + { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct EtsiTs103097HeaderInfoExtensions, content), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_content_3, + select_EtsiTs103097HeaderInfoExtensions_content_type, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_content_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_content_constraint_1 + }, + 0, 0, /* No default value */ + "content" + }, +}; +static const ber_tlv_tag_t asn_DEF_EtsiTs103097HeaderInfoExtensions_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EtsiTs103097HeaderInfoExtensions_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* id */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* content */ +}; +asn_SEQUENCE_specifics_t asn_SPC_EtsiTs103097HeaderInfoExtensions_specs_1 = { + sizeof(struct EtsiTs103097HeaderInfoExtensions), + offsetof(struct EtsiTs103097HeaderInfoExtensions, _asn_ctx), + asn_MAP_EtsiTs103097HeaderInfoExtensions_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EtsiTs103097HeaderInfoExtensions = { + "EtsiTs103097HeaderInfoExtensions", + "EtsiTs103097HeaderInfoExtensions", + &asn_OP_SEQUENCE, + asn_DEF_EtsiTs103097HeaderInfoExtensions_tags_1, + sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensions_tags_1) + /sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensions_tags_1[0]), /* 1 */ + asn_DEF_EtsiTs103097HeaderInfoExtensions_tags_1, /* Same as above */ + sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensions_tags_1) + /sizeof(asn_DEF_EtsiTs103097HeaderInfoExtensions_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EtsiTs103097HeaderInfoExtensions_1, + 2, /* Elements count */ + &asn_SPC_EtsiTs103097HeaderInfoExtensions_specs_1 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_content_6[] = { + { ATF_NOFLAGS, 0, offsetof(struct Ieee1609HeaderInfoExtensions__content, choice.HashedId8), + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "HashedId8" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_content_tag2el_6[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* HashedId8 */ +}; +static asn_CHOICE_specifics_t asn_SPC_content_specs_6 = { + sizeof(struct Ieee1609HeaderInfoExtensions__content), + offsetof(struct Ieee1609HeaderInfoExtensions__content, _asn_ctx), + offsetof(struct Ieee1609HeaderInfoExtensions__content, present), + sizeof(((struct Ieee1609HeaderInfoExtensions__content *)0)->present), + asn_MAP_content_tag2el_6, + 1, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_content_6 = { + "content", + "content", + &asn_OP_OPEN_TYPE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OPEN_TYPE_constraint + }, + asn_MBR_content_6, + 1, /* Elements count */ + &asn_SPC_content_specs_6 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_Ieee1609HeaderInfoExtensions_4[] = { + { ATF_NOFLAGS, 0, offsetof(struct Ieee1609HeaderInfoExtensions, id), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ExtId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_id_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_id_constraint_4 + }, + 0, 0, /* No default value */ + "id" + }, + { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Ieee1609HeaderInfoExtensions, content), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_content_6, + select_Ieee1609HeaderInfoExtensions_content_type, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_content_constr_6, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_content_constraint_4 + }, + 0, 0, /* No default value */ + "content" + }, +}; +static const ber_tlv_tag_t asn_DEF_Ieee1609HeaderInfoExtensions_tags_4[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_Ieee1609HeaderInfoExtensions_tag2el_4[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* id */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* content */ +}; +asn_SEQUENCE_specifics_t asn_SPC_Ieee1609HeaderInfoExtensions_specs_4 = { + sizeof(struct Ieee1609HeaderInfoExtensions), + offsetof(struct Ieee1609HeaderInfoExtensions, _asn_ctx), + asn_MAP_Ieee1609HeaderInfoExtensions_tag2el_4, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609HeaderInfoExtensions = { + "Ieee1609HeaderInfoExtensions", + "Ieee1609HeaderInfoExtensions", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609HeaderInfoExtensions_tags_4, + sizeof(asn_DEF_Ieee1609HeaderInfoExtensions_tags_4) + /sizeof(asn_DEF_Ieee1609HeaderInfoExtensions_tags_4[0]), /* 1 */ + asn_DEF_Ieee1609HeaderInfoExtensions_tags_4, /* Same as above */ + sizeof(asn_DEF_Ieee1609HeaderInfoExtensions_tags_4) + /sizeof(asn_DEF_Ieee1609HeaderInfoExtensions_tags_4[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_Ieee1609HeaderInfoExtensions_4, + 2, /* Elements count */ + &asn_SPC_Ieee1609HeaderInfoExtensions_specs_4 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Extension.h b/certgen/asncodec/Extension.h new file mode 100644 index 0000000..e9b5a97 --- /dev/null +++ b/certgen/asncodec/Extension.h @@ -0,0 +1,86 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ExtId.h" +#include +#include +#include "EtsiTs102941CrlRequest.h" +#include "EtsiTs102941DeltaCtlRequest.h" +#include +#include +#include +#include "HashedId8.h" +#ifndef _Extension_H_ +#define _Extension_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum EtsiTs103097HeaderInfoExtensions__content_PR { + EtsiTs103097HeaderInfoExtensions__content_PR_NOTHING, /* No components present */ + EtsiTs103097HeaderInfoExtensions__content_PR_EtsiTs102941CrlRequest, + EtsiTs103097HeaderInfoExtensions__content_PR_EtsiTs102941DeltaCtlRequest +} EtsiTs103097HeaderInfoExtensions__content_PR; +typedef enum Ieee1609HeaderInfoExtensions__content_PR { + Ieee1609HeaderInfoExtensions__content_PR_NOTHING, /* No components present */ + Ieee1609HeaderInfoExtensions__content_PR_HashedId8 +} Ieee1609HeaderInfoExtensions__content_PR; + +/* Extension */ +typedef struct EtsiTs103097HeaderInfoExtensions { + ExtId_t id; + struct EtsiTs103097HeaderInfoExtensions__content { + EtsiTs103097HeaderInfoExtensions__content_PR present; + union EtsiTs103097HeaderInfoExtensions__content_u { + EtsiTs102941CrlRequest_t EtsiTs102941CrlRequest; + EtsiTs102941DeltaCtlRequest_t EtsiTs102941DeltaCtlRequest; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } content; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EtsiTs103097HeaderInfoExtensions_t; +typedef struct Ieee1609HeaderInfoExtensions { + ExtId_t id; + struct Ieee1609HeaderInfoExtensions__content { + Ieee1609HeaderInfoExtensions__content_PR present; + union Ieee1609HeaderInfoExtensions__content_u { + HashedId8_t HashedId8; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } content; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} Ieee1609HeaderInfoExtensions_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_EtsiTs103097HeaderInfoExtensions; +extern asn_SEQUENCE_specifics_t asn_SPC_EtsiTs103097HeaderInfoExtensions_specs_1; +extern asn_TYPE_member_t asn_MBR_EtsiTs103097HeaderInfoExtensions_1[2]; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609HeaderInfoExtensions; +extern asn_SEQUENCE_specifics_t asn_SPC_Ieee1609HeaderInfoExtensions_specs_4; +extern asn_TYPE_member_t asn_MBR_Ieee1609HeaderInfoExtensions_4[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _Extension_H_ */ +#include diff --git a/certgen/asncodec/ExtensionModuleVersion.c b/certgen/asncodec/ExtensionModuleVersion.c new file mode 100644 index 0000000..6ea505e --- /dev/null +++ b/certgen/asncodec/ExtensionModuleVersion.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ExtensionModuleVersion.h" + +int +ExtensionModuleVersion_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 1)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using NativeInteger, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ExtensionModuleVersion_constr_1 CC_NOTUSED = { + { 1, 1 } /* (1..1) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ExtensionModuleVersion_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ExtensionModuleVersion = { + "ExtensionModuleVersion", + "ExtensionModuleVersion", + &asn_OP_NativeInteger, + asn_DEF_ExtensionModuleVersion_tags_1, + sizeof(asn_DEF_ExtensionModuleVersion_tags_1) + /sizeof(asn_DEF_ExtensionModuleVersion_tags_1[0]), /* 1 */ + asn_DEF_ExtensionModuleVersion_tags_1, /* Same as above */ + sizeof(asn_DEF_ExtensionModuleVersion_tags_1) + /sizeof(asn_DEF_ExtensionModuleVersion_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ExtensionModuleVersion_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ExtensionModuleVersion_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/ExtensionModuleVersion.h b/certgen/asncodec/ExtensionModuleVersion.h new file mode 100644 index 0000000..0606251 --- /dev/null +++ b/certgen/asncodec/ExtensionModuleVersion.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs103097ExtensionModule" + * found in "asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _ExtensionModuleVersion_H_ +#define _ExtensionModuleVersion_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ExtensionModuleVersion */ +typedef long ExtensionModuleVersion_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ExtensionModuleVersion; +asn_struct_free_f ExtensionModuleVersion_free; +asn_struct_print_f ExtensionModuleVersion_print; +asn_constr_check_f ExtensionModuleVersion_constraint; +xer_type_decoder_f ExtensionModuleVersion_decode_xer; +xer_type_encoder_f ExtensionModuleVersion_encode_xer; +oer_type_decoder_f ExtensionModuleVersion_decode_oer; +oer_type_encoder_f ExtensionModuleVersion_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ExtensionModuleVersion_H_ */ +#include diff --git a/certgen/asncodec/FullCtl.c b/certgen/asncodec/FullCtl.c index 28e7393..c68d643 100644 --- a/certgen/asncodec/FullCtl.c +++ b/certgen/asncodec/FullCtl.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "FullCtl.h" @@ -30,9 +30,11 @@ FullCtl_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using CtlFormat, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_FullCtl_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_FullCtl_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_FullCtl = { asn_DEF_FullCtl_tags_1, /* Same as above */ sizeof(asn_DEF_FullCtl_tags_1) /sizeof(asn_DEF_FullCtl_tags_1[0]), /* 1 */ - { &asn_OER_type_FullCtl_constr_1, 0, FullCtl_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_FullCtl_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + FullCtl_constraint + }, asn_MBR_CtlFormat_1, 5, /* Elements count */ &asn_SPC_CtlFormat_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/FullCtl.h b/certgen/asncodec/FullCtl.h index cfc3056..75ba881 100644 --- a/certgen/asncodec/FullCtl.h +++ b/certgen/asncodec/FullCtl.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "CtlFormat.h" #ifndef _FullCtl_H_ #define _FullCtl_H_ #include -/* Including external dependencies */ -#include "CtlFormat.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_FullCtl; asn_struct_free_f FullCtl_free; asn_struct_print_f FullCtl_print; asn_constr_check_f FullCtl_constraint; -ber_type_decoder_f FullCtl_decode_ber; -der_type_encoder_f FullCtl_encode_der; xer_type_decoder_f FullCtl_decode_xer; xer_type_encoder_f FullCtl_encode_xer; oer_type_decoder_f FullCtl_decode_oer; diff --git a/certgen/asncodec/FullIeeeTbsCtl.c b/certgen/asncodec/FullIeeeTbsCtl.c new file mode 100644 index 0000000..94c63cc --- /dev/null +++ b/certgen/asncodec/FullIeeeTbsCtl.c @@ -0,0 +1,454 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "FullIeeeTbsCtl.h" + +static int +memb_type_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 1)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_type_constr_2 CC_NOTUSED = { + { 1, 1 } /* (1..1) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_electorApprove_6[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_CtlElectorEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_electorApprove_tags_6[] = { + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_electorApprove_specs_6 = { + sizeof(struct FullIeeeTbsCtl__electorApprove), + offsetof(struct FullIeeeTbsCtl__electorApprove, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_electorApprove_6 = { + "electorApprove", + "electorApprove", + &asn_OP_SEQUENCE_OF, + asn_DEF_electorApprove_tags_6, + sizeof(asn_DEF_electorApprove_tags_6) + /sizeof(asn_DEF_electorApprove_tags_6[0]) - 1, /* 1 */ + asn_DEF_electorApprove_tags_6, /* Same as above */ + sizeof(asn_DEF_electorApprove_tags_6) + /sizeof(asn_DEF_electorApprove_tags_6[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_electorApprove_6, + 1, /* Single element */ + &asn_SPC_electorApprove_specs_6 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_electorRemove_8[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_CtlElectorEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_electorRemove_tags_8[] = { + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_electorRemove_specs_8 = { + sizeof(struct FullIeeeTbsCtl__electorRemove), + offsetof(struct FullIeeeTbsCtl__electorRemove, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_electorRemove_8 = { + "electorRemove", + "electorRemove", + &asn_OP_SEQUENCE_OF, + asn_DEF_electorRemove_tags_8, + sizeof(asn_DEF_electorRemove_tags_8) + /sizeof(asn_DEF_electorRemove_tags_8[0]) - 1, /* 1 */ + asn_DEF_electorRemove_tags_8, /* Same as above */ + sizeof(asn_DEF_electorRemove_tags_8) + /sizeof(asn_DEF_electorRemove_tags_8[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_electorRemove_8, + 1, /* Single element */ + &asn_SPC_electorRemove_specs_8 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_rootCaApprove_10[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_CtlRootCaEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_rootCaApprove_tags_10[] = { + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_rootCaApprove_specs_10 = { + sizeof(struct FullIeeeTbsCtl__rootCaApprove), + offsetof(struct FullIeeeTbsCtl__rootCaApprove, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_rootCaApprove_10 = { + "rootCaApprove", + "rootCaApprove", + &asn_OP_SEQUENCE_OF, + asn_DEF_rootCaApprove_tags_10, + sizeof(asn_DEF_rootCaApprove_tags_10) + /sizeof(asn_DEF_rootCaApprove_tags_10[0]) - 1, /* 1 */ + asn_DEF_rootCaApprove_tags_10, /* Same as above */ + sizeof(asn_DEF_rootCaApprove_tags_10) + /sizeof(asn_DEF_rootCaApprove_tags_10[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_rootCaApprove_10, + 1, /* Single element */ + &asn_SPC_rootCaApprove_specs_10 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_rootCaRemove_12[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_CtlRootCaEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_rootCaRemove_tags_12[] = { + (ASN_TAG_CLASS_CONTEXT | (7 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_rootCaRemove_specs_12 = { + sizeof(struct FullIeeeTbsCtl__rootCaRemove), + offsetof(struct FullIeeeTbsCtl__rootCaRemove, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_rootCaRemove_12 = { + "rootCaRemove", + "rootCaRemove", + &asn_OP_SEQUENCE_OF, + asn_DEF_rootCaRemove_tags_12, + sizeof(asn_DEF_rootCaRemove_tags_12) + /sizeof(asn_DEF_rootCaRemove_tags_12[0]) - 1, /* 1 */ + asn_DEF_rootCaRemove_tags_12, /* Same as above */ + sizeof(asn_DEF_rootCaRemove_tags_12) + /sizeof(asn_DEF_rootCaRemove_tags_12[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_rootCaRemove_12, + 1, /* Single element */ + &asn_SPC_rootCaRemove_specs_12 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_FullIeeeTbsCtl_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, type), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Ieee1609dot2dot1MsctlType, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_type_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_type_constraint_1 + }, + 0, 0, /* No default value */ + "type" + }, + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, ctlSeriesId), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CtlSeriesId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ctlSeriesId" + }, + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, sequenceNumber), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CtlSequenceNumber, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sequenceNumber" + }, + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, effectiveDate), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "effectiveDate" + }, + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, electorApprove), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + 0, + &asn_DEF_electorApprove_6, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "electorApprove" + }, + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, electorRemove), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + 0, + &asn_DEF_electorRemove_8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "electorRemove" + }, + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, rootCaApprove), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + 0, + &asn_DEF_rootCaApprove_10, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "rootCaApprove" + }, + { ATF_NOFLAGS, 0, offsetof(struct FullIeeeTbsCtl, rootCaRemove), + (ASN_TAG_CLASS_CONTEXT | (7 << 2)), + 0, + &asn_DEF_rootCaRemove_12, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "rootCaRemove" + }, + { ATF_POINTER, 1, offsetof(struct FullIeeeTbsCtl, quorum), + (ASN_TAG_CLASS_CONTEXT | (8 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "quorum" + }, +}; +static const int asn_MAP_FullIeeeTbsCtl_oms_1[] = { 8 }; +static const ber_tlv_tag_t asn_DEF_FullIeeeTbsCtl_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_FullIeeeTbsCtl_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ctlSeriesId */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sequenceNumber */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* effectiveDate */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* electorApprove */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* electorRemove */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* rootCaApprove */ + { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* rootCaRemove */ + { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 } /* quorum */ +}; +asn_SEQUENCE_specifics_t asn_SPC_FullIeeeTbsCtl_specs_1 = { + sizeof(struct FullIeeeTbsCtl), + offsetof(struct FullIeeeTbsCtl, _asn_ctx), + asn_MAP_FullIeeeTbsCtl_tag2el_1, + 9, /* Count of tags in the map */ + asn_MAP_FullIeeeTbsCtl_oms_1, /* Optional members */ + 0, 1, /* Root/Additions */ + 8, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_FullIeeeTbsCtl = { + "FullIeeeTbsCtl", + "FullIeeeTbsCtl", + &asn_OP_SEQUENCE, + asn_DEF_FullIeeeTbsCtl_tags_1, + sizeof(asn_DEF_FullIeeeTbsCtl_tags_1) + /sizeof(asn_DEF_FullIeeeTbsCtl_tags_1[0]), /* 1 */ + asn_DEF_FullIeeeTbsCtl_tags_1, /* Same as above */ + sizeof(asn_DEF_FullIeeeTbsCtl_tags_1) + /sizeof(asn_DEF_FullIeeeTbsCtl_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_FullIeeeTbsCtl_1, + 9, /* Elements count */ + &asn_SPC_FullIeeeTbsCtl_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/FullIeeeTbsCtl.h b/certgen/asncodec/FullIeeeTbsCtl.h new file mode 100644 index 0000000..2d6dfac --- /dev/null +++ b/certgen/asncodec/FullIeeeTbsCtl.h @@ -0,0 +1,80 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609dot2dot1MsctlType.h" +#include "CtlSeriesId.h" +#include "CtlSequenceNumber.h" +#include "Time32.h" +#include +#include "CtlElectorEntry.h" +#include +#include +#include "CtlRootCaEntry.h" +#include +#ifndef _FullIeeeTbsCtl_H_ +#define _FullIeeeTbsCtl_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* FullIeeeTbsCtl */ +typedef struct FullIeeeTbsCtl { + Ieee1609dot2dot1MsctlType_t type; + CtlSeriesId_t ctlSeriesId; + CtlSequenceNumber_t sequenceNumber; + Time32_t effectiveDate; + struct FullIeeeTbsCtl__electorApprove { + A_SEQUENCE_OF(CtlElectorEntry_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } electorApprove; + struct FullIeeeTbsCtl__electorRemove { + A_SEQUENCE_OF(CtlElectorEntry_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } electorRemove; + struct FullIeeeTbsCtl__rootCaApprove { + A_SEQUENCE_OF(CtlRootCaEntry_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } rootCaApprove; + struct FullIeeeTbsCtl__rootCaRemove { + A_SEQUENCE_OF(CtlRootCaEntry_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } rootCaRemove; + /* + * This type is extensible, + * possible extensions are below. + */ + long *quorum; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} FullIeeeTbsCtl_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_FullIeeeTbsCtl; +extern asn_SEQUENCE_specifics_t asn_SPC_FullIeeeTbsCtl_specs_1; +extern asn_TYPE_member_t asn_MBR_FullIeeeTbsCtl_1[9]; + +#ifdef __cplusplus +} +#endif + +#endif /* _FullIeeeTbsCtl_H_ */ +#include diff --git a/certgen/asncodec/GeographicRegion.c b/certgen/asncodec/GeographicRegion.c index 81d92a4..7d616fc 100644 --- a/certgen/asncodec/GeographicRegion.c +++ b/certgen/asncodec/GeographicRegion.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "GeographicRegion.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_GeographicRegion_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_GeographicRegion_1[] = { { ATF_NOFLAGS, 0, offsetof(struct GeographicRegion, choice.circularRegion), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_CircularRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "circularRegion" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_GeographicRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfRectangularRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "rectangularRegion" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_GeographicRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PolygonalRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "polygonalRegion" }, @@ -43,7 +69,15 @@ asn_TYPE_member_t asn_MBR_GeographicRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfIdentifiedRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "identifiedRegion" }, @@ -72,7 +106,15 @@ asn_TYPE_descriptor_t asn_DEF_GeographicRegion = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_GeographicRegion_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_GeographicRegion_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_GeographicRegion_1, 4, /* Elements count */ &asn_SPC_GeographicRegion_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/GeographicRegion.h b/certgen/asncodec/GeographicRegion.h index bcebd31..feef15d 100644 --- a/certgen/asncodec/GeographicRegion.h +++ b/certgen/asncodec/GeographicRegion.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _GeographicRegion_H_ -#define _GeographicRegion_H_ - - -#include /* Including external dependencies */ #include "CircularRegion.h" @@ -17,6 +12,11 @@ #include "PolygonalRegion.h" #include "SequenceOfIdentifiedRegion.h" #include +#ifndef _GeographicRegion_H_ +#define _GeographicRegion_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/GraphicString.c b/certgen/asncodec/GraphicString.c new file mode 100644 index 0000000..b761187 --- /dev/null +++ b/certgen/asncodec/GraphicString.c @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2003 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * GraphicString basic type description. + */ +static const ber_tlv_tag_t asn_DEF_GraphicString_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/ + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ +}; +asn_TYPE_operation_t asn_OP_GraphicString = { + OCTET_STRING_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + OCTET_STRING_print, /* non-ascii string */ +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OCTET_STRING_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OCTET_STRING_decode_xer_hex, + OCTET_STRING_encode_xer, /* Can't expect it to be ASCII/UTF8 */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + OCTET_STRING_encode_jer, /* Can't expect it to be ASCII/UTF8 */ +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + OCTET_STRING_decode_oer, + OCTET_STRING_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OCTET_STRING_decode_aper, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + OCTET_STRING_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_GraphicString = { + "GraphicString", + "GraphicString", + &asn_OP_GraphicString, + asn_DEF_GraphicString_tags, + sizeof(asn_DEF_GraphicString_tags) + / sizeof(asn_DEF_GraphicString_tags[0]) - 1, + asn_DEF_GraphicString_tags, + sizeof(asn_DEF_GraphicString_tags) + / sizeof(asn_DEF_GraphicString_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_unknown_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; diff --git a/certgen/asncodec/GraphicString.h b/certgen/asncodec/GraphicString.h new file mode 100644 index 0000000..807e9d6 --- /dev/null +++ b/certgen/asncodec/GraphicString.h @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _GraphicString_H_ +#define _GraphicString_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef OCTET_STRING_t GraphicString_t; /* Implemented via OCTET STRING */ + +extern asn_TYPE_descriptor_t asn_DEF_GraphicString; +extern asn_TYPE_operation_t asn_OP_GraphicString; + +#define GraphicString_free OCTET_STRING_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +#define GraphicString_print OCTET_STRING_print +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define GraphicString_compare OCTET_STRING_compare + +#define GraphicString_constraint asn_generic_unknown_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define GraphicString_decode_ber OCTET_STRING_decode_ber +#define GraphicString_encode_der OCTET_STRING_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define GraphicString_decode_xer OCTET_STRING_decode_xer_hex +#define GraphicString_encode_xer OCTET_STRING_encode_xer +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +#define GraphicString_encode_jer OCTET_STRING_encode_jer +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +#define GraphicString_decode_uper OCTET_STRING_decode_uper +#define GraphicString_encode_uper OCTET_STRING_encode_uper +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#define GraphicString_decode_aper OCTET_STRING_decode_aper +#define GraphicString_encode_aper OCTET_STRING_encode_aper +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GraphicString_H_ */ diff --git a/certgen/asncodec/GroupCrlEntry.c b/certgen/asncodec/GroupCrlEntry.c new file mode 100644 index 0000000..ba343c0 --- /dev/null +++ b/certgen/asncodec/GroupCrlEntry.c @@ -0,0 +1,138 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "GroupCrlEntry.h" + +asn_TYPE_member_t asn_MBR_GroupCrlEntry_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct GroupCrlEntry, iMax), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint16, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "iMax" + }, + { ATF_NOFLAGS, 0, offsetof(struct GroupCrlEntry, la1Id), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "la1Id" + }, + { ATF_NOFLAGS, 0, offsetof(struct GroupCrlEntry, linkageSeed1), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LinkageSeed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "linkageSeed1" + }, + { ATF_NOFLAGS, 0, offsetof(struct GroupCrlEntry, la2Id), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "la2Id" + }, + { ATF_NOFLAGS, 0, offsetof(struct GroupCrlEntry, linkageSeed2), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LinkageSeed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "linkageSeed2" + }, +}; +static const ber_tlv_tag_t asn_DEF_GroupCrlEntry_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_GroupCrlEntry_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iMax */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* la1Id */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* linkageSeed1 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* la2Id */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* linkageSeed2 */ +}; +asn_SEQUENCE_specifics_t asn_SPC_GroupCrlEntry_specs_1 = { + sizeof(struct GroupCrlEntry), + offsetof(struct GroupCrlEntry, _asn_ctx), + asn_MAP_GroupCrlEntry_tag2el_1, + 5, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 5, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_GroupCrlEntry = { + "GroupCrlEntry", + "GroupCrlEntry", + &asn_OP_SEQUENCE, + asn_DEF_GroupCrlEntry_tags_1, + sizeof(asn_DEF_GroupCrlEntry_tags_1) + /sizeof(asn_DEF_GroupCrlEntry_tags_1[0]), /* 1 */ + asn_DEF_GroupCrlEntry_tags_1, /* Same as above */ + sizeof(asn_DEF_GroupCrlEntry_tags_1) + /sizeof(asn_DEF_GroupCrlEntry_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_GroupCrlEntry_1, + 5, /* Elements count */ + &asn_SPC_GroupCrlEntry_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/GroupCrlEntry.h b/certgen/asncodec/GroupCrlEntry.h new file mode 100644 index 0000000..701d990 --- /dev/null +++ b/certgen/asncodec/GroupCrlEntry.h @@ -0,0 +1,50 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint16.h" +#include "LaId.h" +#include "LinkageSeed.h" +#include +#ifndef _GroupCrlEntry_H_ +#define _GroupCrlEntry_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* GroupCrlEntry */ +typedef struct GroupCrlEntry { + Uint16_t iMax; + LaId_t la1Id; + LinkageSeed_t linkageSeed1; + LaId_t la2Id; + LinkageSeed_t linkageSeed2; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} GroupCrlEntry_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_GroupCrlEntry; +extern asn_SEQUENCE_specifics_t asn_SPC_GroupCrlEntry_specs_1; +extern asn_TYPE_member_t asn_MBR_GroupCrlEntry_1[5]; + +#ifdef __cplusplus +} +#endif + +#endif /* _GroupCrlEntry_H_ */ +#include diff --git a/certgen/asncodec/GroupLinkageValue.c b/certgen/asncodec/GroupLinkageValue.c index 820e7eb..fd43483 100644 --- a/certgen/asncodec/GroupLinkageValue.c +++ b/certgen/asncodec/GroupLinkageValue.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "GroupLinkageValue.h" @@ -59,19 +59,31 @@ memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_jValue_constr_2 CC_NOTUSED = { { 0, 0 }, 4 /* (SIZE(4..4)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_value_constr_3 CC_NOTUSED = { { 0, 0 }, 9 /* (SIZE(9..9)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_GroupLinkageValue_1[] = { { ATF_NOFLAGS, 0, offsetof(struct GroupLinkageValue, jValue), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_jValue_constr_2, 0, memb_jValue_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_jValue_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_jValue_constraint_1 + }, 0, 0, /* No default value */ "jValue" }, @@ -80,7 +92,15 @@ asn_TYPE_member_t asn_MBR_GroupLinkageValue_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_value_constr_3, 0, memb_value_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_value_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_value_constraint_1 + }, 0, 0, /* No default value */ "value" }, @@ -110,7 +130,15 @@ asn_TYPE_descriptor_t asn_DEF_GroupLinkageValue = { asn_DEF_GroupLinkageValue_tags_1, /* Same as above */ sizeof(asn_DEF_GroupLinkageValue_tags_1) /sizeof(asn_DEF_GroupLinkageValue_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_GroupLinkageValue_1, 2, /* Elements count */ &asn_SPC_GroupLinkageValue_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/GroupLinkageValue.h b/certgen/asncodec/GroupLinkageValue.h index 673e9ae..2a9fcdd 100644 --- a/certgen/asncodec/GroupLinkageValue.h +++ b/certgen/asncodec/GroupLinkageValue.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _GroupLinkageValue_H_ #define _GroupLinkageValue_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/GroupSingleSeedCrlEntry.c b/certgen/asncodec/GroupSingleSeedCrlEntry.c new file mode 100644 index 0000000..68592b8 --- /dev/null +++ b/certgen/asncodec/GroupSingleSeedCrlEntry.c @@ -0,0 +1,102 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "GroupSingleSeedCrlEntry.h" + +asn_TYPE_member_t asn_MBR_GroupSingleSeedCrlEntry_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct GroupSingleSeedCrlEntry, iMax), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint16, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "iMax" + }, + { ATF_NOFLAGS, 0, offsetof(struct GroupSingleSeedCrlEntry, laId), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "laId" + }, + { ATF_NOFLAGS, 0, offsetof(struct GroupSingleSeedCrlEntry, linkageSeed), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LinkageSeed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "linkageSeed" + }, +}; +static const ber_tlv_tag_t asn_DEF_GroupSingleSeedCrlEntry_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_GroupSingleSeedCrlEntry_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iMax */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* laId */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* linkageSeed */ +}; +asn_SEQUENCE_specifics_t asn_SPC_GroupSingleSeedCrlEntry_specs_1 = { + sizeof(struct GroupSingleSeedCrlEntry), + offsetof(struct GroupSingleSeedCrlEntry, _asn_ctx), + asn_MAP_GroupSingleSeedCrlEntry_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_GroupSingleSeedCrlEntry = { + "GroupSingleSeedCrlEntry", + "GroupSingleSeedCrlEntry", + &asn_OP_SEQUENCE, + asn_DEF_GroupSingleSeedCrlEntry_tags_1, + sizeof(asn_DEF_GroupSingleSeedCrlEntry_tags_1) + /sizeof(asn_DEF_GroupSingleSeedCrlEntry_tags_1[0]), /* 1 */ + asn_DEF_GroupSingleSeedCrlEntry_tags_1, /* Same as above */ + sizeof(asn_DEF_GroupSingleSeedCrlEntry_tags_1) + /sizeof(asn_DEF_GroupSingleSeedCrlEntry_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_GroupSingleSeedCrlEntry_1, + 3, /* Elements count */ + &asn_SPC_GroupSingleSeedCrlEntry_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/GroupSingleSeedCrlEntry.h b/certgen/asncodec/GroupSingleSeedCrlEntry.h new file mode 100644 index 0000000..e80fc6d --- /dev/null +++ b/certgen/asncodec/GroupSingleSeedCrlEntry.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint16.h" +#include "LaId.h" +#include "LinkageSeed.h" +#include +#ifndef _GroupSingleSeedCrlEntry_H_ +#define _GroupSingleSeedCrlEntry_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* GroupSingleSeedCrlEntry */ +typedef struct GroupSingleSeedCrlEntry { + Uint16_t iMax; + LaId_t laId; + LinkageSeed_t linkageSeed; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} GroupSingleSeedCrlEntry_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_GroupSingleSeedCrlEntry; +extern asn_SEQUENCE_specifics_t asn_SPC_GroupSingleSeedCrlEntry_specs_1; +extern asn_TYPE_member_t asn_MBR_GroupSingleSeedCrlEntry_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _GroupSingleSeedCrlEntry_H_ */ +#include diff --git a/certgen/asncodec/HashAlgorithm.c b/certgen/asncodec/HashAlgorithm.c index 61f3e33..52f93dd 100644 --- a/certgen/asncodec/HashAlgorithm.c +++ b/certgen/asncodec/HashAlgorithm.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "HashAlgorithm.h" @@ -11,23 +11,27 @@ * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_HashAlgorithm_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const asn_INTEGER_enum_map_t asn_MAP_HashAlgorithm_value2enum_1[] = { { 0, 6, "sha256" }, - { 1, 6, "sha384" } + { 1, 6, "sha384" }, + { 2, 3, "sm3" } /* This list is extensible */ }; static const unsigned int asn_MAP_HashAlgorithm_enum2value_1[] = { 0, /* sha256(0) */ - 1 /* sha384(1) */ + 1, /* sha384(1) */ + 2 /* sm3(2) */ /* This list is extensible */ }; const asn_INTEGER_specifics_t asn_SPC_HashAlgorithm_specs_1 = { asn_MAP_HashAlgorithm_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_HashAlgorithm_enum2value_1, /* N => "tag"; sorted by N */ - 2, /* Number of elements in the maps */ + 3, /* Number of elements in the maps */ 2, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ @@ -46,7 +50,15 @@ asn_TYPE_descriptor_t asn_DEF_HashAlgorithm = { asn_DEF_HashAlgorithm_tags_1, /* Same as above */ sizeof(asn_DEF_HashAlgorithm_tags_1) /sizeof(asn_DEF_HashAlgorithm_tags_1[0]), /* 1 */ - { &asn_OER_type_HashAlgorithm_constr_1, 0, NativeEnumerated_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HashAlgorithm_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeEnumerated_constraint + }, 0, 0, /* Defined elsewhere */ &asn_SPC_HashAlgorithm_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/HashAlgorithm.h b/certgen/asncodec/HashAlgorithm.h index c3ebf89..fb61dca 100644 --- a/certgen/asncodec/HashAlgorithm.h +++ b/certgen/asncodec/HashAlgorithm.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _HashAlgorithm_H_ #define _HashAlgorithm_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -24,7 +24,8 @@ typedef enum HashAlgorithm { /* * Enumeration is extensible */ - HashAlgorithm_sha384 = 1 + HashAlgorithm_sha384 = 1, + HashAlgorithm_sm3 = 2 } e_HashAlgorithm; /* HashAlgorithm */ @@ -36,8 +37,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_HashAlgorithm_specs_1; asn_struct_free_f HashAlgorithm_free; asn_struct_print_f HashAlgorithm_print; asn_constr_check_f HashAlgorithm_constraint; -ber_type_decoder_f HashAlgorithm_decode_ber; -der_type_encoder_f HashAlgorithm_encode_der; xer_type_decoder_f HashAlgorithm_decode_xer; xer_type_encoder_f HashAlgorithm_encode_xer; oer_type_decoder_f HashAlgorithm_decode_oer; diff --git a/certgen/asncodec/HashBasedRevocationInfo.c b/certgen/asncodec/HashBasedRevocationInfo.c new file mode 100644 index 0000000..d755844 --- /dev/null +++ b/certgen/asncodec/HashBasedRevocationInfo.c @@ -0,0 +1,84 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "HashBasedRevocationInfo.h" + +asn_TYPE_member_t asn_MBR_HashBasedRevocationInfo_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct HashBasedRevocationInfo, id), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId10, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "id" + }, + { ATF_NOFLAGS, 0, offsetof(struct HashBasedRevocationInfo, expiry), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "expiry" + }, +}; +static const ber_tlv_tag_t asn_DEF_HashBasedRevocationInfo_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_HashBasedRevocationInfo_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* id */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* expiry */ +}; +asn_SEQUENCE_specifics_t asn_SPC_HashBasedRevocationInfo_specs_1 = { + sizeof(struct HashBasedRevocationInfo), + offsetof(struct HashBasedRevocationInfo, _asn_ctx), + asn_MAP_HashBasedRevocationInfo_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_HashBasedRevocationInfo = { + "HashBasedRevocationInfo", + "HashBasedRevocationInfo", + &asn_OP_SEQUENCE, + asn_DEF_HashBasedRevocationInfo_tags_1, + sizeof(asn_DEF_HashBasedRevocationInfo_tags_1) + /sizeof(asn_DEF_HashBasedRevocationInfo_tags_1[0]), /* 1 */ + asn_DEF_HashBasedRevocationInfo_tags_1, /* Same as above */ + sizeof(asn_DEF_HashBasedRevocationInfo_tags_1) + /sizeof(asn_DEF_HashBasedRevocationInfo_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_HashBasedRevocationInfo_1, + 2, /* Elements count */ + &asn_SPC_HashBasedRevocationInfo_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/HashBasedRevocationInfo.h b/certgen/asncodec/HashBasedRevocationInfo.h new file mode 100644 index 0000000..2bc06e6 --- /dev/null +++ b/certgen/asncodec/HashBasedRevocationInfo.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashedId10.h" +#include "Time32.h" +#include +#ifndef _HashBasedRevocationInfo_H_ +#define _HashBasedRevocationInfo_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* HashBasedRevocationInfo */ +typedef struct HashBasedRevocationInfo { + HashedId10_t id; + Time32_t expiry; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} HashBasedRevocationInfo_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_HashBasedRevocationInfo; +extern asn_SEQUENCE_specifics_t asn_SPC_HashBasedRevocationInfo_specs_1; +extern asn_TYPE_member_t asn_MBR_HashBasedRevocationInfo_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _HashBasedRevocationInfo_H_ */ +#include diff --git a/certgen/asncodec/HashedData.c b/certgen/asncodec/HashedData.c index d36b2dc..5d9ba24 100644 --- a/certgen/asncodec/HashedData.c +++ b/certgen/asncodec/HashedData.c @@ -1,57 +1,74 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "HashedData.h" -static int -memb_sha256HashedData_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - size_t size; - - if(!sptr) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - size = st->size; - - if((size == 32)) { - /* Constraint check succeeded */ - return 0; - } else { - ASN__CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } -} - -static asn_oer_constraints_t asn_OER_memb_sha256HashedData_constr_2 CC_NOTUSED = { - { 0, 0 }, - 32 /* (SIZE(32..32)) */}; +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_HashedData_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_HashedData_1[] = { { ATF_NOFLAGS, 0, offsetof(struct HashedData, choice.sha256HashedData), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ - &asn_DEF_OCTET_STRING, + &asn_DEF_HashedId32, 0, - { &asn_OER_memb_sha256HashedData_constr_2, 0, memb_sha256HashedData_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "sha256HashedData" }, + { ATF_NOFLAGS, 0, offsetof(struct HashedData, choice.sha384HashedData), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId48, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sha384HashedData" + }, + { ATF_NOFLAGS, 0, offsetof(struct HashedData, choice.sm3HashedData), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sm3HashedData" + }, }; static const asn_TYPE_tag2member_t asn_MAP_HashedData_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* sha256HashedData */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sha256HashedData */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* sha384HashedData */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* sm3HashedData */ }; asn_CHOICE_specifics_t asn_SPC_HashedData_specs_1 = { sizeof(struct HashedData), @@ -59,7 +76,7 @@ asn_CHOICE_specifics_t asn_SPC_HashedData_specs_1 = { offsetof(struct HashedData, present), sizeof(((struct HashedData *)0)->present), asn_MAP_HashedData_tag2el_1, - 1, /* Count of tags in the map */ + 3, /* Count of tags in the map */ 0, 0, 1 /* Extensions start */ }; @@ -71,9 +88,17 @@ asn_TYPE_descriptor_t asn_DEF_HashedData = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_HashedData_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HashedData_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_HashedData_1, - 1, /* Elements count */ + 3, /* Elements count */ &asn_SPC_HashedData_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/HashedData.h b/certgen/asncodec/HashedData.h index 9c49d4a..b016eea 100644 --- a/certgen/asncodec/HashedData.h +++ b/certgen/asncodec/HashedData.h @@ -1,20 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "HashedId32.h" +#include "HashedId48.h" +#include #ifndef _HashedData_H_ #define _HashedData_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif @@ -22,20 +23,23 @@ extern "C" { /* Dependencies */ typedef enum HashedData_PR { HashedData_PR_NOTHING, /* No components present */ - HashedData_PR_sha256HashedData + HashedData_PR_sha256HashedData, /* Extensions may appear below */ - + HashedData_PR_sha384HashedData, + HashedData_PR_sm3HashedData } HashedData_PR; /* HashedData */ typedef struct HashedData { HashedData_PR present; union HashedData_u { - OCTET_STRING_t sha256HashedData; + HashedId32_t sha256HashedData; /* * This type is extensible, * possible extensions are below. */ + HashedId48_t sha384HashedData; + HashedId32_t sm3HashedData; } choice; /* Context for parsing across buffer boundaries */ @@ -45,7 +49,7 @@ typedef struct HashedData { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_HashedData; extern asn_CHOICE_specifics_t asn_SPC_HashedData_specs_1; -extern asn_TYPE_member_t asn_MBR_HashedData_1[1]; +extern asn_TYPE_member_t asn_MBR_HashedData_1[3]; #ifdef __cplusplus } diff --git a/certgen/asncodec/HashedId10.c b/certgen/asncodec/HashedId10.c index 22ffe6c..ac47a0b 100644 --- a/certgen/asncodec/HashedId10.c +++ b/certgen/asncodec/HashedId10.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "HashedId10.h" @@ -37,9 +37,11 @@ HashedId10_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_HashedId10_constr_1 CC_NOTUSED = { { 0, 0 }, 10 /* (SIZE(10..10)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_HashedId10_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_HashedId10 = { asn_DEF_HashedId10_tags_1, /* Same as above */ sizeof(asn_DEF_HashedId10_tags_1) /sizeof(asn_DEF_HashedId10_tags_1[0]), /* 1 */ - { &asn_OER_type_HashedId10_constr_1, 0, HashedId10_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HashedId10_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + HashedId10_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/HashedId10.h b/certgen/asncodec/HashedId10.h index 3b610aa..e3f97a4 100644 --- a/certgen/asncodec/HashedId10.h +++ b/certgen/asncodec/HashedId10.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _HashedId10_H_ #define _HashedId10_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_HashedId10; asn_struct_free_f HashedId10_free; asn_struct_print_f HashedId10_print; asn_constr_check_f HashedId10_constraint; -ber_type_decoder_f HashedId10_decode_ber; -der_type_encoder_f HashedId10_encode_der; xer_type_decoder_f HashedId10_decode_xer; xer_type_encoder_f HashedId10_encode_xer; oer_type_decoder_f HashedId10_decode_oer; diff --git a/certgen/asncodec/HashedId3.c b/certgen/asncodec/HashedId3.c index 3ce1406..842ac5c 100644 --- a/certgen/asncodec/HashedId3.c +++ b/certgen/asncodec/HashedId3.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "HashedId3.h" @@ -37,9 +37,11 @@ HashedId3_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_HashedId3_constr_1 CC_NOTUSED = { { 0, 0 }, 3 /* (SIZE(3..3)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_HashedId3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_HashedId3 = { asn_DEF_HashedId3_tags_1, /* Same as above */ sizeof(asn_DEF_HashedId3_tags_1) /sizeof(asn_DEF_HashedId3_tags_1[0]), /* 1 */ - { &asn_OER_type_HashedId3_constr_1, 0, HashedId3_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HashedId3_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + HashedId3_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/HashedId3.h b/certgen/asncodec/HashedId3.h index 534eaba..9759572 100644 --- a/certgen/asncodec/HashedId3.h +++ b/certgen/asncodec/HashedId3.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _HashedId3_H_ #define _HashedId3_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_HashedId3; asn_struct_free_f HashedId3_free; asn_struct_print_f HashedId3_print; asn_constr_check_f HashedId3_constraint; -ber_type_decoder_f HashedId3_decode_ber; -der_type_encoder_f HashedId3_encode_der; xer_type_decoder_f HashedId3_decode_xer; xer_type_encoder_f HashedId3_encode_xer; oer_type_decoder_f HashedId3_decode_oer; diff --git a/certgen/asncodec/HashedId32.c b/certgen/asncodec/HashedId32.c new file mode 100644 index 0000000..88bf09a --- /dev/null +++ b/certgen/asncodec/HashedId32.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "HashedId32.h" + +int +HashedId32_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 32)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using OCTET_STRING, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_HashedId32_constr_1 CC_NOTUSED = { + { 0, 0 }, + 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_HashedId32_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_HashedId32 = { + "HashedId32", + "HashedId32", + &asn_OP_OCTET_STRING, + asn_DEF_HashedId32_tags_1, + sizeof(asn_DEF_HashedId32_tags_1) + /sizeof(asn_DEF_HashedId32_tags_1[0]), /* 1 */ + asn_DEF_HashedId32_tags_1, /* Same as above */ + sizeof(asn_DEF_HashedId32_tags_1) + /sizeof(asn_DEF_HashedId32_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HashedId32_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + HashedId32_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/HashedId32.h b/certgen/asncodec/HashedId32.h new file mode 100644 index 0000000..988c7ab --- /dev/null +++ b/certgen/asncodec/HashedId32.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _HashedId32_H_ +#define _HashedId32_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* HashedId32 */ +typedef OCTET_STRING_t HashedId32_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_HashedId32; +asn_struct_free_f HashedId32_free; +asn_struct_print_f HashedId32_print; +asn_constr_check_f HashedId32_constraint; +xer_type_decoder_f HashedId32_decode_xer; +xer_type_encoder_f HashedId32_encode_xer; +oer_type_decoder_f HashedId32_decode_oer; +oer_type_encoder_f HashedId32_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _HashedId32_H_ */ +#include diff --git a/certgen/asncodec/HashedId48.c b/certgen/asncodec/HashedId48.c new file mode 100644 index 0000000..dd1db73 --- /dev/null +++ b/certgen/asncodec/HashedId48.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "HashedId48.h" + +int +HashedId48_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 48)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using OCTET_STRING, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_HashedId48_constr_1 CC_NOTUSED = { + { 0, 0 }, + 48 /* (SIZE(48..48)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_HashedId48_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_HashedId48 = { + "HashedId48", + "HashedId48", + &asn_OP_OCTET_STRING, + asn_DEF_HashedId48_tags_1, + sizeof(asn_DEF_HashedId48_tags_1) + /sizeof(asn_DEF_HashedId48_tags_1[0]), /* 1 */ + asn_DEF_HashedId48_tags_1, /* Same as above */ + sizeof(asn_DEF_HashedId48_tags_1) + /sizeof(asn_DEF_HashedId48_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HashedId48_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + HashedId48_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/HashedId48.h b/certgen/asncodec/HashedId48.h new file mode 100644 index 0000000..e8f26dd --- /dev/null +++ b/certgen/asncodec/HashedId48.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _HashedId48_H_ +#define _HashedId48_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* HashedId48 */ +typedef OCTET_STRING_t HashedId48_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_HashedId48; +asn_struct_free_f HashedId48_free; +asn_struct_print_f HashedId48_print; +asn_constr_check_f HashedId48_constraint; +xer_type_decoder_f HashedId48_decode_xer; +xer_type_encoder_f HashedId48_encode_xer; +oer_type_decoder_f HashedId48_decode_oer; +oer_type_encoder_f HashedId48_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _HashedId48_H_ */ +#include diff --git a/certgen/asncodec/HashedId8.c b/certgen/asncodec/HashedId8.c index 3033642..bf66db0 100644 --- a/certgen/asncodec/HashedId8.c +++ b/certgen/asncodec/HashedId8.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "HashedId8.h" @@ -37,9 +37,11 @@ HashedId8_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_HashedId8_constr_1 CC_NOTUSED = { { 0, 0 }, 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_HashedId8_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_HashedId8 = { asn_DEF_HashedId8_tags_1, /* Same as above */ sizeof(asn_DEF_HashedId8_tags_1) /sizeof(asn_DEF_HashedId8_tags_1[0]), /* 1 */ - { &asn_OER_type_HashedId8_constr_1, 0, HashedId8_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HashedId8_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + HashedId8_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/HashedId8.h b/certgen/asncodec/HashedId8.h index 484c249..9c42c02 100644 --- a/certgen/asncodec/HashedId8.h +++ b/certgen/asncodec/HashedId8.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _HashedId8_H_ #define _HashedId8_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_HashedId8; asn_struct_free_f HashedId8_free; asn_struct_print_f HashedId8_print; asn_constr_check_f HashedId8_constraint; -ber_type_decoder_f HashedId8_decode_ber; -der_type_encoder_f HashedId8_encode_der; xer_type_decoder_f HashedId8_decode_xer; xer_type_encoder_f HashedId8_encode_xer; oer_type_decoder_f HashedId8_decode_oer; diff --git a/certgen/asncodec/HeaderInfo.c b/certgen/asncodec/HeaderInfo.c index 248a240..2ea55a3 100644 --- a/certgen/asncodec/HeaderInfo.c +++ b/certgen/asncodec/HeaderInfo.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "HeaderInfo.h" @@ -13,84 +13,190 @@ asn_TYPE_member_t asn_MBR_HeaderInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Psid, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "psid" }, - { ATF_POINTER, 8, offsetof(struct HeaderInfo, generationTime), + { ATF_POINTER, 10, offsetof(struct HeaderInfo, generationTime), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Time64, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "generationTime" }, - { ATF_POINTER, 7, offsetof(struct HeaderInfo, expiryTime), + { ATF_POINTER, 9, offsetof(struct HeaderInfo, expiryTime), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Time64, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "expiryTime" }, - { ATF_POINTER, 6, offsetof(struct HeaderInfo, generationLocation), + { ATF_POINTER, 8, offsetof(struct HeaderInfo, generationLocation), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ThreeDLocation, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "generationLocation" }, - { ATF_POINTER, 5, offsetof(struct HeaderInfo, p2pcdLearningRequest), + { ATF_POINTER, 7, offsetof(struct HeaderInfo, p2pcdLearningRequest), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId3, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "p2pcdLearningRequest" }, - { ATF_POINTER, 4, offsetof(struct HeaderInfo, missingCrlIdentifier), + { ATF_POINTER, 6, offsetof(struct HeaderInfo, missingCrlIdentifier), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_MissingCrlIdentifier, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "missingCrlIdentifier" }, - { ATF_POINTER, 3, offsetof(struct HeaderInfo, encryptionKey), + { ATF_POINTER, 5, offsetof(struct HeaderInfo, encryptionKey), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_EncryptionKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "encryptionKey" }, - { ATF_POINTER, 2, offsetof(struct HeaderInfo, inlineP2pcdRequest), + { ATF_POINTER, 4, offsetof(struct HeaderInfo, inlineP2pcdRequest), (ASN_TAG_CLASS_CONTEXT | (7 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfHashedId3, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "inlineP2pcdRequest" }, - { ATF_POINTER, 1, offsetof(struct HeaderInfo, requestedCertificate), + { ATF_POINTER, 3, offsetof(struct HeaderInfo, requestedCertificate), (ASN_TAG_CLASS_CONTEXT | (8 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "requestedCertificate" }, + { ATF_POINTER, 2, offsetof(struct HeaderInfo, pduFunctionalType), + (ASN_TAG_CLASS_CONTEXT | (9 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_PduFunctionalType, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "pduFunctionalType" + }, + { ATF_POINTER, 1, offsetof(struct HeaderInfo, contributedExtensions), + (ASN_TAG_CLASS_CONTEXT | (10 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ContributedExtensionBlocks, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "contributedExtensions" + }, }; -static const int asn_MAP_HeaderInfo_oms_1[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; +static const int asn_MAP_HeaderInfo_oms_1[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; static const ber_tlv_tag_t asn_DEF_HeaderInfo_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -103,15 +209,17 @@ static const asn_TYPE_tag2member_t asn_MAP_HeaderInfo_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* missingCrlIdentifier */ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* encryptionKey */ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* inlineP2pcdRequest */ - { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 } /* requestedCertificate */ + { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* requestedCertificate */ + { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* pduFunctionalType */ + { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 } /* contributedExtensions */ }; asn_SEQUENCE_specifics_t asn_SPC_HeaderInfo_specs_1 = { sizeof(struct HeaderInfo), offsetof(struct HeaderInfo, _asn_ctx), asn_MAP_HeaderInfo_tag2el_1, - 9, /* Count of tags in the map */ + 11, /* Count of tags in the map */ asn_MAP_HeaderInfo_oms_1, /* Optional members */ - 6, 2, /* Root/Additions */ + 6, 4, /* Root/Additions */ 7, /* First extension addition */ }; asn_TYPE_descriptor_t asn_DEF_HeaderInfo = { @@ -124,9 +232,17 @@ asn_TYPE_descriptor_t asn_DEF_HeaderInfo = { asn_DEF_HeaderInfo_tags_1, /* Same as above */ sizeof(asn_DEF_HeaderInfo_tags_1) /sizeof(asn_DEF_HeaderInfo_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_HeaderInfo_1, - 9, /* Elements count */ + 11, /* Elements count */ &asn_SPC_HeaderInfo_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/HeaderInfo.h b/certgen/asncodec/HeaderInfo.h index d27908f..009b61e 100644 --- a/certgen/asncodec/HeaderInfo.h +++ b/certgen/asncodec/HeaderInfo.h @@ -1,21 +1,22 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _HeaderInfo_H_ -#define _HeaderInfo_H_ - - -#include /* Including external dependencies */ #include "Psid.h" #include "Time64.h" #include "HashedId3.h" +#include "PduFunctionalType.h" #include +#ifndef _HeaderInfo_H_ +#define _HeaderInfo_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -27,22 +28,25 @@ struct MissingCrlIdentifier; struct EncryptionKey; struct SequenceOfHashedId3; struct Certificate; +struct ContributedExtensionBlocks; /* HeaderInfo */ typedef struct HeaderInfo { Psid_t psid; - Time64_t *generationTime /* OPTIONAL */; - Time64_t *expiryTime /* OPTIONAL */; - struct ThreeDLocation *generationLocation /* OPTIONAL */; - HashedId3_t *p2pcdLearningRequest /* OPTIONAL */; - struct MissingCrlIdentifier *missingCrlIdentifier /* OPTIONAL */; - struct EncryptionKey *encryptionKey /* OPTIONAL */; + Time64_t *generationTime; /* OPTIONAL */ + Time64_t *expiryTime; /* OPTIONAL */ + struct ThreeDLocation *generationLocation; /* OPTIONAL */ + HashedId3_t *p2pcdLearningRequest; /* OPTIONAL */ + struct MissingCrlIdentifier *missingCrlIdentifier; /* OPTIONAL */ + struct EncryptionKey *encryptionKey; /* OPTIONAL */ /* * This type is extensible, * possible extensions are below. */ - struct SequenceOfHashedId3 *inlineP2pcdRequest /* OPTIONAL */; - struct Certificate *requestedCertificate /* OPTIONAL */; + struct SequenceOfHashedId3 *inlineP2pcdRequest; /* OPTIONAL */ + struct Certificate *requestedCertificate; /* OPTIONAL */ + PduFunctionalType_t *pduFunctionalType; /* OPTIONAL */ + struct ContributedExtensionBlocks *contributedExtensions; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; @@ -51,7 +55,7 @@ typedef struct HeaderInfo { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_HeaderInfo; extern asn_SEQUENCE_specifics_t asn_SPC_HeaderInfo_specs_1; -extern asn_TYPE_member_t asn_MBR_HeaderInfo_1[9]; +extern asn_TYPE_member_t asn_MBR_HeaderInfo_1[11]; #ifdef __cplusplus } @@ -63,6 +67,7 @@ extern asn_TYPE_member_t asn_MBR_HeaderInfo_1[9]; #include "EncryptionKey.h" #include "SequenceOfHashedId3.h" #include "Certificate.h" +#include "ContributedExtensionBlocks.h" #endif /* _HeaderInfo_H_ */ #include diff --git a/certgen/asncodec/HeaderInfoContributorId.c b/certgen/asncodec/HeaderInfoContributorId.c new file mode 100644 index 0000000..a2c8644 --- /dev/null +++ b/certgen/asncodec/HeaderInfoContributorId.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "HeaderInfoContributorId.h" + +int +HeaderInfoContributorId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using NativeInteger, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_HeaderInfoContributorId_constr_1 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_HeaderInfoContributorId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_HeaderInfoContributorId = { + "HeaderInfoContributorId", + "HeaderInfoContributorId", + &asn_OP_NativeInteger, + asn_DEF_HeaderInfoContributorId_tags_1, + sizeof(asn_DEF_HeaderInfoContributorId_tags_1) + /sizeof(asn_DEF_HeaderInfoContributorId_tags_1[0]), /* 1 */ + asn_DEF_HeaderInfoContributorId_tags_1, /* Same as above */ + sizeof(asn_DEF_HeaderInfoContributorId_tags_1) + /sizeof(asn_DEF_HeaderInfoContributorId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_HeaderInfoContributorId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + HeaderInfoContributorId_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/HeaderInfoContributorId.h b/certgen/asncodec/HeaderInfoContributorId.h new file mode 100644 index 0000000..2fd3a62 --- /dev/null +++ b/certgen/asncodec/HeaderInfoContributorId.h @@ -0,0 +1,41 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _HeaderInfoContributorId_H_ +#define _HeaderInfoContributorId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* HeaderInfoContributorId */ +typedef long HeaderInfoContributorId_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_HeaderInfoContributorId; +asn_struct_free_f HeaderInfoContributorId_free; +asn_struct_print_f HeaderInfoContributorId_print; +asn_constr_check_f HeaderInfoContributorId_constraint; +xer_type_decoder_f HeaderInfoContributorId_decode_xer; +xer_type_encoder_f HeaderInfoContributorId_encode_xer; +oer_type_decoder_f HeaderInfoContributorId_decode_oer; +oer_type_encoder_f HeaderInfoContributorId_encode_oer; +#define HeaderInfoContributorId_ieee1609HeaderInfoContributorId ((HeaderInfoContributorId_t)1) +#define HeaderInfoContributorId_etsiHeaderInfoContributorId ((HeaderInfoContributorId_t)2) + +#ifdef __cplusplus +} +#endif + +#endif /* _HeaderInfoContributorId_H_ */ +#include diff --git a/certgen/asncodec/Hostname.c b/certgen/asncodec/Hostname.c index 712b79a..3da2308 100644 --- a/certgen/asncodec/Hostname.c +++ b/certgen/asncodec/Hostname.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Hostname.h" @@ -43,9 +43,11 @@ Hostname_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using UTF8String, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Hostname_constr_1 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Hostname_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; @@ -59,7 +61,15 @@ asn_TYPE_descriptor_t asn_DEF_Hostname = { asn_DEF_Hostname_tags_1, /* Same as above */ sizeof(asn_DEF_Hostname_tags_1) /sizeof(asn_DEF_Hostname_tags_1[0]), /* 1 */ - { &asn_OER_type_Hostname_constr_1, 0, Hostname_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Hostname_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Hostname_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Hostname.h b/certgen/asncodec/Hostname.h index 6626704..0d55a4b 100644 --- a/certgen/asncodec/Hostname.h +++ b/certgen/asncodec/Hostname.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Hostname_H_ #define _Hostname_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Hostname; asn_struct_free_f Hostname_free; asn_struct_print_f Hostname_print; asn_constr_check_f Hostname_constraint; -ber_type_decoder_f Hostname_decode_ber; -der_type_encoder_f Hostname_encode_der; xer_type_decoder_f Hostname_decode_xer; xer_type_encoder_f Hostname_encode_xer; oer_type_decoder_f Hostname_decode_oer; diff --git a/certgen/asncodec/IA5String.c b/certgen/asncodec/IA5String.c index 4037005..876142d 100644 --- a/certgen/asncodec/IA5String.c +++ b/certgen/asncodec/IA5String.c @@ -1,93 +1,133 @@ -/*- - * Copyright (c) 2003 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -/* - * IA5String basic type description. - */ -static const ber_tlv_tag_t asn_DEF_IA5String_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/ - (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ -}; -static asn_per_constraints_t asn_DEF_IA5String_per_constraints = { - { APC_CONSTRAINED, 7, 7, 0, 0x7f }, /* Value */ - { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ - 0, 0 -}; -asn_TYPE_operation_t asn_OP_IA5String = { - OCTET_STRING_free, - OCTET_STRING_print_utf8, /* ASCII subset */ - OCTET_STRING_compare, - OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ - OCTET_STRING_encode_der, - OCTET_STRING_decode_xer_utf8, - OCTET_STRING_encode_xer_utf8, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - OCTET_STRING_decode_oer, - OCTET_STRING_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - OCTET_STRING_decode_uper, - OCTET_STRING_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - OCTET_STRING_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_IA5String = { - "IA5String", - "IA5String", - &asn_OP_IA5String, - asn_DEF_IA5String_tags, - sizeof(asn_DEF_IA5String_tags) - / sizeof(asn_DEF_IA5String_tags[0]) - 1, - asn_DEF_IA5String_tags, - sizeof(asn_DEF_IA5String_tags) - / sizeof(asn_DEF_IA5String_tags[0]), - { 0, &asn_DEF_IA5String_per_constraints, IA5String_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -int -IA5String_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const IA5String_t *st = (const IA5String_t *)sptr; - - if(st && st->buf) { - uint8_t *buf = st->buf; - uint8_t *end = buf + st->size; - /* - * IA5String is generally equivalent to 7bit ASCII. - * ISO/ITU-T T.50, 1963. - */ - for(; buf < end; buf++) { - if(*buf > 0x7F) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value byte %ld out of range: " - "%d > 127 (%s:%d)", - td->name, - (long)((buf - st->buf) + 1), - *buf, - __FILE__, __LINE__); - return -1; - } - } - } else { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - return 0; -} - +/*- + * Copyright (c) 2003 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * IA5String basic type description. + */ +static const ber_tlv_tag_t asn_DEF_IA5String_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/ + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ +}; +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) +static asn_per_constraints_t asn_DEF_IA5String_per_constraints = { + { APC_CONSTRAINED, 7, 7, 0, 0x7f }, /* Value */ + { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ + 0, 0 +}; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +asn_TYPE_operation_t asn_OP_IA5String = { + OCTET_STRING_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + OCTET_STRING_print_utf8, /* ASCII subset */ +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OCTET_STRING_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OCTET_STRING_decode_xer_utf8, + OCTET_STRING_encode_xer_utf8, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + OCTET_STRING_encode_jer_utf8, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + OCTET_STRING_decode_oer, + OCTET_STRING_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OCTET_STRING_decode_aper, + OCTET_STRING_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + OCTET_STRING_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_IA5String = { + "IA5String", + "IA5String", + &asn_OP_IA5String, + asn_DEF_IA5String_tags, + sizeof(asn_DEF_IA5String_tags) + / sizeof(asn_DEF_IA5String_tags[0]) - 1, + asn_DEF_IA5String_tags, + sizeof(asn_DEF_IA5String_tags) + / sizeof(asn_DEF_IA5String_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + &asn_DEF_IA5String_per_constraints, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + IA5String_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +int +IA5String_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const IA5String_t *st = (const IA5String_t *)sptr; + + if(st && st->buf) { + uint8_t *buf = st->buf; + uint8_t *end = buf + st->size; + /* + * IA5String is generally equivalent to 7bit ASCII. + * ISO/ITU-T T.50, 1963. + */ + for(; buf < end; buf++) { + if(*buf > 0x7F) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value byte %ld out of range: " + "%d > 127 (%s:%d)", + td->name, + (long)((buf - st->buf) + 1), + *buf, + __FILE__, __LINE__); + return -1; + } + } + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + return 0; +} + diff --git a/certgen/asncodec/IA5String.h b/certgen/asncodec/IA5String.h index 9c84ca1..195f474 100644 --- a/certgen/asncodec/IA5String.h +++ b/certgen/asncodec/IA5String.h @@ -1,38 +1,59 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _IA5String_H_ -#define _IA5String_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef OCTET_STRING_t IA5String_t; /* Implemented via OCTET STRING */ - -/* - * IA5String ASN.1 type definition. - */ -extern asn_TYPE_descriptor_t asn_DEF_IA5String; -extern asn_TYPE_operation_t asn_OP_IA5String; - -asn_constr_check_f IA5String_constraint; - -#define IA5String_free OCTET_STRING_free -#define IA5String_print OCTET_STRING_print_utf8 -#define IA5String_compare OCTET_STRING_compare -#define IA5String_decode_ber OCTET_STRING_decode_ber -#define IA5String_encode_der OCTET_STRING_encode_der -#define IA5String_decode_xer OCTET_STRING_decode_xer_utf8 -#define IA5String_encode_xer OCTET_STRING_encode_xer_utf8 -#define IA5String_decode_uper OCTET_STRING_decode_uper -#define IA5String_encode_uper OCTET_STRING_encode_uper - -#ifdef __cplusplus -} -#endif - -#endif /* _IA5String_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _IA5String_H_ +#define _IA5String_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef OCTET_STRING_t IA5String_t; /* Implemented via OCTET STRING */ + +/* + * IA5String ASN.1 type definition. + */ +extern asn_TYPE_descriptor_t asn_DEF_IA5String; +extern asn_TYPE_operation_t asn_OP_IA5String; + +#define IA5String_free OCTET_STRING_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +#define IA5String_print OCTET_STRING_print_utf8 +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define IA5String_compare OCTET_STRING_compare + +asn_constr_check_f IA5String_constraint; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define IA5String_decode_ber OCTET_STRING_decode_ber +#define IA5String_encode_der OCTET_STRING_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define IA5String_decode_xer OCTET_STRING_decode_xer_utf8 +#define IA5String_encode_xer OCTET_STRING_encode_xer_utf8 +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +#define IA5String_encode_jer OCTET_STRING_encode_jer_utf8 +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +#define IA5String_decode_uper OCTET_STRING_decode_uper +#define IA5String_encode_uper OCTET_STRING_encode_uper +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#define IA5String_decode_aper OCTET_STRING_decode_aper +#define IA5String_encode_aper OCTET_STRING_encode_aper +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _IA5String_H_ */ diff --git a/certgen/asncodec/IMaxGroup.c b/certgen/asncodec/IMaxGroup.c new file mode 100644 index 0000000..d877d08 --- /dev/null +++ b/certgen/asncodec/IMaxGroup.c @@ -0,0 +1,104 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "IMaxGroup.h" + +asn_TYPE_member_t asn_MBR_IMaxGroup_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct IMaxGroup, iMax), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint16, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "iMax" + }, + { ATF_NOFLAGS, 0, offsetof(struct IMaxGroup, contents), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfIndividualRevocation, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "contents" + }, + { ATF_POINTER, 1, offsetof(struct IMaxGroup, singleSeed), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfLinkageSeed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "singleSeed" + }, +}; +static const int asn_MAP_IMaxGroup_oms_1[] = { 2 }; +static const ber_tlv_tag_t asn_DEF_IMaxGroup_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_IMaxGroup_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iMax */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* contents */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* singleSeed */ +}; +asn_SEQUENCE_specifics_t asn_SPC_IMaxGroup_specs_1 = { + sizeof(struct IMaxGroup), + offsetof(struct IMaxGroup, _asn_ctx), + asn_MAP_IMaxGroup_tag2el_1, + 3, /* Count of tags in the map */ + asn_MAP_IMaxGroup_oms_1, /* Optional members */ + 0, 1, /* Root/Additions */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_IMaxGroup = { + "IMaxGroup", + "IMaxGroup", + &asn_OP_SEQUENCE, + asn_DEF_IMaxGroup_tags_1, + sizeof(asn_DEF_IMaxGroup_tags_1) + /sizeof(asn_DEF_IMaxGroup_tags_1[0]), /* 1 */ + asn_DEF_IMaxGroup_tags_1, /* Same as above */ + sizeof(asn_DEF_IMaxGroup_tags_1) + /sizeof(asn_DEF_IMaxGroup_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_IMaxGroup_1, + 3, /* Elements count */ + &asn_SPC_IMaxGroup_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/IMaxGroup.h b/certgen/asncodec/IMaxGroup.h new file mode 100644 index 0000000..536a19d --- /dev/null +++ b/certgen/asncodec/IMaxGroup.h @@ -0,0 +1,53 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint16.h" +#include "SequenceOfIndividualRevocation.h" +#include +#ifndef _IMaxGroup_H_ +#define _IMaxGroup_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct SequenceOfLinkageSeed; + +/* IMaxGroup */ +typedef struct IMaxGroup { + Uint16_t iMax; + SequenceOfIndividualRevocation_t contents; + /* + * This type is extensible, + * possible extensions are below. + */ + struct SequenceOfLinkageSeed *singleSeed; /* OPTIONAL */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} IMaxGroup_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_IMaxGroup; +extern asn_SEQUENCE_specifics_t asn_SPC_IMaxGroup_specs_1; +extern asn_TYPE_member_t asn_MBR_IMaxGroup_1[3]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "SequenceOfLinkageSeed.h" + +#endif /* _IMaxGroup_H_ */ +#include diff --git a/certgen/asncodec/INTEGER.c b/certgen/asncodec/INTEGER.c index b447a06..095063f 100644 --- a/certgen/asncodec/INTEGER.c +++ b/certgen/asncodec/INTEGER.c @@ -1,1339 +1,738 @@ -/*- - * Copyright (c) 2003-2014 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include /* Encoder and decoder of a primitive type */ -#include - -/* - * INTEGER basic type description. - */ -static const ber_tlv_tag_t asn_DEF_INTEGER_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) -}; -asn_TYPE_operation_t asn_OP_INTEGER = { - INTEGER_free, - INTEGER_print, - INTEGER_compare, - ber_decode_primitive, - INTEGER_encode_der, - INTEGER_decode_xer, - INTEGER_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - INTEGER_decode_oer, /* OER decoder */ - INTEGER_encode_oer, /* Canonical OER encoder */ -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - INTEGER_decode_uper, /* Unaligned PER decoder */ - INTEGER_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - INTEGER_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_INTEGER = { - "INTEGER", - "INTEGER", - &asn_OP_INTEGER, - asn_DEF_INTEGER_tags, - sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), - asn_DEF_INTEGER_tags, /* Same as above */ - sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), - { 0, 0, asn_generic_no_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -/* - * Encode INTEGER type using DER. - */ -asn_enc_rval_t -INTEGER_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr, - int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, - void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; - asn_enc_rval_t rval; - INTEGER_t effective_integer; - - ASN_DEBUG("%s %s as INTEGER (tm=%d)", - cb?"Encoding":"Estimating", td->name, tag_mode); - - /* - * Canonicalize integer in the buffer. - * (Remove too long sign extension, remove some first 0x00 bytes) - */ - if(st->buf) { - uint8_t *buf = st->buf; - uint8_t *end1 = buf + st->size - 1; - int shift; - - /* Compute the number of superfluous leading bytes */ - for(; buf < end1; buf++) { - /* - * If the contents octets of an integer value encoding - * consist of more than one octet, then the bits of the - * first octet and bit 8 of the second octet: - * a) shall not all be ones; and - * b) shall not all be zero. - */ - switch(*buf) { - case 0x00: if((buf[1] & 0x80) == 0) - continue; - break; - case 0xff: if((buf[1] & 0x80)) - continue; - break; - } - break; - } - - /* Remove leading superfluous bytes from the integer */ - shift = buf - st->buf; - if(shift) { - union { - const uint8_t *c_buf; - uint8_t *nc_buf; - } unconst; - unconst.c_buf = st->buf; - effective_integer.buf = unconst.nc_buf + shift; - effective_integer.size = st->size - shift; - - st = &effective_integer; - } - } - - rval = der_encode_primitive(td, st, tag_mode, tag, cb, app_key); - if(rval.structure_ptr == &effective_integer) { - rval.structure_ptr = sptr; - } - return rval; -} - -static const asn_INTEGER_enum_map_t *INTEGER_map_enum2value( - const asn_INTEGER_specifics_t *specs, const char *lstart, - const char *lstop); - -/* - * INTEGER specific human-readable output. - */ -static ssize_t -INTEGER__dump(const asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - char scratch[32]; - uint8_t *buf = st->buf; - uint8_t *buf_end = st->buf + st->size; - intmax_t value; - ssize_t wrote = 0; - char *p; - int ret; - - if(specs && specs->field_unsigned) - ret = asn_INTEGER2umax(st, (uintmax_t *)&value); - else - ret = asn_INTEGER2imax(st, &value); - - /* Simple case: the integer size is small */ - if(ret == 0) { - const asn_INTEGER_enum_map_t *el; - el = (value >= 0 || !specs || !specs->field_unsigned) - ? INTEGER_map_value2enum(specs, value) : 0; - if(el) { - if(plainOrXER == 0) - return asn__format_to_callback(cb, app_key, - "%" ASN_PRIdMAX " (%s)", value, el->enum_name); - else - return asn__format_to_callback(cb, app_key, - "<%s/>", el->enum_name); - } else if(plainOrXER && specs && specs->strict_enumeration) { - ASN_DEBUG("ASN.1 forbids dealing with " - "unknown value of ENUMERATED type"); - errno = EPERM; - return -1; - } else { - return asn__format_to_callback(cb, app_key, - (specs && specs->field_unsigned) - ? "%" ASN_PRIuMAX - : "%" ASN_PRIdMAX, - value); - } - } else if(plainOrXER && specs && specs->strict_enumeration) { - /* - * Here and earlier, we cannot encode the ENUMERATED values - * if there is no corresponding identifier. - */ - ASN_DEBUG("ASN.1 forbids dealing with " - "unknown value of ENUMERATED type"); - errno = EPERM; - return -1; - } - - /* Output in the long xx:yy:zz... format */ - /* TODO: replace with generic algorithm (Knuth TAOCP Vol 2, 4.3.1) */ - for(p = scratch; buf < buf_end; buf++) { - const char * const h2c = "0123456789ABCDEF"; - if((p - scratch) >= (ssize_t)(sizeof(scratch) - 4)) { - /* Flush buffer */ - if(cb(scratch, p - scratch, app_key) < 0) - return -1; - wrote += p - scratch; - p = scratch; - } - *p++ = h2c[*buf >> 4]; - *p++ = h2c[*buf & 0x0F]; - *p++ = 0x3a; /* ":" */ - } - if(p != scratch) - p--; /* Remove the last ":" */ - - wrote += p - scratch; - return (cb(scratch, p - scratch, app_key) < 0) ? -1 : wrote; -} - -/* - * INTEGER specific human-readable output. - */ -int -INTEGER_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; - ssize_t ret; - - (void)ilevel; - - if(!st || !st->buf) - ret = cb("", 8, app_key); - else - ret = INTEGER__dump(td, st, cb, app_key, 0); - - return (ret < 0) ? -1 : 0; -} - -struct e2v_key { - const char *start; - const char *stop; - const asn_INTEGER_enum_map_t *vemap; - const unsigned int *evmap; -}; -static int -INTEGER__compar_enum2value(const void *kp, const void *am) { - const struct e2v_key *key = (const struct e2v_key *)kp; - const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; - const char *ptr, *end, *name; - - /* Remap the element (sort by different criterion) */ - el = key->vemap + key->evmap[el - key->vemap]; - - /* Compare strings */ - for(ptr = key->start, end = key->stop, name = el->enum_name; - ptr < end; ptr++, name++) { - if(*ptr != *name || !*name) - return *(const unsigned char *)ptr - - *(const unsigned char *)name; - } - return name[0] ? -1 : 0; -} - -static const asn_INTEGER_enum_map_t * -INTEGER_map_enum2value(const asn_INTEGER_specifics_t *specs, const char *lstart, - const char *lstop) { - const asn_INTEGER_enum_map_t *el_found; - int count = specs ? specs->map_count : 0; - struct e2v_key key; - const char *lp; - - if(!count) return NULL; - - /* Guaranteed: assert(lstart < lstop); */ - /* Figure out the tag name */ - for(lstart++, lp = lstart; lp < lstop; lp++) { - switch(*lp) { - case 9: case 10: case 11: case 12: case 13: case 32: /* WSP */ - case 0x2f: /* '/' */ case 0x3e: /* '>' */ - break; - default: - continue; - } - break; - } - if(lp == lstop) return NULL; /* No tag found */ - lstop = lp; - - key.start = lstart; - key.stop = lstop; - key.vemap = specs->value2enum; - key.evmap = specs->enum2value; - el_found = (asn_INTEGER_enum_map_t *)bsearch(&key, - specs->value2enum, count, sizeof(specs->value2enum[0]), - INTEGER__compar_enum2value); - if(el_found) { - /* Remap enum2value into value2enum */ - el_found = key.vemap + key.evmap[el_found - key.vemap]; - } - return el_found; -} - -static int -INTEGER__compar_value2enum(const void *kp, const void *am) { - long a = *(const long *)kp; - const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; - long b = el->nat_value; - if(a < b) return -1; - else if(a == b) return 0; - else return 1; -} - -const asn_INTEGER_enum_map_t * -INTEGER_map_value2enum(const asn_INTEGER_specifics_t *specs, long value) { - int count = specs ? specs->map_count : 0; - if(!count) return 0; - return (asn_INTEGER_enum_map_t *)bsearch(&value, specs->value2enum, - count, sizeof(specs->value2enum[0]), - INTEGER__compar_value2enum); -} - -static int -INTEGER_st_prealloc(INTEGER_t *st, int min_size) { - void *p = MALLOC(min_size + 1); - if(p) { - void *b = st->buf; - st->size = 0; - st->buf = p; - FREEMEM(b); - return 0; - } else { - return -1; - } -} - -/* - * Decode the chunk of XML text encoding INTEGER. - */ -static enum xer_pbd_rval -INTEGER__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, - const void *chunk_buf, size_t chunk_size) { - INTEGER_t *st = (INTEGER_t *)sptr; - intmax_t dec_value; - intmax_t hex_value = 0; - const char *lp; - const char *lstart = (const char *)chunk_buf; - const char *lstop = lstart + chunk_size; - enum { - ST_LEADSPACE, - ST_SKIPSPHEX, - ST_WAITDIGITS, - ST_DIGITS, - ST_DIGITS_TRAILSPACE, - ST_HEXDIGIT1, - ST_HEXDIGIT2, - ST_HEXDIGITS_TRAILSPACE, - ST_HEXCOLON, - ST_END_ENUM, - ST_UNEXPECTED - } state = ST_LEADSPACE; - const char *dec_value_start = 0; /* INVARIANT: always !0 in ST_DIGITS */ - const char *dec_value_end = 0; - - if(chunk_size) - ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x", - (long)chunk_size, *lstart, lstop[-1]); - - if(INTEGER_st_prealloc(st, (chunk_size/3) + 1)) - return XPBD_SYSTEM_FAILURE; - - /* - * We may have received a tag here. It will be processed inline. - * Use strtoul()-like code and serialize the result. - */ - for(lp = lstart; lp < lstop; lp++) { - int lv = *lp; - switch(lv) { - case 0x09: case 0x0a: case 0x0d: case 0x20: - switch(state) { - case ST_LEADSPACE: - case ST_DIGITS_TRAILSPACE: - case ST_HEXDIGITS_TRAILSPACE: - case ST_SKIPSPHEX: - continue; - case ST_DIGITS: - dec_value_end = lp; - state = ST_DIGITS_TRAILSPACE; - continue; - case ST_HEXCOLON: - state = ST_HEXDIGITS_TRAILSPACE; - continue; - default: - break; - } - break; - case 0x2d: /* '-' */ - if(state == ST_LEADSPACE) { - dec_value = 0; - dec_value_start = lp; - state = ST_WAITDIGITS; - continue; - } - break; - case 0x2b: /* '+' */ - if(state == ST_LEADSPACE) { - dec_value = 0; - dec_value_start = lp; - state = ST_WAITDIGITS; - continue; - } - break; - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: - switch(state) { - case ST_DIGITS: continue; - case ST_SKIPSPHEX: /* Fall through */ - case ST_HEXDIGIT1: - hex_value = (lv - 0x30) << 4; - state = ST_HEXDIGIT2; - continue; - case ST_HEXDIGIT2: - hex_value += (lv - 0x30); - state = ST_HEXCOLON; - st->buf[st->size++] = (uint8_t)hex_value; - continue; - case ST_HEXCOLON: - return XPBD_BROKEN_ENCODING; - case ST_LEADSPACE: - dec_value = 0; - dec_value_start = lp; - /* FALL THROUGH */ - case ST_WAITDIGITS: - state = ST_DIGITS; - continue; - default: - break; - } - break; - case 0x3c: /* '<', start of XML encoded enumeration */ - if(state == ST_LEADSPACE) { - const asn_INTEGER_enum_map_t *el; - el = INTEGER_map_enum2value( - (const asn_INTEGER_specifics_t *) - td->specifics, lstart, lstop); - if(el) { - ASN_DEBUG("Found \"%s\" => %ld", - el->enum_name, el->nat_value); - dec_value = el->nat_value; - state = ST_END_ENUM; - lp = lstop - 1; - continue; - } - ASN_DEBUG("Unknown identifier for INTEGER"); - } - return XPBD_BROKEN_ENCODING; - case 0x3a: /* ':' */ - if(state == ST_HEXCOLON) { - /* This colon is expected */ - state = ST_HEXDIGIT1; - continue; - } else if(state == ST_DIGITS) { - /* The colon here means that we have - * decoded the first two hexadecimal - * places as a decimal value. - * Switch decoding mode. */ - ASN_DEBUG("INTEGER re-evaluate as hex form"); - state = ST_SKIPSPHEX; - dec_value_start = 0; - lp = lstart - 1; - continue; - } else { - ASN_DEBUG("state %d at %ld", state, (long)(lp - lstart)); - break; - } - /* [A-Fa-f] */ - case 0x41:case 0x42:case 0x43:case 0x44:case 0x45:case 0x46: - case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:case 0x66: - switch(state) { - case ST_SKIPSPHEX: - case ST_LEADSPACE: /* Fall through */ - case ST_HEXDIGIT1: - hex_value = lv - ((lv < 0x61) ? 0x41 : 0x61); - hex_value += 10; - hex_value <<= 4; - state = ST_HEXDIGIT2; - continue; - case ST_HEXDIGIT2: - hex_value += lv - ((lv < 0x61) ? 0x41 : 0x61); - hex_value += 10; - st->buf[st->size++] = (uint8_t)hex_value; - state = ST_HEXCOLON; - continue; - case ST_DIGITS: - ASN_DEBUG("INTEGER re-evaluate as hex form"); - state = ST_SKIPSPHEX; - dec_value_start = 0; - lp = lstart - 1; - continue; - default: - break; - } - break; - } - - /* Found extra non-numeric stuff */ - ASN_DEBUG("INTEGER :: Found non-numeric 0x%2x at %ld", - lv, (long)(lp - lstart)); - state = ST_UNEXPECTED; - break; - } - - switch(state) { - case ST_END_ENUM: - /* Got a complete and valid enumeration encoded as a tag. */ - break; - case ST_DIGITS: - dec_value_end = lstop; - /* FALL THROUGH */ - case ST_DIGITS_TRAILSPACE: - /* The last symbol encountered was a digit. */ - switch(asn_strtoimax_lim(dec_value_start, &dec_value_end, &dec_value)) { - case ASN_STRTOX_OK: - if(dec_value >= LONG_MIN && dec_value <= LONG_MAX) { - break; - } else { - /* - * We model INTEGER on long for XER, - * to avoid rewriting all the tests at once. - */ - ASN_DEBUG("INTEGER exceeds long range"); - } - /* Fall through */ - case ASN_STRTOX_ERROR_RANGE: - ASN_DEBUG("INTEGER decode %s hit range limit", td->name); - return XPBD_DECODER_LIMIT; - case ASN_STRTOX_ERROR_INVAL: - case ASN_STRTOX_EXPECT_MORE: - case ASN_STRTOX_EXTRA_DATA: - return XPBD_BROKEN_ENCODING; - } - break; - case ST_HEXCOLON: - case ST_HEXDIGITS_TRAILSPACE: - st->buf[st->size] = 0; /* Just in case termination */ - return XPBD_BODY_CONSUMED; - case ST_HEXDIGIT1: - case ST_HEXDIGIT2: - case ST_SKIPSPHEX: - return XPBD_BROKEN_ENCODING; - case ST_LEADSPACE: - /* Content not found */ - return XPBD_NOT_BODY_IGNORE; - case ST_WAITDIGITS: - case ST_UNEXPECTED: - ASN_DEBUG("INTEGER: No useful digits (state %d)", state); - return XPBD_BROKEN_ENCODING; /* No digits */ - } - - /* - * Convert the result of parsing of enumeration or a straight - * decimal value into a BER representation. - */ - if(asn_imax2INTEGER(st, dec_value)) { - ASN_DEBUG("INTEGER decode %s conversion failed", td->name); - return XPBD_SYSTEM_FAILURE; - } - - return XPBD_BODY_CONSUMED; -} - -asn_dec_rval_t -INTEGER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, size_t size) { - return xer_decode_primitive(opt_codec_ctx, td, - sptr, sizeof(INTEGER_t), opt_mname, - buf_ptr, size, INTEGER__xer_body_decode); -} - -asn_enc_rval_t -INTEGER_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; - asn_enc_rval_t er; - - (void)ilevel; - (void)flags; - - if(!st || !st->buf) - ASN__ENCODE_FAILED; - - er.encoded = INTEGER__dump(td, st, cb, app_key, 1); - if(er.encoded < 0) ASN__ENCODE_FAILED; - - ASN__ENCODED_OK(er); -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_dec_rval_t -INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval = { RC_OK, 0 }; - INTEGER_t *st = (INTEGER_t *)*sptr; - const asn_per_constraint_t *ct; - int repeat; - - (void)opt_codec_ctx; - - if(!st) { - st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st))); - if(!st) ASN__DECODE_FAILED; - } - - if(!constraints) constraints = td->encoding_constraints.per_constraints; - ct = constraints ? &constraints->value : 0; - - if(ct && ct->flags & APC_EXTENSIBLE) { - int inext = per_get_few_bits(pd, 1); - if(inext < 0) ASN__DECODE_STARVED; - if(inext) ct = 0; - } - - FREEMEM(st->buf); - st->buf = 0; - st->size = 0; - if(ct) { - if(ct->flags & APC_SEMI_CONSTRAINED) { - st->buf = (uint8_t *)CALLOC(1, 2); - if(!st->buf) ASN__DECODE_FAILED; - st->size = 1; - } else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) { - size_t size = (ct->range_bits + 7) >> 3; - st->buf = (uint8_t *)MALLOC(1 + size + 1); - if(!st->buf) ASN__DECODE_FAILED; - st->size = size; - } - } - - /* X.691-2008/11, #13.2.2, constrained whole number */ - if(ct && ct->flags != APC_UNCONSTRAINED) { - /* #11.5.6 */ - ASN_DEBUG("Integer with range %d bits", ct->range_bits); - if(ct->range_bits >= 0) { - if((size_t)ct->range_bits > 8 * sizeof(unsigned long)) - ASN__DECODE_FAILED; - - if(specs && specs->field_unsigned) { - unsigned long uvalue = 0; - if(uper_get_constrained_whole_number(pd, - &uvalue, ct->range_bits)) - ASN__DECODE_STARVED; - ASN_DEBUG("Got value %lu + low %ld", - uvalue, ct->lower_bound); - uvalue += ct->lower_bound; - if(asn_ulong2INTEGER(st, uvalue)) - ASN__DECODE_FAILED; - } else { - unsigned long uvalue = 0; - long svalue; - if(uper_get_constrained_whole_number(pd, - &uvalue, ct->range_bits)) - ASN__DECODE_STARVED; - ASN_DEBUG("Got value %lu + low %ld", - uvalue, ct->lower_bound); - if(per_long_range_unrebase(uvalue, ct->lower_bound, - ct->upper_bound, &svalue) - || asn_long2INTEGER(st, svalue)) { - ASN__DECODE_FAILED; - } - } - return rval; - } - } else { - ASN_DEBUG("Decoding unconstrained integer %s", td->name); - } - - /* X.691, #12.2.3, #12.2.4 */ - do { - ssize_t len = 0; - void *p = NULL; - int ret = 0; - - /* Get the PER length */ - len = uper_get_length(pd, -1, 0, &repeat); - if(len < 0) ASN__DECODE_STARVED; - - p = REALLOC(st->buf, st->size + len + 1); - if(!p) ASN__DECODE_FAILED; - st->buf = (uint8_t *)p; - - ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len); - if(ret < 0) ASN__DECODE_STARVED; - st->size += len; - } while(repeat); - st->buf[st->size] = 0; /* JIC */ - - /* #12.2.3 */ - if(ct && ct->lower_bound) { - /* - * TODO: replace by in-place arithmetics. - */ - long value = 0; - if(asn_INTEGER2long(st, &value)) - ASN__DECODE_FAILED; - if(asn_imax2INTEGER(st, value + ct->lower_bound)) - ASN__DECODE_FAILED; - } - - return rval; -} - -asn_enc_rval_t -INTEGER_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_per_outp_t *po) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - const INTEGER_t *st = (const INTEGER_t *)sptr; - const uint8_t *buf; - const uint8_t *end; - const asn_per_constraint_t *ct; - long value = 0; - - if(!st || st->size == 0) ASN__ENCODE_FAILED; - - if(!constraints) constraints = td->encoding_constraints.per_constraints; - ct = constraints ? &constraints->value : 0; - - er.encoded = 0; - - if(ct) { - int inext = 0; - if(specs && specs->field_unsigned) { - unsigned long uval; - if(asn_INTEGER2ulong(st, &uval)) - ASN__ENCODE_FAILED; - /* Check proper range */ - if(ct->flags & APC_SEMI_CONSTRAINED) { - if(uval < (unsigned long)ct->lower_bound) - inext = 1; - } else if(ct->range_bits >= 0) { - if(uval < (unsigned long)ct->lower_bound - || uval > (unsigned long)ct->upper_bound) - inext = 1; - } - ASN_DEBUG("Value %lu (%02x/%" ASN_PRI_SIZE ") lb %lu ub %lu %s", - uval, st->buf[0], st->size, - ct->lower_bound, ct->upper_bound, - inext ? "ext" : "fix"); - value = uval; - } else { - if(asn_INTEGER2long(st, &value)) - ASN__ENCODE_FAILED; - /* Check proper range */ - if(ct->flags & APC_SEMI_CONSTRAINED) { - if(value < ct->lower_bound) - inext = 1; - } else if(ct->range_bits >= 0) { - if(value < ct->lower_bound - || value > ct->upper_bound) - inext = 1; - } - ASN_DEBUG("Value %ld (%02x/%" ASN_PRI_SIZE ") lb %ld ub %ld %s", - value, st->buf[0], st->size, - ct->lower_bound, ct->upper_bound, - inext ? "ext" : "fix"); - } - if(ct->flags & APC_EXTENSIBLE) { - if(per_put_few_bits(po, inext, 1)) - ASN__ENCODE_FAILED; - if(inext) ct = 0; - } else if(inext) { - ASN__ENCODE_FAILED; - } - } - - - /* X.691-11/2008, #13.2.2, test if constrained whole number */ - if(ct && ct->range_bits >= 0) { - unsigned long v; - /* #11.5.6 -> #11.3 */ - ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits", - value, value - ct->lower_bound, ct->range_bits); - if(per_long_range_rebase(value, ct->lower_bound, ct->upper_bound, &v)) { - ASN__ENCODE_FAILED; - } - if(uper_put_constrained_whole_number_u(po, v, ct->range_bits)) - ASN__ENCODE_FAILED; - ASN__ENCODED_OK(er); - } - - if(ct && ct->lower_bound) { - ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound); - /* TODO: adjust lower bound */ - ASN__ENCODE_FAILED; - } - - for(buf = st->buf, end = st->buf + st->size; buf < end;) { - int need_eom = 0; - ssize_t mayEncode = uper_put_length(po, end - buf, &need_eom); - if(mayEncode < 0) - ASN__ENCODE_FAILED; - if(per_put_many_bits(po, buf, 8 * mayEncode)) - ASN__ENCODE_FAILED; - buf += mayEncode; - if(need_eom && uper_put_length(po, 0, 0)) ASN__ENCODE_FAILED; - } - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -static intmax_t -asn__integer_convert(const uint8_t *b, const uint8_t *end) { - uintmax_t value; - - /* Perform the sign initialization */ - /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */ - if((*b >> 7)) { - value = (uintmax_t)(-1); - } else { - value = 0; - } - - /* Conversion engine */ - for(; b < end; b++) { - value = (value << 8) | *b; - } - - return value; -} - -int -asn_INTEGER2imax(const INTEGER_t *iptr, intmax_t *lptr) { - uint8_t *b, *end; - size_t size; - - /* Sanity checking */ - if(!iptr || !iptr->buf || !lptr) { - errno = EINVAL; - return -1; - } - - /* Cache the begin/end of the buffer */ - b = iptr->buf; /* Start of the INTEGER buffer */ - size = iptr->size; - end = b + size; /* Where to stop */ - - if(size > sizeof(intmax_t)) { - uint8_t *end1 = end - 1; - /* - * Slightly more advanced processing, - * able to process INTEGERs with >sizeof(intmax_t) bytes - * when the actual value is small, e.g. for intmax_t == int32_t - * (0x0000000000abcdef INTEGER would yield a fine 0x00abcdef int32_t) - */ - /* Skip out the insignificant leading bytes */ - for(; b < end1; b++) { - switch(*b) { - case 0x00: if((b[1] & 0x80) == 0) continue; break; - case 0xff: if((b[1] & 0x80) != 0) continue; break; - } - break; - } - - size = end - b; - if(size > sizeof(intmax_t)) { - /* Still cannot fit the sizeof(intmax_t) */ - errno = ERANGE; - return -1; - } - } - - /* Shortcut processing of a corner case */ - if(end == b) { - *lptr = 0; - return 0; - } - - *lptr = asn__integer_convert(b, end); - return 0; -} - -/* FIXME: negative INTEGER values are silently interpreted as large unsigned ones. */ -int -asn_INTEGER2umax(const INTEGER_t *iptr, uintmax_t *lptr) { - uint8_t *b, *end; - uintmax_t value; - size_t size; - - if(!iptr || !iptr->buf || !lptr) { - errno = EINVAL; - return -1; - } - - b = iptr->buf; - size = iptr->size; - end = b + size; - - /* If all extra leading bytes are zeroes, ignore them */ - for(; size > sizeof(value); b++, size--) { - if(*b) { - /* Value won't fit into uintmax_t */ - errno = ERANGE; - return -1; - } - } - - /* Conversion engine */ - for(value = 0; b < end; b++) - value = (value << 8) | *b; - - *lptr = value; - return 0; -} - -int -asn_umax2INTEGER(INTEGER_t *st, uintmax_t value) { - uint8_t *buf; - uint8_t *end; - uint8_t *b; - int shr; - - if(value <= ((~(uintmax_t)0) >> 1)) { - return asn_imax2INTEGER(st, value); - } - - buf = (uint8_t *)MALLOC(1 + sizeof(value)); - if(!buf) return -1; - - end = buf + (sizeof(value) + 1); - buf[0] = 0; /* INTEGERs are signed. 0-byte indicates positive. */ - for(b = buf + 1, shr = (sizeof(value) - 1) * 8; b < end; shr -= 8, b++) - *b = (uint8_t)(value >> shr); - - if(st->buf) FREEMEM(st->buf); - st->buf = buf; - st->size = 1 + sizeof(value); - - return 0; -} - -int -asn_imax2INTEGER(INTEGER_t *st, intmax_t value) { - uint8_t *buf, *bp; - uint8_t *p; - uint8_t *pstart; - uint8_t *pend1; - int littleEndian = 1; /* Run-time detection */ - int add; - - if(!st) { - errno = EINVAL; - return -1; - } - - buf = (uint8_t *)(long *)MALLOC(sizeof(value)); - if(!buf) return -1; - - if(*(char *)&littleEndian) { - pstart = (uint8_t *)&value + sizeof(value) - 1; - pend1 = (uint8_t *)&value; - add = -1; - } else { - pstart = (uint8_t *)&value; - pend1 = pstart + sizeof(value) - 1; - add = 1; - } - - /* - * If the contents octet consists of more than one octet, - * then bits of the first octet and bit 8 of the second octet: - * a) shall not all be ones; and - * b) shall not all be zero. - */ - for(p = pstart; p != pend1; p += add) { - switch(*p) { - case 0x00: if((*(p+add) & 0x80) == 0) - continue; - break; - case 0xff: if((*(p+add) & 0x80)) - continue; - break; - } - break; - } - /* Copy the integer body */ - for(bp = buf, pend1 += add; p != pend1; p += add) - *bp++ = *p; - - if(st->buf) FREEMEM(st->buf); - st->buf = buf; - st->size = bp - buf; - - return 0; -} - -int -asn_INTEGER2long(const INTEGER_t *iptr, long *l) { - intmax_t v; - if(asn_INTEGER2imax(iptr, &v) == 0) { - if(v < LONG_MIN || v > LONG_MAX) { - errno = ERANGE; - return -1; - } - *l = v; - return 0; - } else { - return -1; - } -} - -int -asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *l) { - uintmax_t v; - if(asn_INTEGER2umax(iptr, &v) == 0) { - if(v > ULONG_MAX) { - errno = ERANGE; - return -1; - } - *l = v; - return 0; - } else { - return -1; - } -} - -int -asn_long2INTEGER(INTEGER_t *st, long value) { - return asn_imax2INTEGER(st, value); -} - -int -asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) { - return asn_imax2INTEGER(st, value); -} - -/* - * Parse the number in the given string until the given *end position, - * returning the position after the last parsed character back using the - * same (*end) pointer. - * WARNING: This behavior is different from the standard strtol/strtoimax(3). - */ -enum asn_strtox_result_e -asn_strtoimax_lim(const char *str, const char **end, intmax_t *intp) { - int sign = 1; - intmax_t value; - -#define ASN1_INTMAX_MAX ((~(uintmax_t)0) >> 1) - const intmax_t upper_boundary = ASN1_INTMAX_MAX / 10; - intmax_t last_digit_max = ASN1_INTMAX_MAX % 10; -#undef ASN1_INTMAX_MAX - - if(str >= *end) return ASN_STRTOX_ERROR_INVAL; - - switch(*str) { - case '-': - last_digit_max++; - sign = -1; - /* FALL THROUGH */ - case '+': - str++; - if(str >= *end) { - *end = str; - return ASN_STRTOX_EXPECT_MORE; - } - } - - for(value = 0; str < (*end); str++) { - switch(*str) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: { - int d = *str - '0'; - if(value < upper_boundary) { - value = value * 10 + d; - } else if(value == upper_boundary) { - if(d <= last_digit_max) { - if(sign > 0) { - value = value * 10 + d; - } else { - sign = 1; - value = -value * 10 - d; - } - } else { - *end = str; - return ASN_STRTOX_ERROR_RANGE; - } - } else { - *end = str; - return ASN_STRTOX_ERROR_RANGE; - } - } - continue; - default: - *end = str; - *intp = sign * value; - return ASN_STRTOX_EXTRA_DATA; - } - } - - *end = str; - *intp = sign * value; - return ASN_STRTOX_OK; -} - -/* - * Parse the number in the given string until the given *end position, - * returning the position after the last parsed character back using the - * same (*end) pointer. - * WARNING: This behavior is different from the standard strtoul/strtoumax(3). - */ -enum asn_strtox_result_e -asn_strtoumax_lim(const char *str, const char **end, uintmax_t *uintp) { - uintmax_t value; - -#define ASN1_UINTMAX_MAX ((~(uintmax_t)0)) - const uintmax_t upper_boundary = ASN1_UINTMAX_MAX / 10; - uintmax_t last_digit_max = ASN1_UINTMAX_MAX % 10; -#undef ASN1_UINTMAX_MAX - - if(str >= *end) return ASN_STRTOX_ERROR_INVAL; - - switch(*str) { - case '-': - return ASN_STRTOX_ERROR_INVAL; - case '+': - str++; - if(str >= *end) { - *end = str; - return ASN_STRTOX_EXPECT_MORE; - } - } - - for(value = 0; str < (*end); str++) { - switch(*str) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: { - unsigned int d = *str - '0'; - if(value < upper_boundary) { - value = value * 10 + d; - } else if(value == upper_boundary) { - if(d <= last_digit_max) { - value = value * 10 + d; - } else { - *end = str; - return ASN_STRTOX_ERROR_RANGE; - } - } else { - *end = str; - return ASN_STRTOX_ERROR_RANGE; - } - } - continue; - default: - *end = str; - *uintp = value; - return ASN_STRTOX_EXTRA_DATA; - } - } - - *end = str; - *uintp = value; - return ASN_STRTOX_OK; -} - -enum asn_strtox_result_e -asn_strtol_lim(const char *str, const char **end, long *lp) { - intmax_t value; - switch(asn_strtoimax_lim(str, end, &value)) { - case ASN_STRTOX_ERROR_RANGE: - return ASN_STRTOX_ERROR_RANGE; - case ASN_STRTOX_ERROR_INVAL: - return ASN_STRTOX_ERROR_INVAL; - case ASN_STRTOX_EXPECT_MORE: - return ASN_STRTOX_EXPECT_MORE; - case ASN_STRTOX_OK: - if(value >= LONG_MIN && value <= LONG_MAX) { - *lp = value; - return ASN_STRTOX_OK; - } else { - return ASN_STRTOX_ERROR_RANGE; - } - case ASN_STRTOX_EXTRA_DATA: - if(value >= LONG_MIN && value <= LONG_MAX) { - *lp = value; - return ASN_STRTOX_EXTRA_DATA; - } else { - return ASN_STRTOX_ERROR_RANGE; - } - } - - assert(!"Unreachable"); - return ASN_STRTOX_ERROR_INVAL; -} - -enum asn_strtox_result_e -asn_strtoul_lim(const char *str, const char **end, unsigned long *ulp) { - uintmax_t value; - switch(asn_strtoumax_lim(str, end, &value)) { - case ASN_STRTOX_ERROR_RANGE: - return ASN_STRTOX_ERROR_RANGE; - case ASN_STRTOX_ERROR_INVAL: - return ASN_STRTOX_ERROR_INVAL; - case ASN_STRTOX_EXPECT_MORE: - return ASN_STRTOX_EXPECT_MORE; - case ASN_STRTOX_OK: - if(value <= ULONG_MAX) { - *ulp = value; - return ASN_STRTOX_OK; - } else { - return ASN_STRTOX_ERROR_RANGE; - } - case ASN_STRTOX_EXTRA_DATA: - if(value <= ULONG_MAX) { - *ulp = value; - return ASN_STRTOX_EXTRA_DATA; - } else { - return ASN_STRTOX_ERROR_RANGE; - } - } - - assert(!"Unreachable"); - return ASN_STRTOX_ERROR_INVAL; -} - -int -INTEGER_compare(const asn_TYPE_descriptor_t *td, const void *aptr, - const void *bptr) { - const INTEGER_t *a = aptr; - const INTEGER_t *b = bptr; - - (void)td; - - if(a && b) { - if(a->size && b->size) { - int sign_a = (a->buf[0] & 0x80) ? -1 : 1; - int sign_b = (b->buf[0] & 0x80) ? -1 : 1; - - if(sign_a < sign_b) return -1; - if(sign_a > sign_b) return 1; - - /* The shortest integer wins, unless comparing negatives */ - if(a->size < b->size) { - return -1 * sign_a; - } else if(a->size > b->size) { - return 1 * sign_b; - } - - return sign_a * memcmp(a->buf, b->buf, a->size); - } else if(a->size) { - int sign = (a->buf[0] & 0x80) ? -1 : 1; - return (1) * sign; - } else if(b->size) { - int sign = (a->buf[0] & 0x80) ? -1 : 1; - return (-1) * sign; - } else { - return 0; - } - } else if(!a && !b) { - return 0; - } else if(!a) { - return -1; - } else { - return 1; - } - -} - -asn_random_fill_result_t -INTEGER_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constraints, - size_t max_length) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - INTEGER_t *st = *sptr; - const asn_INTEGER_enum_map_t *emap; - size_t emap_len; - intmax_t value; - int find_inside_map; - - if(max_length == 0) return result_skipped; - - if(st == NULL) { - st = (INTEGER_t *)CALLOC(1, sizeof(*st)); - if(st == NULL) { - return result_failed; - } - } - - if(specs) { - emap = specs->value2enum; - emap_len = specs->map_count; - if(specs->strict_enumeration) { - find_inside_map = emap_len > 0; - } else { - find_inside_map = emap_len ? asn_random_between(0, 1) : 0; - } - } else { - emap = 0; - emap_len = 0; - find_inside_map = 0; - } - - if(find_inside_map) { - assert(emap_len > 0); - value = emap[asn_random_between(0, emap_len - 1)].nat_value; - } else { - const asn_per_constraints_t *ct; - - static const long variants[] = { - -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384, - -16383, -257, -256, -255, -254, -129, -128, -127, - -126, -1, 0, 1, 126, 127, 128, 129, - 254, 255, 256, 257, 16383, 16384, 16385, 32767, - 32768, 32769, 65534, 65535, 65536, 65537}; - if(specs && specs->field_unsigned) { - assert(variants[18] == 0); - value = variants[asn_random_between( - 18, sizeof(variants) / sizeof(variants[0]) - 1)]; - } else { - value = variants[asn_random_between( - 0, sizeof(variants) / sizeof(variants[0]) - 1)]; - } - - if(!constraints) constraints = &td->encoding_constraints; - ct = constraints ? constraints->per_constraints : 0; - if(ct && (ct->value.flags & APC_CONSTRAINED)) { - if(value < ct->value.lower_bound || value > ct->value.upper_bound) { - value = asn_random_between(ct->value.lower_bound, - ct->value.upper_bound); - } - } - } - - if(asn_imax2INTEGER(st, value)) { - if(st == *sptr) { - ASN_STRUCT_RESET(*td, st); - } else { - ASN_STRUCT_FREE(*td, st); - } - return result_failed; - } else { - *sptr = st; - result_ok.length = st->size; - return result_ok; - } -} +/* + * Copyright (c) 2003-2019 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include +#include + +/* + * INTEGER basic type description. + */ +static const ber_tlv_tag_t asn_DEF_INTEGER_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_operation_t asn_OP_INTEGER = { + INTEGER_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + INTEGER_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + INTEGER_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + ber_decode_primitive, + INTEGER_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + INTEGER_decode_xer, + INTEGER_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + INTEGER_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + INTEGER_decode_oer, /* OER decoder */ + INTEGER_encode_oer, /* Canonical OER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + INTEGER_decode_uper, /* Unaligned PER decoder */ + INTEGER_encode_uper, /* Unaligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + INTEGER_decode_aper, /* Aligned PER decoder */ + INTEGER_encode_aper, /* Aligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + INTEGER_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ +0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_INTEGER = { + "INTEGER", + "INTEGER", + &asn_OP_INTEGER, + asn_DEF_INTEGER_tags, + sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), + asn_DEF_INTEGER_tags, /* Same as above */ + sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +/* + * INTEGER specific human-readable output. + */ +ssize_t +INTEGER__dump(const asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + char scratch[32]; + uint8_t *buf = st->buf; + uint8_t *buf_end = st->buf + st->size; + intmax_t value; + ssize_t wrote = 0; + char *p; + int ret; + + if(specs && specs->field_unsigned) + ret = asn_INTEGER2umax(st, (uintmax_t *)&value); + else + ret = asn_INTEGER2imax(st, &value); + + /* Simple case: the integer size is small */ + if(ret == 0) { + const asn_INTEGER_enum_map_t *el; + el = (value >= 0 || !specs || !specs->field_unsigned) + ? INTEGER_map_value2enum(specs, value) : 0; + if(el) { + if(plainOrXER == 0) + return asn__format_to_callback(cb, app_key, + "%" ASN_PRIdMAX " (%s)", value, el->enum_name); + else + return asn__format_to_callback(cb, app_key, + "<%s/>", el->enum_name); + } else if(plainOrXER && specs && specs->strict_enumeration) { + ASN_DEBUG("ASN.1 forbids dealing with " + "unknown value of ENUMERATED type"); + errno = EPERM; + return -1; + } else { + return asn__format_to_callback(cb, app_key, + (specs && specs->field_unsigned) + ? "%" ASN_PRIuMAX + : "%" ASN_PRIdMAX, + value); + } + } else if(plainOrXER && specs && specs->strict_enumeration) { + /* + * Here and earlier, we cannot encode the ENUMERATED values + * if there is no corresponding identifier. + */ + ASN_DEBUG("ASN.1 forbids dealing with " + "unknown value of ENUMERATED type"); + errno = EPERM; + return -1; + } + + /* Output in the long xx:yy:zz... format */ + /* TODO: replace with generic algorithm (Knuth TAOCP Vol 2, 4.3.1) */ + for(p = scratch; buf < buf_end; buf++) { + const char * const h2c = "0123456789ABCDEF"; + if((p - scratch) >= (ssize_t)(sizeof(scratch) - 4)) { + /* Flush buffer */ + if(cb(scratch, p - scratch, app_key) < 0) + return -1; + wrote += p - scratch; + p = scratch; + } + *p++ = h2c[*buf >> 4]; + *p++ = h2c[*buf & 0x0F]; + *p++ = 0x3a; /* ":" */ + } + if(p != scratch) + p--; /* Remove the last ":" */ + + wrote += p - scratch; + return (cb(scratch, p - scratch, app_key) < 0) ? -1 : wrote; +} + +static int +INTEGER__compar_value2enum(const void *kp, const void *am) { + long a = *(const long *)kp; + const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; + long b = el->nat_value; + if(a < b) return -1; + else if(a == b) return 0; + else return 1; +} + +const asn_INTEGER_enum_map_t * +INTEGER_map_value2enum(const asn_INTEGER_specifics_t *specs, long value) { + int count = specs ? specs->map_count : 0; + if(!count) return 0; + return (asn_INTEGER_enum_map_t *)bsearch(&value, specs->value2enum, + count, sizeof(specs->value2enum[0]), + INTEGER__compar_value2enum); +} + +static intmax_t +asn__integer_convert(const uint8_t *b, const uint8_t *end) { + uintmax_t value; + + /* Perform the sign initialization */ + /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */ + if((*b >> 7)) { + value = (uintmax_t)(-1); + } else { + value = 0; + } + + /* Conversion engine */ + for(; b < end; b++) { + value = (value << 8) | *b; + } + + return value; +} + +int +asn_INTEGER2imax(const INTEGER_t *iptr, intmax_t *lptr) { + uint8_t *b, *end; + size_t size; + + /* Sanity checking */ + if(!iptr || !iptr->buf || !lptr) { + errno = EINVAL; + return -1; + } + + /* Cache the begin/end of the buffer */ + b = iptr->buf; /* Start of the INTEGER buffer */ + size = iptr->size; + end = b + size; /* Where to stop */ + + if(size > sizeof(intmax_t)) { + uint8_t *end1 = end - 1; + /* + * Slightly more advanced processing, + * able to process INTEGERs with >sizeof(intmax_t) bytes + * when the actual value is small, e.g. for intmax_t == int32_t + * (0x0000000000abcdef INTEGER would yield a fine 0x00abcdef int32_t) + */ + /* Skip out the insignificant leading bytes */ + for(; b < end1; b++) { + switch(*b) { + case 0x00: if((b[1] & 0x80) == 0) continue; break; + case 0xff: if((b[1] & 0x80) != 0) continue; break; + } + break; + } + + size = end - b; + if(size > sizeof(intmax_t)) { + /* Still cannot fit the sizeof(intmax_t) */ + errno = ERANGE; + return -1; + } + } + + /* Shortcut processing of a corner case */ + if(end == b) { + *lptr = 0; + return 0; + } + + *lptr = asn__integer_convert(b, end); + return 0; +} + +/* FIXME: negative INTEGER values are silently interpreted as large unsigned ones. */ +int +asn_INTEGER2umax(const INTEGER_t *iptr, uintmax_t *lptr) { + uint8_t *b, *end; + uintmax_t value; + size_t size; + + if(!iptr || !iptr->buf || !lptr) { + errno = EINVAL; + return -1; + } + + b = iptr->buf; + size = iptr->size; + end = b + size; + + /* If all extra leading bytes are zeroes, ignore them */ + for(; size > sizeof(value); b++, size--) { + if(*b) { + /* Value won't fit into uintmax_t */ + errno = ERANGE; + return -1; + } + } + + /* Conversion engine */ + for(value = 0; b < end; b++) + value = (value << 8) | *b; + + *lptr = value; + return 0; +} + +int +asn_umax2INTEGER(INTEGER_t *st, uintmax_t value) { + uint8_t *buf; + uint8_t *end; + uint8_t *b; + int shr; + + if(value <= ((~(uintmax_t)0) >> 1)) { + return asn_imax2INTEGER(st, value); + } + + buf = (uint8_t *)MALLOC(1 + sizeof(value)); + if(!buf) return -1; + + end = buf + (sizeof(value) + 1); + buf[0] = 0; /* INTEGERs are signed. 0-byte indicates positive. */ + for(b = buf + 1, shr = (sizeof(value) - 1) * 8; b < end; shr -= 8, b++) + *b = (uint8_t)(value >> shr); + + if(st->buf) FREEMEM(st->buf); + st->buf = buf; + st->size = 1 + sizeof(value); + + return 0; +} + +int +asn_imax2INTEGER(INTEGER_t *st, intmax_t value) { + uint8_t *buf, *bp; + uint8_t *p; + uint8_t *pstart; + uint8_t *pend1; + int littleEndian = 1; /* Run-time detection */ + int add; + + if(!st) { + errno = EINVAL; + return -1; + } + + buf = (uint8_t *)(long *)MALLOC(sizeof(value)); + if(!buf) return -1; + + if(*(char *)&littleEndian) { + pstart = (uint8_t *)&value + sizeof(value) - 1; + pend1 = (uint8_t *)&value; + add = -1; + } else { + pstart = (uint8_t *)&value; + pend1 = pstart + sizeof(value) - 1; + add = 1; + } + + /* + * If the contents octet consists of more than one octet, + * then bits of the first octet and bit 8 of the second octet: + * a) shall not all be ones; and + * b) shall not all be zero. + */ + for(p = pstart; p != pend1; p += add) { + switch(*p) { + case 0x00: if((*(p+add) & 0x80) == 0) + continue; + break; + case 0xff: if((*(p+add) & 0x80)) + continue; + break; + } + break; + } + /* Copy the integer body */ + for(bp = buf, pend1 += add; p != pend1; p += add) + *bp++ = *p; + + if(st->buf) FREEMEM(st->buf); + st->buf = buf; + st->size = bp - buf; + + return 0; +} + +int +asn_INTEGER2long(const INTEGER_t *iptr, long *l) { + intmax_t v; + if(asn_INTEGER2imax(iptr, &v) == 0) { + if(v < LONG_MIN || v > LONG_MAX) { + errno = ERANGE; + return -1; + } + *l = v; + return 0; + } else { + return -1; + } +} + +int +asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *l) { + uintmax_t v; + if(asn_INTEGER2umax(iptr, &v) == 0) { + if(v > ULONG_MAX) { + errno = ERANGE; + return -1; + } + *l = v; + return 0; + } else { + return -1; + } +} + +int +asn_long2INTEGER(INTEGER_t *st, long value) { + return asn_imax2INTEGER(st, value); +} + +int +asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) { + return asn_imax2INTEGER(st, value); +} + + +int +asn_uint642INTEGER(INTEGER_t *st, uint64_t value) { + uint8_t *buf; + uint8_t *end; + uint8_t *b; + int shr; + + if(value <= INT64_MAX) + return asn_int642INTEGER(st, value); + + buf = (uint8_t *)MALLOC(1 + sizeof(value)); + if(!buf) return -1; + + end = buf + (sizeof(value) + 1); + buf[0] = 0; + for(b = buf + 1, shr = (sizeof(value)-1)*8; b < end; shr -= 8, b++) + *b = (uint8_t)(value >> shr); + + if(st->buf) FREEMEM(st->buf); + st->buf = buf; + st->size = 1 + sizeof(value); + + return 0; +} + +int +asn_int642INTEGER(INTEGER_t *st, int64_t value) { + uint8_t *buf, *bp; + uint8_t *p; + uint8_t *pstart; + uint8_t *pend1; + int littleEndian = 1; /* Run-time detection */ + int add; + + if(!st) { + errno = EINVAL; + return -1; + } + + buf = (uint8_t *)MALLOC(sizeof(value)); + if(!buf) return -1; + + if(*(char *)&littleEndian) { + pstart = (uint8_t *)&value + sizeof(value) - 1; + pend1 = (uint8_t *)&value; + add = -1; + } else { + pstart = (uint8_t *)&value; + pend1 = pstart + sizeof(value) - 1; + add = 1; + } + + /* + * If the contents octet consists of more than one octet, + * then bits of the first octet and bit 8 of the second octet: + * a) shall not all be ones; and + * b) shall not all be zero. + */ + for(p = pstart; p != pend1; p += add) { + switch(*p) { + case 0x00: if((*(p+add) & 0x80) == 0) + continue; + break; + case 0xff: if((*(p+add) & 0x80)) + continue; + break; + } + break; + } + /* Copy the integer body */ + for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add) + *bp++ = *p; + + if(st->buf) FREEMEM(st->buf); + st->buf = buf; + st->size = bp - buf; + + return 0; +} + +/* + * Parse the number in the given string until the given *end position, + * returning the position after the last parsed character back using the + * same (*end) pointer. + * WARNING: This behavior is different from the standard strtol/strtoimax(3). + */ +enum asn_strtox_result_e +asn_strtoimax_lim(const char *str, const char **end, intmax_t *intp) { + int sign = 1; + intmax_t value; + + const intmax_t asn1_intmax_max = ((~(uintmax_t)0) >> 1); + const intmax_t upper_boundary = asn1_intmax_max / 10; + intmax_t last_digit_max = asn1_intmax_max % 10; + + if(str >= *end) return ASN_STRTOX_ERROR_INVAL; + + switch(*str) { + case '-': + last_digit_max++; + sign = -1; + /* FALL THROUGH */ + case '+': + str++; + if(str >= *end) { + *end = str; + return ASN_STRTOX_EXPECT_MORE; + } + } + + for(value = 0; str < (*end); str++) { + if(*str >= 0x30 && *str <= 0x39) { + int d = *str - '0'; + if(value < upper_boundary) { + value = value * 10 + d; + } else if(value == upper_boundary) { + if(d <= last_digit_max) { + if(sign > 0) { + value = value * 10 + d; + } else { + sign = 1; + value = -value * 10 - d; + } + str += 1; + if(str < *end) { + // If digits continue, we're guaranteed out of range. + *end = str; + if(*str >= 0x30 && *str <= 0x39) { + return ASN_STRTOX_ERROR_RANGE; + } else { + *intp = sign * value; + return ASN_STRTOX_EXTRA_DATA; + } + } + break; + } else { + *end = str; + return ASN_STRTOX_ERROR_RANGE; + } + } else { + *end = str; + return ASN_STRTOX_ERROR_RANGE; + } + } else { + *end = str; + *intp = sign * value; + return ASN_STRTOX_EXTRA_DATA; + } + } + + *end = str; + *intp = sign * value; + return ASN_STRTOX_OK; +} + +/* + * Parse the number in the given string until the given *end position, + * returning the position after the last parsed character back using the + * same (*end) pointer. + * WARNING: This behavior is different from the standard strtoul/strtoumax(3). + */ +enum asn_strtox_result_e +asn_strtoumax_lim(const char *str, const char **end, uintmax_t *uintp) { + uintmax_t value; + + const uintmax_t asn1_uintmax_max = ((~(uintmax_t)0)); + const uintmax_t upper_boundary = asn1_uintmax_max / 10; + uintmax_t last_digit_max = asn1_uintmax_max % 10; + + if(str >= *end) return ASN_STRTOX_ERROR_INVAL; + + switch(*str) { + case '-': + return ASN_STRTOX_ERROR_INVAL; + case '+': + str++; + if(str >= *end) { + *end = str; + return ASN_STRTOX_EXPECT_MORE; + } + } + + for(value = 0; str < (*end); str++) { + if(*str >= 0x30 && *str <= 0x39) { + unsigned int d = *str - '0'; + if(value < upper_boundary) { + value = value * 10 + d; + } else if(value == upper_boundary) { + if(d <= last_digit_max) { + value = value * 10 + d; + str += 1; + if(str < *end) { + // If digits continue, we're guaranteed out of range. + *end = str; + if(*str >= 0x30 && *str <= 0x39) { + return ASN_STRTOX_ERROR_RANGE; + } else { + *uintp = value; + return ASN_STRTOX_EXTRA_DATA; + } + } + break; + } else { + *end = str; + return ASN_STRTOX_ERROR_RANGE; + } + } else { + *end = str; + return ASN_STRTOX_ERROR_RANGE; + } + } else { + *end = str; + *uintp = value; + return ASN_STRTOX_EXTRA_DATA; + } + } + + *end = str; + *uintp = value; + return ASN_STRTOX_OK; +} + +enum asn_strtox_result_e +asn_strtol_lim(const char *str, const char **end, long *lp) { + intmax_t value; + switch(asn_strtoimax_lim(str, end, &value)) { + case ASN_STRTOX_ERROR_RANGE: + return ASN_STRTOX_ERROR_RANGE; + case ASN_STRTOX_ERROR_INVAL: + return ASN_STRTOX_ERROR_INVAL; + case ASN_STRTOX_EXPECT_MORE: + return ASN_STRTOX_EXPECT_MORE; + case ASN_STRTOX_OK: + if(value >= LONG_MIN && value <= LONG_MAX) { + *lp = value; + return ASN_STRTOX_OK; + } else { + return ASN_STRTOX_ERROR_RANGE; + } + case ASN_STRTOX_EXTRA_DATA: + if(value >= LONG_MIN && value <= LONG_MAX) { + *lp = value; + return ASN_STRTOX_EXTRA_DATA; + } else { + return ASN_STRTOX_ERROR_RANGE; + } + } + + assert(!"Unreachable"); + return ASN_STRTOX_ERROR_INVAL; +} + +enum asn_strtox_result_e +asn_strtoul_lim(const char *str, const char **end, unsigned long *ulp) { + uintmax_t value; + switch(asn_strtoumax_lim(str, end, &value)) { + case ASN_STRTOX_ERROR_RANGE: + return ASN_STRTOX_ERROR_RANGE; + case ASN_STRTOX_ERROR_INVAL: + return ASN_STRTOX_ERROR_INVAL; + case ASN_STRTOX_EXPECT_MORE: + return ASN_STRTOX_EXPECT_MORE; + case ASN_STRTOX_OK: + if(value <= ULONG_MAX) { + *ulp = value; + return ASN_STRTOX_OK; + } else { + return ASN_STRTOX_ERROR_RANGE; + } + case ASN_STRTOX_EXTRA_DATA: + if(value <= ULONG_MAX) { + *ulp = value; + return ASN_STRTOX_EXTRA_DATA; + } else { + return ASN_STRTOX_ERROR_RANGE; + } + } + + assert(!"Unreachable"); + return ASN_STRTOX_ERROR_INVAL; +} + +int +INTEGER_compare(const asn_TYPE_descriptor_t *td, const void *aptr, + const void *bptr) { + const INTEGER_t *a = aptr; + const INTEGER_t *b = bptr; + + (void)td; + + if(a && b) { + if(a->size && b->size) { + int sign_a = (a->buf[0] & 0x80) ? -1 : 1; + int sign_b = (b->buf[0] & 0x80) ? -1 : 1; + + if(sign_a < sign_b) return -1; + if(sign_a > sign_b) return 1; + + /* The shortest integer wins, unless comparing negatives */ + if(a->size < b->size) { + return -1 * sign_a; + } else if(a->size > b->size) { + return 1 * sign_b; + } + + return sign_a * memcmp(a->buf, b->buf, a->size); + } else if(a->size) { + int sign = (a->buf[0] & 0x80) ? -1 : 1; + return (1) * sign; + } else if(b->size) { + int sign = (a->buf[0] & 0x80) ? -1 : 1; + return (-1) * sign; + } else { + return 0; + } + } else if(!a && !b) { + return 0; + } else if(!a) { + return -1; + } else { + return 1; + } + +} diff --git a/certgen/asncodec/INTEGER.h b/certgen/asncodec/INTEGER.h index 94a455e..1666e0b 100644 --- a/certgen/asncodec/INTEGER.h +++ b/certgen/asncodec/INTEGER.h @@ -1,104 +1,139 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _INTEGER_H_ -#define _INTEGER_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; - -extern asn_TYPE_descriptor_t asn_DEF_INTEGER; -extern asn_TYPE_operation_t asn_OP_INTEGER; - -/* Map with to integer value association */ -typedef struct asn_INTEGER_enum_map_s { - long nat_value; /* associated native integer value */ - size_t enum_len; /* strlen("tag") */ - const char *enum_name; /* "tag" */ -} asn_INTEGER_enum_map_t; - -/* This type describes an enumeration for INTEGER and ENUMERATED types */ -typedef struct asn_INTEGER_specifics_s { - const asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ - const unsigned int *enum2value; /* "tag" => N; sorted by tag */ - int map_count; /* Elements in either map */ - int extension; /* This map is extensible */ - int strict_enumeration; /* Enumeration set is fixed */ - int field_width; /* Size of native integer */ - int field_unsigned; /* Signed=0, unsigned=1 */ -} asn_INTEGER_specifics_t; - -#define INTEGER_free ASN__PRIMITIVE_TYPE_free -#define INTEGER_decode_ber ber_decode_primitive -#define INTEGER_constraint asn_generic_no_constraint -asn_struct_print_f INTEGER_print; -asn_struct_compare_f INTEGER_compare; -der_type_encoder_f INTEGER_encode_der; -xer_type_decoder_f INTEGER_decode_xer; -xer_type_encoder_f INTEGER_encode_xer; -oer_type_decoder_f INTEGER_decode_oer; -oer_type_encoder_f INTEGER_encode_oer; -per_type_decoder_f INTEGER_decode_uper; -per_type_encoder_f INTEGER_encode_uper; -asn_random_fill_f INTEGER_random_fill; - -/*********************************** - * Some handy conversion routines. * - ***********************************/ - -/* - * Natiwe size-independent conversion of native integers to/from INTEGER. - * (l_size) is in bytes. - * Returns 0 if it was possible to convert, -1 otherwise. - * -1/EINVAL: Mandatory argument missing - * -1/ERANGE: Value encoded is out of range for long representation - * -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()). - */ -int asn_INTEGER2imax(const INTEGER_t *i, intmax_t *l); -int asn_INTEGER2umax(const INTEGER_t *i, uintmax_t *l); -int asn_imax2INTEGER(INTEGER_t *i, intmax_t l); -int asn_umax2INTEGER(INTEGER_t *i, uintmax_t l); - -/* - * Size-specific conversion helpers. - */ -int asn_INTEGER2long(const INTEGER_t *i, long *l); -int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); -int asn_long2INTEGER(INTEGER_t *i, long l); -int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); - -/* A version of strtol/strtoimax(3) with nicer error reporting. */ -enum asn_strtox_result_e { - ASN_STRTOX_ERROR_RANGE = -3, /* Input outside of supported numeric range */ - ASN_STRTOX_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */ - ASN_STRTOX_EXPECT_MORE = -1, /* More data expected (e.g. "+") */ - ASN_STRTOX_OK = 0, /* Conversion succeded, number ends at (*end) */ - ASN_STRTOX_EXTRA_DATA = 1 /* Conversion succeded, but the string has extra stuff */ -}; -enum asn_strtox_result_e asn_strtol_lim(const char *str, const char **end, - long *l); -enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end, - unsigned long *l); -enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end, - intmax_t *l); -enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end, - uintmax_t *l); - -/* - * Convert the integer value into the corresponding enumeration map entry. - */ -const asn_INTEGER_enum_map_t *INTEGER_map_value2enum( - const asn_INTEGER_specifics_t *specs, long value); - -#ifdef __cplusplus -} -#endif - -#endif /* _INTEGER_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _INTEGER_H_ +#define _INTEGER_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; + +extern asn_TYPE_descriptor_t asn_DEF_INTEGER; +extern asn_TYPE_operation_t asn_OP_INTEGER; + +/* Map with to integer value association */ +typedef struct asn_INTEGER_enum_map_s { + long nat_value; /* associated native integer value */ + size_t enum_len; /* strlen("tag") */ + const char *enum_name; /* "tag" */ +} asn_INTEGER_enum_map_t; + +/* This type describes an enumeration for INTEGER and ENUMERATED types */ +typedef struct asn_INTEGER_specifics_s { + const asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ + const unsigned int *enum2value; /* "tag" => N; sorted by tag */ + int map_count; /* Elements in either map */ + int extension; /* This map is extensible */ + int strict_enumeration; /* Enumeration set is fixed */ + int field_width; /* Size of native integer */ + int field_unsigned; /* Signed=0, unsigned=1 */ +} asn_INTEGER_specifics_t; + +ssize_t INTEGER__dump(const asn_TYPE_descriptor_t *td, + const INTEGER_t *st, + asn_app_consume_bytes_f *cb, + void *app_key, int plainOrXER); + +#define INTEGER_free ASN__PRIMITIVE_TYPE_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f INTEGER_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f INTEGER_compare; + +#define INTEGER_constraint asn_generic_no_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define INTEGER_decode_ber ber_decode_primitive +der_type_encoder_f INTEGER_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f INTEGER_decode_xer; +xer_type_encoder_f INTEGER_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f INTEGER_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f INTEGER_decode_oer; +oer_type_encoder_f INTEGER_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f INTEGER_decode_uper; +per_type_encoder_f INTEGER_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f INTEGER_decode_aper; +per_type_encoder_f INTEGER_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f INTEGER_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +/*********************************** + * Some handy conversion routines. * + ***********************************/ + +/* + * Natiwe size-independent conversion of native integers to/from INTEGER. + * (l_size) is in bytes. + * Returns 0 if it was possible to convert, -1 otherwise. + * -1/EINVAL: Mandatory argument missing + * -1/ERANGE: Value encoded is out of range for long representation + * -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()). + */ +int asn_INTEGER2imax(const INTEGER_t *i, intmax_t *l); +int asn_INTEGER2umax(const INTEGER_t *i, uintmax_t *l); +int asn_imax2INTEGER(INTEGER_t *i, intmax_t l); +int asn_umax2INTEGER(INTEGER_t *i, uintmax_t l); + +/* + * Size-specific conversion helpers. + */ +int asn_INTEGER2long(const INTEGER_t *i, long *l); +int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); +int asn_long2INTEGER(INTEGER_t *i, long l); +int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); +int asn_int642INTEGER(INTEGER_t *i, int64_t l); +int asn_uint642INTEGER(INTEGER_t *i, uint64_t l); + +/* A version of strtol/strtoimax(3) with nicer error reporting. */ +enum asn_strtox_result_e { + ASN_STRTOX_ERROR_RANGE = -3, /* Input outside of supported numeric range */ + ASN_STRTOX_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */ + ASN_STRTOX_EXPECT_MORE = -1, /* More data expected (e.g. "+") */ + ASN_STRTOX_OK = 0, /* Conversion succeeded, number ends at (*end) */ + ASN_STRTOX_EXTRA_DATA = 1 /* Conversion succeeded, but the string has extra stuff */ +}; +enum asn_strtox_result_e asn_strtol_lim(const char *str, const char **end, + long *l); +enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end, + unsigned long *l); +enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end, + intmax_t *l); +enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end, + uintmax_t *l); + +/* + * Convert the integer value into the corresponding enumeration map entry. + */ +const asn_INTEGER_enum_map_t *INTEGER_map_value2enum( + const asn_INTEGER_specifics_t *specs, long value); + +#ifdef __cplusplus +} +#endif + +#endif /* _INTEGER_H_ */ diff --git a/certgen/asncodec/INTEGER_oer.c b/certgen/asncodec/INTEGER_oer.c index 10cbe9d..19f276d 100644 --- a/certgen/asncodec/INTEGER_oer.c +++ b/certgen/asncodec/INTEGER_oer.c @@ -1,179 +1,174 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include - -asn_dec_rval_t -INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **sptr, - const void *ptr, size_t size) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval = {RC_OK, 0}; - INTEGER_t *st = (INTEGER_t *)*sptr; - struct asn_oer_constraint_number_s ct = {0, 0}; - size_t req_bytes; - - (void)opt_codec_ctx; - (void)specs; - - if(!st) { - st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st))); - if(!st) ASN__DECODE_FAILED; - } - - FREEMEM(st->buf); - st->buf = 0; - st->size = 0; - - if(!constraints) constraints = td->encoding_constraints.oer_constraints; - if(constraints) ct = constraints->value; - - if(ct.width) { - req_bytes = ct.width; - } else { - /* No lower bound and no upper bound, effectively */ - - ssize_t consumed = oer_fetch_length(ptr, size, &req_bytes); - if(consumed == 0) { - ASN__DECODE_STARVED; - } else if(consumed == -1) { - ASN__DECODE_FAILED; - } - rval.consumed += consumed; - ptr = (const char *)ptr + consumed; - size -= consumed; - } - - if(req_bytes > size) { - ASN__DECODE_STARVED; - } - - if(ct.positive) { - /* X.969 08/2015 10.2(a) */ - unsigned msb; /* Most significant bit */ - size_t useful_size; - - /* Check most significant bit */ - msb = *(const uint8_t *)ptr >> 7; /* yields 0 or 1 */ - useful_size = msb + req_bytes; - st->buf = (uint8_t *)MALLOC(useful_size + 1); - if(!st->buf) { - ASN__DECODE_FAILED; - } - - /* - * Record a large unsigned in a way not to confuse it - * with signed value. - */ - st->buf[0] = '\0'; - memcpy(st->buf + msb, ptr, req_bytes); - st->buf[useful_size] = '\0'; /* Just in case, 0-terminate */ - st->size = useful_size; - - rval.consumed += req_bytes; - return rval; - } else { - /* X.969 08/2015 10.2(b) */ - st->buf = (uint8_t *)MALLOC(req_bytes + 1); - if(!st->buf) { - ASN__DECODE_FAILED; - } - - memcpy(st->buf, ptr, req_bytes); - st->buf[req_bytes] = '\0'; /* Just in case, 0-terminate */ - st->size = req_bytes; - - rval.consumed += req_bytes; - return rval; - } -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -INTEGER_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - const INTEGER_t *st = sptr; - asn_enc_rval_t er; - struct asn_oer_constraint_number_s ct = {0, 0}; - const uint8_t *buf; - const uint8_t *end; - size_t useful_bytes; - size_t req_bytes = 0; - int sign = 0; - - if(!st || st->size == 0) ASN__ENCODE_FAILED; - - if(!constraints) constraints = td->encoding_constraints.oer_constraints; - if(constraints) ct = constraints->value; - - er.encoded = 0; - - buf = st->buf; - end = buf + st->size; - - sign = (buf && buf < end) ? buf[0] & 0x80 : 0; - - /* Ignore 9 leading zeroes or ones */ - if(ct.positive) { - if(sign) { - /* The value given is a signed value. Can't proceed. */ - ASN__ENCODE_FAILED; - } - /* Remove leading zeros. */ - for(; buf + 1 < end; buf++) { - if(buf[0] != 0x0) break; - } - } else { - for(; buf + 1 < end; buf++) { - if(buf[0] == 0x0 && (buf[1] & 0x80) == 0) { - continue; - } else if(buf[0] == 0xff && (buf[1] & 0x80) != 0) { - continue; - } - break; - } - } - - useful_bytes = end - buf; - if(ct.width) { - req_bytes = ct.width; - } else { - ssize_t r = oer_serialize_length(useful_bytes, cb, app_key); - if(r < 0) { - ASN__ENCODE_FAILED; - } - er.encoded += r; - req_bytes = useful_bytes; - } - - if(req_bytes < useful_bytes) { - ASN__ENCODE_FAILED; - } - - er.encoded += req_bytes; - - for(; req_bytes > useful_bytes; req_bytes--) { - if(cb(sign?"\xff":"\0", 1, app_key) < 0) { - ASN__ENCODE_FAILED; - } - } - - if(cb(buf, useful_bytes, app_key) < 0) { - ASN__ENCODE_FAILED; - } - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_dec_rval_t +INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **sptr, + const void *ptr, size_t size) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval = {RC_OK, 0}; + INTEGER_t *st = (INTEGER_t *)*sptr; + struct asn_oer_constraint_number_s ct = {0, 0}; + size_t req_bytes; + + (void)opt_codec_ctx; + (void)specs; + + if(!st) { + st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st))); + if(!st) ASN__DECODE_FAILED; + } + + FREEMEM(st->buf); + st->buf = 0; + st->size = 0; + + if(!constraints) constraints = td->encoding_constraints.oer_constraints; + if(constraints) ct = constraints->value; + + if(ct.width) { + req_bytes = ct.width; + } else { + /* No lower bound and no upper bound, effectively */ + + ssize_t consumed = oer_fetch_length(ptr, size, &req_bytes); + if(consumed == 0) { + ASN__DECODE_STARVED; + } else if(consumed == -1) { + ASN__DECODE_FAILED; + } + rval.consumed += consumed; + ptr = (const char *)ptr + consumed; + size -= consumed; + } + + if(req_bytes > size) { + ASN__DECODE_STARVED; + } + + if(ct.positive) { + /* X.969 08/2015 10.2(a) */ + unsigned msb; /* Most significant bit */ + size_t useful_size; + + /* Check most significant bit */ + msb = *(const uint8_t *)ptr >> 7; /* yields 0 or 1 */ + useful_size = msb + req_bytes; + st->buf = (uint8_t *)MALLOC(useful_size + 1); + if(!st->buf) { + ASN__DECODE_FAILED; + } + + /* + * Record a large unsigned in a way not to confuse it + * with signed value. + */ + st->buf[0] = '\0'; + memcpy(st->buf + msb, ptr, req_bytes); + st->buf[useful_size] = '\0'; /* Just in case, 0-terminate */ + st->size = useful_size; + + rval.consumed += req_bytes; + return rval; + } else { + /* X.969 08/2015 10.2(b) */ + st->buf = (uint8_t *)MALLOC(req_bytes + 1); + if(!st->buf) { + ASN__DECODE_FAILED; + } + + memcpy(st->buf, ptr, req_bytes); + st->buf[req_bytes] = '\0'; /* Just in case, 0-terminate */ + st->size = req_bytes; + + rval.consumed += req_bytes; + return rval; + } +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +INTEGER_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + const INTEGER_t *st = sptr; + asn_enc_rval_t er = {0,0,0}; + struct asn_oer_constraint_number_s ct = {0, 0}; + const uint8_t *buf; + const uint8_t *end; + size_t useful_bytes; + size_t req_bytes = 0; + int sign = 0; + + if(!st || st->size == 0) ASN__ENCODE_FAILED; + + if(!constraints) constraints = td->encoding_constraints.oer_constraints; + if(constraints) ct = constraints->value; + + er.encoded = 0; + + buf = st->buf; + end = buf + st->size; + + sign = (buf && buf < end) ? buf[0] & 0x80 : 0; + + /* Ignore 9 leading zeroes or ones */ + if(ct.positive) { + if(sign) { + /* The value given is a signed value. Can't proceed. */ + ASN__ENCODE_FAILED; + } + /* Remove leading zeros. */ + for(; buf + 1 < end; buf++) { + if(buf[0] != 0x0) break; + } + } else { + for(; buf + 1 < end; buf++) { + if(buf[0] == 0x0 && (buf[1] & 0x80) == 0) { + continue; + } else if(buf[0] == 0xff && (buf[1] & 0x80) != 0) { + continue; + } + break; + } + } + + useful_bytes = end - buf; + if(ct.width) { + req_bytes = ct.width; + } else { + ssize_t r = oer_serialize_length(useful_bytes, cb, app_key); + if(r < 0) { + ASN__ENCODE_FAILED; + } + er.encoded += r; + req_bytes = useful_bytes; + } + + if(req_bytes < useful_bytes) { + ASN__ENCODE_FAILED; + } + + er.encoded += req_bytes; + + for(; req_bytes > useful_bytes; req_bytes--) { + if(cb(sign?"\xff":"\0", 1, app_key) < 0) { + ASN__ENCODE_FAILED; + } + } + + if(cb(buf, useful_bytes, app_key) < 0) { + ASN__ENCODE_FAILED; + } + + ASN__ENCODED_OK(er); +} diff --git a/certgen/asncodec/INTEGER_print.c b/certgen/asncodec/INTEGER_print.c new file mode 100644 index 0000000..2d37dee --- /dev/null +++ b/certgen/asncodec/INTEGER_print.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * INTEGER specific human-readable output. + */ +int +INTEGER_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + const INTEGER_t *st = (const INTEGER_t *)sptr; + ssize_t ret; + + (void)ilevel; + + if(!st || !st->buf) + ret = cb("", 8, app_key); + else + ret = INTEGER__dump(td, st, cb, app_key, 0); + + return (ret < 0) ? -1 : 0; +} diff --git a/certgen/asncodec/INTEGER_xer.c b/certgen/asncodec/INTEGER_xer.c new file mode 100644 index 0000000..4f21c86 --- /dev/null +++ b/certgen/asncodec/INTEGER_xer.c @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +struct e2v_key { + const char *start; + const char *stop; + const asn_INTEGER_enum_map_t *vemap; + const unsigned int *evmap; +}; +static int +INTEGER__compar_enum2value(const void *kp, const void *am) { + const struct e2v_key *key = (const struct e2v_key *)kp; + const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; + const char *ptr, *end, *name; + + /* Remap the element (sort by different criterion) */ + el = key->vemap + key->evmap[el - key->vemap]; + + /* Compare strings */ + for(ptr = key->start, end = key->stop, name = el->enum_name; + ptr < end; ptr++, name++) { + if(*ptr != *name || !*name) + return *(const unsigned char *)ptr - *(const unsigned char *)name; + } + return name[0] ? -1 : 0; +} + +static const asn_INTEGER_enum_map_t * +INTEGER_map_enum2value(const asn_INTEGER_specifics_t *specs, const char *lstart, + const char *lstop) { + const asn_INTEGER_enum_map_t *el_found; + int count = specs ? specs->map_count : 0; + struct e2v_key key; + const char *lp; + + if(!count) return NULL; + + /* Guaranteed: assert(lstart < lstop); */ + /* Figure out the tag name */ + for(lstart++, lp = lstart; lp < lstop; lp++) { + switch(*lp) { + case 9: case 10: case 11: case 12: case 13: case 32: /* WSP */ + case 0x2f: /* '/' */ case 0x3e: /* '>' */ + break; + default: + continue; + } + break; + } + if(lp == lstop) return NULL; /* No tag found */ + lstop = lp; + + key.start = lstart; + key.stop = lstop; + key.vemap = specs->value2enum; + key.evmap = specs->enum2value; + el_found = (asn_INTEGER_enum_map_t *)bsearch(&key, + specs->value2enum, count, sizeof(specs->value2enum[0]), + INTEGER__compar_enum2value); + if(el_found) { + /* Remap enum2value into value2enum */ + el_found = key.vemap + key.evmap[el_found - key.vemap]; + } + return el_found; +} + +static int +INTEGER_st_prealloc(INTEGER_t *st, int min_size) { + void *p = MALLOC(min_size + 1); + if(p) { + void *b = st->buf; + st->size = 0; + st->buf = p; + FREEMEM(b); + return 0; + } else { + return -1; + } +} + +/* + * Decode the chunk of XML text encoding INTEGER. + */ +static enum xer_pbd_rval +INTEGER__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, + const void *chunk_buf, size_t chunk_size) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + INTEGER_t *st = (INTEGER_t *)sptr; + intmax_t dec_value; + intmax_t hex_value = 0; + const char *lp; + const char *lstart = (const char *)chunk_buf; + const char *lstop = lstart + chunk_size; + enum { + ST_LEADSPACE, + ST_SKIPSPHEX, + ST_WAITDIGITS, + ST_DIGITS, + ST_DIGITS_TRAILSPACE, + ST_HEXDIGIT1, + ST_HEXDIGIT2, + ST_HEXDIGITS_TRAILSPACE, + ST_HEXCOLON, + ST_END_ENUM, + ST_UNEXPECTED + } state = ST_LEADSPACE; + const char *dec_value_start = 0; /* INVARIANT: always !0 in ST_DIGITS */ + const char *dec_value_end = 0; + + if(chunk_size) + ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x", + (long)chunk_size, *lstart, lstop[-1]); + + if(INTEGER_st_prealloc(st, (chunk_size/3) + 1)) + return XPBD_SYSTEM_FAILURE; + + /* + * We may have received a tag here. It will be processed inline. + * Use strtoul()-like code and serialize the result. + */ + for(lp = lstart; lp < lstop; lp++) { + int lv = *lp; + switch(lv) { + case 0x09: case 0x0a: case 0x0d: case 0x20: + switch(state) { + case ST_LEADSPACE: + case ST_DIGITS_TRAILSPACE: + case ST_HEXDIGITS_TRAILSPACE: + case ST_SKIPSPHEX: + continue; + case ST_DIGITS: + dec_value_end = lp; + state = ST_DIGITS_TRAILSPACE; + continue; + case ST_HEXCOLON: + state = ST_HEXDIGITS_TRAILSPACE; + continue; + default: + break; + } + break; + case 0x2d: /* '-' */ + if(state == ST_LEADSPACE) { + dec_value = 0; + dec_value_start = lp; + state = ST_WAITDIGITS; + continue; + } + break; + case 0x2b: /* '+' */ + if(state == ST_LEADSPACE) { + dec_value = 0; + dec_value_start = lp; + state = ST_WAITDIGITS; + continue; + } + break; + case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: + case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: + switch(state) { + case ST_DIGITS: continue; + case ST_SKIPSPHEX: /* Fall through */ + case ST_HEXDIGIT1: + hex_value = (lv - 0x30) << 4; + state = ST_HEXDIGIT2; + continue; + case ST_HEXDIGIT2: + hex_value += (lv - 0x30); + state = ST_HEXCOLON; + st->buf[st->size++] = (uint8_t)hex_value; + continue; + case ST_HEXCOLON: + return XPBD_BROKEN_ENCODING; + case ST_LEADSPACE: + dec_value = 0; + dec_value_start = lp; + /* FALL THROUGH */ + case ST_WAITDIGITS: + state = ST_DIGITS; + continue; + default: + break; + } + break; + case 0x3c: /* '<', start of XML encoded enumeration */ + if(state == ST_LEADSPACE) { + const asn_INTEGER_enum_map_t *el; + el = INTEGER_map_enum2value( + (const asn_INTEGER_specifics_t *) + td->specifics, lstart, lstop); + if(el) { + ASN_DEBUG("Found \"%s\" => %ld", + el->enum_name, el->nat_value); + dec_value = el->nat_value; + state = ST_END_ENUM; + lp = lstop - 1; + continue; + } + ASN_DEBUG("Unknown identifier for INTEGER"); + } + return XPBD_BROKEN_ENCODING; + case 0x3a: /* ':' */ + if(state == ST_HEXCOLON) { + /* This colon is expected */ + state = ST_HEXDIGIT1; + continue; + } else if(state == ST_DIGITS) { + /* The colon here means that we have + * decoded the first two hexadecimal + * places as a decimal value. + * Switch decoding mode. */ + ASN_DEBUG("INTEGER re-evaluate as hex form"); + state = ST_SKIPSPHEX; + dec_value_start = 0; + lp = lstart - 1; + continue; + } else { + ASN_DEBUG("state %d at %ld", state, (long)(lp - lstart)); + break; + } + /* [A-Fa-f] */ + case 0x41:case 0x42:case 0x43:case 0x44:case 0x45:case 0x46: + case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:case 0x66: + switch(state) { + case ST_SKIPSPHEX: + case ST_LEADSPACE: /* Fall through */ + case ST_HEXDIGIT1: + hex_value = lv - ((lv < 0x61) ? 0x41 : 0x61); + hex_value += 10; + hex_value <<= 4; + state = ST_HEXDIGIT2; + continue; + case ST_HEXDIGIT2: + hex_value += lv - ((lv < 0x61) ? 0x41 : 0x61); + hex_value += 10; + st->buf[st->size++] = (uint8_t)hex_value; + state = ST_HEXCOLON; + continue; + case ST_DIGITS: + ASN_DEBUG("INTEGER re-evaluate as hex form"); + state = ST_SKIPSPHEX; + dec_value_start = 0; + lp = lstart - 1; + continue; + default: + break; + } + break; + } + + /* Found extra non-numeric stuff */ + ASN_DEBUG("INTEGER :: Found non-numeric 0x%2x at %ld", + lv, (long)(lp - lstart)); + state = ST_UNEXPECTED; + break; + } + + switch(state) { + case ST_END_ENUM: + /* Got a complete and valid enumeration encoded as a tag. */ + break; + case ST_DIGITS: + dec_value_end = lstop; + /* FALL THROUGH */ + case ST_DIGITS_TRAILSPACE: + /* The last symbol encountered was a digit. */ + switch(asn_strtoimax_lim(dec_value_start, &dec_value_end, &dec_value)) { + case ASN_STRTOX_OK: + if(specs && specs->field_unsigned && (uintmax_t) dec_value <= ULONG_MAX) { + break; + } else if(dec_value >= LONG_MIN && dec_value <= LONG_MAX) { + break; + } else { + /* + * We model INTEGER on long for XER, + * to avoid rewriting all the tests at once. + */ + ASN_DEBUG("INTEGER exceeds long range"); + } + /* Fall through */ + case ASN_STRTOX_ERROR_RANGE: + ASN_DEBUG("INTEGER decode %s hit range limit", td->name); + return XPBD_DECODER_LIMIT; + case ASN_STRTOX_ERROR_INVAL: + case ASN_STRTOX_EXPECT_MORE: + case ASN_STRTOX_EXTRA_DATA: + return XPBD_BROKEN_ENCODING; + } + break; + case ST_HEXCOLON: + case ST_HEXDIGITS_TRAILSPACE: + st->buf[st->size] = 0; /* Just in case termination */ + return XPBD_BODY_CONSUMED; + case ST_HEXDIGIT1: + case ST_HEXDIGIT2: + case ST_SKIPSPHEX: + return XPBD_BROKEN_ENCODING; + case ST_LEADSPACE: + /* Content not found */ + return XPBD_NOT_BODY_IGNORE; + case ST_WAITDIGITS: + case ST_UNEXPECTED: + ASN_DEBUG("INTEGER: No useful digits (state %d)", state); + return XPBD_BROKEN_ENCODING; /* No digits */ + } + + /* + * Convert the result of parsing of enumeration or a straight + * decimal value into a BER representation. + */ + if(asn_imax2INTEGER(st, dec_value)) { + ASN_DEBUG("INTEGER decode %s conversion failed", td->name); + return XPBD_SYSTEM_FAILURE; + } + + return XPBD_BODY_CONSUMED; +} + +asn_dec_rval_t +INTEGER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, size_t size) { + return xer_decode_primitive(opt_codec_ctx, td, + sptr, sizeof(INTEGER_t), opt_mname, + buf_ptr, size, INTEGER__xer_body_decode); +} + +asn_enc_rval_t +INTEGER_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + const INTEGER_t *st = (const INTEGER_t *)sptr; + asn_enc_rval_t er = {0,0,0}; + + (void)ilevel; + (void)flags; + + if(!st || !st->buf) + ASN__ENCODE_FAILED; + + er.encoded = INTEGER__dump(td, st, cb, app_key, 1); + if(er.encoded < 0) ASN__ENCODE_FAILED; + + ASN__ENCODED_OK(er); +} diff --git a/certgen/asncodec/IValue.c b/certgen/asncodec/IValue.c index 6314d04..cd7ad06 100644 --- a/certgen/asncodec/IValue.c +++ b/certgen/asncodec/IValue.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "IValue.h" @@ -36,9 +36,11 @@ IValue_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using Uint16, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_IValue_constr_1 CC_NOTUSED = { { 2, 1 } /* (0..65535) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_IValue_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_IValue = { asn_DEF_IValue_tags_1, /* Same as above */ sizeof(asn_DEF_IValue_tags_1) /sizeof(asn_DEF_IValue_tags_1[0]), /* 1 */ - { &asn_OER_type_IValue_constr_1, 0, IValue_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_IValue_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + IValue_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/IValue.h b/certgen/asncodec/IValue.h index efb13fc..cdc0a18 100644 --- a/certgen/asncodec/IValue.h +++ b/certgen/asncodec/IValue.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Uint16.h" #ifndef _IValue_H_ #define _IValue_H_ #include -/* Including external dependencies */ -#include "Uint16.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_IValue; asn_struct_free_f IValue_free; asn_struct_print_f IValue_print; asn_constr_check_f IValue_constraint; -ber_type_decoder_f IValue_decode_ber; -der_type_encoder_f IValue_encode_der; xer_type_decoder_f IValue_decode_xer; xer_type_encoder_f IValue_encode_xer; oer_type_decoder_f IValue_decode_oer; diff --git a/certgen/asncodec/IcaSsp.c b/certgen/asncodec/IcaSsp.c new file mode 100644 index 0000000..8cd5478 --- /dev/null +++ b/certgen/asncodec/IcaSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "IcaSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_IcaSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct IcaSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_IcaSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_IcaSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_IcaSsp_specs_1 = { + sizeof(struct IcaSsp), + offsetof(struct IcaSsp, _asn_ctx), + asn_MAP_IcaSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_IcaSsp = { + "IcaSsp", + "IcaSsp", + &asn_OP_SEQUENCE, + asn_DEF_IcaSsp_tags_1, + sizeof(asn_DEF_IcaSsp_tags_1) + /sizeof(asn_DEF_IcaSsp_tags_1[0]), /* 1 */ + asn_DEF_IcaSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_IcaSsp_tags_1) + /sizeof(asn_DEF_IcaSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_IcaSsp_1, + 1, /* Elements count */ + &asn_SPC_IcaSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/IcaSsp.h b/certgen/asncodec/IcaSsp.h new file mode 100644 index 0000000..bbed1a1 --- /dev/null +++ b/certgen/asncodec/IcaSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _IcaSsp_H_ +#define _IcaSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* IcaSsp */ +typedef struct IcaSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} IcaSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_IcaSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_IcaSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_IcaSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _IcaSsp_H_ */ +#include diff --git a/certgen/asncodec/IdentifiedRegion.c b/certgen/asncodec/IdentifiedRegion.c index 59b9b93..73cafb4 100644 --- a/certgen/asncodec/IdentifiedRegion.c +++ b/certgen/asncodec/IdentifiedRegion.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "IdentifiedRegion.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_IdentifiedRegion_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_IdentifiedRegion_1[] = { { ATF_NOFLAGS, 0, offsetof(struct IdentifiedRegion, choice.countryOnly), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ - &asn_DEF_CountryOnly, + &asn_DEF_UnCountryId, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "countryOnly" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_IdentifiedRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CountryAndRegions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "countryAndRegions" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_IdentifiedRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CountryAndSubregions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "countryAndSubregions" }, @@ -62,7 +88,15 @@ asn_TYPE_descriptor_t asn_DEF_IdentifiedRegion = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_IdentifiedRegion_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_IdentifiedRegion_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_IdentifiedRegion_1, 3, /* Elements count */ &asn_SPC_IdentifiedRegion_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/IdentifiedRegion.h b/certgen/asncodec/IdentifiedRegion.h index 3c29982..cdc5414 100644 --- a/certgen/asncodec/IdentifiedRegion.h +++ b/certgen/asncodec/IdentifiedRegion.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _IdentifiedRegion_H_ -#define _IdentifiedRegion_H_ - - -#include /* Including external dependencies */ -#include "CountryOnly.h" +#include "UnCountryId.h" #include "CountryAndRegions.h" #include "CountryAndSubregions.h" #include +#ifndef _IdentifiedRegion_H_ +#define _IdentifiedRegion_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -35,7 +35,7 @@ typedef enum IdentifiedRegion_PR { typedef struct IdentifiedRegion { IdentifiedRegion_PR present; union IdentifiedRegion_u { - CountryOnly_t countryOnly; + UnCountryId_t countryOnly; CountryAndRegions_t countryAndRegions; CountryAndSubregions_t countryAndSubregions; /* diff --git a/certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.c b/certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.c new file mode 100644 index 0000000..771b84c --- /dev/null +++ b/certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609ContributedHeaderInfoExtension.h" + +/* + * This type is implemented using Ieee1609HeaderInfoExtensions, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_Ieee1609ContributedHeaderInfoExtension_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609ContributedHeaderInfoExtension = { + "Ieee1609ContributedHeaderInfoExtension", + "Ieee1609ContributedHeaderInfoExtension", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609ContributedHeaderInfoExtension_tags_1, + sizeof(asn_DEF_Ieee1609ContributedHeaderInfoExtension_tags_1) + /sizeof(asn_DEF_Ieee1609ContributedHeaderInfoExtension_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609ContributedHeaderInfoExtension_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609ContributedHeaderInfoExtension_tags_1) + /sizeof(asn_DEF_Ieee1609ContributedHeaderInfoExtension_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_Ieee1609HeaderInfoExtensions_4, + 2, /* Elements count */ + &asn_SPC_Ieee1609HeaderInfoExtensions_specs_4 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.h b/certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.h new file mode 100644 index 0000000..e670277 --- /dev/null +++ b/certgen/asncodec/Ieee1609ContributedHeaderInfoExtension.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Extension.h" +#ifndef _Ieee1609ContributedHeaderInfoExtension_H_ +#define _Ieee1609ContributedHeaderInfoExtension_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609ContributedHeaderInfoExtension */ +typedef Ieee1609HeaderInfoExtensions_t Ieee1609ContributedHeaderInfoExtension_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609ContributedHeaderInfoExtension; +asn_struct_free_f Ieee1609ContributedHeaderInfoExtension_free; +asn_struct_print_f Ieee1609ContributedHeaderInfoExtension_print; +asn_constr_check_f Ieee1609ContributedHeaderInfoExtension_constraint; +xer_type_decoder_f Ieee1609ContributedHeaderInfoExtension_decode_xer; +xer_type_encoder_f Ieee1609ContributedHeaderInfoExtension_encode_xer; +oer_type_decoder_f Ieee1609ContributedHeaderInfoExtension_decode_oer; +oer_type_encoder_f Ieee1609ContributedHeaderInfoExtension_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609ContributedHeaderInfoExtension_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Content.c b/certgen/asncodec/Ieee1609Dot2Content.c index 0769929..e95a0ca 100644 --- a/certgen/asncodec/Ieee1609Dot2Content.c +++ b/certgen/asncodec/Ieee1609Dot2Content.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Ieee1609Dot2Content.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Content_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_Ieee1609Dot2Content_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Ieee1609Dot2Content, choice.unsecuredData), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Opaque, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "unsecuredData" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_Ieee1609Dot2Content_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SignedData, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "signedData" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_Ieee1609Dot2Content_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EncryptedData, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "encryptedData" }, @@ -43,16 +69,42 @@ asn_TYPE_member_t asn_MBR_Ieee1609Dot2Content_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Opaque, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "signedCertificateRequest" }, + { ATF_NOFLAGS, 0, offsetof(struct Ieee1609Dot2Content, choice.signedX509CertificateRequest), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Opaque, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "signedX509CertificateRequest" + }, }; static const asn_TYPE_tag2member_t asn_MAP_Ieee1609Dot2Content_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* unsecuredData */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* signedData */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* encryptedData */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* signedCertificateRequest */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* signedCertificateRequest */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* signedX509CertificateRequest */ }; asn_CHOICE_specifics_t asn_SPC_Ieee1609Dot2Content_specs_1 = { sizeof(struct Ieee1609Dot2Content), @@ -60,7 +112,7 @@ asn_CHOICE_specifics_t asn_SPC_Ieee1609Dot2Content_specs_1 = { offsetof(struct Ieee1609Dot2Content, present), sizeof(((struct Ieee1609Dot2Content *)0)->present), asn_MAP_Ieee1609Dot2Content_tag2el_1, - 4, /* Count of tags in the map */ + 5, /* Count of tags in the map */ 0, 0, 4 /* Extensions start */ }; @@ -72,9 +124,17 @@ asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Content = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_Ieee1609Dot2Content_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Content_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_Ieee1609Dot2Content_1, - 4, /* Elements count */ + 5, /* Elements count */ &asn_SPC_Ieee1609Dot2Content_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/Ieee1609Dot2Content.h b/certgen/asncodec/Ieee1609Dot2Content.h index bfddbeb..5cec57c 100644 --- a/certgen/asncodec/Ieee1609Dot2Content.h +++ b/certgen/asncodec/Ieee1609Dot2Content.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _Ieee1609Dot2Content_H_ -#define _Ieee1609Dot2Content_H_ - - -#include /* Including external dependencies */ #include "Opaque.h" #include "EncryptedData.h" #include +#ifndef _Ieee1609Dot2Content_H_ +#define _Ieee1609Dot2Content_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -26,9 +26,9 @@ typedef enum Ieee1609Dot2Content_PR { Ieee1609Dot2Content_PR_unsecuredData, Ieee1609Dot2Content_PR_signedData, Ieee1609Dot2Content_PR_encryptedData, - Ieee1609Dot2Content_PR_signedCertificateRequest + Ieee1609Dot2Content_PR_signedCertificateRequest, /* Extensions may appear below */ - + Ieee1609Dot2Content_PR_signedX509CertificateRequest } Ieee1609Dot2Content_PR; /* Forward declarations */ @@ -46,6 +46,7 @@ typedef struct Ieee1609Dot2Content { * This type is extensible, * possible extensions are below. */ + Opaque_t signedX509CertificateRequest; } choice; /* Context for parsing across buffer boundaries */ @@ -55,7 +56,7 @@ typedef struct Ieee1609Dot2Content { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Content; extern asn_CHOICE_specifics_t asn_SPC_Ieee1609Dot2Content_specs_1; -extern asn_TYPE_member_t asn_MBR_Ieee1609Dot2Content_1[4]; +extern asn_TYPE_member_t asn_MBR_Ieee1609Dot2Content_1[5]; #ifdef __cplusplus } diff --git a/certgen/asncodec/Ieee1609Dot2Data-Encrypted.c b/certgen/asncodec/Ieee1609Dot2Data-Encrypted.c new file mode 100644 index 0000000..c4c4d57 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-Encrypted.c @@ -0,0 +1,229 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-Encrypted.h" + +int +Ieee1609Dot2Data_Encrypted_276P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +int +Ieee1609Dot2Data_Encrypted_276P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +int +Ieee1609Dot2Data_Encrypted_276P2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +int +Ieee1609Dot2Data_Encrypted_276P3_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Encrypted_276P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Encrypted_276P1_constr_2 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Encrypted_276P2_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Encrypted_276P3_constr_4 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P0 = { + "Ieee1609Dot2Data-Encrypted", + "Ieee1609Dot2Data-Encrypted", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Encrypted_276P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Encrypted_276P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Encrypted_276P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Encrypted_276P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P1_tags_2[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P1 = { + "Ieee1609Dot2Data-Encrypted", + "Ieee1609Dot2Data-Encrypted", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Encrypted_276P1_tags_2, + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P1_tags_2[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Encrypted_276P1_tags_2, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P1_tags_2[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Encrypted_276P1_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Encrypted_276P1_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P2_tags_3[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P2 = { + "Ieee1609Dot2Data-Encrypted", + "Ieee1609Dot2Data-Encrypted", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Encrypted_276P2_tags_3, + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P2_tags_3) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P2_tags_3[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Encrypted_276P2_tags_3, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P2_tags_3) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P2_tags_3[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Encrypted_276P2_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Encrypted_276P2_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P3_tags_4[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P3 = { + "Ieee1609Dot2Data-Encrypted", + "Ieee1609Dot2Data-Encrypted", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Encrypted_276P3_tags_4, + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P3_tags_4) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P3_tags_4[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Encrypted_276P3_tags_4, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P3_tags_4) + /sizeof(asn_DEF_Ieee1609Dot2Data_Encrypted_276P3_tags_4[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Encrypted_276P3_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Encrypted_276P3_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-Encrypted.h b/certgen/asncodec/Ieee1609Dot2Data-Encrypted.h new file mode 100644 index 0000000..afe40c4 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-Encrypted.h @@ -0,0 +1,66 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _Ieee1609Dot2Data_Encrypted_H_ +#define _Ieee1609Dot2Data_Encrypted_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-Encrypted */ +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Encrypted_276P0_t; +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Encrypted_276P1_t; +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Encrypted_276P2_t; +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Encrypted_276P3_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P0; +asn_struct_free_f Ieee1609Dot2Data_Encrypted_276P0_free; +asn_struct_print_f Ieee1609Dot2Data_Encrypted_276P0_print; +asn_constr_check_f Ieee1609Dot2Data_Encrypted_276P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P1; +asn_struct_free_f Ieee1609Dot2Data_Encrypted_276P1_free; +asn_struct_print_f Ieee1609Dot2Data_Encrypted_276P1_print; +asn_constr_check_f Ieee1609Dot2Data_Encrypted_276P1_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P1_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P1_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P1_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P1_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P2; +asn_struct_free_f Ieee1609Dot2Data_Encrypted_276P2_free; +asn_struct_print_f Ieee1609Dot2Data_Encrypted_276P2_print; +asn_constr_check_f Ieee1609Dot2Data_Encrypted_276P2_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P2_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P2_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P2_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P2_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Encrypted_276P3; +asn_struct_free_f Ieee1609Dot2Data_Encrypted_276P3_free; +asn_struct_print_f Ieee1609Dot2Data_Encrypted_276P3_print; +asn_constr_check_f Ieee1609Dot2Data_Encrypted_276P3_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P3_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P3_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Encrypted_276P3_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Encrypted_276P3_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_Encrypted_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.c b/certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.c new file mode 100644 index 0000000..3399c80 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-EncryptedSigned.h" + +int +Ieee1609Dot2Data_EncryptedSigned_379P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_EncryptedSigned_379P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0 = { + "Ieee1609Dot2Data-EncryptedSigned", + "Ieee1609Dot2Data-EncryptedSigned", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_EncryptedSigned_379P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_EncryptedSigned_379P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.h b/certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.h new file mode 100644 index 0000000..6d4b791 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-EncryptedSigned.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _Ieee1609Dot2Data_EncryptedSigned_H_ +#define _Ieee1609Dot2Data_EncryptedSigned_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-EncryptedSigned */ +typedef Ieee1609Dot2Data_Signed_228P0_t Ieee1609Dot2Data_EncryptedSigned_379P0_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_EncryptedSigned_379P0; +asn_struct_free_f Ieee1609Dot2Data_EncryptedSigned_379P0_free; +asn_struct_print_f Ieee1609Dot2Data_EncryptedSigned_379P0_print; +asn_constr_check_f Ieee1609Dot2Data_EncryptedSigned_379P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_EncryptedSigned_379P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_EncryptedSigned_379P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_EncryptedSigned_379P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_EncryptedSigned_379P0_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_EncryptedSigned_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-Signed.c b/certgen/asncodec/Ieee1609Dot2Data-Signed.c new file mode 100644 index 0000000..0945160 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-Signed.c @@ -0,0 +1,174 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-Signed.h" + +int +Ieee1609Dot2Data_Signed_228P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +int +Ieee1609Dot2Data_Signed_228P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +int +Ieee1609Dot2Data_Signed_228P2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Signed_228P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Signed_228P1_constr_2 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Signed_228P2_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Signed_228P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Signed_228P0 = { + "Ieee1609Dot2Data-Signed", + "Ieee1609Dot2Data-Signed", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Signed_228P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Signed_228P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Signed_228P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Signed_228P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Signed_228P1_tags_2[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Signed_228P1 = { + "Ieee1609Dot2Data-Signed", + "Ieee1609Dot2Data-Signed", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Signed_228P1_tags_2, + sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P1_tags_2[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Signed_228P1_tags_2, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P1_tags_2[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Signed_228P1_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Signed_228P1_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Signed_228P2_tags_3[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Signed_228P2 = { + "Ieee1609Dot2Data-Signed", + "Ieee1609Dot2Data-Signed", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Signed_228P2_tags_3, + sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P2_tags_3) + /sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P2_tags_3[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Signed_228P2_tags_3, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P2_tags_3) + /sizeof(asn_DEF_Ieee1609Dot2Data_Signed_228P2_tags_3[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Signed_228P2_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Signed_228P2_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-Signed.h b/certgen/asncodec/Ieee1609Dot2Data-Signed.h new file mode 100644 index 0000000..d66b518 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-Signed.h @@ -0,0 +1,57 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _Ieee1609Dot2Data_Signed_H_ +#define _Ieee1609Dot2Data_Signed_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-Signed */ +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Signed_228P0_t; +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Signed_228P1_t; +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Signed_228P2_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Signed_228P0; +asn_struct_free_f Ieee1609Dot2Data_Signed_228P0_free; +asn_struct_print_f Ieee1609Dot2Data_Signed_228P0_print; +asn_constr_check_f Ieee1609Dot2Data_Signed_228P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Signed_228P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Signed_228P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Signed_228P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Signed_228P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Signed_228P1; +asn_struct_free_f Ieee1609Dot2Data_Signed_228P1_free; +asn_struct_print_f Ieee1609Dot2Data_Signed_228P1_print; +asn_constr_check_f Ieee1609Dot2Data_Signed_228P1_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Signed_228P1_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Signed_228P1_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Signed_228P1_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Signed_228P1_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Signed_228P2; +asn_struct_free_f Ieee1609Dot2Data_Signed_228P2_free; +asn_struct_print_f Ieee1609Dot2Data_Signed_228P2_print; +asn_constr_check_f Ieee1609Dot2Data_Signed_228P2_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Signed_228P2_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Signed_228P2_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Signed_228P2_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Signed_228P2_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_Signed_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.c b/certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.c new file mode 100644 index 0000000..797733c --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.c @@ -0,0 +1,119 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-SignedCertRequest.h" + +int +Ieee1609Dot2Data_SignedCertRequest_290P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +int +Ieee1609Dot2Data_SignedCertRequest_290P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_SignedCertRequest_290P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_SignedCertRequest_290P1_constr_2 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0 = { + "Ieee1609Dot2Data-SignedCertRequest", + "Ieee1609Dot2Data-SignedCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_SignedCertRequest_290P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_SignedCertRequest_290P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1_tags_2[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1 = { + "Ieee1609Dot2Data-SignedCertRequest", + "Ieee1609Dot2Data-SignedCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1_tags_2, + sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1_tags_2[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1_tags_2, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1_tags_2[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_SignedCertRequest_290P1_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_SignedCertRequest_290P1_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.h b/certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.h new file mode 100644 index 0000000..6d0243d --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedCertRequest.h @@ -0,0 +1,48 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _Ieee1609Dot2Data_SignedCertRequest_H_ +#define _Ieee1609Dot2Data_SignedCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-SignedCertRequest */ +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_SignedCertRequest_290P0_t; +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_SignedCertRequest_290P1_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P0; +asn_struct_free_f Ieee1609Dot2Data_SignedCertRequest_290P0_free; +asn_struct_print_f Ieee1609Dot2Data_SignedCertRequest_290P0_print; +asn_constr_check_f Ieee1609Dot2Data_SignedCertRequest_290P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_SignedCertRequest_290P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_SignedCertRequest_290P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_SignedCertRequest_290P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_SignedCertRequest_290P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedCertRequest_290P1; +asn_struct_free_f Ieee1609Dot2Data_SignedCertRequest_290P1_free; +asn_struct_print_f Ieee1609Dot2Data_SignedCertRequest_290P1_print; +asn_constr_check_f Ieee1609Dot2Data_SignedCertRequest_290P1_constraint; +xer_type_decoder_f Ieee1609Dot2Data_SignedCertRequest_290P1_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_SignedCertRequest_290P1_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_SignedCertRequest_290P1_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_SignedCertRequest_290P1_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_SignedCertRequest_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.c b/certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.c new file mode 100644 index 0000000..3fdbe87 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-SignedEncrypted.h" + +int +Ieee1609Dot2Data_SignedEncrypted_358P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Encrypted_276P3, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_SignedEncrypted_358P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0 = { + "Ieee1609Dot2Data-SignedEncrypted", + "Ieee1609Dot2Data-SignedEncrypted", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_SignedEncrypted_358P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_SignedEncrypted_358P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.h b/certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.h new file mode 100644 index 0000000..41c3fc8 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedEncrypted.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Encrypted.h" +#ifndef _Ieee1609Dot2Data_SignedEncrypted_H_ +#define _Ieee1609Dot2Data_SignedEncrypted_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-SignedEncrypted */ +typedef Ieee1609Dot2Data_Encrypted_276P3_t Ieee1609Dot2Data_SignedEncrypted_358P0_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedEncrypted_358P0; +asn_struct_free_f Ieee1609Dot2Data_SignedEncrypted_358P0_free; +asn_struct_print_f Ieee1609Dot2Data_SignedEncrypted_358P0_print; +asn_constr_check_f Ieee1609Dot2Data_SignedEncrypted_358P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_SignedEncrypted_358P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_SignedEncrypted_358P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_SignedEncrypted_358P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_SignedEncrypted_358P0_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_SignedEncrypted_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.c b/certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.c new file mode 100644 index 0000000..e34c485 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-SignedEncryptedCertRequest.h" + +int +Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Encrypted_276P1, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0 = { + "Ieee1609Dot2Data-SignedEncryptedCertRequest", + "Ieee1609Dot2Data-SignedEncryptedCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.h b/certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.h new file mode 100644 index 0000000..52ac791 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedEncryptedCertRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Encrypted.h" +#ifndef _Ieee1609Dot2Data_SignedEncryptedCertRequest_H_ +#define _Ieee1609Dot2Data_SignedEncryptedCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-SignedEncryptedCertRequest */ +typedef Ieee1609Dot2Data_Encrypted_276P1_t Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0; +asn_struct_free_f Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_free; +asn_struct_print_f Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_print; +asn_constr_check_f Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_SignedEncryptedCertRequest_391P0_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_SignedEncryptedCertRequest_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.c b/certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.c new file mode 100644 index 0000000..fa9f679 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.h" + +int +Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0 = { + "Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest", + "Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.h b/certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.h new file mode 100644 index 0000000..7a0683f --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_H_ +#define _Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest */ +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0; +asn_struct_free_f Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_free; +asn_struct_print_f Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_print; +asn_constr_check_f Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_335P0_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_SignedX509AuthenticatedCertRequest_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.c b/certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.c new file mode 100644 index 0000000..bdd5c4b --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-SymmEncryptedSingleRecipient.h" + +int +Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0 = { + "Ieee1609Dot2Data-SymmEncryptedSingleRecipient", + "Ieee1609Dot2Data-SymmEncryptedSingleRecipient", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.h b/certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.h new file mode 100644 index 0000000..babcae3 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-SymmEncryptedSingleRecipient.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _Ieee1609Dot2Data_SymmEncryptedSingleRecipient_H_ +#define _Ieee1609Dot2Data_SymmEncryptedSingleRecipient_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-SymmEncryptedSingleRecipient */ +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0; +asn_struct_free_f Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_free; +asn_struct_print_f Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_print; +asn_constr_check_f Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_SymmEncryptedSingleRecipient_402P0_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_SymmEncryptedSingleRecipient_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data-Unsecured.c b/certgen/asncodec/Ieee1609Dot2Data-Unsecured.c new file mode 100644 index 0000000..9094459 --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-Unsecured.c @@ -0,0 +1,119 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609Dot2Data-Unsecured.h" + +int +Ieee1609Dot2Data_Unsecured_216P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +int +Ieee1609Dot2Data_Unsecured_216P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Unsecured_216P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609Dot2Data_Unsecured_216P1_constr_2 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Unsecured_216P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Unsecured_216P0 = { + "Ieee1609Dot2Data-Unsecured", + "Ieee1609Dot2Data-Unsecured", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Unsecured_216P0_tags_1, + sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P0_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Unsecured_216P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P0_tags_1) + /sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Unsecured_216P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Unsecured_216P0_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_Ieee1609Dot2Data_Unsecured_216P1_tags_2[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Unsecured_216P1 = { + "Ieee1609Dot2Data-Unsecured", + "Ieee1609Dot2Data-Unsecured", + &asn_OP_SEQUENCE, + asn_DEF_Ieee1609Dot2Data_Unsecured_216P1_tags_2, + sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P1_tags_2[0]), /* 1 */ + asn_DEF_Ieee1609Dot2Data_Unsecured_216P1_tags_2, /* Same as above */ + sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P1_tags_2) + /sizeof(asn_DEF_Ieee1609Dot2Data_Unsecured_216P1_tags_2[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609Dot2Data_Unsecured_216P1_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609Dot2Data_Unsecured_216P1_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/Ieee1609Dot2Data-Unsecured.h b/certgen/asncodec/Ieee1609Dot2Data-Unsecured.h new file mode 100644 index 0000000..f1d36ef --- /dev/null +++ b/certgen/asncodec/Ieee1609Dot2Data-Unsecured.h @@ -0,0 +1,48 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _Ieee1609Dot2Data_Unsecured_H_ +#define _Ieee1609Dot2Data_Unsecured_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609Dot2Data-Unsecured */ +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Unsecured_216P0_t; +typedef Ieee1609Dot2Data_t Ieee1609Dot2Data_Unsecured_216P1_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Unsecured_216P0; +asn_struct_free_f Ieee1609Dot2Data_Unsecured_216P0_free; +asn_struct_print_f Ieee1609Dot2Data_Unsecured_216P0_print; +asn_constr_check_f Ieee1609Dot2Data_Unsecured_216P0_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Unsecured_216P0_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Unsecured_216P0_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Unsecured_216P0_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Unsecured_216P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data_Unsecured_216P1; +asn_struct_free_f Ieee1609Dot2Data_Unsecured_216P1_free; +asn_struct_print_f Ieee1609Dot2Data_Unsecured_216P1_print; +asn_constr_check_f Ieee1609Dot2Data_Unsecured_216P1_constraint; +xer_type_decoder_f Ieee1609Dot2Data_Unsecured_216P1_decode_xer; +xer_type_encoder_f Ieee1609Dot2Data_Unsecured_216P1_encode_xer; +oer_type_decoder_f Ieee1609Dot2Data_Unsecured_216P1_decode_oer; +oer_type_encoder_f Ieee1609Dot2Data_Unsecured_216P1_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609Dot2Data_Unsecured_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609Dot2Data.c b/certgen/asncodec/Ieee1609Dot2Data.c index 8e2eaaa..792dd48 100644 --- a/certgen/asncodec/Ieee1609Dot2Data.c +++ b/certgen/asncodec/Ieee1609Dot2Data.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Ieee1609Dot2Data.h" @@ -32,16 +32,26 @@ memb_protocolVersion_constraint_1(const asn_TYPE_descriptor_t *td, const void *s } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_protocolVersion_constr_2 CC_NOTUSED = { { 1, 1 } /* (3..3) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_Ieee1609Dot2Data_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Ieee1609Dot2Data, protocolVersion), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint8, 0, - { &asn_OER_memb_protocolVersion_constr_2, 0, memb_protocolVersion_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_protocolVersion_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_protocolVersion_constraint_1 + }, 0, 0, /* No default value */ "protocolVersion" }, @@ -50,7 +60,15 @@ asn_TYPE_member_t asn_MBR_Ieee1609Dot2Data_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_Ieee1609Dot2Content, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "content" }, @@ -80,7 +98,15 @@ asn_TYPE_descriptor_t asn_DEF_Ieee1609Dot2Data = { asn_DEF_Ieee1609Dot2Data_tags_1, /* Same as above */ sizeof(asn_DEF_Ieee1609Dot2Data_tags_1) /sizeof(asn_DEF_Ieee1609Dot2Data_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/Ieee1609Dot2Data.h b/certgen/asncodec/Ieee1609Dot2Data.h index e134812..a79558f 100644 --- a/certgen/asncodec/Ieee1609Dot2Data.h +++ b/certgen/asncodec/Ieee1609Dot2Data.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Uint8.h" +#include #ifndef _Ieee1609Dot2Data_H_ #define _Ieee1609Dot2Data_H_ #include -/* Including external dependencies */ -#include "Uint8.h" -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/Ieee1609HeaderInfoExtensionId.c b/certgen/asncodec/Ieee1609HeaderInfoExtensionId.c new file mode 100644 index 0000000..6273dcb --- /dev/null +++ b/certgen/asncodec/Ieee1609HeaderInfoExtensionId.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609HeaderInfoExtensionId.h" + +int +Ieee1609HeaderInfoExtensionId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using ExtId, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609HeaderInfoExtensionId_constr_1 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609HeaderInfoExtensionId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609HeaderInfoExtensionId = { + "Ieee1609HeaderInfoExtensionId", + "Ieee1609HeaderInfoExtensionId", + &asn_OP_NativeInteger, + asn_DEF_Ieee1609HeaderInfoExtensionId_tags_1, + sizeof(asn_DEF_Ieee1609HeaderInfoExtensionId_tags_1) + /sizeof(asn_DEF_Ieee1609HeaderInfoExtensionId_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609HeaderInfoExtensionId_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609HeaderInfoExtensionId_tags_1) + /sizeof(asn_DEF_Ieee1609HeaderInfoExtensionId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609HeaderInfoExtensionId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609HeaderInfoExtensionId_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/Ieee1609HeaderInfoExtensionId.h b/certgen/asncodec/Ieee1609HeaderInfoExtensionId.h new file mode 100644 index 0000000..a636601 --- /dev/null +++ b/certgen/asncodec/Ieee1609HeaderInfoExtensionId.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ExtId.h" +#ifndef _Ieee1609HeaderInfoExtensionId_H_ +#define _Ieee1609HeaderInfoExtensionId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609HeaderInfoExtensionId */ +typedef ExtId_t Ieee1609HeaderInfoExtensionId_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609HeaderInfoExtensionId; +asn_struct_free_f Ieee1609HeaderInfoExtensionId_free; +asn_struct_print_f Ieee1609HeaderInfoExtensionId_print; +asn_constr_check_f Ieee1609HeaderInfoExtensionId_constraint; +xer_type_decoder_f Ieee1609HeaderInfoExtensionId_decode_xer; +xer_type_encoder_f Ieee1609HeaderInfoExtensionId_encode_xer; +oer_type_decoder_f Ieee1609HeaderInfoExtensionId_decode_oer; +oer_type_encoder_f Ieee1609HeaderInfoExtensionId_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609HeaderInfoExtensionId_H_ */ +#include diff --git a/certgen/asncodec/Ieee1609dot2dot1MsctlType.c b/certgen/asncodec/Ieee1609dot2dot1MsctlType.c new file mode 100644 index 0000000..2ede439 --- /dev/null +++ b/certgen/asncodec/Ieee1609dot2dot1MsctlType.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "Ieee1609dot2dot1MsctlType.h" + +int +Ieee1609dot2dot1MsctlType_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using NativeInteger, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_Ieee1609dot2dot1MsctlType_constr_1 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_Ieee1609dot2dot1MsctlType_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_Ieee1609dot2dot1MsctlType = { + "Ieee1609dot2dot1MsctlType", + "Ieee1609dot2dot1MsctlType", + &asn_OP_NativeInteger, + asn_DEF_Ieee1609dot2dot1MsctlType_tags_1, + sizeof(asn_DEF_Ieee1609dot2dot1MsctlType_tags_1) + /sizeof(asn_DEF_Ieee1609dot2dot1MsctlType_tags_1[0]), /* 1 */ + asn_DEF_Ieee1609dot2dot1MsctlType_tags_1, /* Same as above */ + sizeof(asn_DEF_Ieee1609dot2dot1MsctlType_tags_1) + /sizeof(asn_DEF_Ieee1609dot2dot1MsctlType_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Ieee1609dot2dot1MsctlType_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Ieee1609dot2dot1MsctlType_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/Ieee1609dot2dot1MsctlType.h b/certgen/asncodec/Ieee1609dot2dot1MsctlType.h new file mode 100644 index 0000000..eb00378 --- /dev/null +++ b/certgen/asncodec/Ieee1609dot2dot1MsctlType.h @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _Ieee1609dot2dot1MsctlType_H_ +#define _Ieee1609dot2dot1MsctlType_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Ieee1609dot2dot1MsctlType */ +typedef long Ieee1609dot2dot1MsctlType_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_Ieee1609dot2dot1MsctlType; +asn_struct_free_f Ieee1609dot2dot1MsctlType_free; +asn_struct_print_f Ieee1609dot2dot1MsctlType_print; +asn_constr_check_f Ieee1609dot2dot1MsctlType_constraint; +xer_type_decoder_f Ieee1609dot2dot1MsctlType_decode_xer; +xer_type_encoder_f Ieee1609dot2dot1MsctlType_encode_xer; +oer_type_decoder_f Ieee1609dot2dot1MsctlType_decode_oer; +oer_type_encoder_f Ieee1609dot2dot1MsctlType_encode_oer; +#define Ieee1609dot2dot1MsctlType_fullIeeeCtl ((Ieee1609dot2dot1MsctlType_t)1) + +#ifdef __cplusplus +} +#endif + +#endif /* _Ieee1609dot2dot1MsctlType_H_ */ +#include diff --git a/certgen/asncodec/ImplicitCertificate.c b/certgen/asncodec/ImplicitCertificate.c index 7e3717b..03a2baf 100644 --- a/certgen/asncodec/ImplicitCertificate.c +++ b/certgen/asncodec/ImplicitCertificate.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ImplicitCertificate.h" @@ -30,9 +30,11 @@ ImplicitCertificate_constraint(const asn_TYPE_descriptor_t *td, const void *sptr * This type is implemented using CertificateBase, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_ImplicitCertificate_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_ImplicitCertificate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_ImplicitCertificate = { asn_DEF_ImplicitCertificate_tags_1, /* Same as above */ sizeof(asn_DEF_ImplicitCertificate_tags_1) /sizeof(asn_DEF_ImplicitCertificate_tags_1[0]), /* 1 */ - { &asn_OER_type_ImplicitCertificate_constr_1, 0, ImplicitCertificate_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ImplicitCertificate_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ImplicitCertificate_constraint + }, asn_MBR_CertificateBase_1, 5, /* Elements count */ &asn_SPC_CertificateBase_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ImplicitCertificate.h b/certgen/asncodec/ImplicitCertificate.h index d1ff70a..cb3b44a 100644 --- a/certgen/asncodec/ImplicitCertificate.h +++ b/certgen/asncodec/ImplicitCertificate.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "CertificateBase.h" #ifndef _ImplicitCertificate_H_ #define _ImplicitCertificate_H_ #include -/* Including external dependencies */ -#include "CertificateBase.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_ImplicitCertificate; asn_struct_free_f ImplicitCertificate_free; asn_struct_print_f ImplicitCertificate_print; asn_constr_check_f ImplicitCertificate_constraint; -ber_type_decoder_f ImplicitCertificate_decode_ber; -der_type_encoder_f ImplicitCertificate_encode_der; xer_type_decoder_f ImplicitCertificate_decode_xer; xer_type_encoder_f ImplicitCertificate_encode_xer; oer_type_decoder_f ImplicitCertificate_decode_oer; diff --git a/certgen/asncodec/IndividualAprv.c b/certgen/asncodec/IndividualAprv.c new file mode 100644 index 0000000..4490ea5 --- /dev/null +++ b/certgen/asncodec/IndividualAprv.c @@ -0,0 +1,186 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "IndividualAprv.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_IndividualAprv_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct IndividualAprv, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct IndividualAprv, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct IndividualAprv, currentI), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "currentI" + }, + { ATF_NOFLAGS, 0, offsetof(struct IndividualAprv, acpcTreeId), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcpcTreeId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acpcTreeId" + }, + { ATF_NOFLAGS, 0, offsetof(struct IndividualAprv, nodeId), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_BIT_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "nodeId" + }, + { ATF_NOFLAGS, 0, offsetof(struct IndividualAprv, nodeValue), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcpcNodeValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "nodeValue" + }, +}; +static const ber_tlv_tag_t asn_DEF_IndividualAprv_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_IndividualAprv_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* currentI */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* acpcTreeId */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* nodeId */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* nodeValue */ +}; +asn_SEQUENCE_specifics_t asn_SPC_IndividualAprv_specs_1 = { + sizeof(struct IndividualAprv), + offsetof(struct IndividualAprv, _asn_ctx), + asn_MAP_IndividualAprv_tag2el_1, + 6, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 6, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_IndividualAprv = { + "IndividualAprv", + "IndividualAprv", + &asn_OP_SEQUENCE, + asn_DEF_IndividualAprv_tags_1, + sizeof(asn_DEF_IndividualAprv_tags_1) + /sizeof(asn_DEF_IndividualAprv_tags_1[0]), /* 1 */ + asn_DEF_IndividualAprv_tags_1, /* Same as above */ + sizeof(asn_DEF_IndividualAprv_tags_1) + /sizeof(asn_DEF_IndividualAprv_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_IndividualAprv_1, + 6, /* Elements count */ + &asn_SPC_IndividualAprv_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/IndividualAprv.h b/certgen/asncodec/IndividualAprv.h new file mode 100644 index 0000000..7fb13fd --- /dev/null +++ b/certgen/asncodec/IndividualAprv.h @@ -0,0 +1,54 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "IValue.h" +#include "AcpcTreeId.h" +#include +#include "AcpcNodeValue.h" +#include +#ifndef _IndividualAprv_H_ +#define _IndividualAprv_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* IndividualAprv */ +typedef struct IndividualAprv { + Uint8_t version; + Time32_t generationTime; + IValue_t currentI; + AcpcTreeId_t acpcTreeId; + BIT_STRING_t nodeId; + AcpcNodeValue_t nodeValue; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} IndividualAprv_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_IndividualAprv; +extern asn_SEQUENCE_specifics_t asn_SPC_IndividualAprv_specs_1; +extern asn_TYPE_member_t asn_MBR_IndividualAprv_1[6]; + +#ifdef __cplusplus +} +#endif + +#endif /* _IndividualAprv_H_ */ +#include diff --git a/certgen/asncodec/IndividualRevocation.c b/certgen/asncodec/IndividualRevocation.c new file mode 100644 index 0000000..7c85656 --- /dev/null +++ b/certgen/asncodec/IndividualRevocation.c @@ -0,0 +1,84 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "IndividualRevocation.h" + +asn_TYPE_member_t asn_MBR_IndividualRevocation_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct IndividualRevocation, linkageSeed1), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LinkageSeed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "linkageSeed1" + }, + { ATF_NOFLAGS, 0, offsetof(struct IndividualRevocation, linkageSeed2), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LinkageSeed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "linkageSeed2" + }, +}; +static const ber_tlv_tag_t asn_DEF_IndividualRevocation_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_IndividualRevocation_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* linkageSeed1 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* linkageSeed2 */ +}; +asn_SEQUENCE_specifics_t asn_SPC_IndividualRevocation_specs_1 = { + sizeof(struct IndividualRevocation), + offsetof(struct IndividualRevocation, _asn_ctx), + asn_MAP_IndividualRevocation_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_IndividualRevocation = { + "IndividualRevocation", + "IndividualRevocation", + &asn_OP_SEQUENCE, + asn_DEF_IndividualRevocation_tags_1, + sizeof(asn_DEF_IndividualRevocation_tags_1) + /sizeof(asn_DEF_IndividualRevocation_tags_1[0]), /* 1 */ + asn_DEF_IndividualRevocation_tags_1, /* Same as above */ + sizeof(asn_DEF_IndividualRevocation_tags_1) + /sizeof(asn_DEF_IndividualRevocation_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_IndividualRevocation_1, + 2, /* Elements count */ + &asn_SPC_IndividualRevocation_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/IndividualRevocation.h b/certgen/asncodec/IndividualRevocation.h new file mode 100644 index 0000000..b9c3f0a --- /dev/null +++ b/certgen/asncodec/IndividualRevocation.h @@ -0,0 +1,45 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "LinkageSeed.h" +#include +#ifndef _IndividualRevocation_H_ +#define _IndividualRevocation_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* IndividualRevocation */ +typedef struct IndividualRevocation { + LinkageSeed_t linkageSeed1; + LinkageSeed_t linkageSeed2; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} IndividualRevocation_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_IndividualRevocation; +extern asn_SEQUENCE_specifics_t asn_SPC_IndividualRevocation_specs_1; +extern asn_TYPE_member_t asn_MBR_IndividualRevocation_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _IndividualRevocation_H_ */ +#include diff --git a/certgen/asncodec/InnerAtRequest.c b/certgen/asncodec/InnerAtRequest.c index b4a79ef..cab9e5a 100644 --- a/certgen/asncodec/InnerAtRequest.c +++ b/certgen/asncodec/InnerAtRequest.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "InnerAtRequest.h" @@ -33,16 +33,26 @@ memb_hmacKey_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_hmacKey_constr_3 CC_NOTUSED = { { 0, 0 }, 32 /* (SIZE(32..32)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_InnerAtRequest_1[] = { { ATF_NOFLAGS, 0, offsetof(struct InnerAtRequest, publicKeys), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_PublicKeys, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "publicKeys" }, @@ -51,7 +61,15 @@ asn_TYPE_member_t asn_MBR_InnerAtRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_hmacKey_constr_3, 0, memb_hmacKey_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_hmacKey_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_hmacKey_constraint_1 + }, 0, 0, /* No default value */ "hmacKey" }, @@ -60,7 +78,15 @@ asn_TYPE_member_t asn_MBR_InnerAtRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SharedAtRequest, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "sharedAtRequest" }, @@ -69,7 +95,15 @@ asn_TYPE_member_t asn_MBR_InnerAtRequest_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_EcSignature, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecSignature" }, @@ -101,7 +135,15 @@ asn_TYPE_descriptor_t asn_DEF_InnerAtRequest = { asn_DEF_InnerAtRequest_tags_1, /* Same as above */ sizeof(asn_DEF_InnerAtRequest_tags_1) /sizeof(asn_DEF_InnerAtRequest_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_InnerAtRequest_1, 4, /* Elements count */ &asn_SPC_InnerAtRequest_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/InnerAtRequest.h b/certgen/asncodec/InnerAtRequest.h index 8af6ccc..2206349 100644 --- a/certgen/asncodec/InnerAtRequest.h +++ b/certgen/asncodec/InnerAtRequest.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _InnerAtRequest_H_ -#define _InnerAtRequest_H_ - - -#include /* Including external dependencies */ #include "PublicKeys.h" @@ -17,6 +12,11 @@ #include "SharedAtRequest.h" #include "EcSignature.h" #include +#ifndef _InnerAtRequest_H_ +#define _InnerAtRequest_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/InnerAtResponse.c b/certgen/asncodec/InnerAtResponse.c index 3989c24..c2695e8 100644 --- a/certgen/asncodec/InnerAtResponse.c +++ b/certgen/asncodec/InnerAtResponse.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "InnerAtResponse.h" @@ -33,19 +33,31 @@ memb_requestHash_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_requestHash_constr_2 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_InnerAtResponse_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_InnerAtResponse_1[] = { { ATF_NOFLAGS, 0, offsetof(struct InnerAtResponse, requestHash), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_requestHash_constr_2, 0, memb_requestHash_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_requestHash_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_requestHash_constraint_1 + }, 0, 0, /* No default value */ "requestHash" }, @@ -54,7 +66,15 @@ asn_TYPE_member_t asn_MBR_InnerAtResponse_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthorizationResponseCode, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "responseCode" }, @@ -63,7 +83,15 @@ asn_TYPE_member_t asn_MBR_InnerAtResponse_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificate" }, @@ -96,7 +124,15 @@ asn_TYPE_descriptor_t asn_DEF_InnerAtResponse = { asn_DEF_InnerAtResponse_tags_1, /* Same as above */ sizeof(asn_DEF_InnerAtResponse_tags_1) /sizeof(asn_DEF_InnerAtResponse_tags_1[0]), /* 1 */ - { &asn_OER_type_InnerAtResponse_constr_1, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_InnerAtResponse_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_InnerAtResponse_1, 3, /* Elements count */ &asn_SPC_InnerAtResponse_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/InnerAtResponse.h b/certgen/asncodec/InnerAtResponse.h index a97c474..4c58ab5 100644 --- a/certgen/asncodec/InnerAtResponse.h +++ b/certgen/asncodec/InnerAtResponse.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _InnerAtResponse_H_ -#define _InnerAtResponse_H_ - - -#include /* Including external dependencies */ #include #include "AuthorizationResponseCode.h" #include +#ifndef _InnerAtResponse_H_ +#define _InnerAtResponse_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -27,7 +27,7 @@ struct EtsiTs103097Certificate; typedef struct InnerAtResponse { OCTET_STRING_t requestHash; AuthorizationResponseCode_t responseCode; - struct EtsiTs103097Certificate *certificate /* OPTIONAL */; + struct EtsiTs103097Certificate *certificate; /* OPTIONAL */ /* * This type is extensible, * possible extensions are below. diff --git a/certgen/asncodec/InnerEcRequest.c b/certgen/asncodec/InnerEcRequest.c index 1e917ee..afd81b0 100644 --- a/certgen/asncodec/InnerEcRequest.c +++ b/certgen/asncodec/InnerEcRequest.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "InnerEcRequest.h" @@ -26,16 +26,26 @@ memb_requestedSubjectAttributes_constraint_1(const asn_TYPE_descriptor_t *td, co return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_requestedSubjectAttributes_constr_5 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static asn_TYPE_member_t asn_MBR_InnerEcRequest_1[] = { { ATF_NOFLAGS, 0, offsetof(struct InnerEcRequest, itsId), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ - &asn_DEF_IA5String, + &asn_DEF_OCTET_STRING, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "itsId" }, @@ -44,7 +54,15 @@ static asn_TYPE_member_t asn_MBR_InnerEcRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CertificateFormat, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificateFormat" }, @@ -53,7 +71,15 @@ static asn_TYPE_member_t asn_MBR_InnerEcRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PublicKeys, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "publicKeys" }, @@ -62,7 +88,15 @@ static asn_TYPE_member_t asn_MBR_InnerEcRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CertificateSubjectAttributes, 0, - { &asn_OER_memb_requestedSubjectAttributes_constr_5, 0, memb_requestedSubjectAttributes_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_requestedSubjectAttributes_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_requestedSubjectAttributes_constraint_1 + }, 0, 0, /* No default value */ "requestedSubjectAttributes" }, @@ -94,7 +128,15 @@ asn_TYPE_descriptor_t asn_DEF_InnerEcRequest = { asn_DEF_InnerEcRequest_tags_1, /* Same as above */ sizeof(asn_DEF_InnerEcRequest_tags_1) /sizeof(asn_DEF_InnerEcRequest_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_InnerEcRequest_1, 4, /* Elements count */ &asn_SPC_InnerEcRequest_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/InnerEcRequest.h b/certgen/asncodec/InnerEcRequest.h index eac0d89..d8d404c 100644 --- a/certgen/asncodec/InnerEcRequest.h +++ b/certgen/asncodec/InnerEcRequest.h @@ -1,22 +1,22 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _InnerEcRequest_H_ -#define _InnerEcRequest_H_ - - -#include /* Including external dependencies */ -#include +#include #include "CertificateFormat.h" #include "PublicKeys.h" #include "CertificateSubjectAttributes.h" #include +#ifndef _InnerEcRequest_H_ +#define _InnerEcRequest_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -24,7 +24,7 @@ extern "C" { /* InnerEcRequest */ typedef struct InnerEcRequest { - IA5String_t itsId; + OCTET_STRING_t itsId; CertificateFormat_t certificateFormat; PublicKeys_t publicKeys; CertificateSubjectAttributes_t requestedSubjectAttributes; diff --git a/certgen/asncodec/InnerEcRequestSignedForPop.c b/certgen/asncodec/InnerEcRequestSignedForPop.c index 4594232..35b0a7a 100644 --- a/certgen/asncodec/InnerEcRequestSignedForPop.c +++ b/certgen/asncodec/InnerEcRequestSignedForPop.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "InnerEcRequestSignedForPop.h" @@ -27,12 +27,14 @@ InnerEcRequestSignedForPop_constraint(const asn_TYPE_descriptor_t *td, const voi } /* - * This type is implemented using EtsiTs103097Data_Signed_60P2, + * This type is implemented using EtsiTs103097Data_Signed_63P2, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_InnerEcRequestSignedForPop_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_InnerEcRequestSignedForPop_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_InnerEcRequestSignedForPop = { asn_DEF_InnerEcRequestSignedForPop_tags_1, /* Same as above */ sizeof(asn_DEF_InnerEcRequestSignedForPop_tags_1) /sizeof(asn_DEF_InnerEcRequestSignedForPop_tags_1[0]), /* 1 */ - { &asn_OER_type_InnerEcRequestSignedForPop_constr_1, 0, InnerEcRequestSignedForPop_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_InnerEcRequestSignedForPop_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + InnerEcRequestSignedForPop_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/InnerEcRequestSignedForPop.h b/certgen/asncodec/InnerEcRequestSignedForPop.h index 615f940..f49f540 100644 --- a/certgen/asncodec/InnerEcRequestSignedForPop.h +++ b/certgen/asncodec/InnerEcRequestSignedForPop.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" #ifndef _InnerEcRequestSignedForPop_H_ #define _InnerEcRequestSignedForPop_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Signed.h" - #ifdef __cplusplus extern "C" { #endif /* InnerEcRequestSignedForPop */ -typedef EtsiTs103097Data_Signed_60P2_t InnerEcRequestSignedForPop_t; +typedef EtsiTs103097Data_Signed_63P2_t InnerEcRequestSignedForPop_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_InnerEcRequestSignedForPop; asn_struct_free_f InnerEcRequestSignedForPop_free; asn_struct_print_f InnerEcRequestSignedForPop_print; asn_constr_check_f InnerEcRequestSignedForPop_constraint; -ber_type_decoder_f InnerEcRequestSignedForPop_decode_ber; -der_type_encoder_f InnerEcRequestSignedForPop_encode_der; xer_type_decoder_f InnerEcRequestSignedForPop_decode_xer; xer_type_encoder_f InnerEcRequestSignedForPop_encode_xer; oer_type_decoder_f InnerEcRequestSignedForPop_decode_oer; diff --git a/certgen/asncodec/InnerEcResponse.c b/certgen/asncodec/InnerEcResponse.c index ec60b96..36a7f2b 100644 --- a/certgen/asncodec/InnerEcResponse.c +++ b/certgen/asncodec/InnerEcResponse.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "InnerEcResponse.h" @@ -33,19 +33,31 @@ memb_requestHash_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_requestHash_constr_2 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_InnerEcResponse_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_InnerEcResponse_1[] = { { ATF_NOFLAGS, 0, offsetof(struct InnerEcResponse, requestHash), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_requestHash_constr_2, 0, memb_requestHash_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_requestHash_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_requestHash_constraint_1 + }, 0, 0, /* No default value */ "requestHash" }, @@ -54,7 +66,15 @@ asn_TYPE_member_t asn_MBR_InnerEcResponse_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EnrolmentResponseCode, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "responseCode" }, @@ -63,7 +83,15 @@ asn_TYPE_member_t asn_MBR_InnerEcResponse_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificate" }, @@ -96,7 +124,15 @@ asn_TYPE_descriptor_t asn_DEF_InnerEcResponse = { asn_DEF_InnerEcResponse_tags_1, /* Same as above */ sizeof(asn_DEF_InnerEcResponse_tags_1) /sizeof(asn_DEF_InnerEcResponse_tags_1[0]), /* 1 */ - { &asn_OER_type_InnerEcResponse_constr_1, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_InnerEcResponse_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_InnerEcResponse_1, 3, /* Elements count */ &asn_SPC_InnerEcResponse_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/InnerEcResponse.h b/certgen/asncodec/InnerEcResponse.h index ee64572..1c5a42f 100644 --- a/certgen/asncodec/InnerEcResponse.h +++ b/certgen/asncodec/InnerEcResponse.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesEnrolment" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesEnrolment.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _InnerEcResponse_H_ -#define _InnerEcResponse_H_ - - -#include /* Including external dependencies */ #include #include "EnrolmentResponseCode.h" #include +#ifndef _InnerEcResponse_H_ +#define _InnerEcResponse_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -27,7 +27,7 @@ struct EtsiTs103097Certificate; typedef struct InnerEcResponse { OCTET_STRING_t requestHash; EnrolmentResponseCode_t responseCode; - struct EtsiTs103097Certificate *certificate /* OPTIONAL */; + struct EtsiTs103097Certificate *certificate; /* OPTIONAL */ /* * This type is extensible, * possible extensions are below. diff --git a/certgen/asncodec/IssuerIdentifier.c b/certgen/asncodec/IssuerIdentifier.c index a621c0c..ca08d26 100644 --- a/certgen/asncodec/IssuerIdentifier.c +++ b/certgen/asncodec/IssuerIdentifier.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "IssuerIdentifier.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_IssuerIdentifier_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_IssuerIdentifier_1[] = { { ATF_NOFLAGS, 0, offsetof(struct IssuerIdentifier, choice.sha256AndDigest), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "sha256AndDigest" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_IssuerIdentifier_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HashAlgorithm, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "self" }, @@ -34,15 +52,41 @@ asn_TYPE_member_t asn_MBR_IssuerIdentifier_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "sha384AndDigest" }, + { ATF_NOFLAGS, 0, offsetof(struct IssuerIdentifier, choice.sm3AndDigest), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sm3AndDigest" + }, }; static const asn_TYPE_tag2member_t asn_MAP_IssuerIdentifier_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sha256AndDigest */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* self */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* sha384AndDigest */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sha384AndDigest */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* sm3AndDigest */ }; asn_CHOICE_specifics_t asn_SPC_IssuerIdentifier_specs_1 = { sizeof(struct IssuerIdentifier), @@ -50,7 +94,7 @@ asn_CHOICE_specifics_t asn_SPC_IssuerIdentifier_specs_1 = { offsetof(struct IssuerIdentifier, present), sizeof(((struct IssuerIdentifier *)0)->present), asn_MAP_IssuerIdentifier_tag2el_1, - 3, /* Count of tags in the map */ + 4, /* Count of tags in the map */ 0, 0, 2 /* Extensions start */ }; @@ -62,9 +106,17 @@ asn_TYPE_descriptor_t asn_DEF_IssuerIdentifier = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_IssuerIdentifier_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_IssuerIdentifier_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_IssuerIdentifier_1, - 3, /* Elements count */ + 4, /* Elements count */ &asn_SPC_IssuerIdentifier_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/IssuerIdentifier.h b/certgen/asncodec/IssuerIdentifier.h index 44eb005..4dc293c 100644 --- a/certgen/asncodec/IssuerIdentifier.h +++ b/certgen/asncodec/IssuerIdentifier.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _IssuerIdentifier_H_ -#define _IssuerIdentifier_H_ - - -#include /* Including external dependencies */ #include "HashedId8.h" #include "HashAlgorithm.h" #include +#ifndef _IssuerIdentifier_H_ +#define _IssuerIdentifier_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -26,7 +26,8 @@ typedef enum IssuerIdentifier_PR { IssuerIdentifier_PR_sha256AndDigest, IssuerIdentifier_PR_self, /* Extensions may appear below */ - IssuerIdentifier_PR_sha384AndDigest + IssuerIdentifier_PR_sha384AndDigest, + IssuerIdentifier_PR_sm3AndDigest } IssuerIdentifier_PR; /* IssuerIdentifier */ @@ -40,6 +41,7 @@ typedef struct IssuerIdentifier { * possible extensions are below. */ HashedId8_t sha384AndDigest; + HashedId8_t sm3AndDigest; } choice; /* Context for parsing across buffer boundaries */ @@ -49,7 +51,7 @@ typedef struct IssuerIdentifier { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_IssuerIdentifier; extern asn_CHOICE_specifics_t asn_SPC_IssuerIdentifier_specs_1; -extern asn_TYPE_member_t asn_MBR_IssuerIdentifier_1[3]; +extern asn_TYPE_member_t asn_MBR_IssuerIdentifier_1[4]; #ifdef __cplusplus } diff --git a/certgen/asncodec/JMaxGroup.c b/certgen/asncodec/JMaxGroup.c new file mode 100644 index 0000000..ff62020 --- /dev/null +++ b/certgen/asncodec/JMaxGroup.c @@ -0,0 +1,84 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "JMaxGroup.h" + +asn_TYPE_member_t asn_MBR_JMaxGroup_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct JMaxGroup, jmax), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "jmax" + }, + { ATF_NOFLAGS, 0, offsetof(struct JMaxGroup, contents), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfLAGroup, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "contents" + }, +}; +static const ber_tlv_tag_t asn_DEF_JMaxGroup_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_JMaxGroup_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* jmax */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* contents */ +}; +asn_SEQUENCE_specifics_t asn_SPC_JMaxGroup_specs_1 = { + sizeof(struct JMaxGroup), + offsetof(struct JMaxGroup, _asn_ctx), + asn_MAP_JMaxGroup_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_JMaxGroup = { + "JMaxGroup", + "JMaxGroup", + &asn_OP_SEQUENCE, + asn_DEF_JMaxGroup_tags_1, + sizeof(asn_DEF_JMaxGroup_tags_1) + /sizeof(asn_DEF_JMaxGroup_tags_1[0]), /* 1 */ + asn_DEF_JMaxGroup_tags_1, /* Same as above */ + sizeof(asn_DEF_JMaxGroup_tags_1) + /sizeof(asn_DEF_JMaxGroup_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_JMaxGroup_1, + 2, /* Elements count */ + &asn_SPC_JMaxGroup_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/JMaxGroup.h b/certgen/asncodec/JMaxGroup.h new file mode 100644 index 0000000..ee09c43 --- /dev/null +++ b/certgen/asncodec/JMaxGroup.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "SequenceOfLAGroup.h" +#include +#ifndef _JMaxGroup_H_ +#define _JMaxGroup_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* JMaxGroup */ +typedef struct JMaxGroup { + Uint8_t jmax; + SequenceOfLAGroup_t contents; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} JMaxGroup_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_JMaxGroup; +extern asn_SEQUENCE_specifics_t asn_SPC_JMaxGroup_specs_1; +extern asn_TYPE_member_t asn_MBR_JMaxGroup_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _JMaxGroup_H_ */ +#include diff --git a/certgen/asncodec/KnownLatitude.c b/certgen/asncodec/KnownLatitude.c index a05a430..bfc334d 100644 --- a/certgen/asncodec/KnownLatitude.c +++ b/certgen/asncodec/KnownLatitude.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "KnownLatitude.h" @@ -36,9 +36,11 @@ KnownLatitude_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NinetyDegreeInt, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_KnownLatitude_constr_1 CC_NOTUSED = { { 4, 0 } /* (-900000000..900000000) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_KnownLatitude_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_KnownLatitude = { asn_DEF_KnownLatitude_tags_1, /* Same as above */ sizeof(asn_DEF_KnownLatitude_tags_1) /sizeof(asn_DEF_KnownLatitude_tags_1[0]), /* 1 */ - { &asn_OER_type_KnownLatitude_constr_1, 0, KnownLatitude_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_KnownLatitude_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + KnownLatitude_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/KnownLatitude.h b/certgen/asncodec/KnownLatitude.h index 8df46e4..08cc5bf 100644 --- a/certgen/asncodec/KnownLatitude.h +++ b/certgen/asncodec/KnownLatitude.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "NinetyDegreeInt.h" #ifndef _KnownLatitude_H_ #define _KnownLatitude_H_ #include -/* Including external dependencies */ -#include "NinetyDegreeInt.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_KnownLatitude; asn_struct_free_f KnownLatitude_free; asn_struct_print_f KnownLatitude_print; asn_constr_check_f KnownLatitude_constraint; -ber_type_decoder_f KnownLatitude_decode_ber; -der_type_encoder_f KnownLatitude_encode_der; xer_type_decoder_f KnownLatitude_decode_xer; xer_type_encoder_f KnownLatitude_encode_xer; oer_type_decoder_f KnownLatitude_decode_oer; diff --git a/certgen/asncodec/KnownLongitude.c b/certgen/asncodec/KnownLongitude.c index f152d18..c5d5c00 100644 --- a/certgen/asncodec/KnownLongitude.c +++ b/certgen/asncodec/KnownLongitude.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "KnownLongitude.h" @@ -36,9 +36,11 @@ KnownLongitude_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OneEightyDegreeInt, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_KnownLongitude_constr_1 CC_NOTUSED = { { 4, 0 } /* (-1799999999..1800000000) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_KnownLongitude_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_KnownLongitude = { asn_DEF_KnownLongitude_tags_1, /* Same as above */ sizeof(asn_DEF_KnownLongitude_tags_1) /sizeof(asn_DEF_KnownLongitude_tags_1[0]), /* 1 */ - { &asn_OER_type_KnownLongitude_constr_1, 0, KnownLongitude_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_KnownLongitude_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + KnownLongitude_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/KnownLongitude.h b/certgen/asncodec/KnownLongitude.h index 762696b..36fc50b 100644 --- a/certgen/asncodec/KnownLongitude.h +++ b/certgen/asncodec/KnownLongitude.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "OneEightyDegreeInt.h" #ifndef _KnownLongitude_H_ #define _KnownLongitude_H_ #include -/* Including external dependencies */ -#include "OneEightyDegreeInt.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_KnownLongitude; asn_struct_free_f KnownLongitude_free; asn_struct_print_f KnownLongitude_print; asn_constr_check_f KnownLongitude_constraint; -ber_type_decoder_f KnownLongitude_decode_ber; -der_type_encoder_f KnownLongitude_encode_der; xer_type_decoder_f KnownLongitude_decode_xer; xer_type_encoder_f KnownLongitude_encode_xer; oer_type_decoder_f KnownLongitude_decode_oer; diff --git a/certgen/asncodec/LAGroup.c b/certgen/asncodec/LAGroup.c new file mode 100644 index 0000000..dbf9ba3 --- /dev/null +++ b/certgen/asncodec/LAGroup.c @@ -0,0 +1,102 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "LAGroup.h" + +asn_TYPE_member_t asn_MBR_LAGroup_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct LAGroup, la1Id), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "la1Id" + }, + { ATF_NOFLAGS, 0, offsetof(struct LAGroup, la2Id), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "la2Id" + }, + { ATF_NOFLAGS, 0, offsetof(struct LAGroup, contents), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfIMaxGroup, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "contents" + }, +}; +static const ber_tlv_tag_t asn_DEF_LAGroup_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_LAGroup_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* la1Id */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* la2Id */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* contents */ +}; +asn_SEQUENCE_specifics_t asn_SPC_LAGroup_specs_1 = { + sizeof(struct LAGroup), + offsetof(struct LAGroup, _asn_ctx), + asn_MAP_LAGroup_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 3, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_LAGroup = { + "LAGroup", + "LAGroup", + &asn_OP_SEQUENCE, + asn_DEF_LAGroup_tags_1, + sizeof(asn_DEF_LAGroup_tags_1) + /sizeof(asn_DEF_LAGroup_tags_1[0]), /* 1 */ + asn_DEF_LAGroup_tags_1, /* Same as above */ + sizeof(asn_DEF_LAGroup_tags_1) + /sizeof(asn_DEF_LAGroup_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_LAGroup_1, + 3, /* Elements count */ + &asn_SPC_LAGroup_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/LAGroup.h b/certgen/asncodec/LAGroup.h new file mode 100644 index 0000000..c377fff --- /dev/null +++ b/certgen/asncodec/LAGroup.h @@ -0,0 +1,47 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "LaId.h" +#include "SequenceOfIMaxGroup.h" +#include +#ifndef _LAGroup_H_ +#define _LAGroup_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* LAGroup */ +typedef struct LAGroup { + LaId_t la1Id; + LaId_t la2Id; + SequenceOfIMaxGroup_t contents; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} LAGroup_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_LAGroup; +extern asn_SEQUENCE_specifics_t asn_SPC_LAGroup_specs_1; +extern asn_TYPE_member_t asn_MBR_LAGroup_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _LAGroup_H_ */ +#include diff --git a/certgen/asncodec/LaId.c b/certgen/asncodec/LaId.c index 9d39175..4e92252 100644 --- a/certgen/asncodec/LaId.c +++ b/certgen/asncodec/LaId.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "LaId.h" @@ -37,9 +37,11 @@ LaId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_LaId_constr_1 CC_NOTUSED = { { 0, 0 }, 2 /* (SIZE(2..2)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_LaId_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_LaId = { asn_DEF_LaId_tags_1, /* Same as above */ sizeof(asn_DEF_LaId_tags_1) /sizeof(asn_DEF_LaId_tags_1[0]), /* 1 */ - { &asn_OER_type_LaId_constr_1, 0, LaId_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_LaId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + LaId_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/LaId.h b/certgen/asncodec/LaId.h index bd56de9..4f0376e 100644 --- a/certgen/asncodec/LaId.h +++ b/certgen/asncodec/LaId.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _LaId_H_ #define _LaId_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_LaId; asn_struct_free_f LaId_free; asn_struct_print_f LaId_print; asn_constr_check_f LaId_constraint; -ber_type_decoder_f LaId_decode_ber; -der_type_encoder_f LaId_encode_der; xer_type_decoder_f LaId_decode_xer; xer_type_encoder_f LaId_encode_xer; oer_type_decoder_f LaId_decode_oer; diff --git a/certgen/asncodec/LaMaInterfacePdu.c b/certgen/asncodec/LaMaInterfacePdu.c new file mode 100644 index 0000000..56a8d20 --- /dev/null +++ b/certgen/asncodec/LaMaInterfacePdu.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1LaMaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "LaMaInterfacePdu.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_LaMaInterfacePdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_LaMaInterfacePdu = { + "LaMaInterfacePdu", + "LaMaInterfacePdu", + &asn_OP_NULL, + asn_DEF_LaMaInterfacePdu_tags_1, + sizeof(asn_DEF_LaMaInterfacePdu_tags_1) + /sizeof(asn_DEF_LaMaInterfacePdu_tags_1[0]), /* 1 */ + asn_DEF_LaMaInterfacePdu_tags_1, /* Same as above */ + sizeof(asn_DEF_LaMaInterfacePdu_tags_1) + /sizeof(asn_DEF_LaMaInterfacePdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/LaMaInterfacePdu.h b/certgen/asncodec/LaMaInterfacePdu.h new file mode 100644 index 0000000..ef622eb --- /dev/null +++ b/certgen/asncodec/LaMaInterfacePdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1LaMaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _LaMaInterfacePdu_H_ +#define _LaMaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* LaMaInterfacePdu */ +typedef NULL_t LaMaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_LaMaInterfacePdu; +asn_struct_free_f LaMaInterfacePdu_free; +asn_struct_print_f LaMaInterfacePdu_print; +asn_constr_check_f LaMaInterfacePdu_constraint; +xer_type_decoder_f LaMaInterfacePdu_decode_xer; +xer_type_encoder_f LaMaInterfacePdu_encode_xer; +oer_type_decoder_f LaMaInterfacePdu_decode_oer; +oer_type_encoder_f LaMaInterfacePdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _LaMaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/LaRaInterfacePdu.c b/certgen/asncodec/LaRaInterfacePdu.c new file mode 100644 index 0000000..fdc187b --- /dev/null +++ b/certgen/asncodec/LaRaInterfacePdu.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1LaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "LaRaInterfacePdu.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_LaRaInterfacePdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_LaRaInterfacePdu = { + "LaRaInterfacePdu", + "LaRaInterfacePdu", + &asn_OP_NULL, + asn_DEF_LaRaInterfacePdu_tags_1, + sizeof(asn_DEF_LaRaInterfacePdu_tags_1) + /sizeof(asn_DEF_LaRaInterfacePdu_tags_1[0]), /* 1 */ + asn_DEF_LaRaInterfacePdu_tags_1, /* Same as above */ + sizeof(asn_DEF_LaRaInterfacePdu_tags_1) + /sizeof(asn_DEF_LaRaInterfacePdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/LaRaInterfacePdu.h b/certgen/asncodec/LaRaInterfacePdu.h new file mode 100644 index 0000000..0bbe73d --- /dev/null +++ b/certgen/asncodec/LaRaInterfacePdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1LaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _LaRaInterfacePdu_H_ +#define _LaRaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* LaRaInterfacePdu */ +typedef NULL_t LaRaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_LaRaInterfacePdu; +asn_struct_free_f LaRaInterfacePdu_free; +asn_struct_print_f LaRaInterfacePdu_print; +asn_constr_check_f LaRaInterfacePdu_constraint; +xer_type_decoder_f LaRaInterfacePdu_decode_xer; +xer_type_encoder_f LaRaInterfacePdu_encode_xer; +oer_type_decoder_f LaRaInterfacePdu_decode_oer; +oer_type_encoder_f LaRaInterfacePdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _LaRaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/LaSsp.c b/certgen/asncodec/LaSsp.c new file mode 100644 index 0000000..18b3778 --- /dev/null +++ b/certgen/asncodec/LaSsp.c @@ -0,0 +1,114 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "LaSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_LaSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct LaSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct LaSsp, laId), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint16, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "laId" + }, +}; +static const ber_tlv_tag_t asn_DEF_LaSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_LaSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* laId */ +}; +asn_SEQUENCE_specifics_t asn_SPC_LaSsp_specs_1 = { + sizeof(struct LaSsp), + offsetof(struct LaSsp, _asn_ctx), + asn_MAP_LaSsp_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_LaSsp = { + "LaSsp", + "LaSsp", + &asn_OP_SEQUENCE, + asn_DEF_LaSsp_tags_1, + sizeof(asn_DEF_LaSsp_tags_1) + /sizeof(asn_DEF_LaSsp_tags_1[0]), /* 1 */ + asn_DEF_LaSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_LaSsp_tags_1) + /sizeof(asn_DEF_LaSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_LaSsp_1, + 2, /* Elements count */ + &asn_SPC_LaSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/LaSsp.h b/certgen/asncodec/LaSsp.h new file mode 100644 index 0000000..2d1539a --- /dev/null +++ b/certgen/asncodec/LaSsp.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Uint16.h" +#include +#ifndef _LaSsp_H_ +#define _LaSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* LaSsp */ +typedef struct LaSsp { + Uint8_t version; + Uint16_t laId; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} LaSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_LaSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_LaSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_LaSsp_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _LaSsp_H_ */ +#include diff --git a/certgen/asncodec/Latitude.c b/certgen/asncodec/Latitude.c index 1af9751..89ef230 100644 --- a/certgen/asncodec/Latitude.c +++ b/certgen/asncodec/Latitude.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Latitude.h" @@ -36,9 +36,11 @@ Latitude_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NinetyDegreeInt, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Latitude_constr_1 CC_NOTUSED = { { 4, 0 } /* (-900000000..900000001) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Latitude_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_Latitude = { asn_DEF_Latitude_tags_1, /* Same as above */ sizeof(asn_DEF_Latitude_tags_1) /sizeof(asn_DEF_Latitude_tags_1[0]), /* 1 */ - { &asn_OER_type_Latitude_constr_1, 0, Latitude_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Latitude_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Latitude_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Latitude.h b/certgen/asncodec/Latitude.h index 32ee749..ef78afe 100644 --- a/certgen/asncodec/Latitude.h +++ b/certgen/asncodec/Latitude.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "NinetyDegreeInt.h" #ifndef _Latitude_H_ #define _Latitude_H_ #include -/* Including external dependencies */ -#include "NinetyDegreeInt.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Latitude; asn_struct_free_f Latitude_free; asn_struct_print_f Latitude_print; asn_constr_check_f Latitude_constraint; -ber_type_decoder_f Latitude_decode_ber; -der_type_encoder_f Latitude_encode_der; xer_type_decoder_f Latitude_decode_xer; xer_type_encoder_f Latitude_encode_xer; oer_type_decoder_f Latitude_decode_oer; diff --git a/certgen/asncodec/LinkageData.c b/certgen/asncodec/LinkageData.c index 00fb72a..1e8a1e5 100644 --- a/certgen/asncodec/LinkageData.c +++ b/certgen/asncodec/LinkageData.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "LinkageData.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_LinkageData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_IValue, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "iCert" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_LinkageData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_LinkageValue, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "linkage-value" }, @@ -31,7 +47,15 @@ asn_TYPE_member_t asn_MBR_LinkageData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_GroupLinkageValue, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "group-linkage-value" }, @@ -64,7 +88,15 @@ asn_TYPE_descriptor_t asn_DEF_LinkageData = { asn_DEF_LinkageData_tags_1, /* Same as above */ sizeof(asn_DEF_LinkageData_tags_1) /sizeof(asn_DEF_LinkageData_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_LinkageData_1, 3, /* Elements count */ &asn_SPC_LinkageData_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/LinkageData.h b/certgen/asncodec/LinkageData.h index 5ad80cc..b26ebed 100644 --- a/certgen/asncodec/LinkageData.h +++ b/certgen/asncodec/LinkageData.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _LinkageData_H_ -#define _LinkageData_H_ - - -#include /* Including external dependencies */ #include "IValue.h" #include "LinkageValue.h" #include +#ifndef _LinkageData_H_ +#define _LinkageData_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -27,7 +27,7 @@ struct GroupLinkageValue; typedef struct LinkageData { IValue_t iCert; LinkageValue_t linkage_value; - struct GroupLinkageValue *group_linkage_value /* OPTIONAL */; + struct GroupLinkageValue *group_linkage_value; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/LinkageInfo.c b/certgen/asncodec/LinkageInfo.c new file mode 100644 index 0000000..1572622 --- /dev/null +++ b/certgen/asncodec/LinkageInfo.c @@ -0,0 +1,84 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "LinkageInfo.h" + +asn_TYPE_member_t asn_MBR_LinkageInfo_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct LinkageInfo, encPlv1), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EncryptedIndividualPLV, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "encPlv1" + }, + { ATF_NOFLAGS, 0, offsetof(struct LinkageInfo, encPlv2), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EncryptedIndividualPLV, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "encPlv2" + }, +}; +static const ber_tlv_tag_t asn_DEF_LinkageInfo_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_LinkageInfo_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* encPlv1 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* encPlv2 */ +}; +asn_SEQUENCE_specifics_t asn_SPC_LinkageInfo_specs_1 = { + sizeof(struct LinkageInfo), + offsetof(struct LinkageInfo, _asn_ctx), + asn_MAP_LinkageInfo_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_LinkageInfo = { + "LinkageInfo", + "LinkageInfo", + &asn_OP_SEQUENCE, + asn_DEF_LinkageInfo_tags_1, + sizeof(asn_DEF_LinkageInfo_tags_1) + /sizeof(asn_DEF_LinkageInfo_tags_1[0]), /* 1 */ + asn_DEF_LinkageInfo_tags_1, /* Same as above */ + sizeof(asn_DEF_LinkageInfo_tags_1) + /sizeof(asn_DEF_LinkageInfo_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_LinkageInfo_1, + 2, /* Elements count */ + &asn_SPC_LinkageInfo_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/LinkageInfo.h b/certgen/asncodec/LinkageInfo.h new file mode 100644 index 0000000..ec10455 --- /dev/null +++ b/certgen/asncodec/LinkageInfo.h @@ -0,0 +1,45 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EncryptedIndividualPLV.h" +#include +#ifndef _LinkageInfo_H_ +#define _LinkageInfo_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* LinkageInfo */ +typedef struct LinkageInfo { + EncryptedIndividualPLV_t encPlv1; + EncryptedIndividualPLV_t encPlv2; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} LinkageInfo_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_LinkageInfo; +extern asn_SEQUENCE_specifics_t asn_SPC_LinkageInfo_specs_1; +extern asn_TYPE_member_t asn_MBR_LinkageInfo_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _LinkageInfo_H_ */ +#include diff --git a/certgen/asncodec/LinkageSeed.c b/certgen/asncodec/LinkageSeed.c index c96e807..e65d4a6 100644 --- a/certgen/asncodec/LinkageSeed.c +++ b/certgen/asncodec/LinkageSeed.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "LinkageSeed.h" @@ -37,9 +37,11 @@ LinkageSeed_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_LinkageSeed_constr_1 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_LinkageSeed_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_LinkageSeed = { asn_DEF_LinkageSeed_tags_1, /* Same as above */ sizeof(asn_DEF_LinkageSeed_tags_1) /sizeof(asn_DEF_LinkageSeed_tags_1[0]), /* 1 */ - { &asn_OER_type_LinkageSeed_constr_1, 0, LinkageSeed_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_LinkageSeed_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + LinkageSeed_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/LinkageSeed.h b/certgen/asncodec/LinkageSeed.h index 4f5d495..3b76a1d 100644 --- a/certgen/asncodec/LinkageSeed.h +++ b/certgen/asncodec/LinkageSeed.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _LinkageSeed_H_ #define _LinkageSeed_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_LinkageSeed; asn_struct_free_f LinkageSeed_free; asn_struct_print_f LinkageSeed_print; asn_constr_check_f LinkageSeed_constraint; -ber_type_decoder_f LinkageSeed_decode_ber; -der_type_encoder_f LinkageSeed_encode_der; xer_type_decoder_f LinkageSeed_decode_xer; xer_type_encoder_f LinkageSeed_encode_xer; oer_type_decoder_f LinkageSeed_decode_oer; diff --git a/certgen/asncodec/LinkageValue.c b/certgen/asncodec/LinkageValue.c index 5ac2dbf..a2aecf3 100644 --- a/certgen/asncodec/LinkageValue.c +++ b/certgen/asncodec/LinkageValue.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "LinkageValue.h" @@ -37,9 +37,11 @@ LinkageValue_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_LinkageValue_constr_1 CC_NOTUSED = { { 0, 0 }, 9 /* (SIZE(9..9)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_LinkageValue_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_LinkageValue = { asn_DEF_LinkageValue_tags_1, /* Same as above */ sizeof(asn_DEF_LinkageValue_tags_1) /sizeof(asn_DEF_LinkageValue_tags_1[0]), /* 1 */ - { &asn_OER_type_LinkageValue_constr_1, 0, LinkageValue_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_LinkageValue_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + LinkageValue_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/LinkageValue.h b/certgen/asncodec/LinkageValue.h index 9154d3d..91a7341 100644 --- a/certgen/asncodec/LinkageValue.h +++ b/certgen/asncodec/LinkageValue.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _LinkageValue_H_ #define _LinkageValue_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_LinkageValue; asn_struct_free_f LinkageValue_free; asn_struct_print_f LinkageValue_print; asn_constr_check_f LinkageValue_constraint; -ber_type_decoder_f LinkageValue_decode_ber; -der_type_encoder_f LinkageValue_encode_der; xer_type_decoder_f LinkageValue_decode_xer; xer_type_encoder_f LinkageValue_encode_xer; oer_type_decoder_f LinkageValue_decode_oer; diff --git a/certgen/asncodec/Longitude.c b/certgen/asncodec/Longitude.c index c122471..14b1f5c 100644 --- a/certgen/asncodec/Longitude.c +++ b/certgen/asncodec/Longitude.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Longitude.h" @@ -36,9 +36,11 @@ Longitude_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OneEightyDegreeInt, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Longitude_constr_1 CC_NOTUSED = { { 4, 0 } /* (-1799999999..1800000001) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Longitude_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_Longitude = { asn_DEF_Longitude_tags_1, /* Same as above */ sizeof(asn_DEF_Longitude_tags_1) /sizeof(asn_DEF_Longitude_tags_1[0]), /* 1 */ - { &asn_OER_type_Longitude_constr_1, 0, Longitude_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Longitude_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Longitude_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Longitude.h b/certgen/asncodec/Longitude.h index 9963311..7c0a08e 100644 --- a/certgen/asncodec/Longitude.h +++ b/certgen/asncodec/Longitude.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "OneEightyDegreeInt.h" #ifndef _Longitude_H_ #define _Longitude_H_ #include -/* Including external dependencies */ -#include "OneEightyDegreeInt.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Longitude; asn_struct_free_f Longitude_free; asn_struct_print_f Longitude_print; asn_constr_check_f Longitude_constraint; -ber_type_decoder_f Longitude_decode_ber; -der_type_encoder_f Longitude_encode_der; xer_type_decoder_f Longitude_decode_xer; xer_type_encoder_f Longitude_encode_xer; oer_type_decoder_f Longitude_decode_oer; diff --git a/certgen/asncodec/LopSsp.c b/certgen/asncodec/LopSsp.c new file mode 100644 index 0000000..f3c4d71 --- /dev/null +++ b/certgen/asncodec/LopSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "LopSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_LopSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct LopSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_LopSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_LopSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_LopSsp_specs_1 = { + sizeof(struct LopSsp), + offsetof(struct LopSsp, _asn_ctx), + asn_MAP_LopSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_LopSsp = { + "LopSsp", + "LopSsp", + &asn_OP_SEQUENCE, + asn_DEF_LopSsp_tags_1, + sizeof(asn_DEF_LopSsp_tags_1) + /sizeof(asn_DEF_LopSsp_tags_1[0]), /* 1 */ + asn_DEF_LopSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_LopSsp_tags_1) + /sizeof(asn_DEF_LopSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_LopSsp_1, + 1, /* Elements count */ + &asn_SPC_LopSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/LopSsp.h b/certgen/asncodec/LopSsp.h new file mode 100644 index 0000000..e65688f --- /dev/null +++ b/certgen/asncodec/LopSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _LopSsp_H_ +#define _LopSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* LopSsp */ +typedef struct LopSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} LopSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_LopSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_LopSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_LopSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _LopSsp_H_ */ +#include diff --git a/certgen/asncodec/LvGenerationFunctionIdentifier.c b/certgen/asncodec/LvGenerationFunctionIdentifier.c new file mode 100644 index 0000000..157ea2e --- /dev/null +++ b/certgen/asncodec/LvGenerationFunctionIdentifier.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "LvGenerationFunctionIdentifier.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_LvGenerationFunctionIdentifier_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_LvGenerationFunctionIdentifier = { + "LvGenerationFunctionIdentifier", + "LvGenerationFunctionIdentifier", + &asn_OP_NULL, + asn_DEF_LvGenerationFunctionIdentifier_tags_1, + sizeof(asn_DEF_LvGenerationFunctionIdentifier_tags_1) + /sizeof(asn_DEF_LvGenerationFunctionIdentifier_tags_1[0]), /* 1 */ + asn_DEF_LvGenerationFunctionIdentifier_tags_1, /* Same as above */ + sizeof(asn_DEF_LvGenerationFunctionIdentifier_tags_1) + /sizeof(asn_DEF_LvGenerationFunctionIdentifier_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/LvGenerationFunctionIdentifier.h b/certgen/asncodec/LvGenerationFunctionIdentifier.h new file mode 100644 index 0000000..e70b55d --- /dev/null +++ b/certgen/asncodec/LvGenerationFunctionIdentifier.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _LvGenerationFunctionIdentifier_H_ +#define _LvGenerationFunctionIdentifier_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* LvGenerationFunctionIdentifier */ +typedef NULL_t LvGenerationFunctionIdentifier_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_LvGenerationFunctionIdentifier; +asn_struct_free_f LvGenerationFunctionIdentifier_free; +asn_struct_print_f LvGenerationFunctionIdentifier_print; +asn_constr_check_f LvGenerationFunctionIdentifier_constraint; +xer_type_decoder_f LvGenerationFunctionIdentifier_decode_xer; +xer_type_encoder_f LvGenerationFunctionIdentifier_encode_xer; +oer_type_decoder_f LvGenerationFunctionIdentifier_decode_oer; +oer_type_encoder_f LvGenerationFunctionIdentifier_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _LvGenerationFunctionIdentifier_H_ */ +#include diff --git a/certgen/asncodec/MaInfoStatus.c b/certgen/asncodec/MaInfoStatus.c new file mode 100644 index 0000000..c63abb6 --- /dev/null +++ b/certgen/asncodec/MaInfoStatus.c @@ -0,0 +1,84 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "MaInfoStatus.h" + +asn_TYPE_member_t asn_MBR_MaInfoStatus_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct MaInfoStatus, psids), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfPsid, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "psids" + }, + { ATF_NOFLAGS, 0, offsetof(struct MaInfoStatus, updated), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "updated" + }, +}; +static const ber_tlv_tag_t asn_DEF_MaInfoStatus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_MaInfoStatus_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* psids */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* updated */ +}; +asn_SEQUENCE_specifics_t asn_SPC_MaInfoStatus_specs_1 = { + sizeof(struct MaInfoStatus), + offsetof(struct MaInfoStatus, _asn_ctx), + asn_MAP_MaInfoStatus_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_MaInfoStatus = { + "MaInfoStatus", + "MaInfoStatus", + &asn_OP_SEQUENCE, + asn_DEF_MaInfoStatus_tags_1, + sizeof(asn_DEF_MaInfoStatus_tags_1) + /sizeof(asn_DEF_MaInfoStatus_tags_1[0]), /* 1 */ + asn_DEF_MaInfoStatus_tags_1, /* Same as above */ + sizeof(asn_DEF_MaInfoStatus_tags_1) + /sizeof(asn_DEF_MaInfoStatus_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_MaInfoStatus_1, + 2, /* Elements count */ + &asn_SPC_MaInfoStatus_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/MaInfoStatus.h b/certgen/asncodec/MaInfoStatus.h new file mode 100644 index 0000000..c5496d5 --- /dev/null +++ b/certgen/asncodec/MaInfoStatus.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "SequenceOfPsid.h" +#include "Time32.h" +#include +#ifndef _MaInfoStatus_H_ +#define _MaInfoStatus_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* MaInfoStatus */ +typedef struct MaInfoStatus { + SequenceOfPsid_t psids; + Time32_t updated; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} MaInfoStatus_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_MaInfoStatus; +extern asn_SEQUENCE_specifics_t asn_SPC_MaInfoStatus_specs_1; +extern asn_TYPE_member_t asn_MBR_MaInfoStatus_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _MaInfoStatus_H_ */ +#include diff --git a/certgen/asncodec/MaRaInterfacePdu.c b/certgen/asncodec/MaRaInterfacePdu.c new file mode 100644 index 0000000..fdbda24 --- /dev/null +++ b/certgen/asncodec/MaRaInterfacePdu.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1MaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "MaRaInterfacePdu.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_MaRaInterfacePdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_MaRaInterfacePdu = { + "MaRaInterfacePdu", + "MaRaInterfacePdu", + &asn_OP_NULL, + asn_DEF_MaRaInterfacePdu_tags_1, + sizeof(asn_DEF_MaRaInterfacePdu_tags_1) + /sizeof(asn_DEF_MaRaInterfacePdu_tags_1[0]), /* 1 */ + asn_DEF_MaRaInterfacePdu_tags_1, /* Same as above */ + sizeof(asn_DEF_MaRaInterfacePdu_tags_1) + /sizeof(asn_DEF_MaRaInterfacePdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/MaRaInterfacePdu.h b/certgen/asncodec/MaRaInterfacePdu.h new file mode 100644 index 0000000..364c50c --- /dev/null +++ b/certgen/asncodec/MaRaInterfacePdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1MaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _MaRaInterfacePdu_H_ +#define _MaRaInterfacePdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* MaRaInterfacePdu */ +typedef NULL_t MaRaInterfacePdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_MaRaInterfacePdu; +asn_struct_free_f MaRaInterfacePdu_free; +asn_struct_print_f MaRaInterfacePdu_print; +asn_constr_check_f MaRaInterfacePdu_constraint; +xer_type_decoder_f MaRaInterfacePdu_decode_xer; +xer_type_encoder_f MaRaInterfacePdu_encode_xer; +oer_type_decoder_f MaRaInterfacePdu_decode_oer; +oer_type_encoder_f MaRaInterfacePdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _MaRaInterfacePdu_H_ */ +#include diff --git a/certgen/asncodec/MaSsp.c b/certgen/asncodec/MaSsp.c new file mode 100644 index 0000000..52f2dba --- /dev/null +++ b/certgen/asncodec/MaSsp.c @@ -0,0 +1,114 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "MaSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_MaSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct MaSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct MaSsp, relevantPsids), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfPsid, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "relevantPsids" + }, +}; +static const ber_tlv_tag_t asn_DEF_MaSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_MaSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* relevantPsids */ +}; +asn_SEQUENCE_specifics_t asn_SPC_MaSsp_specs_1 = { + sizeof(struct MaSsp), + offsetof(struct MaSsp, _asn_ctx), + asn_MAP_MaSsp_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_MaSsp = { + "MaSsp", + "MaSsp", + &asn_OP_SEQUENCE, + asn_DEF_MaSsp_tags_1, + sizeof(asn_DEF_MaSsp_tags_1) + /sizeof(asn_DEF_MaSsp_tags_1[0]), /* 1 */ + asn_DEF_MaSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_MaSsp_tags_1) + /sizeof(asn_DEF_MaSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_MaSsp_1, + 2, /* Elements count */ + &asn_SPC_MaSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/MaSsp.h b/certgen/asncodec/MaSsp.h new file mode 100644 index 0000000..bf50f0f --- /dev/null +++ b/certgen/asncodec/MaSsp.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "SequenceOfPsid.h" +#include +#ifndef _MaSsp_H_ +#define _MaSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* MaSsp */ +typedef struct MaSsp { + Uint8_t version; + SequenceOfPsid_t relevantPsids; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} MaSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_MaSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_MaSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_MaSsp_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _MaSsp_H_ */ +#include diff --git a/certgen/asncodec/Makefile b/certgen/asncodec/Makefile index e2c2c8c..8f06d5d 100644 --- a/certgen/asncodec/Makefile +++ b/certgen/asncodec/Makefile @@ -1,16 +1,77 @@ -###################################################################### -## -## Created by: Denis Filatov -## -## Copyleft (c) 2015 -## This code is provided under the MIT license agreement. -###################################################################### +ifneq ( $(findstring $(MAKECMDGOALS),clean regen),) + include Makefile.am.libasncodec +endif + PROJECTROOT = ../.. BUILDROOT = $(PROJECTROOT)/build CSHAREDDIR = $(PROJECTROOT)/cshared PROJECT = ItsCertAsn DEBUG = yes alibs = ItsCertAsn -sources := $(wildcard *.c) +sources := $(ASN_MODULE_SRCS) includes += . +cflags += $(ASN_MODULE_CFLAGS) + include $(CSHAREDDIR)/common.mk + +TS102941_DIR := asn1/pki_ts102941 +TS103097_DIR := asn1/sec_ts103097 +IEEE1609_2_DIR := asn1/ieee1609.2 +IEEE1609_2_1_DIR := asn1/ieee1609.2.1 + +ASN1CDIR ?= ../../../../asn1c-fillabs2 + +ifeq (,$(ASN1C)) + ifneq (,$(ASN1CDIR)) + ASN1C := $(ASN1CDIR)/asn1c/.libs/asn1c -S $(ASN1CDIR)/skeletons + else + ASN1C := asn1c + endif +endif + +ASN1C_ARGS := -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example + +ASN1_SRC := \ + $(TS102941_DIR)/EtsiTs102941MessagesCA.asn \ + $(TS102941_DIR)/EtsiTs102941TrustLists.asn \ + $(TS102941_DIR)/EtsiTs102941TypesAuthorization.asn \ + $(TS102941_DIR)/EtsiTs102941TypesAuthorizationValidation.asn \ + $(TS102941_DIR)/EtsiTs102941TypesCaManagement.asn \ + $(TS102941_DIR)/EtsiTs102941BaseTypes.asn \ + $(TS102941_DIR)/EtsiTs102941TypesEnrolment.asn \ + $(TS102941_DIR)/EtsiTs102941TypesLinkCertificate.asn \ + $(TS103097_DIR)/EtsiTs103097Module.asn \ + $(TS103097_DIR)/EtsiTs103097ExtensionModule.asn \ + $(IEEE1609_2_DIR)/IEEE1609dot2.asn \ + $(IEEE1609_2_DIR)/IEEE1609dot2BaseTypes.asn \ + $(IEEE1609_2_DIR)/Ieee1609Dot2Crl.asn \ + $(IEEE1609_2_DIR)/Ieee1609Dot2CrlBaseTypes.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1AcaEeInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1AcaLaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1AcaMaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1AcaRaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1Acpc.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1CamRaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1CertManagement.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1EcaEeInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1EeMaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1EeRaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1LaMaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1LaRaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1MaRaInterface.asn \ + $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1Protocol.asn \ + +ASN1_PDU := \ + EtsiTs103097Data \ + EnrolmentRequestMessage EnrolmentResponseMessage \ + AuthorizationRequestMessage AuthorizationRequestMessageWithPop AuthorizationResponseMessage \ + CertificateRevocationListMessage TlmCertificateTrustListMessage RcaCertificateTrustListMessage \ + AuthorizationValidationRequestMessage AuthorizationValidationResponseMessage \ + CaCertificateRequestMessage \ + EtsiTs103097Certificate + +regen: force_regen Makefile.am.libasncodec +force_regen: + rm -f Makefile.am.libasncodec +Makefile.am.libasncodec: $(ASN1_SRC) + $(ASN1C) -fcompound-names $(ASN1C_ARGS) $(addprefix -pdu=,$(ASN1_PDU)) $(patsubst %,"%",$(ASN1_SRC)) 2>&1 diff --git a/certgen/asncodec/MissingCrlIdentifier.c b/certgen/asncodec/MissingCrlIdentifier.c index 119b516..89a709c 100644 --- a/certgen/asncodec/MissingCrlIdentifier.c +++ b/certgen/asncodec/MissingCrlIdentifier.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "MissingCrlIdentifier.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_MissingCrlIdentifier_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId3, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "cracaId" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_MissingCrlIdentifier_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CrlSeries, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "crlSeries" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_MissingCrlIdentifier = { asn_DEF_MissingCrlIdentifier_tags_1, /* Same as above */ sizeof(asn_DEF_MissingCrlIdentifier_tags_1) /sizeof(asn_DEF_MissingCrlIdentifier_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_MissingCrlIdentifier_1, 2, /* Elements count */ &asn_SPC_MissingCrlIdentifier_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/MissingCrlIdentifier.h b/certgen/asncodec/MissingCrlIdentifier.h index 1af523a..35ee007 100644 --- a/certgen/asncodec/MissingCrlIdentifier.h +++ b/certgen/asncodec/MissingCrlIdentifier.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _MissingCrlIdentifier_H_ -#define _MissingCrlIdentifier_H_ - - -#include /* Including external dependencies */ #include "HashedId3.h" #include "CrlSeries.h" #include +#ifndef _MissingCrlIdentifier_H_ +#define _MissingCrlIdentifier_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/MultiSignedCtl.c b/certgen/asncodec/MultiSignedCtl.c new file mode 100644 index 0000000..cdd5fa7 --- /dev/null +++ b/certgen/asncodec/MultiSignedCtl.c @@ -0,0 +1,460 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "MultiSignedCtl.h" + +static const long asn_VAL_1_fullIeeeCtl = 1; +static const asn_ioc_cell_t asn_IOS_Ieee1609dot2dot1Ctls_1_rows[] = { + { "&type", aioc__value, &asn_DEF_Ieee1609dot2dot1MsctlType, &asn_VAL_1_fullIeeeCtl }, + { "&TbsCtl", aioc__type, &asn_DEF_FullIeeeTbsCtl }, + { "&UnsignedCtlMaterial", aioc__type, &asn_DEF_SequenceOfCertificate } +}; +static const asn_ioc_set_t asn_IOS_Ieee1609dot2dot1Ctls_1[] = { + { 1, 3, asn_IOS_Ieee1609dot2dot1Ctls_1_rows } +}; +static int +memb_type_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static asn_type_selector_result_t +select_MultiSignedCtl_tbsCtl_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { + asn_type_selector_result_t result = {0, 0}; + const asn_ioc_set_t *itable = asn_IOS_Ieee1609dot2dot1Ctls_1; + size_t constraining_column = 0; /* &type */ + size_t for_column = 1; /* &TbsCtl */ + size_t row, presence_index = 0; + const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct MultiSignedCtl, type)); + + for(row=0; row < itable->rows_count; row++) { + const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column]; + const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column]; + + if(type_cell->cell_kind == aioc__undefined) + continue; + + presence_index++; + if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { + result.type_descriptor = type_cell->type_descriptor; + result.presence_index = presence_index; + break; + } + } + + return result; +} + +static int +memb_tbsCtl_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +static asn_type_selector_result_t +select_MultiSignedCtl_unsigned_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { + asn_type_selector_result_t result = {0, 0}; + const asn_ioc_set_t *itable = asn_IOS_Ieee1609dot2dot1Ctls_1; + size_t constraining_column = 0; /* &type */ + size_t for_column = 2; /* &UnsignedCtlMaterial */ + size_t row, presence_index = 0; + const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct MultiSignedCtl, type)); + + for(row=0; row < itable->rows_count; row++) { + const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column]; + const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column]; + + if(type_cell->cell_kind == aioc__undefined) + continue; + + presence_index++; + if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { + result.type_descriptor = type_cell->type_descriptor; + result.presence_index = presence_index; + break; + } + } + + return result; +} + +static int +memb_unsigned_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +static int +memb_signatures_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + /* Determine the number of elements */ + size = _A_CSEQUENCE_FROM_VOID(sptr)->count; + + if((size >= 1)) { + /* Perform validation of the inner elements */ + return SEQUENCE_OF_constraint(td, sptr, ctfailcb, app_key); + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_signatures_constr_5 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_type_constr_2 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_tbsCtl_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_unsigned_constr_4 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_signatures_constr_5 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_tbsCtl_3[] = { + { ATF_NOFLAGS, 0, offsetof(struct MultiSignedCtl__tbsCtl, choice.FullIeeeTbsCtl), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_FullIeeeTbsCtl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "FullIeeeTbsCtl" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_tbsCtl_tag2el_3[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* FullIeeeTbsCtl */ +}; +static asn_CHOICE_specifics_t asn_SPC_tbsCtl_specs_3 = { + sizeof(struct MultiSignedCtl__tbsCtl), + offsetof(struct MultiSignedCtl__tbsCtl, _asn_ctx), + offsetof(struct MultiSignedCtl__tbsCtl, present), + sizeof(((struct MultiSignedCtl__tbsCtl *)0)->present), + asn_MAP_tbsCtl_tag2el_3, + 1, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_tbsCtl_3 = { + "tbsCtl", + "tbsCtl", + &asn_OP_OPEN_TYPE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OPEN_TYPE_constraint + }, + asn_MBR_tbsCtl_3, + 1, /* Elements count */ + &asn_SPC_tbsCtl_specs_3 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_unsigned_4[] = { + { ATF_NOFLAGS, 0, offsetof(struct MultiSignedCtl__unsigned, choice.SequenceOfCertificate), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_SequenceOfCertificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "SequenceOfCertificate" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_unsigned_tag2el_4[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* SequenceOfCertificate */ +}; +static asn_CHOICE_specifics_t asn_SPC_unsigned_specs_4 = { + sizeof(struct MultiSignedCtl__unsigned), + offsetof(struct MultiSignedCtl__unsigned, _asn_ctx), + offsetof(struct MultiSignedCtl__unsigned, present), + sizeof(((struct MultiSignedCtl__unsigned *)0)->present), + asn_MAP_unsigned_tag2el_4, + 1, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_unsigned_4 = { + "unsigned", + "unsigned", + &asn_OP_OPEN_TYPE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OPEN_TYPE_constraint + }, + asn_MBR_unsigned_4, + 1, /* Elements count */ + &asn_SPC_unsigned_specs_4 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_signatures_5[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_CtlSignatureSpdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_signatures_tags_5[] = { + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_signatures_specs_5 = { + sizeof(struct MultiSignedCtl__signatures), + offsetof(struct MultiSignedCtl__signatures, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_signatures_5 = { + "signatures", + "signatures", + &asn_OP_SEQUENCE_OF, + asn_DEF_signatures_tags_5, + sizeof(asn_DEF_signatures_tags_5) + /sizeof(asn_DEF_signatures_tags_5[0]) - 1, /* 1 */ + asn_DEF_signatures_tags_5, /* Same as above */ + sizeof(asn_DEF_signatures_tags_5) + /sizeof(asn_DEF_signatures_tags_5[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_signatures_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_signatures_5, + 1, /* Single element */ + &asn_SPC_signatures_specs_5 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_MultiSignedCtl_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct MultiSignedCtl, type), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Ieee1609dot2dot1MsctlType, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_type_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_type_constraint_1 + }, + 0, 0, /* No default value */ + "type" + }, + { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct MultiSignedCtl, tbsCtl), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_tbsCtl_3, + select_MultiSignedCtl_tbsCtl_type, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_tbsCtl_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_tbsCtl_constraint_1 + }, + 0, 0, /* No default value */ + "tbsCtl" + }, + { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct MultiSignedCtl, Unsigned), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_unsigned_4, + select_MultiSignedCtl_unsigned_type, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_unsigned_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_unsigned_constraint_1 + }, + 0, 0, /* No default value */ + "unsigned" + }, + { ATF_NOFLAGS, 0, offsetof(struct MultiSignedCtl, signatures), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + 0, + &asn_DEF_signatures_5, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_signatures_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_signatures_constraint_1 + }, + 0, 0, /* No default value */ + "signatures" + }, +}; +static const ber_tlv_tag_t asn_DEF_MultiSignedCtl_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_MultiSignedCtl_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* tbsCtl */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* unsigned */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* signatures */ +}; +asn_SEQUENCE_specifics_t asn_SPC_MultiSignedCtl_specs_1 = { + sizeof(struct MultiSignedCtl), + offsetof(struct MultiSignedCtl, _asn_ctx), + asn_MAP_MultiSignedCtl_tag2el_1, + 4, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_MultiSignedCtl = { + "MultiSignedCtl", + "MultiSignedCtl", + &asn_OP_SEQUENCE, + asn_DEF_MultiSignedCtl_tags_1, + sizeof(asn_DEF_MultiSignedCtl_tags_1) + /sizeof(asn_DEF_MultiSignedCtl_tags_1[0]), /* 1 */ + asn_DEF_MultiSignedCtl_tags_1, /* Same as above */ + sizeof(asn_DEF_MultiSignedCtl_tags_1) + /sizeof(asn_DEF_MultiSignedCtl_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_MultiSignedCtl_1, + 4, /* Elements count */ + &asn_SPC_MultiSignedCtl_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/MultiSignedCtl.h b/certgen/asncodec/MultiSignedCtl.h new file mode 100644 index 0000000..bf268a6 --- /dev/null +++ b/certgen/asncodec/MultiSignedCtl.h @@ -0,0 +1,88 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609dot2dot1MsctlType.h" +#include +#include +#include "FullIeeeTbsCtl.h" +#include "SequenceOfCertificate.h" +#include +#include +#include +#include +#include +#ifndef _MultiSignedCtl_H_ +#define _MultiSignedCtl_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum MultiSignedCtl__tbsCtl_PR { + MultiSignedCtl__tbsCtl_PR_NOTHING, /* No components present */ + MultiSignedCtl__tbsCtl_PR_FullIeeeTbsCtl +} MultiSignedCtl__tbsCtl_PR; +typedef enum MultiSignedCtl__unsigned_PR { + MultiSignedCtl__unsigned_PR_NOTHING, /* No components present */ + MultiSignedCtl__unsigned_PR_SequenceOfCertificate +} MultiSignedCtl__unsigned_PR; + +/* Forward declarations */ +struct CtlSignatureSpdu; + +/* MultiSignedCtl */ +typedef struct MultiSignedCtl { + Ieee1609dot2dot1MsctlType_t type; + struct MultiSignedCtl__tbsCtl { + MultiSignedCtl__tbsCtl_PR present; + union MultiSignedCtl__tbsCtl_u { + FullIeeeTbsCtl_t FullIeeeTbsCtl; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } tbsCtl; + struct MultiSignedCtl__unsigned { + MultiSignedCtl__unsigned_PR present; + union MultiSignedCtl__unsigned_u { + SequenceOfCertificate_t SequenceOfCertificate; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Unsigned; + struct MultiSignedCtl__signatures { + A_SEQUENCE_OF(struct CtlSignatureSpdu) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } signatures; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} MultiSignedCtl_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_MultiSignedCtl; +extern asn_SEQUENCE_specifics_t asn_SPC_MultiSignedCtl_specs_1; +extern asn_TYPE_member_t asn_MBR_MultiSignedCtl_1[4]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "CtlSignatureSpdu.h" + +#endif /* _MultiSignedCtl_H_ */ +#include diff --git a/certgen/asncodec/MultiSignedCtlSpdu.c b/certgen/asncodec/MultiSignedCtlSpdu.c new file mode 100644 index 0000000..762c499 --- /dev/null +++ b/certgen/asncodec/MultiSignedCtlSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "MultiSignedCtlSpdu.h" + +int +MultiSignedCtlSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Unsecured_216P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_MultiSignedCtlSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_MultiSignedCtlSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_MultiSignedCtlSpdu = { + "MultiSignedCtlSpdu", + "MultiSignedCtlSpdu", + &asn_OP_SEQUENCE, + asn_DEF_MultiSignedCtlSpdu_tags_1, + sizeof(asn_DEF_MultiSignedCtlSpdu_tags_1) + /sizeof(asn_DEF_MultiSignedCtlSpdu_tags_1[0]), /* 1 */ + asn_DEF_MultiSignedCtlSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_MultiSignedCtlSpdu_tags_1) + /sizeof(asn_DEF_MultiSignedCtlSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_MultiSignedCtlSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + MultiSignedCtlSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/MultiSignedCtlSpdu.h b/certgen/asncodec/MultiSignedCtlSpdu.h new file mode 100644 index 0000000..165829a --- /dev/null +++ b/certgen/asncodec/MultiSignedCtlSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Unsecured.h" +#ifndef _MultiSignedCtlSpdu_H_ +#define _MultiSignedCtlSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* MultiSignedCtlSpdu */ +typedef Ieee1609Dot2Data_Unsecured_216P0_t MultiSignedCtlSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_MultiSignedCtlSpdu; +asn_struct_free_f MultiSignedCtlSpdu_free; +asn_struct_print_f MultiSignedCtlSpdu_print; +asn_constr_check_f MultiSignedCtlSpdu_constraint; +xer_type_decoder_f MultiSignedCtlSpdu_decode_xer; +xer_type_encoder_f MultiSignedCtlSpdu_encode_xer; +oer_type_decoder_f MultiSignedCtlSpdu_decode_oer; +oer_type_encoder_f MultiSignedCtlSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _MultiSignedCtlSpdu_H_ */ +#include diff --git a/certgen/asncodec/NULL.c b/certgen/asncodec/NULL.c index 1268341..d160e69 100644 --- a/certgen/asncodec/NULL.c +++ b/certgen/asncodec/NULL.c @@ -1,250 +1,113 @@ -/*- - * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include -#include /* Implemented in terms of BOOLEAN type */ - -/* - * NULL basic type description. - */ -static const ber_tlv_tag_t asn_DEF_NULL_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) -}; -asn_TYPE_operation_t asn_OP_NULL = { - BOOLEAN_free, - NULL_print, - NULL_compare, - BOOLEAN_decode_ber, /* Implemented in terms of BOOLEAN */ - NULL_encode_der, /* Special handling of DER encoding */ - NULL_decode_xer, - NULL_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - NULL_decode_oer, - NULL_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - NULL_decode_uper, /* Unaligned PER decoder */ - NULL_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - NULL_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_NULL = { - "NULL", - "NULL", - &asn_OP_NULL, - asn_DEF_NULL_tags, - sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), - asn_DEF_NULL_tags, /* Same as above */ - sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), - { 0, 0, asn_generic_no_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -asn_enc_rval_t -NULL_encode_der(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, - ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t erval; - - erval.encoded = der_write_tags(td, 0, tag_mode, 0, tag, cb, app_key); - if(erval.encoded == -1) { - erval.failed_type = td; - erval.structure_ptr = ptr; - } - - ASN__ENCODED_OK(erval); -} - -asn_enc_rval_t -NULL_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, - void *app_key) { - asn_enc_rval_t er; - - (void)td; - (void)sptr; - (void)ilevel; - (void)flags; - (void)cb; - (void)app_key; - - /* XMLNullValue is empty */ - er.encoded = 0; - ASN__ENCODED_OK(er); -} - - -static enum xer_pbd_rval -NULL__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, - const void *chunk_buf, size_t chunk_size) { - (void)td; - (void)sptr; - (void)chunk_buf; /* Going to be empty according to the rules below. */ - - /* - * There must be no content in self-terminating tag. - */ - if(chunk_size) - return XPBD_BROKEN_ENCODING; - else - return XPBD_BODY_CONSUMED; -} - -asn_dec_rval_t -NULL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, size_t size) { - return xer_decode_primitive(opt_codec_ctx, td, - sptr, sizeof(NULL_t), opt_mname, buf_ptr, size, - NULL__xer_body_decode); -} - -int -NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) { - (void)td; - (void)a; - (void)b; - return 0; -} - -int -NULL_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - (void)td; /* Unused argument */ - (void)ilevel; /* Unused argument */ - - if(sptr) { - return (cb("", 9, app_key) < 0) ? -1 : 0; - } else { - return (cb("", 8, app_key) < 0) ? -1 : 0; - } -} - -#ifndef ASN_DISABLE_OER_SUPPORT - -asn_dec_rval_t -NULL_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **sptr, - const void *ptr, size_t size) { - asn_dec_rval_t rv = {RC_OK, 0}; - (void)opt_codec_ctx; - (void)td; - (void)constraints; - (void)ptr; - (void)size; - - if(!*sptr) { - *sptr = MALLOC(sizeof(NULL_t)); - if(*sptr) { - *(NULL_t *)*sptr = 0; - } else { - ASN__DECODE_FAILED; - } - } - - return rv; -} - -asn_enc_rval_t -NULL_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er; - - (void)td; - (void)sptr; - (void)constraints; - (void)cb; - (void)app_key; - - er.encoded = 0; /* Encoding in 0 bytes. */ - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_dec_rval_t -NULL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - asn_dec_rval_t rv; - - (void)opt_codec_ctx; - (void)td; - (void)constraints; - (void)pd; - - if(!*sptr) { - *sptr = MALLOC(sizeof(NULL_t)); - if(*sptr) { - *(NULL_t *)*sptr = 0; - } else { - ASN__DECODE_FAILED; - } - } - - /* - * NULL type does not have content octets. - */ - - rv.code = RC_OK; - rv.consumed = 0; - return rv; -} - -asn_enc_rval_t -NULL_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_per_outp_t *po) { - asn_enc_rval_t er; - - (void)td; - (void)constraints; - (void)sptr; - (void)po; - - er.encoded = 0; - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -asn_random_fill_result_t -NULL_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constr, - size_t max_length) { - asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - NULL_t *st = *sptr; - - (void)td; - (void)constr; - - if(max_length == 0) return result_skipped; - - if(st == NULL) { - st = (NULL_t *)(*sptr = CALLOC(1, sizeof(*st))); - if(st == NULL) { - return result_failed; - } - } - - return result_ok; -} - +/*- + * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * NULL basic type description. + */ +static const ber_tlv_tag_t asn_DEF_NULL_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_operation_t asn_OP_NULL = { + NULL_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + NULL_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + NULL_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + NULL_decode_ber, + NULL_encode_der, /* Special handling of DER encoding */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + NULL_decode_xer, + NULL_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + NULL_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + NULL_decode_oer, + NULL_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + NULL_decode_uper, /* Unaligned PER decoder */ + NULL_encode_uper, /* Unaligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + NULL_decode_aper, /* Aligned PER decoder */ + NULL_encode_aper, /* Aligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + NULL_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_NULL = { + "NULL", + "NULL", + &asn_OP_NULL, + asn_DEF_NULL_tags, + sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), + asn_DEF_NULL_tags, /* Same as above */ + sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +void +NULL_free(const asn_TYPE_descriptor_t *td, void *ptr, + enum asn_struct_free_method method) { + if(td && ptr) { + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(ptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(ptr, 0, sizeof(NULL_t)); + break; + } + } +} + +int +NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) { + (void)td; + (void)a; + (void)b; + return 0; +} diff --git a/certgen/asncodec/NULL.h b/certgen/asncodec/NULL.h index 95ad57a..7264475 100644 --- a/certgen/asncodec/NULL.h +++ b/certgen/asncodec/NULL.h @@ -1,43 +1,69 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_TYPE_NULL_H -#define ASN_TYPE_NULL_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The value of the NULL type is meaningless: see BOOLEAN if you want to - * carry true/false semantics. - */ -typedef int NULL_t; - -extern asn_TYPE_descriptor_t asn_DEF_NULL; -extern asn_TYPE_operation_t asn_OP_NULL; - -asn_struct_print_f NULL_print; -asn_struct_compare_f NULL_compare; -der_type_encoder_f NULL_encode_der; -xer_type_decoder_f NULL_decode_xer; -xer_type_encoder_f NULL_encode_xer; -oer_type_decoder_f NULL_decode_oer; -oer_type_encoder_f NULL_encode_oer; -per_type_decoder_f NULL_decode_uper; -per_type_encoder_f NULL_encode_uper; -asn_random_fill_f NULL_random_fill; - -#define NULL_free BOOLEAN_free -#define NULL_decode_ber BOOLEAN_decode_ber -#define NULL_constraint asn_generic_no_constraint - -#ifdef __cplusplus -} -#endif - -#endif /* NULL_H */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_TYPE_NULL_H +#define ASN_TYPE_NULL_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The value of the NULL type is meaningless. + * Use the BOOLEAN type if you need to carry true/false semantics. + */ +typedef int NULL_t; + +extern asn_TYPE_descriptor_t asn_DEF_NULL; +extern asn_TYPE_operation_t asn_OP_NULL; + +asn_struct_free_f NULL_free; + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f NULL_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f NULL_compare; + +#define NULL_constraint asn_generic_no_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f NULL_decode_ber; +der_type_encoder_f NULL_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f NULL_decode_xer; +xer_type_encoder_f NULL_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f NULL_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f NULL_decode_oer; +oer_type_encoder_f NULL_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f NULL_decode_uper; +per_type_encoder_f NULL_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f NULL_decode_aper; +per_type_encoder_f NULL_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f NULL_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* NULL_H */ diff --git a/certgen/asncodec/NULL_oer.c b/certgen/asncodec/NULL_oer.c new file mode 100644 index 0000000..29abaa2 --- /dev/null +++ b/certgen/asncodec/NULL_oer.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_dec_rval_t +NULL_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **sptr, + const void *ptr, size_t size) { + asn_dec_rval_t rv = {RC_OK, 0}; + (void)opt_codec_ctx; + (void)td; + (void)constraints; + (void)ptr; + (void)size; + + if(!*sptr) { + *sptr = MALLOC(sizeof(NULL_t)); + if(*sptr) { + *(NULL_t *)*sptr = 0; + } else { + ASN__DECODE_FAILED; + } + } + + return rv; +} + +asn_enc_rval_t +NULL_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_enc_rval_t er = {0,0,0}; + + (void)td; + (void)sptr; + (void)constraints; + (void)cb; + (void)app_key; + + er.encoded = 0; /* Encoding in 0 bytes. */ + + ASN__ENCODED_OK(er); +} diff --git a/certgen/asncodec/NULL_print.c b/certgen/asncodec/NULL_print.c new file mode 100644 index 0000000..52fcc0e --- /dev/null +++ b/certgen/asncodec/NULL_print.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +NULL_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(sptr) { + return (cb("", 9, app_key) < 0) ? -1 : 0; + } else { + return (cb("", 8, app_key) < 0) ? -1 : 0; + } +} diff --git a/certgen/asncodec/NULL_xer.c b/certgen/asncodec/NULL_xer.c new file mode 100644 index 0000000..5a6e4b9 --- /dev/null +++ b/certgen/asncodec/NULL_xer.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +asn_enc_rval_t +NULL_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, + void *app_key) { + asn_enc_rval_t er = {0,0,0}; + + (void)td; + (void)sptr; + (void)ilevel; + (void)flags; + (void)cb; + (void)app_key; + + /* XMLNullValue is empty */ + er.encoded = 0; + ASN__ENCODED_OK(er); +} + + +static enum xer_pbd_rval +NULL__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, + const void *chunk_buf, size_t chunk_size) { + (void)td; + (void)sptr; + (void)chunk_buf; /* Going to be empty according to the rules below. */ + + /* + * There must be no content in self-terminating tag. + */ + if(chunk_size) + return XPBD_BROKEN_ENCODING; + else + return XPBD_BODY_CONSUMED; +} + +asn_dec_rval_t +NULL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, size_t size) { + return xer_decode_primitive(opt_codec_ctx, td, + sptr, sizeof(NULL_t), opt_mname, buf_ptr, size, + NULL__xer_body_decode); +} diff --git a/certgen/asncodec/NativeEnumerated.c b/certgen/asncodec/NativeEnumerated.c index 208911f..aee450c 100644 --- a/certgen/asncodec/NativeEnumerated.c +++ b/certgen/asncodec/NativeEnumerated.c @@ -1,226 +1,108 @@ -/*- - * Copyright (c) 2004, 2007 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Read the NativeInteger.h for the explanation wrt. differences between - * INTEGER and NativeInteger. - * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this - * implementation deals with the standard (machine-specific) representation - * of them instead of using the platform-independent buffer. - */ -#include -#include - -/* - * NativeEnumerated basic type description. - */ -static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) -}; -asn_TYPE_operation_t asn_OP_NativeEnumerated = { - NativeInteger_free, - NativeInteger_print, - NativeInteger_compare, - NativeInteger_decode_ber, - NativeInteger_encode_der, - NativeInteger_decode_xer, - NativeEnumerated_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - NativeEnumerated_decode_oer, - NativeEnumerated_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - NativeEnumerated_decode_uper, - NativeEnumerated_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - NativeEnumerated_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = { - "ENUMERATED", /* The ASN.1 type is still ENUMERATED */ - "ENUMERATED", - &asn_OP_NativeEnumerated, - asn_DEF_NativeEnumerated_tags, - sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), - asn_DEF_NativeEnumerated_tags, /* Same as above */ - sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), - { 0, 0, asn_generic_no_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -asn_enc_rval_t -NativeEnumerated_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - const long *native = (const long *)sptr; - const asn_INTEGER_enum_map_t *el; - - (void)ilevel; - (void)flags; - - if(!native) ASN__ENCODE_FAILED; - - el = INTEGER_map_value2enum(specs, *native); - if(el) { - er.encoded = - asn__format_to_callback(cb, app_key, "<%s/>", el->enum_name); - if(er.encoded < 0) ASN__ENCODE_FAILED; - ASN__ENCODED_OK(er); - } else { - ASN_DEBUG( - "ASN.1 forbids dealing with " - "unknown value of ENUMERATED type"); - ASN__ENCODE_FAILED; - } -} - -asn_dec_rval_t -NativeEnumerated_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - void **sptr, asn_per_data_t *pd) { - const asn_INTEGER_specifics_t *specs = td->specifics; - asn_dec_rval_t rval = { RC_OK, 0 }; - long *native = (long *)*sptr; - const asn_per_constraint_t *ct; - long value; - - (void)opt_codec_ctx; - - if(constraints) ct = &constraints->value; - else if(td->encoding_constraints.per_constraints) - ct = &td->encoding_constraints.per_constraints->value; - else ASN__DECODE_FAILED; /* Mandatory! */ - if(!specs) ASN__DECODE_FAILED; - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - if(!native) ASN__DECODE_FAILED; - } - - ASN_DEBUG("Decoding %s as NativeEnumerated", td->name); - - if(ct->flags & APC_EXTENSIBLE) { - int inext = per_get_few_bits(pd, 1); - if(inext < 0) ASN__DECODE_STARVED; - if(inext) ct = 0; - } - - if(ct && ct->range_bits >= 0) { - value = per_get_few_bits(pd, ct->range_bits); - if(value < 0) ASN__DECODE_STARVED; - if(value >= (specs->extension - ? specs->extension - 1 : specs->map_count)) - ASN__DECODE_FAILED; - } else { - if(!specs->extension) - ASN__DECODE_FAILED; - /* - * X.691, #10.6: normally small non-negative whole number; - */ - value = uper_get_nsnnwn(pd); - if(value < 0) ASN__DECODE_STARVED; - value += specs->extension - 1; - if(value >= specs->map_count) - ASN__DECODE_FAILED; - } - - *native = specs->value2enum[value].nat_value; - ASN_DEBUG("Decoded %s = %ld", td->name, *native); - - return rval; -} - -static int -NativeEnumerated__compar_value2enum(const void *ap, const void *bp) { - const asn_INTEGER_enum_map_t *a = ap; - const asn_INTEGER_enum_map_t *b = bp; - if(a->nat_value == b->nat_value) - return 0; - if(a->nat_value < b->nat_value) - return -1; - return 1; -} - -asn_enc_rval_t -NativeEnumerated_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, asn_per_outp_t *po) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - long native, value; - const asn_per_constraint_t *ct; - int inext = 0; - asn_INTEGER_enum_map_t key; - const asn_INTEGER_enum_map_t *kf; - - if(!sptr) ASN__ENCODE_FAILED; - if(!specs) ASN__ENCODE_FAILED; - - if(constraints) ct = &constraints->value; - else if(td->encoding_constraints.per_constraints) - ct = &td->encoding_constraints.per_constraints->value; - else ASN__ENCODE_FAILED; /* Mandatory! */ - - ASN_DEBUG("Encoding %s as NativeEnumerated", td->name); - - er.encoded = 0; - - native = *(const long *)sptr; - - key.nat_value = native; - kf = bsearch(&key, specs->value2enum, specs->map_count, - sizeof(key), NativeEnumerated__compar_value2enum); - if(!kf) { - ASN_DEBUG("No element corresponds to %ld", native); - ASN__ENCODE_FAILED; - } - value = kf - specs->value2enum; - - if(ct->range_bits >= 0) { - int cmpWith = specs->extension - ? specs->extension - 1 : specs->map_count; - if(value >= cmpWith) - inext = 1; - } - if(ct->flags & APC_EXTENSIBLE) { - if(per_put_few_bits(po, inext, 1)) - ASN__ENCODE_FAILED; - if(inext) ct = 0; - } else if(inext) { - ASN__ENCODE_FAILED; - } - - if(ct && ct->range_bits >= 0) { - if(per_put_few_bits(po, value, ct->range_bits)) - ASN__ENCODE_FAILED; - ASN__ENCODED_OK(er); - } - - if(!specs->extension) - ASN__ENCODE_FAILED; - - /* - * X.691, #10.6: normally small non-negative whole number; - */ - ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld", - value, specs->extension, inext, - value - (inext ? (specs->extension - 1) : 0)); - if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0))) - ASN__ENCODE_FAILED; - - ASN__ENCODED_OK(er); -} - +/*- + * Copyright (c) 2004, 2007 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Read the NativeInteger.h for the explanation wrt. differences between + * INTEGER and NativeInteger. + * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this + * implementation deals with the standard (machine-specific) representation + * of them instead of using the platform-independent buffer. + */ +#include +#include + +/* + * NativeEnumerated basic type description. + */ +static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) +}; +asn_TYPE_operation_t asn_OP_NativeEnumerated = { + NativeInteger_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + NativeInteger_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + NativeInteger_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + NativeInteger_decode_ber, + NativeInteger_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + NativeInteger_decode_xer, + NativeEnumerated_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + NativeEnumerated_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + NativeEnumerated_decode_oer, + NativeEnumerated_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + NativeEnumerated_decode_uper, + NativeEnumerated_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + NativeEnumerated_decode_aper, + NativeEnumerated_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + NativeEnumerated_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = { + "ENUMERATED", /* The ASN.1 type is still ENUMERATED */ + "ENUMERATED", + &asn_OP_NativeEnumerated, + asn_DEF_NativeEnumerated_tags, + sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), + asn_DEF_NativeEnumerated_tags, /* Same as above */ + sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) +int +NativeEnumerated__compar_value2enum(const void *ap, const void *bp) { + const asn_INTEGER_enum_map_t *a = ap; + const asn_INTEGER_enum_map_t *b = bp; + if(a->nat_value == b->nat_value) + return 0; + if(a->nat_value < b->nat_value) + return -1; + return 1; +} +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ diff --git a/certgen/asncodec/NativeEnumerated.h b/certgen/asncodec/NativeEnumerated.h index 50f582e..0c711e3 100644 --- a/certgen/asncodec/NativeEnumerated.h +++ b/certgen/asncodec/NativeEnumerated.h @@ -1,43 +1,76 @@ -/* - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * This type differs from the standard ENUMERATED in that it is modelled using - * the fixed machine type (long, int, short), so it can hold only values of - * limited length. There is no type (i.e., NativeEnumerated_t, any integer type - * will do). - * This type may be used when integer range is limited by subtype constraints. - */ -#ifndef _NativeEnumerated_H_ -#define _NativeEnumerated_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; -extern asn_TYPE_operation_t asn_OP_NativeEnumerated; - -xer_type_encoder_f NativeEnumerated_encode_xer; -oer_type_decoder_f NativeEnumerated_decode_oer; -oer_type_encoder_f NativeEnumerated_encode_oer; -per_type_decoder_f NativeEnumerated_decode_uper; -per_type_encoder_f NativeEnumerated_encode_uper; - -#define NativeEnumerated_free NativeInteger_free -#define NativeEnumerated_print NativeInteger_print -#define NativeEnumerated_compare NativeInteger_compare -#define NativeEnumerated_random_fill NativeInteger_random_fill -#define NativeEnumerated_constraint asn_generic_no_constraint -#define NativeEnumerated_decode_ber NativeInteger_decode_ber -#define NativeEnumerated_encode_der NativeInteger_encode_der -#define NativeEnumerated_decode_xer NativeInteger_decode_xer - -#ifdef __cplusplus -} -#endif - -#endif /* _NativeEnumerated_H_ */ +/* + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * This type differs from the standard ENUMERATED in that it is modelled using + * the fixed machine type (long, int, short), so it can hold only values of + * limited length. There is no type (i.e., NativeEnumerated_t, any integer type + * will do). + * This type may be used when integer range is limited by subtype constraints. + */ +#ifndef _NativeEnumerated_H_ +#define _NativeEnumerated_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; +extern asn_TYPE_operation_t asn_OP_NativeEnumerated; + +#define NativeEnumerated_free NativeInteger_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +#define NativeEnumerated_print NativeInteger_print +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define NativeEnumerated_compare NativeInteger_compare + +#define NativeEnumerated_constraint asn_generic_no_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define NativeEnumerated_decode_ber NativeInteger_decode_ber +#define NativeEnumerated_encode_der NativeInteger_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define NativeEnumerated_decode_xer NativeInteger_decode_xer +xer_type_encoder_f NativeEnumerated_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f NativeEnumerated_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f NativeEnumerated_decode_oer; +oer_type_encoder_f NativeEnumerated_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f NativeEnumerated_decode_uper; +per_type_encoder_f NativeEnumerated_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f NativeEnumerated_decode_aper; +per_type_encoder_f NativeEnumerated_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +#define NativeEnumerated_random_fill NativeInteger_random_fill +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) +int NativeEnumerated__compar_value2enum( + const void *ap, + const void *bp); +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _NativeEnumerated_H_ */ diff --git a/certgen/asncodec/NativeEnumerated_oer.c b/certgen/asncodec/NativeEnumerated_oer.c index 074204f..52dbcb8 100644 --- a/certgen/asncodec/NativeEnumerated_oer.c +++ b/certgen/asncodec/NativeEnumerated_oer.c @@ -1,149 +1,144 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include - -static long -asn__nativeenumerated_convert(const uint8_t *b, const uint8_t *end) { - unsigned long value; - - /* Perform the sign initialization */ - /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */ - if((*b >> 7)) { - value = (unsigned long)(-1); - } else { - value = 0; - } - - /* Conversion engine */ - for(; b < end; b++) { - value = (value << 8) | *b; - } - - return value; -} - -asn_dec_rval_t -NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, - void **nint_ptr, const void *ptr, size_t size) { - asn_dec_rval_t rval = {RC_OK, 0}; - long *native = (long *)*nint_ptr; - const uint8_t *b = ptr; - - (void)opt_codec_ctx; - (void)constraints; - - if(size < 1) { - ASN__DECODE_STARVED; - } - - if((*b & 0x80) == 0) { - /* - * X.696 (08/2015) #11.2 Short form for Enumerated. - */ - if(!native) { - native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); - if(!native) ASN__DECODE_FAILED; - } - - *native = *b; - rval.consumed = 1; - } else { - /* - * X.696 (08/2015) #11.4 Long form for Enumerated. - */ - size_t length = *b & 0x7f; - const uint8_t *bend; - long value; - - if(length < 1 || length > sizeof(*native)) { - ASN__DECODE_FAILED; - } - if((1 + length) > size) { - ASN__DECODE_STARVED; - } - b++; - bend = b + length; - - value = asn__nativeenumerated_convert(b, bend); - if(value < 0) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - if(specs && specs->field_unsigned) { - ASN__DECODE_FAILED; - } - } - - if(!native) { - native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); - if(!native) ASN__DECODE_FAILED; - } - - *native = value; - - rval.consumed = (1 + length); - } - - return rval; -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -NativeEnumerated_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, - const void *sptr, asn_app_consume_bytes_f *cb, - void *app_key) { - asn_enc_rval_t er; - long native; - - (void)constraints; - - if(!sptr) ASN__ENCODE_FAILED; - - native = *(const long *)sptr; - - if(native >= 0 && native <= 127) { - /* #11.2 Short form */ - uint8_t b = native; - er.encoded = 1; - if(cb(&b, er.encoded, app_key) < 0) { - ASN__ENCODE_FAILED; - } - ASN__ENCODED_OK(er); - } else { - /* #11.2 Long form */ - uint8_t buf[1 + sizeof(native)]; - uint8_t *b = &buf[sizeof(native)]; /* Last addressable */ - long final_pattern = -1 * (native < 0); - - for(;;) { - *b-- = native; - native >>= 8; - if(native == final_pattern) { - if(final_pattern) { - if((b[1] & 0x80)) break; - } else { - if(!(b[1] & 0x80)) break; - } - } - } - *b = 0x80 | (&buf[sizeof(native)] - b); - er.encoded = 1 + (&buf[sizeof(native)] - b); - if(cb(b, er.encoded, app_key) < 0) { - ASN__ENCODE_FAILED; - } - ASN__ENCODED_OK(er); - } -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +static long +asn__nativeenumerated_convert(const uint8_t *b, const uint8_t *end) { + unsigned long value; + + /* Perform the sign initialization */ + /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */ + if((*b >> 7)) { + value = (unsigned long)(-1); + } else { + value = 0; + } + + /* Conversion engine */ + for(; b < end; b++) { + value = (value << 8) | *b; + } + + return value; +} + +asn_dec_rval_t +NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, + void **nint_ptr, const void *ptr, size_t size) { + asn_dec_rval_t rval = {RC_OK, 0}; + long *native = (long *)*nint_ptr; + const uint8_t *b = ptr; + + (void)opt_codec_ctx; + (void)constraints; + + if(size < 1) { + ASN__DECODE_STARVED; + } + + if((*b & 0x80) == 0) { + /* + * X.696 (08/2015) #11.2 Short form for Enumerated. + */ + if(!native) { + native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); + if(!native) ASN__DECODE_FAILED; + } + + *native = *b; + rval.consumed = 1; + } else { + /* + * X.696 (08/2015) #11.4 Long form for Enumerated. + */ + size_t length = *b & 0x7f; + const uint8_t *bend; + long value; + + if(length < 1 || length > sizeof(*native)) { + ASN__DECODE_FAILED; + } + if((1 + length) > size) { + ASN__DECODE_STARVED; + } + b++; + bend = b + length; + + value = asn__nativeenumerated_convert(b, bend); + if(value < 0) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + if(specs && specs->field_unsigned) { + ASN__DECODE_FAILED; + } + } + + if(!native) { + native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); + if(!native) ASN__DECODE_FAILED; + } + + *native = value; + + rval.consumed = (1 + length); + } + + return rval; +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +NativeEnumerated_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, + const void *sptr, asn_app_consume_bytes_f *cb, + void *app_key) { + asn_enc_rval_t er = {0,0,0}; + long native; + + (void)constraints; + + if(!sptr) ASN__ENCODE_FAILED; + + native = *(const long *)sptr; + + if(native >= 0 && native <= 127) { + /* #11.2 Short form */ + uint8_t b = native; + er.encoded = 1; + if(cb(&b, er.encoded, app_key) < 0) { + ASN__ENCODE_FAILED; + } + ASN__ENCODED_OK(er); + } else { + /* #11.2 Long form */ + uint8_t buf[1 + sizeof(native)]; + uint8_t *b = &buf[sizeof(native)]; /* Last addressable */ + long final_pattern = -1 * (native < 0); + + for(;;) { + *b-- = native; + native >>= 8; + if(native == final_pattern) { + if(final_pattern) { + if((b[1] & 0x80)) break; + } else { + if(!(b[1] & 0x80)) break; + } + } + } + *b = 0x80 | (&buf[sizeof(native)] - b); + er.encoded = 1 + (&buf[sizeof(native)] - b); + if(cb(b, er.encoded, app_key) < 0) { + ASN__ENCODE_FAILED; + } + ASN__ENCODED_OK(er); + } +} diff --git a/certgen/asncodec/NativeEnumerated_xer.c b/certgen/asncodec/NativeEnumerated_xer.c new file mode 100644 index 0000000..e8d6d0d --- /dev/null +++ b/certgen/asncodec/NativeEnumerated_xer.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_enc_rval_t +NativeEnumerated_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + asn_enc_rval_t er = {0,0,0}; + const long *native = (const long *)sptr; + const asn_INTEGER_enum_map_t *el; + + (void)ilevel; + (void)flags; + + if(!native) ASN__ENCODE_FAILED; + + el = INTEGER_map_value2enum(specs, *native); + if(el) { + er.encoded = + asn__format_to_callback(cb, app_key, "<%s/>", el->enum_name); + if(er.encoded < 0) ASN__ENCODE_FAILED; + ASN__ENCODED_OK(er); + } else { + ASN_DEBUG( + "ASN.1 forbids dealing with " + "unknown value of ENUMERATED type"); + ASN__ENCODE_FAILED; + } +} diff --git a/certgen/asncodec/NativeInteger.c b/certgen/asncodec/NativeInteger.c index 5f307dd..f0309b0 100644 --- a/certgen/asncodec/NativeInteger.c +++ b/certgen/asncodec/NativeInteger.c @@ -1,484 +1,152 @@ -/*- - * Copyright (c) 2004, 2005, 2006 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Read the NativeInteger.h for the explanation wrt. differences between - * INTEGER and NativeInteger. - * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this - * implementation deals with the standard (machine-specific) representation - * of them instead of using the platform-independent buffer. - */ -#include -#include - -/* - * NativeInteger basic type description. - */ -static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) -}; -asn_TYPE_operation_t asn_OP_NativeInteger = { - NativeInteger_free, - NativeInteger_print, - NativeInteger_compare, - NativeInteger_decode_ber, - NativeInteger_encode_der, - NativeInteger_decode_xer, - NativeInteger_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - NativeInteger_decode_oer, /* OER decoder */ - NativeInteger_encode_oer, /* Canonical OER encoder */ -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - NativeInteger_decode_uper, /* Unaligned PER decoder */ - NativeInteger_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - NativeInteger_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_NativeInteger = { - "INTEGER", /* The ASN.1 type is still INTEGER */ - "INTEGER", - &asn_OP_NativeInteger, - asn_DEF_NativeInteger_tags, - sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), - asn_DEF_NativeInteger_tags, /* Same as above */ - sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), - { 0, 0, asn_generic_no_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -/* - * Decode INTEGER type. - */ -asn_dec_rval_t -NativeInteger_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **nint_ptr, - const void *buf_ptr, size_t size, int tag_mode) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - long *native = (long *)*nint_ptr; - asn_dec_rval_t rval; - ber_tlv_len_t length; - - /* - * If the structure is not there, allocate it. - */ - if(native == NULL) { - native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); - if(native == NULL) { - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; - } - } - - ASN_DEBUG("Decoding %s as INTEGER (tm=%d)", - td->name, tag_mode); - - /* - * Check tags. - */ - rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); - if(rval.code != RC_OK) - return rval; - - ASN_DEBUG("%s length is %d bytes", td->name, (int)length); - - /* - * Make sure we have this length. - */ - buf_ptr = ((const char *)buf_ptr) + rval.consumed; - size -= rval.consumed; - if(length > (ber_tlv_len_t)size) { - rval.code = RC_WMORE; - rval.consumed = 0; - return rval; - } - - /* - * ASN.1 encoded INTEGER: buf_ptr, length - * Fill the native, at the same time checking for overflow. - * If overflow occured, return with RC_FAIL. - */ - { - INTEGER_t tmp; - union { - const void *constbuf; - void *nonconstbuf; - } unconst_buf; - long l; - - unconst_buf.constbuf = buf_ptr; - tmp.buf = (uint8_t *)unconst_buf.nonconstbuf; - tmp.size = length; - - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&tmp, &l)) { - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; - } - - *native = l; - } - - rval.code = RC_OK; - rval.consumed += length; - - ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)", - (long)rval.consumed, (long)length, td->name, (long)*native); - - return rval; -} - -/* - * Encode the NativeInteger using the standard INTEGER type DER encoder. - */ -asn_enc_rval_t -NativeInteger_encode_der(const asn_TYPE_descriptor_t *sd, const void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - unsigned long native = *(const unsigned long *)ptr; /* Disable sign ext. */ - asn_enc_rval_t erval; - INTEGER_t tmp; - -#ifdef WORDS_BIGENDIAN /* Opportunistic optimization */ - - tmp.buf = (uint8_t *)&native; - tmp.size = sizeof(native); - -#else /* Works even if WORDS_BIGENDIAN is not set where should've been */ - uint8_t buf[sizeof(native)]; - uint8_t *p; - - /* Prepare a fake INTEGER */ - for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8) - *p = (uint8_t)native; - - tmp.buf = buf; - tmp.size = sizeof(buf); -#endif /* WORDS_BIGENDIAN */ - - /* Encode fake INTEGER */ - erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key); - if(erval.structure_ptr == &tmp) { - erval.structure_ptr = ptr; - } - return erval; -} - -/* - * Decode the chunk of XML text encoding INTEGER. - */ -asn_dec_rval_t -NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, - size_t size) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - INTEGER_t st; - void *st_ptr = (void *)&st; - long *native = (long *)*sptr; - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - if(!native) ASN__DECODE_FAILED; - } - - memset(&st, 0, sizeof(st)); - rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, - opt_mname, buf_ptr, size); - if(rval.code == RC_OK) { - long l; - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&st, &l)) { - rval.code = RC_FAIL; - rval.consumed = 0; - } else { - *native = l; - } - } else { - /* - * Cannot restart from the middle; - * there is no place to save state in the native type. - * Request a continuation from the very beginning. - */ - rval.consumed = 0; - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st); - return rval; -} - - -asn_enc_rval_t -NativeInteger_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - char scratch[32]; /* Enough for 64-bit int */ - asn_enc_rval_t er; - const long *native = (const long *)sptr; - - (void)ilevel; - (void)flags; - - if(!native) ASN__ENCODE_FAILED; - - er.encoded = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) - ? "%lu" : "%ld", *native); - if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) - || cb(scratch, er.encoded, app_key) < 0) - ASN__ENCODE_FAILED; - - ASN__ENCODED_OK(er); -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_dec_rval_t -NativeInteger_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - long *native = (long *)*sptr; - INTEGER_t tmpint; - void *tmpintptr = &tmpint; - - (void)opt_codec_ctx; - ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name); - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - if(!native) ASN__DECODE_FAILED; - } - - memset(&tmpint, 0, sizeof tmpint); - rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints, - &tmpintptr, pd); - if(rval.code == RC_OK) { - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) - : asn_INTEGER2long(&tmpint, native)) - rval.code = RC_FAIL; - else - ASN_DEBUG("NativeInteger %s got value %ld", - td->name, *native); - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - - return rval; -} - -asn_enc_rval_t -NativeInteger_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, asn_per_outp_t *po) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - long native; - INTEGER_t tmpint; - - if(!sptr) ASN__ENCODE_FAILED; - - native = *(const long *)sptr; - - ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native); - - memset(&tmpint, 0, sizeof(tmpint)); - if((specs&&specs->field_unsigned) - ? asn_ulong2INTEGER(&tmpint, native) - : asn_long2INTEGER(&tmpint, native)) - ASN__ENCODE_FAILED; - er = INTEGER_encode_uper(td, constraints, &tmpint, po); - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - return er; -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -/* - * INTEGER specific human-readable output. - */ -int -NativeInteger_print(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - const long *native = (const long *)sptr; - char scratch[32]; /* Enough for 64-bit int */ - int ret; - - (void)td; /* Unused argument */ - (void)ilevel; /* Unused argument */ - - if(native) { - long value = *native; - ret = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) ? "%lu" : "%ld", value); - assert(ret > 0 && (size_t)ret < sizeof(scratch)); - if(cb(scratch, ret, app_key) < 0) return -1; - if(specs && (value >= 0 || !specs->field_unsigned)) { - const asn_INTEGER_enum_map_t *el = - INTEGER_map_value2enum(specs, value); - if(el) { - if(cb(" (", 2, app_key) < 0) return -1; - if(cb(el->enum_name, el->enum_len, app_key) < 0) return -1; - if(cb(")", 1, app_key) < 0) return -1; - } - } - return 0; - } else { - return (cb("", 8, app_key) < 0) ? -1 : 0; - } -} - -void -NativeInteger_free(const asn_TYPE_descriptor_t *td, void *ptr, - enum asn_struct_free_method method) { - if(!td || !ptr) - return; - - ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", - td->name, method, ptr); - - switch(method) { - case ASFM_FREE_EVERYTHING: - FREEMEM(ptr); - break; - case ASFM_FREE_UNDERLYING: - break; - case ASFM_FREE_UNDERLYING_AND_RESET: - memset(ptr, 0, sizeof(long)); - break; - } -} - -int -NativeInteger_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) { - (void)td; - - if(aptr && bptr) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - if(specs && specs->field_unsigned) { - const unsigned long *a = aptr; - const unsigned long *b = bptr; - if(*a < *b) { - return -1; - } else if(*a > *b) { - return 1; - } else { - return 0; - } - } else { - const long *a = aptr; - const long *b = bptr; - if(*a < *b) { - return -1; - } else if(*a > *b) { - return 1; - } else { - return 0; - } - } - } else if(!aptr) { - return -1; - } else { - return 1; - } -} - -asn_random_fill_result_t -NativeInteger_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constraints, - size_t max_length) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - long *st = *sptr; - const asn_INTEGER_enum_map_t *emap; - size_t emap_len; - intmax_t value; - int find_inside_map; - - if(max_length == 0) return result_skipped; - - if(st == NULL) { - st = (long *)CALLOC(1, sizeof(*st)); - if(st == NULL) { - return result_failed; - } - } - - if(specs) { - emap = specs->value2enum; - emap_len = specs->map_count; - if(specs->strict_enumeration) { - find_inside_map = emap_len > 0; - } else { - find_inside_map = emap_len ? asn_random_between(0, 1) : 0; - } - } else { - emap = 0; - emap_len = 0; - find_inside_map = 0; - } - - if(find_inside_map) { - assert(emap_len > 0); - value = emap[asn_random_between(0, emap_len - 1)].nat_value; - } else { - const asn_per_constraints_t *ct; - - static const long variants[] = { - -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384, - -16383, -257, -256, -255, -254, -129, -128, -127, - -126, -1, 0, 1, 126, 127, 128, 129, - 254, 255, 256, 257, 16383, 16384, 16385, 32767, - 32768, 32769, 65534, 65535, 65536, 65537}; - if(specs && specs->field_unsigned) { - assert(variants[18] == 0); - value = variants[asn_random_between( - 18, sizeof(variants) / sizeof(variants[0]) - 1)]; - } else { - value = variants[asn_random_between( - 0, sizeof(variants) / sizeof(variants[0]) - 1)]; - } - - if(!constraints) constraints = &td->encoding_constraints; - ct = constraints ? constraints->per_constraints : 0; - if(ct && (ct->value.flags & APC_CONSTRAINED)) { - if(value < ct->value.lower_bound || value > ct->value.upper_bound) { - value = asn_random_between(ct->value.lower_bound, - ct->value.upper_bound); - } - } - } - - *sptr = st; - *st = value; - return result_ok; -} +/*- + * Copyright (c) 2004, 2005, 2006 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Read the NativeInteger.h for the explanation wrt. differences between + * INTEGER and NativeInteger. + * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this + * implementation deals with the standard (machine-specific) representation + * of them instead of using the platform-independent buffer. + */ +#include +#include + +/* + * NativeInteger basic type description. + */ +static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_operation_t asn_OP_NativeInteger = { + NativeInteger_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + NativeInteger_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + NativeInteger_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + NativeInteger_decode_ber, + NativeInteger_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + NativeInteger_decode_xer, + NativeInteger_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + NativeInteger_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + NativeInteger_decode_oer, /* OER decoder */ + NativeInteger_encode_oer, /* Canonical OER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + NativeInteger_decode_uper, /* Unaligned PER decoder */ + NativeInteger_encode_uper, /* Unaligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + NativeInteger_decode_aper, /* Aligned PER decoder */ + NativeInteger_encode_aper, /* Aligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + NativeInteger_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_NativeInteger = { + "INTEGER", /* The ASN.1 type is still INTEGER */ + "INTEGER", + &asn_OP_NativeInteger, + asn_DEF_NativeInteger_tags, + sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), + asn_DEF_NativeInteger_tags, /* Same as above */ + sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +void +NativeInteger_free(const asn_TYPE_descriptor_t *td, void *ptr, + enum asn_struct_free_method method) { + if(!td || !ptr) + return; + + ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", + td->name, method, ptr); + + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(ptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(ptr, 0, sizeof(long)); + break; + } +} + +int +NativeInteger_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) { + (void)td; + + if(aptr && bptr) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + if(specs && specs->field_unsigned) { + const unsigned long *a = aptr; + const unsigned long *b = bptr; + if(*a < *b) { + return -1; + } else if(*a > *b) { + return 1; + } else { + return 0; + } + } else { + const long *a = aptr; + const long *b = bptr; + if(*a < *b) { + return -1; + } else if(*a > *b) { + return 1; + } else { + return 0; + } + } + } else if(!aptr) { + return -1; + } else { + return 1; + } +} diff --git a/certgen/asncodec/NativeInteger.h b/certgen/asncodec/NativeInteger.h index 5defa96..3a47c11 100644 --- a/certgen/asncodec/NativeInteger.h +++ b/certgen/asncodec/NativeInteger.h @@ -1,44 +1,71 @@ -/*- - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * This type differs from the standard INTEGER in that it is modelled using - * the fixed machine type (long, int, short), so it can hold only values of - * limited length. There is no type (i.e., NativeInteger_t, any integer type - * will do). - * This type may be used when integer range is limited by subtype constraints. - */ -#ifndef _NativeInteger_H_ -#define _NativeInteger_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; -extern asn_TYPE_operation_t asn_OP_NativeInteger; - -asn_struct_free_f NativeInteger_free; -asn_struct_print_f NativeInteger_print; -asn_struct_compare_f NativeInteger_compare; -ber_type_decoder_f NativeInteger_decode_ber; -der_type_encoder_f NativeInteger_encode_der; -xer_type_decoder_f NativeInteger_decode_xer; -xer_type_encoder_f NativeInteger_encode_xer; -oer_type_decoder_f NativeInteger_decode_oer; -oer_type_encoder_f NativeInteger_encode_oer; -per_type_decoder_f NativeInteger_decode_uper; -per_type_encoder_f NativeInteger_encode_uper; -asn_random_fill_f NativeInteger_random_fill; - -#define NativeInteger_constraint asn_generic_no_constraint - -#ifdef __cplusplus -} -#endif - -#endif /* _NativeInteger_H_ */ +/*- + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * This type differs from the standard INTEGER in that it is modelled using + * the fixed machine type (long, int, short), so it can hold only values of + * limited length. There is no type (i.e., NativeInteger_t, any integer type + * will do). + * This type may be used when integer range is limited by subtype constraints. + */ +#ifndef _NativeInteger_H_ +#define _NativeInteger_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; +extern asn_TYPE_operation_t asn_OP_NativeInteger; + +asn_struct_free_f NativeInteger_free; + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f NativeInteger_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f NativeInteger_compare; + +#define NativeInteger_constraint asn_generic_no_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f NativeInteger_decode_ber; +der_type_encoder_f NativeInteger_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f NativeInteger_decode_xer; +xer_type_encoder_f NativeInteger_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f NativeInteger_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f NativeInteger_decode_oer; +oer_type_encoder_f NativeInteger_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f NativeInteger_decode_uper; +per_type_encoder_f NativeInteger_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f NativeInteger_decode_aper; +per_type_encoder_f NativeInteger_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f NativeInteger_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _NativeInteger_H_ */ diff --git a/certgen/asncodec/NativeInteger_oer.c b/certgen/asncodec/NativeInteger_oer.c index 1e71497..4e90046 100644 --- a/certgen/asncodec/NativeInteger_oer.c +++ b/certgen/asncodec/NativeInteger_oer.c @@ -1,99 +1,94 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include - -asn_dec_rval_t -NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, - void **nint_ptr, const void *ptr, size_t size) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval = {RC_OK, 0}; - long *native = (long *)*nint_ptr; - INTEGER_t tmpint; - INTEGER_t *tmpintptr = &tmpint; - - memset(&tmpint, 0, sizeof(tmpint)); - - if(!native) { - native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); - if(!native) ASN__DECODE_FAILED; - } - - /* - * OPTIMIZATION: Encode directly rather than passing through INTEGER. - * Saves a memory allocation. - */ - rval = INTEGER_decode_oer(opt_codec_ctx, td, constraints, - (void **)&tmpintptr, ptr, size); - if(rval.code != RC_OK) { - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - return rval; - } - - if(specs && specs->field_unsigned) { - unsigned long ul; - int ok = asn_INTEGER2ulong(&tmpint, &ul) == 0; - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - if(ok) { - *native = ul; - } else { - rval.code = RC_FAIL; - return rval; - } - } else { - long l; - int ok = asn_INTEGER2long(&tmpint, &l) == 0; - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - if(ok) { - *native = l; - } else { - rval.code = RC_FAIL; - return rval; - } - } - - return rval; -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -NativeInteger_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, - const void *sptr, asn_app_consume_bytes_f *cb, - void *app_key) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - INTEGER_t tmpint; - long native; - - if(!sptr) ASN__ENCODE_FAILED; - - native = *(const long *)sptr; - memset(&tmpint, 0, sizeof(tmpint)); - - ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native); - - if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native) - : asn_long2INTEGER(&tmpint, native)) { - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - ASN__ENCODE_FAILED; - } else { - asn_enc_rval_t er = - INTEGER_encode_oer(td, constraints, &tmpint, cb, app_key); - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - return er; - } -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_dec_rval_t +NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, + void **nint_ptr, const void *ptr, size_t size) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval = {RC_OK, 0}; + long *native = (long *)*nint_ptr; + INTEGER_t tmpint; + INTEGER_t *tmpintptr = &tmpint; + + memset(&tmpint, 0, sizeof(tmpint)); + + if(!native) { + native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); + if(!native) ASN__DECODE_FAILED; + } + + /* + * OPTIMIZATION: Encode directly rather than passing through INTEGER. + * Saves a memory allocation. + */ + rval = INTEGER_decode_oer(opt_codec_ctx, td, constraints, + (void **)&tmpintptr, ptr, size); + if(rval.code != RC_OK) { + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + return rval; + } + + if(specs && specs->field_unsigned) { + unsigned long ul; + int ok = asn_INTEGER2ulong(&tmpint, &ul) == 0; + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + if(ok) { + *native = ul; + } else { + rval.code = RC_FAIL; + return rval; + } + } else { + long l; + int ok = asn_INTEGER2long(&tmpint, &l) == 0; + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + if(ok) { + *native = l; + } else { + rval.code = RC_FAIL; + return rval; + } + } + + return rval; +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +NativeInteger_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, + const void *sptr, asn_app_consume_bytes_f *cb, + void *app_key) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + INTEGER_t tmpint; + long native; + + if(!sptr) ASN__ENCODE_FAILED; + + native = *(const long *)sptr; + memset(&tmpint, 0, sizeof(tmpint)); + + ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native); + + if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native) + : asn_long2INTEGER(&tmpint, native)) { + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + ASN__ENCODE_FAILED; + } else { + asn_enc_rval_t er = + INTEGER_encode_oer(td, constraints, &tmpint, cb, app_key); + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + return er; + } +} diff --git a/certgen/asncodec/NativeInteger_print.c b/certgen/asncodec/NativeInteger_print.c new file mode 100644 index 0000000..0602e0d --- /dev/null +++ b/certgen/asncodec/NativeInteger_print.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * INTEGER specific human-readable output. + */ +int +NativeInteger_print(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + const long *native = (const long *)sptr; + char scratch[32]; /* Enough for 64-bit int */ + int ret; + + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(native) { + long value = *native; + ret = snprintf(scratch, sizeof(scratch), + (specs && specs->field_unsigned) ? "%lu" : "%ld", value); + assert(ret > 0 && (size_t)ret < sizeof(scratch)); + if(cb(scratch, ret, app_key) < 0) return -1; + if(specs && (value >= 0 || !specs->field_unsigned)) { + const asn_INTEGER_enum_map_t *el = + INTEGER_map_value2enum(specs, value); + if(el) { + if(cb(" (", 2, app_key) < 0) return -1; + if(cb(el->enum_name, el->enum_len, app_key) < 0) return -1; + if(cb(")", 1, app_key) < 0) return -1; + } + } + return 0; + } else { + return (cb("", 8, app_key) < 0) ? -1 : 0; + } +} diff --git a/certgen/asncodec/NativeInteger_xer.c b/certgen/asncodec/NativeInteger_xer.c new file mode 100644 index 0000000..18ec59a --- /dev/null +++ b/certgen/asncodec/NativeInteger_xer.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * Decode the chunk of XML text encoding INTEGER. + */ +asn_dec_rval_t +NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, + size_t size) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval; + INTEGER_t st; + void *st_ptr = (void *)&st; + long *native = (long *)*sptr; + + if(!native) { + native = (long *)(*sptr = CALLOC(1, sizeof(*native))); + if(!native) ASN__DECODE_FAILED; + } + + memset(&st, 0, sizeof(st)); + rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, + opt_mname, buf_ptr, size); + if(rval.code == RC_OK) { + long l; + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ + : asn_INTEGER2long(&st, &l)) { + rval.code = RC_FAIL; + rval.consumed = 0; + } else { + *native = l; + } + } else { + /* + * Cannot restart from the middle; + * there is no place to save state in the native type. + * Request a continuation from the very beginning. + */ + rval.consumed = 0; + } + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st); + return rval; +} + + +asn_enc_rval_t +NativeInteger_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + const asn_INTEGER_specifics_t *specs = + (const asn_INTEGER_specifics_t *)td->specifics; + char scratch[32]; /* Enough for 64-bit int */ + asn_enc_rval_t er = {0,0,0}; + const long *native = (const long *)sptr; + + (void)ilevel; + (void)flags; + + if(!native) ASN__ENCODE_FAILED; + + er.encoded = snprintf(scratch, sizeof(scratch), + (specs && specs->field_unsigned) + ? "%lu" : "%ld", *native); + if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) + || cb(scratch, er.encoded, app_key) < 0) + ASN__ENCODE_FAILED; + + ASN__ENCODED_OK(er); +} diff --git a/certgen/asncodec/NinetyDegreeInt.c b/certgen/asncodec/NinetyDegreeInt.c index cf5282b..ba75f84 100644 --- a/certgen/asncodec/NinetyDegreeInt.c +++ b/certgen/asncodec/NinetyDegreeInt.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "NinetyDegreeInt.h" @@ -36,9 +36,11 @@ NinetyDegreeInt_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_NinetyDegreeInt_constr_1 CC_NOTUSED = { { 4, 0 } /* (-900000000..900000001) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_NinetyDegreeInt_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_NinetyDegreeInt = { asn_DEF_NinetyDegreeInt_tags_1, /* Same as above */ sizeof(asn_DEF_NinetyDegreeInt_tags_1) /sizeof(asn_DEF_NinetyDegreeInt_tags_1[0]), /* 1 */ - { &asn_OER_type_NinetyDegreeInt_constr_1, 0, NinetyDegreeInt_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_NinetyDegreeInt_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NinetyDegreeInt_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/NinetyDegreeInt.h b/certgen/asncodec/NinetyDegreeInt.h index fdd9803..74c6991 100644 --- a/certgen/asncodec/NinetyDegreeInt.h +++ b/certgen/asncodec/NinetyDegreeInt.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _NinetyDegreeInt_H_ #define _NinetyDegreeInt_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -33,8 +33,6 @@ extern asn_TYPE_descriptor_t asn_DEF_NinetyDegreeInt; asn_struct_free_f NinetyDegreeInt_free; asn_struct_print_f NinetyDegreeInt_print; asn_constr_check_f NinetyDegreeInt_constraint; -ber_type_decoder_f NinetyDegreeInt_decode_ber; -der_type_encoder_f NinetyDegreeInt_encode_der; xer_type_decoder_f NinetyDegreeInt_decode_xer; xer_type_encoder_f NinetyDegreeInt_encode_xer; oer_type_decoder_f NinetyDegreeInt_decode_oer; diff --git a/certgen/asncodec/OBJECT_IDENTIFIER.c b/certgen/asncodec/OBJECT_IDENTIFIER.c new file mode 100644 index 0000000..5cf2d60 --- /dev/null +++ b/certgen/asncodec/OBJECT_IDENTIFIER.c @@ -0,0 +1,532 @@ +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include +#include +#include /* for CHAR_BIT */ +#include +#include + +/* + * OBJECT IDENTIFIER basic type description. + */ +static const ber_tlv_tag_t asn_DEF_OBJECT_IDENTIFIER_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)) +}; +asn_TYPE_operation_t asn_OP_OBJECT_IDENTIFIER = { + ASN__PRIMITIVE_TYPE_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + OBJECT_IDENTIFIER_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OCTET_STRING_compare, /* Implemented in terms of a string comparison */ +#if !defined(ASN_DISABLE_BER_SUPPORT) + ber_decode_primitive, + der_encode_primitive, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OBJECT_IDENTIFIER_decode_xer, + OBJECT_IDENTIFIER_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + OBJECT_IDENTIFIER_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + OBJECT_IDENTIFIER_decode_oer, + OBJECT_IDENTIFIER_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OCTET_STRING_decode_aper, + OCTET_STRING_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + OBJECT_IDENTIFIER_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER = { + "OBJECT IDENTIFIER", + "OBJECT_IDENTIFIER", + &asn_OP_OBJECT_IDENTIFIER, + asn_DEF_OBJECT_IDENTIFIER_tags, + sizeof(asn_DEF_OBJECT_IDENTIFIER_tags) + / sizeof(asn_DEF_OBJECT_IDENTIFIER_tags[0]), + asn_DEF_OBJECT_IDENTIFIER_tags, /* Same as above */ + sizeof(asn_DEF_OBJECT_IDENTIFIER_tags) + / sizeof(asn_DEF_OBJECT_IDENTIFIER_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OBJECT_IDENTIFIER_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +int +OBJECT_IDENTIFIER_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, + void *app_key) { + const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr; + + if(st && st->buf) { + if(st->size < 1) { + ASN__CTFAIL(app_key, td, sptr, + "%s: at least one numerical value " + "expected (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + return 0; +} + +static ssize_t +OBJECT_IDENTIFIER_get_first_arcs(const uint8_t *arcbuf, size_t arcbuf_len, + asn_oid_arc_t *arc0, asn_oid_arc_t *arc1) { + asn_oid_arc_t value; + + ssize_t rd = OBJECT_IDENTIFIER_get_single_arc(arcbuf, arcbuf_len, &value); + if(rd <= 0) return rd; + + if(value >= 80) { + *arc0 = 2; + *arc1 = value - 80; + } else if(value >= 40) { + *arc0 = 1; + *arc1 = value - 40; + } else { + *arc0 = 0; + *arc1 = value; + } + + return rd; +} + +ssize_t +OBJECT_IDENTIFIER_get_single_arc(const uint8_t *arcbuf, size_t arcbuf_len, + asn_oid_arc_t *ret_value) { + const uint8_t *b = arcbuf; + const uint8_t *arcend = arcbuf + arcbuf_len; /* End of arc */ + + if(arcbuf == arcend) { + return 0; + } else { + asn_oid_arc_t accum; + asn_oid_arc_t upper_limit = (ASN_OID_ARC_MAX >> 7); + /* When the value reaches "upper_limit", it can take */ + /* at most one more digit. If it exceeds "upper_limit" */ + /* but there are more digits - it's an Overflow condition */ + /* Gather all bits into the accumulator */ + for(accum = 0; b < arcend; b++) { + accum = (accum << 7) | (*b & ~0x80); + if((*b & 0x80) == 0) { // no more digits + if(accum <= ASN_OID_ARC_MAX) { + *ret_value = accum; + return 1 + (b - arcbuf); + } else { + errno = ERANGE; /* Overflow */ + return -1; + } + } else { // to make sure we aren't wrapping around + if(accum > upper_limit) { + errno = ERANGE; /* Overflow */ + return -1; + } + } + } + errno = EINVAL; + return -1; + } + +} + +ssize_t +OBJECT_IDENTIFIER__dump_body(const OBJECT_IDENTIFIER_t *st, + asn_app_consume_bytes_f *cb, void *app_key) { + char scratch[32]; + asn_oid_arc_t arc0 = 0; + asn_oid_arc_t arc1 = 0; + size_t produced = 0; + size_t off = 0; + ssize_t rd; + int ret; + + rd = OBJECT_IDENTIFIER_get_first_arcs(st->buf, st->size, &arc0, &arc1); + if(rd <= 0) { + return -1; + } + + ret = snprintf(scratch, sizeof(scratch), "%"PRIu32".%"PRIu32, arc0, arc1); + if(ret >= (ssize_t)sizeof(scratch)) { + return -1; + } + produced += ret; + if(cb(scratch, ret, app_key) < 0) + return -1; + + for(off = rd; ; ) { + asn_oid_arc_t arc; + rd = OBJECT_IDENTIFIER_get_single_arc(st->buf + off, st->size - off, + &arc); + if(rd < 0) { + return -1; + } else if(rd == 0) { + /* No more arcs. */ + break; + } else { + off += rd; + assert(off <= st->size); + ret = snprintf(scratch, sizeof(scratch), ".%" PRIu32, arc); + if(ret >= (ssize_t)sizeof(scratch)) { + return -1; + } + produced += ret; + if(cb(scratch, ret, app_key) < 0) return -1; + } + } + + if(off != st->size) { + ASN_DEBUG("Could not scan to the end of Object Identifier"); + return -1; + } + + return produced; +} + +ssize_t +OBJECT_IDENTIFIER_get_arcs(const OBJECT_IDENTIFIER_t *st, asn_oid_arc_t *arcs, + size_t arc_slots) { + asn_oid_arc_t arc0 = 0; + asn_oid_arc_t arc1 = 0; + size_t num_arcs = 0; + size_t off; + ssize_t rd; + + if(!st || !st->buf) { + errno = EINVAL; + return -1; + } + + rd = OBJECT_IDENTIFIER_get_first_arcs(st->buf, st->size, &arc0, &arc1); + if(rd <= 0) { + return -1; + } + num_arcs = 2; + switch(arc_slots) { + default: + case 2: + arcs[1] = arc1; + /* Fall through */ + case 1: + arcs[0] = arc0; + /* Fall through */ + case 0: + break; + } + + for(off = rd; ; ) { + asn_oid_arc_t arc; + rd = OBJECT_IDENTIFIER_get_single_arc(st->buf + off, st->size - off, + &arc); + if(rd < 0) { + return -1; + } else if(rd == 0) { + /* No more arcs. */ + break; + } else { + off += rd; + if(num_arcs < arc_slots) { + arcs[num_arcs] = arc; + } + num_arcs++; + } + } + + if(off != st->size) { + return -1; + } + + return num_arcs; +} + + +/* + * Save the single value as an object identifier arc. + */ +ssize_t +OBJECT_IDENTIFIER_set_single_arc(uint8_t *arcbuf, size_t arcbuf_len, + asn_oid_arc_t value) { + /* + * The following conditions must hold: + * assert(arcbuf); + */ + uint8_t scratch[((sizeof(value) * CHAR_BIT + 6) / 7)]; + uint8_t *scratch_end = &scratch[sizeof(scratch)-1]; + uint8_t *b; + size_t result_len; + uint8_t mask; + + for(b = scratch_end, mask = 0; ; mask = 0x80, b--) { + *b = mask | (value & 0x7f); + value >>= 7; + if(!value) { + break; + } + } + + result_len = (scratch_end - b) + 1; + + if(result_len > arcbuf_len) { + return -1; + } + + memcpy(arcbuf, b, result_len); + + return result_len; +} + +int +OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *st, const asn_oid_arc_t *arcs, + size_t arc_slots) { + uint8_t *buf; + uint8_t *bp; + ssize_t wrote; + asn_oid_arc_t arc0; + asn_oid_arc_t arc1; + size_t size; + size_t i; + + if(!st || !arcs || arc_slots < 2) { + errno = EINVAL; + return -1; + } + + arc0 = arcs[0]; + arc1 = arcs[1]; + + if(arc0 <= 1) { + if(arc1 >= 40) { + /* 8.19.4: At most 39 subsequent values (including 0) */ + errno = ERANGE; + return -1; + } + } else if(arc0 == 2) { + if(arc1 > ASN_OID_ARC_MAX - 80) { + errno = ERANGE; + return -1; + } + } else if(arc0 > 2) { + /* 8.19.4: Only three values are allocated from the root node */ + errno = ERANGE; + return -1; + } + + /* + * After above tests it is known that the value of arc0 is completely + * trustworthy (0..2). However, the arc1's value is still meaningless. + */ + + /* + * Roughly estimate the maximum size necessary to encode these arcs. + * This estimation implicitly takes in account the following facts, + * that cancel each other: + * * the first two arcs are encoded in a single value. + * * the first value may require more space (+1 byte) + * * the value of the first arc which is in range (0..2) + */ + size = ((sizeof(asn_oid_arc_t) * CHAR_BIT + 6) / 7) * arc_slots; + bp = buf = (uint8_t *)MALLOC(size + 1); + if(!buf) { + /* ENOMEM */ + return -1; + } + + wrote = OBJECT_IDENTIFIER_set_single_arc(bp, size, arc0 * 40 + arc1); + if(wrote <= 0) { + FREEMEM(buf); + return -1; + } + assert((size_t)wrote <= size); + bp += wrote; + size -= wrote; + + for(i = 2; i < arc_slots; i++) { + wrote = OBJECT_IDENTIFIER_set_single_arc(bp, size, arcs[i]); + if(wrote <= 0) { + FREEMEM(buf); + return -1; + } + assert((size_t)wrote <= size); + bp += wrote; + size -= wrote; + } + + /* + * Replace buffer. + */ + st->size = bp - buf; + bp = st->buf; + st->buf = buf; + st->buf[st->size] = '\0'; + if(bp) FREEMEM(bp); + + return 0; +} + +ssize_t +OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length, + asn_oid_arc_t *arcs, size_t arcs_count, + const char **opt_oid_text_end) { + size_t num_arcs = 0; + const char *oid_end; + enum { + ST_LEADSPACE, + ST_TAILSPACE, + ST_AFTERVALUE, /* Next character ought to be '.' or a space */ + ST_WAITDIGITS /* Next character is expected to be a digit */ + } state = ST_LEADSPACE; + + if(!oid_text || oid_txt_length < -1 || (arcs_count && !arcs)) { + if(opt_oid_text_end) *opt_oid_text_end = oid_text; + errno = EINVAL; + return -1; + } + + if(oid_txt_length == -1) + oid_txt_length = strlen(oid_text); + +#define _OID_CAPTURE_ARC(oid_text, oid_end) \ + do { \ + const char *endp = oid_end; \ + unsigned long value; \ + switch(asn_strtoul_lim(oid_text, &endp, &value)) { \ + case ASN_STRTOX_EXTRA_DATA: \ + case ASN_STRTOX_OK: \ + if(value <= ASN_OID_ARC_MAX) { \ + if(num_arcs < arcs_count) arcs[num_arcs] = value; \ + num_arcs++; \ + oid_text = endp - 1; \ + break; \ + } \ + /* Fall through */ \ + case ASN_STRTOX_ERROR_RANGE: \ + if(opt_oid_text_end) *opt_oid_text_end = oid_text; \ + errno = ERANGE; \ + return -1; \ + case ASN_STRTOX_ERROR_INVAL: \ + case ASN_STRTOX_EXPECT_MORE: \ + if(opt_oid_text_end) *opt_oid_text_end = oid_text; \ + errno = EINVAL; \ + return -1; \ + } \ + } while(0) + + for(oid_end = oid_text + oid_txt_length; oid_text broken OID */ + return -1; + case ST_LEADSPACE: + case ST_WAITDIGITS: + _OID_CAPTURE_ARC(oid_text, oid_end); + state = ST_AFTERVALUE; + continue; + } + break; + default: + /* Unexpected symbols */ + state = ST_WAITDIGITS; + break; + } /* switch() */ + break; + } /* for() */ + + + if(opt_oid_text_end) *opt_oid_text_end = oid_text; + + /* Finalize last arc */ + switch(state) { + case ST_LEADSPACE: + return 0; /* No OID found in input data */ + case ST_WAITDIGITS: + errno = EINVAL; /* Broken OID */ + return -1; + case ST_AFTERVALUE: + case ST_TAILSPACE: + return num_arcs; + } + + errno = EINVAL; /* Broken OID */ + return -1; +} diff --git a/certgen/asncodec/OBJECT_IDENTIFIER.h b/certgen/asncodec/OBJECT_IDENTIFIER.h new file mode 100644 index 0000000..f878055 --- /dev/null +++ b/certgen/asncodec/OBJECT_IDENTIFIER.h @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _OBJECT_IDENTIFIER_H_ +#define _OBJECT_IDENTIFIER_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef uint32_t asn_oid_arc_t; +#define ASN_OID_ARC_MAX (~((asn_oid_arc_t)0)) + +typedef ASN__PRIMITIVE_TYPE_t OBJECT_IDENTIFIER_t; + +extern asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER; +extern asn_TYPE_operation_t asn_OP_OBJECT_IDENTIFIER; + +ssize_t OBJECT_IDENTIFIER__dump_body(const OBJECT_IDENTIFIER_t *st, + asn_app_consume_bytes_f *cb, + void *app_key); + +#define OBJECT_IDENTIFIER_free ASN__PRIMITIVE_TYPE_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f OBJECT_IDENTIFIER_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define OBJECT_IDENTIFIER_compare OCTET_STRING_compare + +asn_constr_check_f OBJECT_IDENTIFIER_constraint; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define OBJECT_IDENTIFIER_decode_ber ber_decode_primitive +#define OBJECT_IDENTIFIER_encode_der der_encode_primitive +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f OBJECT_IDENTIFIER_decode_xer; +xer_type_encoder_f OBJECT_IDENTIFIER_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f OBJECT_IDENTIFIER_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +#define OBJECT_IDENTIFIER_decode_oer oer_decode_primitive +#define OBJECT_IDENTIFIER_encode_oer oer_encode_primitive +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +#define OBJECT_IDENTIFIER_decode_uper OCTET_STRING_decode_uper +#define OBJECT_IDENTIFIER_encode_uper OCTET_STRING_encode_uper +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#define OBJECT_IDENTIFIER_decode_aper OCTET_STRING_decode_aper +#define OBJECT_IDENTIFIER_encode_aper OCTET_STRING_encode_aper +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f OBJECT_IDENTIFIER_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +/********************************** + * Some handy conversion routines * + **********************************/ + +/* + * This function fills an (arcs) array with OBJECT IDENTIFIER arcs + * up to specified (arc_slots) elements. + * + * EXAMPLE: + * void print_arcs(OBJECT_IDENTIFIER_t *oid) { + * asn_oid_arc_t fixed_arcs[10]; // Try with fixed space first + * asn_oid_arc_t *arcs = fixed_arcs; + * size_t arc_slots = sizeof(fixed_arcs)/sizeof(fixed_arcs[0]); // 10 + * ssize_t count; // Real number of arcs. + * int i; + * + * count = OBJECT_IDENTIFIER_get_arcs(oid, arcs, arc_slots); + * // If necessary, reallocate arcs array and try again. + * if(count > arc_slots) { + * arc_slots = count; + * arcs = malloc(sizeof(asn_oid_arc_t) * arc_slots); + * if(!arcs) return; + * count = OBJECT_IDENTIFIER_get_arcs(oid, arcs, arc_slots); + * assert(count == arc_slots); + * } + * + * // Print the contents of the arcs array. + * for(i = 0; i < count; i++) + * printf("%"PRIu32"\n", arcs[i]); + * + * // Avoid memory leak. + * if(arcs != fixed_arcs) free(arcs); + * } + * + * RETURN VALUES: + * -1/EINVAL: Invalid arguments (oid is missing) + * -1/ERANGE: One or more arcs have value out of array cell type range. + * >=0: Number of arcs contained in the OBJECT IDENTIFIER + * + * WARNING: The function always returns the actual number of arcs, + * even if there is no sufficient (arc_slots) provided. + */ +ssize_t OBJECT_IDENTIFIER_get_arcs(const OBJECT_IDENTIFIER_t *oid, + asn_oid_arc_t *arcs, size_t arc_slots); + +/* + * This functions initializes the OBJECT IDENTIFIER object with + * the given set of arcs. + * The minimum of two arcs must be present; some restrictions apply. + * RETURN VALUES: + * -1/EINVAL: Invalid arguments + * -1/ERANGE: The first two arcs do not conform to ASN.1 restrictions. + * -1/ENOMEM: Memory allocation failed + * 0: The object was initialized with new arcs. + */ +int OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *oid, + const asn_oid_arc_t *arcs, size_t arcs_count); + + +/* + * Parse the OBJECT IDENTIFIER textual representation ("1.3.6.1.4.1.9363"). + * No arc can exceed the (0..ASN_OID_ARC_MAX, which is the same as UINT32_MAX). + * This function is not specific to OBJECT IDENTIFIER, it may be used to parse + * the RELATIVE-OID data, or any other data consisting of dot-separated + * series of numeric values. + * + * If (oid_txt_length == -1), the strlen() will be invoked to determine the + * size of the (oid_text) string. + * + * After return, the optional (opt_oid_text_end) is set to the character after + * the last parsed one. (opt_oid_text_end) is never less than (oid_text). + * + * RETURN VALUES: + * -1: Parse error. + * >= 0: Number of arcs contained in the OBJECT IDENTIFIER. + * + * WARNING: The function always returns the real number of arcs, + * even if there is no sufficient (arc_slots) provided. + * This is useful for (arc_slots) value estimation. + */ +ssize_t OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, + ssize_t oid_txt_length, + asn_oid_arc_t *arcs, size_t arcs_count, + const char **opt_oid_text_end); + +/* + * Internal functions. + * Used by RELATIVE-OID implementation in particular. + */ + +/* + * Retrieve a single arc of size from the (arcbuf) buffer. + * RETURN VALUES: + * -1: Failed to retrieve the value from the (arcbuf). + * >0: Number of bytes consumed from the (arcbuf), <= (arcbuf_len). + */ +ssize_t OBJECT_IDENTIFIER_get_single_arc(const uint8_t *arcbuf, + size_t arcbuf_len, + asn_oid_arc_t *ret_value); + +/* + * Write the unterminated arc value into the (arcbuf) which has the size at + * least (arcbuf_len). + * RETURN VALUES: + * -1: (arcbuf_len) size is not sufficient to write the value. + * : Number of bytes appended to the arcbuf (<= arcbuf_len). + */ +ssize_t OBJECT_IDENTIFIER_set_single_arc(uint8_t *arcbuf, size_t arcbuf_len, + asn_oid_arc_t arc_value); + +#ifdef __cplusplus +} +#endif + +#endif /* _OBJECT_IDENTIFIER_H_ */ diff --git a/certgen/asncodec/OBJECT_IDENTIFIER_print.c b/certgen/asncodec/OBJECT_IDENTIFIER_print.c new file mode 100644 index 0000000..b0c3a9e --- /dev/null +++ b/certgen/asncodec/OBJECT_IDENTIFIER_print.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +OBJECT_IDENTIFIER_print(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, asn_app_consume_bytes_f *cb, + void *app_key) { + const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr; + + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(!st || !st->buf) + return (cb("", 8, app_key) < 0) ? -1 : 0; + + /* Dump preamble */ + if(cb("{ ", 2, app_key) < 0) + return -1; + + if(OBJECT_IDENTIFIER__dump_body(st, cb, app_key) < 0) { + return -1; + } + + return (cb(" }", 2, app_key) < 0) ? -1 : 0; +} diff --git a/certgen/asncodec/OBJECT_IDENTIFIER_xer.c b/certgen/asncodec/OBJECT_IDENTIFIER_xer.c new file mode 100644 index 0000000..706e51a --- /dev/null +++ b/certgen/asncodec/OBJECT_IDENTIFIER_xer.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +static enum xer_pbd_rval +OBJECT_IDENTIFIER__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, + const void *chunk_buf, size_t chunk_size) { + OBJECT_IDENTIFIER_t *st = (OBJECT_IDENTIFIER_t *)sptr; + const char *chunk_end = (const char *)chunk_buf + chunk_size; + const char *endptr; + asn_oid_arc_t s_arcs[10]; + asn_oid_arc_t *arcs = s_arcs; + ssize_t num_arcs; + ssize_t ret; + + (void)td; + + num_arcs = OBJECT_IDENTIFIER_parse_arcs( + (const char *)chunk_buf, chunk_size, arcs, + sizeof(s_arcs) / sizeof(s_arcs[0]), &endptr); + if(num_arcs < 0) { + /* Expecting more than zero arcs */ + return XPBD_BROKEN_ENCODING; + } else if(num_arcs == 0) { + return XPBD_NOT_BODY_IGNORE; + } + (void)chunk_end; + assert(endptr == chunk_end); + + if((size_t)num_arcs > sizeof(s_arcs)/sizeof(s_arcs[0])) { + arcs = (asn_oid_arc_t *)MALLOC(num_arcs * sizeof(asn_oid_arc_t)); + if(!arcs) return XPBD_SYSTEM_FAILURE; + ret = OBJECT_IDENTIFIER_parse_arcs((const char *)chunk_buf, chunk_size, + arcs, num_arcs, &endptr); + if(ret != num_arcs) + return XPBD_SYSTEM_FAILURE; /* assert?.. */ + } + + /* + * Convert arcs into BER representation. + */ + ret = OBJECT_IDENTIFIER_set_arcs(st, arcs, num_arcs); + if(arcs != s_arcs) FREEMEM(arcs); + + return ret ? XPBD_SYSTEM_FAILURE : XPBD_BODY_CONSUMED; +} + +asn_dec_rval_t +OBJECT_IDENTIFIER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, + size_t size) { + return xer_decode_primitive(opt_codec_ctx, td, + sptr, sizeof(OBJECT_IDENTIFIER_t), opt_mname, + buf_ptr, size, OBJECT_IDENTIFIER__xer_body_decode); +} + +asn_enc_rval_t +OBJECT_IDENTIFIER_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr; + asn_enc_rval_t er = {0,0,0}; + + (void)ilevel; + (void)flags; + + if(!st || !st->buf) { + ASN__ENCODE_FAILED; + } + + er.encoded = OBJECT_IDENTIFIER__dump_body(st, cb, app_key); + if(er.encoded < 0) ASN__ENCODE_FAILED; + + ASN__ENCODED_OK(er); +} diff --git a/certgen/asncodec/OCTET_STRING.c b/certgen/asncodec/OCTET_STRING.c index 84c8411..d0bdead 100644 --- a/certgen/asncodec/OCTET_STRING.c +++ b/certgen/asncodec/OCTET_STRING.c @@ -1,2043 +1,383 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include /* for .bits_unused member */ -#include - -/* - * OCTET STRING basic type description. - */ -static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) -}; -asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs = { - sizeof(OCTET_STRING_t), - offsetof(OCTET_STRING_t, _asn_ctx), - ASN_OSUBV_STR -}; - -asn_TYPE_operation_t asn_OP_OCTET_STRING = { - OCTET_STRING_free, - OCTET_STRING_print, /* OCTET STRING generally means a non-ascii sequence */ - OCTET_STRING_compare, - OCTET_STRING_decode_ber, - OCTET_STRING_encode_der, - OCTET_STRING_decode_xer_hex, - OCTET_STRING_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - OCTET_STRING_decode_oer, - OCTET_STRING_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - OCTET_STRING_decode_uper, /* Unaligned PER decoder */ - OCTET_STRING_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - OCTET_STRING_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { - "OCTET STRING", /* Canonical name */ - "OCTET_STRING", /* XML tag name */ - &asn_OP_OCTET_STRING, - asn_DEF_OCTET_STRING_tags, - sizeof(asn_DEF_OCTET_STRING_tags) - / sizeof(asn_DEF_OCTET_STRING_tags[0]), - asn_DEF_OCTET_STRING_tags, /* Same as above */ - sizeof(asn_DEF_OCTET_STRING_tags) - / sizeof(asn_DEF_OCTET_STRING_tags[0]), - { 0, 0, asn_generic_no_constraint }, - 0, 0, /* No members */ - &asn_SPC_OCTET_STRING_specs -}; - -#undef _CH_PHASE -#undef NEXT_PHASE -#undef PREV_PHASE -#define _CH_PHASE(ctx, inc) do { \ - if(ctx->phase == 0) \ - ctx->context = 0; \ - ctx->phase += inc; \ - } while(0) -#define NEXT_PHASE(ctx) _CH_PHASE(ctx, +1) -#define PREV_PHASE(ctx) _CH_PHASE(ctx, -1) - -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = (num_bytes); \ - buf_ptr = ((const char *)buf_ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -#undef RETURN -#define RETURN(_code) do { \ - asn_dec_rval_t tmprval; \ - tmprval.code = _code; \ - tmprval.consumed = consumed_myself; \ - return tmprval; \ - } while(0) - -#undef APPEND -#define APPEND(bufptr, bufsize) do { \ - size_t _bs = (bufsize); /* Append size */ \ - size_t _ns = ctx->context; /* Allocated now */ \ - size_t _es = st->size + _bs; /* Expected size */ \ - /* int is really a typeof(st->size): */ \ - if((int)_es < 0) RETURN(RC_FAIL); \ - if(_ns <= _es) { \ - void *ptr; \ - /* Be nice and round to the memory allocator */ \ - do { _ns = _ns ? _ns << 1 : 16; } \ - while(_ns <= _es); \ - /* int is really a typeof(st->size): */ \ - if((int)_ns < 0) RETURN(RC_FAIL); \ - ptr = REALLOC(st->buf, _ns); \ - if(ptr) { \ - st->buf = (uint8_t *)ptr; \ - ctx->context = _ns; \ - } else { \ - RETURN(RC_FAIL); \ - } \ - ASN_DEBUG("Reallocating into %ld", (long)_ns); \ - } \ - memcpy(st->buf + st->size, bufptr, _bs); \ - /* Convenient nul-termination */ \ - st->buf[_es] = '\0'; \ - st->size = _es; \ - } while(0) - -/* - * The main reason why ASN.1 is still alive is that too much time and effort - * is necessary for learning it more or less adequately, thus creating a gut - * necessity to demonstrate that aquired skill everywhere afterwards. - * No, I am not going to explain what the following stuff is. - */ -struct _stack_el { - ber_tlv_len_t left; /* What's left to read (or -1) */ - ber_tlv_len_t got; /* What was actually processed */ - unsigned cont_level; /* Depth of subcontainment */ - int want_nulls; /* Want null "end of content" octets? */ - int bits_chopped; /* Flag in BIT STRING mode */ - ber_tlv_tag_t tag; /* For debugging purposes */ - struct _stack_el *prev; - struct _stack_el *next; -}; -struct _stack { - struct _stack_el *tail; - struct _stack_el *cur_ptr; -}; - -static struct _stack_el * -OS__add_stack_el(struct _stack *st) { - struct _stack_el *nel; - - /* - * Reuse the old stack frame or allocate a new one. - */ - if(st->cur_ptr && st->cur_ptr->next) { - nel = st->cur_ptr->next; - nel->bits_chopped = 0; - nel->got = 0; - /* Retain the nel->cont_level, it's correct. */ - } else { - nel = (struct _stack_el *)CALLOC(1, sizeof(struct _stack_el)); - if(nel == NULL) - return NULL; - - if(st->tail) { - /* Increase a subcontainment depth */ - nel->cont_level = st->tail->cont_level + 1; - st->tail->next = nel; - } - nel->prev = st->tail; - st->tail = nel; - } - - st->cur_ptr = nel; - - return nel; -} - -static struct _stack * -_new_stack(void) { - return (struct _stack *)CALLOC(1, sizeof(struct _stack)); -} - -/* - * Decode OCTET STRING type. - */ -asn_dec_rval_t -OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const void *buf_ptr, size_t size, int tag_mode) { - const asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - BIT_STRING_t *st = (BIT_STRING_t *)*sptr; - asn_dec_rval_t rval; - asn_struct_ctx_t *ctx; - ssize_t consumed_myself = 0; - struct _stack *stck; /* Expectations stack structure */ - struct _stack_el *sel = 0; /* Stack element */ - int tlv_constr; - enum asn_OS_Subvariant type_variant = specs->subvariant; - - ASN_DEBUG("Decoding %s as %s (frame %ld)", - td->name, - (type_variant == ASN_OSUBV_STR) ? - "OCTET STRING" : "OS-SpecialCase", - (long)size); - - /* - * Create the string if does not exist. - */ - if(st == NULL) { - st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); - if(st == NULL) RETURN(RC_FAIL); - } - - /* Restore parsing context */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - switch(ctx->phase) { - case 0: - /* - * Check tags. - */ - rval = ber_check_tags(opt_codec_ctx, td, ctx, - buf_ptr, size, tag_mode, -1, - &ctx->left, &tlv_constr); - if(rval.code != RC_OK) - return rval; - - if(tlv_constr) { - /* - * Complex operation, requires stack of expectations. - */ - ctx->ptr = _new_stack(); - if(!ctx->ptr) { - RETURN(RC_FAIL); - } - } else { - /* - * Jump into stackless primitive decoding. - */ - _CH_PHASE(ctx, 3); - if(type_variant == ASN_OSUBV_ANY && tag_mode != 1) - APPEND(buf_ptr, rval.consumed); - ADVANCE(rval.consumed); - goto phase3; - } - - NEXT_PHASE(ctx); - /* Fall through */ - case 1: - phase1: - /* - * Fill the stack with expectations. - */ - stck = (struct _stack *)ctx->ptr; - sel = stck->cur_ptr; - do { - ber_tlv_tag_t tlv_tag; - ber_tlv_len_t tlv_len; - ber_tlv_tag_t expected_tag; - ssize_t tl, ll, tlvl; - /* This one works even if (sel->left == -1) */ - size_t Left = ((!sel||(size_t)sel->left >= size) - ?size:(size_t)sel->left); - - - ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", (void *)sel, - (long)(sel?sel->left:0), - (long)(sel?sel->want_nulls:0), - (long)(sel?sel->got:0) - ); - if(sel && sel->left <= 0 && sel->want_nulls == 0) { - if(sel->prev) { - struct _stack_el *prev = sel->prev; - if(prev->left != -1) { - if(prev->left < sel->got) - RETURN(RC_FAIL); - prev->left -= sel->got; - } - prev->got += sel->got; - sel = stck->cur_ptr = prev; - if(!sel) break; - tlv_constr = 1; - continue; - } else { - sel = stck->cur_ptr = 0; - break; /* Nothing to wait */ - } - } - - tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag); - ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld", - (long)size, (long)Left, sel?"":"!", - (long)(sel?sel->left:0), - (long)(sel?sel->want_nulls:0), - (long)tl); - switch(tl) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - - tlv_constr = BER_TLV_CONSTRUCTED(buf_ptr); - - ll = ber_fetch_length(tlv_constr, - (const char *)buf_ptr + tl,Left - tl,&tlv_len); - ASN_DEBUG("Got tag=%s, tc=%d, left=%ld, tl=%ld, len=%ld, ll=%ld", - ber_tlv_tag_string(tlv_tag), tlv_constr, - (long)Left, (long)tl, (long)tlv_len, (long)ll); - switch(ll) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - - if(sel && sel->want_nulls - && ((const uint8_t *)buf_ptr)[0] == 0 - && ((const uint8_t *)buf_ptr)[1] == 0) - { - - ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls); - - if(type_variant == ASN_OSUBV_ANY - && (tag_mode != 1 || sel->cont_level)) - APPEND("\0\0", 2); - - ADVANCE(2); - sel->got += 2; - if(sel->left != -1) { - sel->left -= 2; /* assert(sel->left >= 2) */ - } - - sel->want_nulls--; - if(sel->want_nulls == 0) { - /* Move to the next expectation */ - sel->left = 0; - tlv_constr = 1; - } - - continue; - } - - /* - * Set up expected tags, - * depending on ASN.1 type being decoded. - */ - switch(type_variant) { - case ASN_OSUBV_BIT: - /* X.690: 8.6.4.1, NOTE 2 */ - /* Fall through */ - case ASN_OSUBV_STR: - default: - if(sel) { - unsigned level = sel->cont_level; - if(level < td->all_tags_count) { - expected_tag = td->all_tags[level]; - break; - } else if(td->all_tags_count) { - expected_tag = td->all_tags - [td->all_tags_count - 1]; - break; - } - /* else, Fall through */ - } - /* Fall through */ - case ASN_OSUBV_ANY: - expected_tag = tlv_tag; - break; - } - - - if(tlv_tag != expected_tag) { - char buf[2][32]; - ber_tlv_tag_snprint(tlv_tag, - buf[0], sizeof(buf[0])); - ber_tlv_tag_snprint(td->tags[td->tags_count-1], - buf[1], sizeof(buf[1])); - ASN_DEBUG("Tag does not match expectation: %s != %s", - buf[0], buf[1]); - RETURN(RC_FAIL); - } - - tlvl = tl + ll; /* Combined length of T and L encoding */ - if((tlv_len + tlvl) < 0) { - /* tlv_len value is too big */ - ASN_DEBUG("TLV encoding + length (%ld) is too big", - (long)tlv_len); - RETURN(RC_FAIL); - } - - /* - * Append a new expectation. - */ - sel = OS__add_stack_el(stck); - if(!sel) RETURN(RC_FAIL); - - sel->tag = tlv_tag; - - sel->want_nulls = (tlv_len==-1); - if(sel->prev && sel->prev->left != -1) { - /* Check that the parent frame is big enough */ - if(sel->prev->left < tlvl + (tlv_len==-1?0:tlv_len)) - RETURN(RC_FAIL); - if(tlv_len == -1) - sel->left = sel->prev->left - tlvl; - else - sel->left = tlv_len; - } else { - sel->left = tlv_len; - } - if(type_variant == ASN_OSUBV_ANY - && (tag_mode != 1 || sel->cont_level)) - APPEND(buf_ptr, tlvl); - sel->got += tlvl; - ADVANCE(tlvl); - - ASN_DEBUG("+EXPECT2 got=%ld left=%ld, wn=%d, clvl=%u", - (long)sel->got, (long)sel->left, - sel->want_nulls, sel->cont_level); - - } while(tlv_constr); - if(sel == NULL) { - /* Finished operation, "phase out" */ - ASN_DEBUG("Phase out"); - _CH_PHASE(ctx, +3); - break; - } - - NEXT_PHASE(ctx); - /* Fall through */ - case 2: - stck = (struct _stack *)ctx->ptr; - sel = stck->cur_ptr; - ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d", - (long)sel->left, (long)size, (long)sel->got, - sel->want_nulls); - { - ber_tlv_len_t len; - - assert(sel->left >= 0); - - len = ((ber_tlv_len_t)size < sel->left) - ? (ber_tlv_len_t)size : sel->left; - if(len > 0) { - if(type_variant == ASN_OSUBV_BIT - && sel->bits_chopped == 0) { - /* Put the unused-bits-octet away */ - st->bits_unused = *(const uint8_t *)buf_ptr; - APPEND(((const char *)buf_ptr+1), (len - 1)); - sel->bits_chopped = 1; - } else { - APPEND(buf_ptr, len); - } - ADVANCE(len); - sel->left -= len; - sel->got += len; - } - - if(sel->left) { - ASN_DEBUG("OS left %ld, size = %ld, wn=%d\n", - (long)sel->left, (long)size, sel->want_nulls); - RETURN(RC_WMORE); - } - - PREV_PHASE(ctx); - goto phase1; - } - break; - case 3: - phase3: - /* - * Primitive form, no stack required. - */ - assert(ctx->left >= 0); - - if(size < (size_t)ctx->left) { - if(!size) RETURN(RC_WMORE); - if(type_variant == ASN_OSUBV_BIT && !ctx->context) { - st->bits_unused = *(const uint8_t *)buf_ptr; - ctx->left--; - ADVANCE(1); - } - APPEND(buf_ptr, size); - assert(ctx->context > 0); - ctx->left -= size; - ADVANCE(size); - RETURN(RC_WMORE); - } else { - if(type_variant == ASN_OSUBV_BIT - && !ctx->context && ctx->left) { - st->bits_unused = *(const uint8_t *)buf_ptr; - ctx->left--; - ADVANCE(1); - } - APPEND(buf_ptr, ctx->left); - ADVANCE(ctx->left); - ctx->left = 0; - - NEXT_PHASE(ctx); - } - break; - } - - if(sel) { - ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld", - (void *)sel->prev, sel->want_nulls, - (long)sel->left, (long)sel->got, (long)size); - if(sel->prev || sel->want_nulls > 1 || sel->left > 0) { - RETURN(RC_WMORE); - } - } - - /* - * BIT STRING-specific processing. - */ - if(type_variant == ASN_OSUBV_BIT) { - if(st->size) { - if(st->bits_unused < 0 || st->bits_unused > 7) { - RETURN(RC_FAIL); - } - /* Finalize BIT STRING: zero out unused bits. */ - st->buf[st->size-1] &= 0xff << st->bits_unused; - } else { - if(st->bits_unused) { - RETURN(RC_FAIL); - } - } - } - - ASN_DEBUG("Took %ld bytes to encode %s: [%s]:%ld", - (long)consumed_myself, td->name, - (type_variant == ASN_OSUBV_STR) ? (char *)st->buf : "", - (long)st->size); - - - RETURN(RC_OK); -} - -/* - * Encode OCTET STRING type using DER. - */ -asn_enc_rval_t -OCTET_STRING_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er; - const asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; - enum asn_OS_Subvariant type_variant = specs->subvariant; - int fix_last_byte = 0; - - ASN_DEBUG("%s %s as OCTET STRING", - cb?"Estimating":"Encoding", td->name); - - /* - * Write tags. - */ - if(type_variant != ASN_OSUBV_ANY || tag_mode == 1) { - er.encoded = der_write_tags(td, - (type_variant == ASN_OSUBV_BIT) + st->size, - tag_mode, type_variant == ASN_OSUBV_ANY, tag, - cb, app_key); - if(er.encoded == -1) { - er.failed_type = td; - er.structure_ptr = sptr; - return er; - } - } else { - /* Disallow: [] IMPLICIT ANY */ - assert(type_variant != ASN_OSUBV_ANY || tag_mode != -1); - er.encoded = 0; - } - - if(!cb) { - er.encoded += (type_variant == ASN_OSUBV_BIT) + st->size; - ASN__ENCODED_OK(er); - } - - /* - * Prepare to deal with the last octet of BIT STRING. - */ - if(type_variant == ASN_OSUBV_BIT) { - uint8_t b = st->bits_unused & 0x07; - if(b && st->size) fix_last_byte = 1; - ASN__CALLBACK(&b, 1); - } - - /* Invoke callback for the main part of the buffer */ - ASN__CALLBACK(st->buf, st->size - fix_last_byte); - - /* The last octet should be stripped off the unused bits */ - if(fix_last_byte) { - uint8_t b = st->buf[st->size-1] & (0xff << st->bits_unused); - ASN__CALLBACK(&b, 1); - } - - ASN__ENCODED_OK(er); -cb_failed: - ASN__ENCODE_FAILED; -} - -asn_enc_rval_t -OCTET_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - const char * const h2c = "0123456789ABCDEF"; - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - asn_enc_rval_t er; - char scratch[16 * 3 + 4]; - char *p = scratch; - uint8_t *buf; - uint8_t *end; - size_t i; - - if(!st || (!st->buf && st->size)) - ASN__ENCODE_FAILED; - - er.encoded = 0; - - /* - * Dump the contents of the buffer in hexadecimal. - */ - buf = st->buf; - end = buf + st->size; - if(flags & XER_F_CANONICAL) { - char *scend = scratch + (sizeof(scratch) - 2); - for(; buf < end; buf++) { - if(p >= scend) { - ASN__CALLBACK(scratch, p - scratch); - p = scratch; - } - *p++ = h2c[(*buf >> 4) & 0x0F]; - *p++ = h2c[*buf & 0x0F]; - } - - ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */ - } else { - for(i = 0; buf < end; buf++, i++) { - if(!(i % 16) && (i || st->size > 16)) { - ASN__CALLBACK(scratch, p-scratch); - p = scratch; - ASN__TEXT_INDENT(1, ilevel); - } - *p++ = h2c[(*buf >> 4) & 0x0F]; - *p++ = h2c[*buf & 0x0F]; - *p++ = 0x20; - } - if(p - scratch) { - p--; /* Remove the tail space */ - ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */ - if(st->size > 16) - ASN__TEXT_INDENT(1, ilevel-1); - } - } - - ASN__ENCODED_OK(er); -cb_failed: - ASN__ENCODE_FAILED; -} - -static const struct OCTET_STRING__xer_escape_table_s { - const char *string; - int size; -} OCTET_STRING__xer_escape_table[] = { -#define OSXET(s) { s, sizeof(s) - 1 } - OSXET("\074\156\165\154\057\076"), /* */ - OSXET("\074\163\157\150\057\076"), /* */ - OSXET("\074\163\164\170\057\076"), /* */ - OSXET("\074\145\164\170\057\076"), /* */ - OSXET("\074\145\157\164\057\076"), /* */ - OSXET("\074\145\156\161\057\076"), /* */ - OSXET("\074\141\143\153\057\076"), /* */ - OSXET("\074\142\145\154\057\076"), /* */ - OSXET("\074\142\163\057\076"), /* */ - OSXET("\011"), /* \t */ - OSXET("\012"), /* \n */ - OSXET("\074\166\164\057\076"), /* */ - OSXET("\074\146\146\057\076"), /* */ - OSXET("\015"), /* \r */ - OSXET("\074\163\157\057\076"), /* */ - OSXET("\074\163\151\057\076"), /* */ - OSXET("\074\144\154\145\057\076"), /* */ - OSXET("\074\144\143\061\057\076"), /* */ - OSXET("\074\144\143\062\057\076"), /* */ - OSXET("\074\144\143\063\057\076"), /* */ - OSXET("\074\144\143\064\057\076"), /* */ - OSXET("\074\156\141\153\057\076"), /* */ - OSXET("\074\163\171\156\057\076"), /* */ - OSXET("\074\145\164\142\057\076"), /* */ - OSXET("\074\143\141\156\057\076"), /* */ - OSXET("\074\145\155\057\076"), /* */ - OSXET("\074\163\165\142\057\076"), /* */ - OSXET("\074\145\163\143\057\076"), /* */ - OSXET("\074\151\163\064\057\076"), /* */ - OSXET("\074\151\163\063\057\076"), /* */ - OSXET("\074\151\163\062\057\076"), /* */ - OSXET("\074\151\163\061\057\076"), /* */ - { 0, 0 }, /* " " */ - { 0, 0 }, /* ! */ - { 0, 0 }, /* \" */ - { 0, 0 }, /* # */ - { 0, 0 }, /* $ */ - { 0, 0 }, /* % */ - OSXET("\046\141\155\160\073"), /* & */ - { 0, 0 }, /* ' */ - {0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* ()*+,-./ */ - {0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* 01234567 */ - {0,0},{0,0},{0,0},{0,0}, /* 89:; */ - OSXET("\046\154\164\073"), /* < */ - { 0, 0 }, /* = */ - OSXET("\046\147\164\073"), /* > */ -}; - -static int -OS__check_escaped_control_char(const void *buf, int size) { - size_t i; - /* - * Inefficient algorithm which translates the escape sequences - * defined above into characters. Returns -1 if not found. - * TODO: replace by a faster algorithm (bsearch(), hash or - * nested table lookups). - */ - for(i = 0; i < 32 /* Don't spend time on the bottom half */; i++) { - const struct OCTET_STRING__xer_escape_table_s *el; - el = &OCTET_STRING__xer_escape_table[i]; - if(el->size == size && memcmp(buf, el->string, size) == 0) - return i; - } - return -1; -} - -static int -OCTET_STRING__handle_control_chars(void *struct_ptr, const void *chunk_buf, size_t chunk_size) { - /* - * This might be one of the escape sequences - * for control characters. Check it out. - * #11.15.5 - */ - int control_char = OS__check_escaped_control_char(chunk_buf,chunk_size); - if(control_char >= 0) { - OCTET_STRING_t *st = (OCTET_STRING_t *)struct_ptr; - void *p = REALLOC(st->buf, st->size + 2); - if(p) { - st->buf = (uint8_t *)p; - st->buf[st->size++] = control_char; - st->buf[st->size] = '\0'; /* nul-termination */ - return 0; - } - } - - return -1; /* No, it's not */ -} - -asn_enc_rval_t -OCTET_STRING_encode_xer_utf8(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - asn_enc_rval_t er; - uint8_t *buf, *end; - uint8_t *ss; /* Sequence start */ - ssize_t encoded_len = 0; - - (void)ilevel; /* Unused argument */ - (void)flags; /* Unused argument */ - - if(!st || (!st->buf && st->size)) - ASN__ENCODE_FAILED; - - buf = st->buf; - end = buf + st->size; - for(ss = buf; buf < end; buf++) { - unsigned int ch = *buf; - int s_len; /* Special encoding sequence length */ - - /* - * Escape certain characters: X.680/11.15 - */ - if(ch < sizeof(OCTET_STRING__xer_escape_table) - /sizeof(OCTET_STRING__xer_escape_table[0]) - && (s_len = OCTET_STRING__xer_escape_table[ch].size)) { - if(((buf - ss) && cb(ss, buf - ss, app_key) < 0) - || cb(OCTET_STRING__xer_escape_table[ch].string, s_len, - app_key) < 0) - ASN__ENCODE_FAILED; - encoded_len += (buf - ss) + s_len; - ss = buf + 1; - } - } - - encoded_len += (buf - ss); - if((buf - ss) && cb(ss, buf - ss, app_key) < 0) - ASN__ENCODE_FAILED; - - er.encoded = encoded_len; - ASN__ENCODED_OK(er); -} - -/* - * Convert from hexadecimal format (cstring): "AB CD EF" - */ -static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) { - OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; - const char *chunk_stop = (const char *)chunk_buf; - const char *p = chunk_stop; - const char *pend = p + chunk_size; - unsigned int clv = 0; - int half = 0; /* Half bit */ - uint8_t *buf; - - /* Reallocate buffer according to high cap estimation */ - size_t new_size = st->size + (chunk_size + 1) / 2; - void *nptr = REALLOC(st->buf, new_size + 1); - if(!nptr) return -1; - st->buf = (uint8_t *)nptr; - buf = st->buf + st->size; - - /* - * If something like " a b c " appears here, the " a b":3 will be - * converted, and the rest skipped. That is, unless buf_size is greater - * than chunk_size, then it'll be equivalent to "ABC0". - */ - for(; p < pend; p++) { - int ch = *(const unsigned char *)p; - switch(ch) { - case 0x09: case 0x0a: case 0x0c: case 0x0d: - case 0x20: - /* Ignore whitespace */ - continue; - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ - clv = (clv << 4) + (ch - 0x30); - break; - case 0x41: case 0x42: case 0x43: /* ABC */ - case 0x44: case 0x45: case 0x46: /* DEF */ - clv = (clv << 4) + (ch - 0x41 + 10); - break; - case 0x61: case 0x62: case 0x63: /* abc */ - case 0x64: case 0x65: case 0x66: /* def */ - clv = (clv << 4) + (ch - 0x61 + 10); - break; - default: - *buf = 0; /* JIC */ - return -1; - } - if(half++) { - half = 0; - *buf++ = clv; - chunk_stop = p + 1; - } - } - - /* - * Check partial decoding. - */ - if(half) { - if(have_more) { - /* - * Partial specification is fine, - * because no more more PXER_TEXT data is available. - */ - *buf++ = clv << 4; - chunk_stop = p; - } - } else { - chunk_stop = p; - } - - st->size = buf - st->buf; /* Adjust the buffer size */ - assert(st->size <= new_size); - st->buf[st->size] = 0; /* Courtesy termination */ - - return (chunk_stop - (const char *)chunk_buf); /* Converted size */ -} - -/* - * Convert from binary format: "00101011101" - */ -static ssize_t OCTET_STRING__convert_binary(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) { - BIT_STRING_t *st = (BIT_STRING_t *)sptr; - const char *p = (const char *)chunk_buf; - const char *pend = p + chunk_size; - int bits_unused = st->bits_unused & 0x7; - uint8_t *buf; - - /* Reallocate buffer according to high cap estimation */ - size_t new_size = st->size + (chunk_size + 7) / 8; - void *nptr = REALLOC(st->buf, new_size + 1); - if(!nptr) return -1; - st->buf = (uint8_t *)nptr; - buf = st->buf + st->size; - - (void)have_more; - - if(bits_unused == 0) - bits_unused = 8; - else if(st->size) - buf--; - - /* - * Convert series of 0 and 1 into the octet string. - */ - for(; p < pend; p++) { - int ch = *(const unsigned char *)p; - switch(ch) { - case 0x09: case 0x0a: case 0x0c: case 0x0d: - case 0x20: - /* Ignore whitespace */ - break; - case 0x30: - case 0x31: - if(bits_unused-- <= 0) { - *++buf = 0; /* Clean the cell */ - bits_unused = 7; - } - *buf |= (ch&1) << bits_unused; - break; - default: - st->bits_unused = bits_unused; - return -1; - } - } - - if(bits_unused == 8) { - st->size = buf - st->buf; - st->bits_unused = 0; - } else { - st->size = buf - st->buf + 1; - st->bits_unused = bits_unused; - } - - assert(st->size <= new_size); - st->buf[st->size] = 0; /* Courtesy termination */ - - return chunk_size; /* Converted in full */ -} - -/* - * Something like strtod(), but with stricter rules. - */ -static int -OS__strtoent(int base, const char *buf, const char *end, int32_t *ret_value) { - const int32_t last_unicode_codepoint = 0x10ffff; - int32_t val = 0; - const char *p; - - for(p = buf; p < end; p++) { - int ch = *p; - - switch(ch) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ - val = val * base + (ch - 0x30); - break; - case 0x41: case 0x42: case 0x43: /* ABC */ - case 0x44: case 0x45: case 0x46: /* DEF */ - val = val * base + (ch - 0x41 + 10); - break; - case 0x61: case 0x62: case 0x63: /* abc */ - case 0x64: case 0x65: case 0x66: /* def */ - val = val * base + (ch - 0x61 + 10); - break; - case 0x3b: /* ';' */ - *ret_value = val; - return (p - buf) + 1; - default: - return -1; /* Character set error */ - } - - /* Value exceeds the Unicode range. */ - if(val > last_unicode_codepoint) { - return -1; - } - } - - *ret_value = -1; - return (p - buf); -} - -/* - * Convert from the plain UTF-8 format, expanding entity references: "2 < 3" - */ -static ssize_t -OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, - size_t chunk_size, int have_more) { - OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; - const char *p = (const char *)chunk_buf; - const char *pend = p + chunk_size; - uint8_t *buf; - - /* Reallocate buffer */ - size_t new_size = st->size + chunk_size; - void *nptr = REALLOC(st->buf, new_size + 1); - if(!nptr) return -1; - st->buf = (uint8_t *)nptr; - buf = st->buf + st->size; - - /* - * Convert series of 0 and 1 into the octet string. - */ - for(; p < pend; p++) { - int ch = *(const unsigned char *)p; - int len; /* Length of the rest of the chunk */ - - if(ch != 0x26 /* '&' */) { - *buf++ = ch; - continue; /* That was easy... */ - } - - /* - * Process entity reference. - */ - len = chunk_size - (p - (const char *)chunk_buf); - if(len == 1 /* "&" */) goto want_more; - if(p[1] == 0x23 /* '#' */) { - const char *pval; /* Pointer to start of digits */ - int32_t val = 0; /* Entity reference value */ - int base; - - if(len == 2 /* "&#" */) goto want_more; - if(p[2] == 0x78 /* 'x' */) - pval = p + 3, base = 16; - else - pval = p + 2, base = 10; - len = OS__strtoent(base, pval, p + len, &val); - if(len == -1) { - /* Invalid charset. Just copy verbatim. */ - *buf++ = ch; - continue; - } - if(!len || pval[len-1] != 0x3b) goto want_more; - assert(val > 0); - p += (pval - p) + len - 1; /* Advance past entref */ - - if(val < 0x80) { - *buf++ = (char)val; - } else if(val < 0x800) { - *buf++ = 0xc0 | ((val >> 6)); - *buf++ = 0x80 | ((val & 0x3f)); - } else if(val < 0x10000) { - *buf++ = 0xe0 | ((val >> 12)); - *buf++ = 0x80 | ((val >> 6) & 0x3f); - *buf++ = 0x80 | ((val & 0x3f)); - } else if(val < 0x200000) { - *buf++ = 0xf0 | ((val >> 18)); - *buf++ = 0x80 | ((val >> 12) & 0x3f); - *buf++ = 0x80 | ((val >> 6) & 0x3f); - *buf++ = 0x80 | ((val & 0x3f)); - } else if(val < 0x4000000) { - *buf++ = 0xf8 | ((val >> 24)); - *buf++ = 0x80 | ((val >> 18) & 0x3f); - *buf++ = 0x80 | ((val >> 12) & 0x3f); - *buf++ = 0x80 | ((val >> 6) & 0x3f); - *buf++ = 0x80 | ((val & 0x3f)); - } else { - *buf++ = 0xfc | ((val >> 30) & 0x1); - *buf++ = 0x80 | ((val >> 24) & 0x3f); - *buf++ = 0x80 | ((val >> 18) & 0x3f); - *buf++ = 0x80 | ((val >> 12) & 0x3f); - *buf++ = 0x80 | ((val >> 6) & 0x3f); - *buf++ = 0x80 | ((val & 0x3f)); - } - } else { - /* - * Ugly, limited parsing of & > < - */ - char *sc = (char *)memchr(p, 0x3b, len > 5 ? 5 : len); - if(!sc) goto want_more; - if((sc - p) == 4 - && p[1] == 0x61 /* 'a' */ - && p[2] == 0x6d /* 'm' */ - && p[3] == 0x70 /* 'p' */) { - *buf++ = 0x26; - p = sc; - continue; - } - if((sc - p) == 3) { - if(p[1] == 0x6c) { - *buf = 0x3c; /* '<' */ - } else if(p[1] == 0x67) { - *buf = 0x3e; /* '>' */ - } else { - /* Unsupported entity reference */ - *buf++ = ch; - continue; - } - if(p[2] != 0x74) { - /* Unsupported entity reference */ - *buf++ = ch; - continue; - } - buf++; - p = sc; - continue; - } - /* Unsupported entity reference */ - *buf++ = ch; - } - - continue; - want_more: - if(have_more) { - /* - * We know that no more data (of the same type) - * is coming. Copy the rest verbatim. - */ - *buf++ = ch; - continue; - } - chunk_size = (p - (const char *)chunk_buf); - /* Processing stalled: need more data */ - break; - } - - st->size = buf - st->buf; - assert(st->size <= new_size); - st->buf[st->size] = 0; /* Courtesy termination */ - - return chunk_size; /* Converted in full */ -} - -/* - * Decode OCTET STRING from the XML element's body. - */ -static asn_dec_rval_t -OCTET_STRING__decode_xer( - const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td, - void **sptr, const char *opt_mname, const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder)(void *struct_ptr, const void *chunk_buf, - size_t chunk_size), - ssize_t (*body_receiver)(void *struct_ptr, const void *chunk_buf, - size_t chunk_size, int have_more)) { - OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; - const asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; - asn_struct_ctx_t *ctx; /* Per-structure parser context */ - asn_dec_rval_t rval; /* Return value from the decoder */ - int st_allocated; - - /* - * Create the string if does not exist. - */ - if(!st) { - st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); - *sptr = (void *)st; - if(!st) goto sta_failed; - st_allocated = 1; - } else { - st_allocated = 0; - } - if(!st->buf) { - /* This is separate from above section */ - st->buf = (uint8_t *)CALLOC(1, 1); - if(!st->buf) { - if(st_allocated) { - *sptr = 0; - goto stb_failed; - } else { - goto sta_failed; - } - } - } - - /* Restore parsing context */ - ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset); - - return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag, - buf_ptr, size, opt_unexpected_tag_decoder, body_receiver); - -stb_failed: - FREEMEM(st); -sta_failed: - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; -} - -/* - * Decode OCTET STRING from the hexadecimal data. - */ -asn_dec_rval_t -OCTET_STRING_decode_xer_hex(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, - size_t size) { - return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, - buf_ptr, size, 0, OCTET_STRING__convert_hexadecimal); -} - -/* - * Decode OCTET STRING from the binary (0/1) data. - */ -asn_dec_rval_t -OCTET_STRING_decode_xer_binary(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, - size_t size) { - return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, - buf_ptr, size, 0, OCTET_STRING__convert_binary); -} - -/* - * Decode OCTET STRING from the string (ASCII/UTF-8) data. - */ -asn_dec_rval_t -OCTET_STRING_decode_xer_utf8(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, - size_t size) { - return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, - buf_ptr, size, - OCTET_STRING__handle_control_chars, - OCTET_STRING__convert_entrefs); -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -static int -OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf, - size_t units, unsigned int bpc, unsigned int unit_bits, - long lb, long ub, const asn_per_constraints_t *pc) { - uint8_t *end = buf + units * bpc; - - ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d", - (int)units, lb, ub, unit_bits); - - /* X.691: 27.5.4 */ - if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { - /* Decode without translation */ - lb = 0; - } else if(pc && pc->code2value) { - if(unit_bits > 16) - return 1; /* FATAL: can't have constrained - * UniversalString with more than - * 16 million code points */ - for(; buf < end; buf += bpc) { - int value; - int code = per_get_few_bits(po, unit_bits); - if(code < 0) return -1; /* WMORE */ - value = pc->code2value(code); - if(value < 0) { - ASN_DEBUG("Code %d (0x%02x) is" - " not in map (%ld..%ld)", - code, code, lb, ub); - return 1; /* FATAL */ - } - switch(bpc) { - case 1: *buf = value; break; - case 2: buf[0] = value >> 8; buf[1] = value; break; - case 4: buf[0] = value >> 24; buf[1] = value >> 16; - buf[2] = value >> 8; buf[3] = value; break; - } - } - return 0; - } - - /* Shortcut the no-op copying to the aligned structure */ - if(lb == 0 && (unit_bits == 8 * bpc)) { - return per_get_many_bits(po, buf, 0, unit_bits * units); - } - - for(; buf < end; buf += bpc) { - int32_t code = per_get_few_bits(po, unit_bits); - int32_t ch = code + lb; - if(code < 0) return -1; /* WMORE */ - if(ch > ub) { - ASN_DEBUG("Code %d is out of range (%ld..%ld)", - ch, lb, ub); - return 1; /* FATAL */ - } - switch(bpc) { - case 1: *buf = ch; break; - case 2: buf[0] = ch >> 8; buf[1] = ch; break; - case 4: buf[0] = ch >> 24; buf[1] = ch >> 16; - buf[2] = ch >> 8; buf[3] = ch; break; - } - } - - return 0; -} - -static int -OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, - size_t units, unsigned int bpc, unsigned int unit_bits, - long lb, long ub, const asn_per_constraints_t *pc) { - const uint8_t *end = buf + units * bpc; - - ASN_DEBUG("Squeezing %d characters into (%ld..%ld):%d (%d bpc)", - (int)units, lb, ub, unit_bits, bpc); - - /* X.691: 27.5.4 */ - if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { - /* Encode as is */ - lb = 0; - } else if(pc && pc->value2code) { - for(; buf < end; buf += bpc) { - int code; - uint32_t value; - switch(bpc) { - case 1: value = *(const uint8_t *)buf; break; - case 2: value = (buf[0] << 8) | buf[1]; break; - case 4: value = (buf[0] << 24) | (buf[1] << 16) - | (buf[2] << 8) | buf[3]; break; - default: return -1; - } - code = pc->value2code(value); - if(code < 0) { - ASN_DEBUG("Character %d (0x%02x) is" - " not in map (%ld..%ld)", - *buf, *buf, lb, ub); - return -1; - } - if(per_put_few_bits(po, code, unit_bits)) - return -1; - } - } - - /* Shortcut the no-op copying to the aligned structure */ - if(lb == 0 && (unit_bits == 8 * bpc)) { - return per_put_many_bits(po, buf, unit_bits * units); - } - - for(ub -= lb; buf < end; buf += bpc) { - int ch; - uint32_t value; - switch(bpc) { - case 1: - value = *(const uint8_t *)buf; - break; - case 2: - value = (buf[0] << 8) | buf[1]; - break; - case 4: - value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; - break; - default: - return -1; - } - ch = value - lb; - if(ch < 0 || ch > ub) { - ASN_DEBUG("Character %d (0x%02x) is out of range (%ld..%ld)", *buf, - value, lb, ub + lb); - return -1; - } - if(per_put_few_bits(po, ch, unit_bits)) return -1; - } - - return 0; -} - -static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = { - { APC_CONSTRAINED, 8, 8, 0, 255 }, - { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, - 0, 0 -}; - -asn_dec_rval_t -OCTET_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - const asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - const asn_per_constraints_t *pc = - constraints ? constraints : td->encoding_constraints.per_constraints; - const asn_per_constraint_t *cval; - const asn_per_constraint_t *csiz; - asn_dec_rval_t rval = { RC_OK, 0 }; - OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; - ssize_t consumed_myself = 0; - int repeat; - enum { - OS__BPC_CHAR = 1, - OS__BPC_U16 = 2, - OS__BPC_U32 = 4 - } bpc; /* Bytes per character */ - unsigned int unit_bits; - unsigned int canonical_unit_bits; - - (void)opt_codec_ctx; - - if(pc) { - cval = &pc->value; - csiz = &pc->size; - } else { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; - } - - switch(specs->subvariant) { - default: - case ASN_OSUBV_ANY: - case ASN_OSUBV_BIT: - ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant); - RETURN(RC_FAIL); - break; - case ASN_OSUBV_STR: - canonical_unit_bits = unit_bits = 8; - if(cval->flags & APC_CONSTRAINED) - unit_bits = cval->range_bits; - bpc = OS__BPC_CHAR; - break; - case ASN_OSUBV_U16: - canonical_unit_bits = unit_bits = 16; - if(cval->flags & APC_CONSTRAINED) - unit_bits = cval->range_bits; - bpc = OS__BPC_U16; - break; - case ASN_OSUBV_U32: - canonical_unit_bits = unit_bits = 32; - if(cval->flags & APC_CONSTRAINED) - unit_bits = cval->range_bits; - bpc = OS__BPC_U32; - break; - } - - /* - * Allocate the string. - */ - if(!st) { - st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); - if(!st) RETURN(RC_FAIL); - } - - ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d", - csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible", - csiz->lower_bound, csiz->upper_bound, csiz->effective_bits); - - if(csiz->flags & APC_EXTENSIBLE) { - int inext = per_get_few_bits(pd, 1); - if(inext < 0) RETURN(RC_WMORE); - if(inext) { - csiz = &asn_DEF_OCTET_STRING_constraints.size; - unit_bits = canonical_unit_bits; - } - } - - if(csiz->effective_bits >= 0) { - FREEMEM(st->buf); - if(bpc) { - st->size = csiz->upper_bound * bpc; - } else { - st->size = (csiz->upper_bound + 7) >> 3; - } - st->buf = (uint8_t *)MALLOC(st->size + 1); - if(!st->buf) { st->size = 0; RETURN(RC_FAIL); } - } - - /* X.691, #16.5: zero-length encoding */ - /* X.691, #16.6: short fixed length encoding (up to 2 octets) */ - /* X.691, #16.7: long fixed length encoding (up to 64K octets) */ - if(csiz->effective_bits == 0) { - int ret; - if(bpc) { - ASN_DEBUG("Encoding OCTET STRING size %ld", - csiz->upper_bound); - ret = OCTET_STRING_per_get_characters(pd, st->buf, - csiz->upper_bound, bpc, unit_bits, - cval->lower_bound, cval->upper_bound, pc); - if(ret > 0) RETURN(RC_FAIL); - } else { - ASN_DEBUG("Encoding BIT STRING size %ld", - csiz->upper_bound); - ret = per_get_many_bits(pd, st->buf, 0, - unit_bits * csiz->upper_bound); - } - if(ret < 0) RETURN(RC_WMORE); - consumed_myself += unit_bits * csiz->upper_bound; - st->buf[st->size] = 0; - RETURN(RC_OK); - } - - st->size = 0; - do { - ssize_t raw_len; - ssize_t len_bytes; - void *p; - int ret; - - /* Get the PER length */ - raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound, - &repeat); - if(raw_len < 0) RETURN(RC_WMORE); - if(raw_len == 0 && st->buf) break; - - ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)", - (long)csiz->effective_bits, (long)raw_len, - repeat ? "repeat" : "once", td->name); - len_bytes = raw_len * bpc; - p = REALLOC(st->buf, st->size + len_bytes + 1); - if(!p) RETURN(RC_FAIL); - st->buf = (uint8_t *)p; - - ret = OCTET_STRING_per_get_characters(pd, &st->buf[st->size], raw_len, - bpc, unit_bits, cval->lower_bound, - cval->upper_bound, pc); - if(ret > 0) RETURN(RC_FAIL); - if(ret < 0) RETURN(RC_WMORE); - st->size += len_bytes; - } while(repeat); - st->buf[st->size] = 0; /* nul-terminate */ - - return rval; -} - -asn_enc_rval_t -OCTET_STRING_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, asn_per_outp_t *po) { - const asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - const asn_per_constraints_t *pc = constraints ? constraints - : td->encoding_constraints.per_constraints; - const asn_per_constraint_t *cval; - const asn_per_constraint_t *csiz; - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - asn_enc_rval_t er = { 0, 0, 0 }; - int inext = 0; /* Lies not within extension root */ - unsigned int unit_bits; - unsigned int canonical_unit_bits; - size_t size_in_units; - const uint8_t *buf; - int ret; - enum { - OS__BPC_CHAR = 1, - OS__BPC_U16 = 2, - OS__BPC_U32 = 4 - } bpc; /* Bytes per character */ - int ct_extensible; - - if(!st || (!st->buf && st->size)) - ASN__ENCODE_FAILED; - - if(pc) { - cval = &pc->value; - csiz = &pc->size; - } else { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; - } - ct_extensible = csiz->flags & APC_EXTENSIBLE; - - switch(specs->subvariant) { - default: - case ASN_OSUBV_ANY: - case ASN_OSUBV_BIT: - ASN__ENCODE_FAILED; - case ASN_OSUBV_STR: - canonical_unit_bits = unit_bits = 8; - if(cval->flags & APC_CONSTRAINED) - unit_bits = cval->range_bits; - bpc = OS__BPC_CHAR; - size_in_units = st->size; - break; - case ASN_OSUBV_U16: - canonical_unit_bits = unit_bits = 16; - if(cval->flags & APC_CONSTRAINED) - unit_bits = cval->range_bits; - bpc = OS__BPC_U16; - size_in_units = st->size >> 1; - if(st->size & 1) { - ASN_DEBUG("%s string size is not modulo 2", td->name); - ASN__ENCODE_FAILED; - } - break; - case ASN_OSUBV_U32: - canonical_unit_bits = unit_bits = 32; - if(cval->flags & APC_CONSTRAINED) - unit_bits = cval->range_bits; - bpc = OS__BPC_U32; - size_in_units = st->size >> 2; - if(st->size & 3) { - ASN_DEBUG("%s string size is not modulo 4", td->name); - ASN__ENCODE_FAILED; - } - break; - } - - ASN_DEBUG("Encoding %s into %" ASN_PRI_SIZE " units of %d bits" - " (%ld..%ld, effective %d)%s", - td->name, size_in_units, unit_bits, - csiz->lower_bound, csiz->upper_bound, - csiz->effective_bits, ct_extensible ? " EXT" : ""); - - /* Figure out whether size lies within PER visible constraint */ - - if(csiz->effective_bits >= 0) { - if((ssize_t)size_in_units < csiz->lower_bound - || (ssize_t)size_in_units > csiz->upper_bound) { - if(ct_extensible) { - csiz = &asn_DEF_OCTET_STRING_constraints.size; - unit_bits = canonical_unit_bits; - inext = 1; - } else { - ASN__ENCODE_FAILED; - } - } - } else { - inext = 0; - } - - if(ct_extensible) { - /* Declare whether length is [not] within extension root */ - if(per_put_few_bits(po, inext, 1)) - ASN__ENCODE_FAILED; - } - - if(csiz->effective_bits >= 0 && !inext) { - ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes (%ld), length in %d bits", st->size, - size_in_units - csiz->lower_bound, csiz->effective_bits); - ret = per_put_few_bits(po, size_in_units - csiz->lower_bound, - csiz->effective_bits); - if(ret) ASN__ENCODE_FAILED; - ret = OCTET_STRING_per_put_characters(po, st->buf, size_in_units, bpc, - unit_bits, cval->lower_bound, - cval->upper_bound, pc); - if(ret) ASN__ENCODE_FAILED; - ASN__ENCODED_OK(er); - } - - ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size); - - buf = st->buf; - ASN_DEBUG("Encoding %" ASN_PRI_SIZE " in units", size_in_units); - do { - int need_eom = 0; - ssize_t may_save = uper_put_length(po, size_in_units, &need_eom); - if(may_save < 0) ASN__ENCODE_FAILED; - - ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "%s", may_save, size_in_units, - need_eom ? ",+EOM" : ""); - - ret = OCTET_STRING_per_put_characters(po, buf, may_save, bpc, unit_bits, - cval->lower_bound, - cval->upper_bound, pc); - if(ret) ASN__ENCODE_FAILED; - - buf += may_save * bpc; - size_in_units -= may_save; - assert(!(may_save & 0x07) || !size_in_units); - if(need_eom && uper_put_length(po, 0, 0)) - ASN__ENCODE_FAILED; /* End of Message length */ - } while(size_in_units); - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -int -OCTET_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { - const char * const h2c = "0123456789ABCDEF"; - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - char scratch[16 * 3 + 4]; - char *p = scratch; - uint8_t *buf; - uint8_t *end; - size_t i; - - (void)td; /* Unused argument */ - - if(!st || (!st->buf && st->size)) - return (cb("", 8, app_key) < 0) ? -1 : 0; - - /* - * Dump the contents of the buffer in hexadecimal. - */ - buf = st->buf; - end = buf + st->size; - for(i = 0; buf < end; buf++, i++) { - if(!(i % 16) && (i || st->size > 16)) { - if(cb(scratch, p - scratch, app_key) < 0) - return -1; - _i_INDENT(1); - p = scratch; - } - *p++ = h2c[(*buf >> 4) & 0x0F]; - *p++ = h2c[*buf & 0x0F]; - *p++ = 0x20; - } - - if(p > scratch) { - p--; /* Remove the tail space */ - if(cb(scratch, p - scratch, app_key) < 0) - return -1; - } - - return 0; -} - -int -OCTET_STRING_print_utf8(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, asn_app_consume_bytes_f *cb, - void *app_key) { - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - - (void)td; /* Unused argument */ - (void)ilevel; /* Unused argument */ - - if(st && (st->buf || !st->size)) { - return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0; - } else { - return (cb("", 8, app_key) < 0) ? -1 : 0; - } -} - -void -OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr, - enum asn_struct_free_method method) { - OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; - const asn_OCTET_STRING_specifics_t *specs; - asn_struct_ctx_t *ctx; - struct _stack *stck; - - if(!td || !st) - return; - - specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - ASN_DEBUG("Freeing %s as OCTET STRING", td->name); - - if(st->buf) { - FREEMEM(st->buf); - st->buf = 0; - } - - /* - * Remove decode-time stack. - */ - stck = (struct _stack *)ctx->ptr; - if(stck) { - while(stck->tail) { - struct _stack_el *sel = stck->tail; - stck->tail = sel->prev; - FREEMEM(sel); - } - FREEMEM(stck); - } - - switch(method) { - case ASFM_FREE_EVERYTHING: - FREEMEM(sptr); - break; - case ASFM_FREE_UNDERLYING: - break; - case ASFM_FREE_UNDERLYING_AND_RESET: - memset(sptr, 0, - td->specifics - ? ((const asn_OCTET_STRING_specifics_t *)(td->specifics)) - ->struct_size - : sizeof(OCTET_STRING_t)); - break; - } -} - -/* - * Conversion routines. - */ -int -OCTET_STRING_fromBuf(OCTET_STRING_t *st, const char *str, int len) { - void *buf; - - if(st == 0 || (str == 0 && len)) { - errno = EINVAL; - return -1; - } - - /* - * Clear the OCTET STRING. - */ - if(str == NULL) { - FREEMEM(st->buf); - st->buf = 0; - st->size = 0; - return 0; - } - - /* Determine the original string size, if not explicitly given */ - if(len < 0) - len = strlen(str); - - /* Allocate and fill the memory */ - buf = MALLOC(len + 1); - if(buf == NULL) - return -1; - - memcpy(buf, str, len); - ((uint8_t *)buf)[len] = '\0'; /* Couldn't use memcpy(len+1)! */ - FREEMEM(st->buf); - st->buf = (uint8_t *)buf; - st->size = len; - - return 0; -} - -OCTET_STRING_t * -OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td, const char *str, - int len) { - const asn_OCTET_STRING_specifics_t *specs = - td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - OCTET_STRING_t *st; - - st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); - if(st && str && OCTET_STRING_fromBuf(st, str, len)) { - FREEMEM(st); - st = NULL; - } - - return st; -} - -/* - * Lexicographically compare the common prefix of both strings, - * and if it is the same return -1 for the smallest string. - */ -int -OCTET_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr, - const void *bptr) { - const asn_OCTET_STRING_specifics_t *specs = td->specifics; - const OCTET_STRING_t *a = aptr; - const OCTET_STRING_t *b = bptr; - - assert(!specs || specs->subvariant != ASN_OSUBV_BIT); - - if(a && b) { - size_t common_prefix_size = a->size <= b->size ? a->size : b->size; - int ret = memcmp(a->buf, b->buf, common_prefix_size); - if(ret == 0) { - /* Figure out which string with equal prefixes is longer. */ - if(a->size < b->size) { - return -1; - } else if(a->size > b->size) { - return 1; - } else { - return 0; - } - } else { - return ret < 0 ? -1 : 1; - } - } else if(!a && !b) { - return 0; - } else if(!a) { - return -1; - } else { - return 1; - } - -} - -/* - * Biased function for randomizing character values around their limits. - */ -static uint32_t -OCTET_STRING__random_char(unsigned long lb, unsigned long ub) { - assert(lb <= ub); - switch(asn_random_between(0, 16)) { - case 0: - if(lb < ub) return lb + 1; - /* Fall through */ - case 1: - return lb; - case 2: - if(lb < ub) return ub - 1; - /* Fall through */ - case 3: - return ub; - default: - return asn_random_between(lb, ub); - } -} - - -size_t -OCTET_STRING_random_length_constrained( - const asn_TYPE_descriptor_t *td, - const asn_encoding_constraints_t *constraints, size_t max_length) { - const unsigned lengths[] = {0, 1, 2, 3, 4, 8, - 126, 127, 128, 16383, 16384, 16385, - 65534, 65535, 65536, 65537}; - size_t rnd_len; - - /* Figure out how far we should go */ - rnd_len = lengths[asn_random_between( - 0, sizeof(lengths) / sizeof(lengths[0]) - 1)]; - - if(!constraints || !constraints->per_constraints) - constraints = &td->encoding_constraints; - if(constraints->per_constraints) { - const asn_per_constraint_t *pc = &constraints->per_constraints->size; - if(pc->flags & APC_CONSTRAINED) { - long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length - ? pc->upper_bound - : (ssize_t)max_length; - if(max_length <= (size_t)pc->lower_bound) { - return pc->lower_bound; - } - if(pc->flags & APC_EXTENSIBLE) { - switch(asn_random_between(0, 5)) { - case 0: - if(pc->lower_bound > 0) { - rnd_len = pc->lower_bound - 1; - break; - } - /* Fall through */ - case 1: - rnd_len = pc->upper_bound + 1; - break; - case 2: - /* Keep rnd_len from the table */ - if(rnd_len <= max_length) { - break; - } - /* Fall through */ - default: - rnd_len = asn_random_between(pc->lower_bound, - suggested_upper_bound); - } - } else { - rnd_len = - asn_random_between(pc->lower_bound, suggested_upper_bound); - } - } else { - rnd_len = asn_random_between(0, max_length); - } - } else if(rnd_len > max_length) { - rnd_len = asn_random_between(0, max_length); - } - - return rnd_len; -} - -asn_random_fill_result_t -OCTET_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constraints, - size_t max_length) { - const asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - unsigned int unit_bytes = 1; - unsigned long clb = 0; /* Lower bound on char */ - unsigned long cub = 255; /* Higher bound on char value */ - uint8_t *buf; - uint8_t *bend; - uint8_t *b; - size_t rnd_len; - OCTET_STRING_t *st; - - if(max_length == 0 && !*sptr) return result_skipped; - - switch(specs->subvariant) { - default: - case ASN_OSUBV_ANY: - return result_failed; - case ASN_OSUBV_BIT: - /* Handled by BIT_STRING itself. */ - return result_failed; - case ASN_OSUBV_STR: - unit_bytes = 1; - clb = 0; - cub = 255; - break; - case ASN_OSUBV_U16: - unit_bytes = 2; - clb = 0; - cub = 65535; - break; - case ASN_OSUBV_U32: - unit_bytes = 4; - clb = 0; - cub = 0x10FFFF; - break; - } - - if(!constraints || !constraints->per_constraints) - constraints = &td->encoding_constraints; - if(constraints->per_constraints) { - const asn_per_constraint_t *pc = &constraints->per_constraints->value; - if(pc->flags & APC_SEMI_CONSTRAINED) { - clb = pc->lower_bound; - } else if(pc->flags & APC_CONSTRAINED) { - clb = pc->lower_bound; - cub = pc->upper_bound; - } - } - - rnd_len = - OCTET_STRING_random_length_constrained(td, constraints, max_length); - - buf = CALLOC(unit_bytes, rnd_len + 1); - if(!buf) return result_failed; - - bend = &buf[unit_bytes * rnd_len]; - - switch(unit_bytes) { - case 1: - for(b = buf; b < bend; b += unit_bytes) { - *(uint8_t *)b = OCTET_STRING__random_char(clb, cub); - } - *(uint8_t *)b = 0; - break; - case 2: - for(b = buf; b < bend; b += unit_bytes) { - uint32_t code = OCTET_STRING__random_char(clb, cub); - b[0] = code >> 8; - b[1] = code; - } - *(uint16_t *)b = 0; - break; - case 4: - for(b = buf; b < bend; b += unit_bytes) { - uint32_t code = OCTET_STRING__random_char(clb, cub); - b[0] = code >> 24; - b[1] = code >> 16; - b[2] = code >> 8; - b[3] = code; - } - *(uint32_t *)b = 0; - break; - } - - if(*sptr) { - st = *sptr; - FREEMEM(st->buf); - } else { - st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); - if(!st) { - FREEMEM(buf); - return result_failed; - } - } - - st->buf = buf; - st->size = unit_bytes * rnd_len; - - result_ok.length = st->size; - return result_ok; -} +/*- + * Copyright (c) 2003-2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * OCTET STRING basic type description. + */ +static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs = { + sizeof(OCTET_STRING_t), + offsetof(OCTET_STRING_t, _asn_ctx), + ASN_OSUBV_STR +}; +asn_TYPE_operation_t asn_OP_OCTET_STRING = { + OCTET_STRING_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + OCTET_STRING_print, /* OCTET STRING generally means a non-ascii sequence */ +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OCTET_STRING_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OCTET_STRING_decode_ber, + OCTET_STRING_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OCTET_STRING_decode_xer_hex, + OCTET_STRING_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + OCTET_STRING_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + OCTET_STRING_decode_oer, + OCTET_STRING_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + OCTET_STRING_decode_uper, /* Unaligned PER decoder */ + OCTET_STRING_encode_uper, /* Unaligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OCTET_STRING_decode_aper, /* Aligned PER decoder */ + OCTET_STRING_encode_aper, /* Aligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + OCTET_STRING_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { + "OCTET STRING", /* Canonical name */ + "OCTET_STRING", /* XML tag name */ + &asn_OP_OCTET_STRING, + asn_DEF_OCTET_STRING_tags, + sizeof(asn_DEF_OCTET_STRING_tags) + / sizeof(asn_DEF_OCTET_STRING_tags[0]), + asn_DEF_OCTET_STRING_tags, /* Same as above */ + sizeof(asn_DEF_OCTET_STRING_tags) + / sizeof(asn_DEF_OCTET_STRING_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs +}; + +void +OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr, + enum asn_struct_free_method method) { + OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; + + if(!td || !st) + return; + + ASN_DEBUG("Freeing %s as OCTET STRING", td->name); + + if(st->buf) { + FREEMEM(st->buf); + st->buf = 0; + } + +#if !defined(ASN_DISABLE_BER_SUPPORT) + const asn_OCTET_STRING_specifics_t *specs; + asn_struct_ctx_t *ctx; + + specs = td->specifics + ? (const asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_SPC_OCTET_STRING_specs; + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Remove decode-time stack. + */ + struct _stack *stck; + stck = (struct _stack *)ctx->ptr; + if(stck) { + while(stck->tail) { + struct _stack_el *sel = stck->tail; + stck->tail = sel->prev; + FREEMEM(sel); + } + FREEMEM(stck); + } +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(sptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(sptr, 0, + td->specifics + ? ((const asn_OCTET_STRING_specifics_t *)(td->specifics)) + ->struct_size + : sizeof(OCTET_STRING_t)); + break; + } +} + +/* + * Conversion routines. + */ +int +OCTET_STRING_fromBuf(OCTET_STRING_t *st, const char *str, int len) { + void *buf; + + if(st == 0 || (str == 0 && len)) { + errno = EINVAL; + return -1; + } + + /* + * Clear the OCTET STRING. + */ + if(str == NULL) { + FREEMEM(st->buf); + st->buf = 0; + st->size = 0; + return 0; + } + + /* Determine the original string size, if not explicitly given */ + if(len < 0) + len = strlen(str); + + /* Allocate and fill the memory */ + buf = MALLOC(len + 1); + if(buf == NULL) + return -1; + + memcpy(buf, str, len); + ((uint8_t *)buf)[len] = '\0'; /* Couldn't use memcpy(len+1)! */ + FREEMEM(st->buf); + st->buf = (uint8_t *)buf; + st->size = len; + + return 0; +} + +OCTET_STRING_t * +OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td, const char *str, + int len) { + const asn_OCTET_STRING_specifics_t *specs = + td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_SPC_OCTET_STRING_specs; + OCTET_STRING_t *st; + + st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); + if(st && str && OCTET_STRING_fromBuf(st, str, len)) { + FREEMEM(st); + st = NULL; + } + + return st; +} + +/* + * Lexicographically compare the common prefix of both strings, + * and if it is the same return -1 for the smallest string. + */ +int +OCTET_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr, + const void *bptr) { + const asn_OCTET_STRING_specifics_t *specs = td->specifics; + const OCTET_STRING_t *a = aptr; + const OCTET_STRING_t *b = bptr; + + (void)specs; + assert(!specs || specs->subvariant != ASN_OSUBV_BIT); + + if(a && b) { + size_t common_prefix_size = a->size <= b->size ? a->size : b->size; + int ret = memcmp(a->buf, b->buf, common_prefix_size); + if(ret == 0) { + /* Figure out which string with equal prefixes is longer. */ + if(a->size < b->size) { + return -1; + } else if(a->size > b->size) { + return 1; + } else { + return 0; + } + } else { + return ret < 0 ? -1 : 1; + } + } else if(!a && !b) { + return 0; + } else if(!a) { + return -1; + } else { + return 1; + } + +} + +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) +int +OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf, + size_t units, unsigned int bpc, unsigned int unit_bits, + long lb, long ub, const asn_per_constraints_t *pc) { + uint8_t *end = buf + units * bpc; + + ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d", + (int)units, lb, ub, unit_bits); + + /* X.691: 27.5.4 */ + if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { + /* Decode without translation */ + lb = 0; + } else if(pc && pc->code2value) { + if(unit_bits > 16) + return 1; /* FATAL: can't have constrained + * UniversalString with more than + * 16 million code points */ + for(; buf < end; buf += bpc) { + int value; + int code = per_get_few_bits(po, unit_bits); + if(code < 0) return -1; /* WMORE */ + value = pc->code2value(code); + if(value < 0) { + ASN_DEBUG("Code %d (0x%02x) is" + " not in map (%ld..%ld)", + code, code, lb, ub); + return 1; /* FATAL */ + } + switch(bpc) { + case 1: *buf = value; break; + case 2: buf[0] = value >> 8; buf[1] = value; break; + case 4: buf[0] = value >> 24; buf[1] = value >> 16; + buf[2] = value >> 8; buf[3] = value; break; + } + } + return 0; + } + + /* Shortcut the no-op copying to the aligned structure */ + if(lb == 0 && (unit_bits == 8 * bpc)) { + return per_get_many_bits(po, buf, 0, unit_bits * units); + } + + for(; buf < end; buf += bpc) { + int32_t code = per_get_few_bits(po, unit_bits); + int32_t ch = code + lb; + if(code < 0) return -1; /* WMORE */ + if(ch > ub) { + ASN_DEBUG("Code %d is out of range (%ld..%ld)", + ch, lb, ub); + return 1; /* FATAL */ + } + switch(bpc) { + case 1: *buf = ch; break; + case 2: buf[0] = ch >> 8; buf[1] = ch; break; + case 4: buf[0] = ch >> 24; buf[1] = ch >> 16; + buf[2] = ch >> 8; buf[3] = ch; break; + } + } + + return 0; +} + +int +OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, + size_t units, unsigned int bpc, unsigned int unit_bits, + long lb, long ub, const asn_per_constraints_t *pc) { + const uint8_t *end = buf + units * bpc; + + ASN_DEBUG("Squeezing %d characters into (%ld..%ld):%d (%d bpc)", + (int)units, lb, ub, unit_bits, bpc); + + /* X.691: 27.5.4 */ + if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { + /* Encode as is */ + lb = 0; + } else if(pc && pc->value2code) { + for(; buf < end; buf += bpc) { + int code; + uint32_t value; + switch(bpc) { + case 1: value = *(const uint8_t *)buf; break; + case 2: value = (buf[0] << 8) | buf[1]; break; + case 4: value = (buf[0] << 24) | (buf[1] << 16) + | (buf[2] << 8) | buf[3]; break; + default: return -1; + } + code = pc->value2code(value); + if(code < 0) { + ASN_DEBUG("Character %d (0x%02x) is" + " not in map (%ld..%ld)", + *buf, *buf, lb, ub); + return -1; + } + if(per_put_few_bits(po, code, unit_bits)) + return -1; + } + } + + /* Shortcut the no-op copying to the aligned structure */ + if(lb == 0 && (unit_bits == 8 * bpc)) { + return per_put_many_bits(po, buf, unit_bits * units); + } + + for(ub -= lb; buf < end; buf += bpc) { + int ch; + uint32_t value; + switch(bpc) { + case 1: + value = *(const uint8_t *)buf; + break; + case 2: + value = (buf[0] << 8) | buf[1]; + break; + case 4: + value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; + break; + default: + return -1; + } + ch = value - lb; + if(ch < 0 || ch > ub) { + ASN_DEBUG("Character %d (0x%02x) is out of range (%ld..%ld)", *buf, + value, lb, ub + lb); + return -1; + } + if(per_put_few_bits(po, ch, unit_bits)) return -1; + } + + return 0; +} +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ diff --git a/certgen/asncodec/OCTET_STRING.h b/certgen/asncodec/OCTET_STRING.h index 22682a8..b1ace14 100644 --- a/certgen/asncodec/OCTET_STRING.h +++ b/certgen/asncodec/OCTET_STRING.h @@ -1,100 +1,165 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _OCTET_STRING_H_ -#define _OCTET_STRING_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct OCTET_STRING { - uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ - size_t size; /* Size of the buffer */ - - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} OCTET_STRING_t; - -extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; -extern asn_TYPE_operation_t asn_OP_OCTET_STRING; - -asn_struct_free_f OCTET_STRING_free; -asn_struct_print_f OCTET_STRING_print; -asn_struct_print_f OCTET_STRING_print_utf8; -asn_struct_compare_f OCTET_STRING_compare; -ber_type_decoder_f OCTET_STRING_decode_ber; -der_type_encoder_f OCTET_STRING_encode_der; -xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ -xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ -xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ -xer_type_encoder_f OCTET_STRING_encode_xer; -xer_type_encoder_f OCTET_STRING_encode_xer_utf8; -oer_type_decoder_f OCTET_STRING_decode_oer; -oer_type_encoder_f OCTET_STRING_encode_oer; -per_type_decoder_f OCTET_STRING_decode_uper; -per_type_encoder_f OCTET_STRING_encode_uper; -asn_random_fill_f OCTET_STRING_random_fill; - -#define OCTET_STRING_constraint asn_generic_no_constraint -#define OCTET_STRING_decode_xer OCTET_STRING_decode_xer_hex - -/****************************** - * Handy conversion routines. * - ******************************/ - -/* - * This function clears the previous value of the OCTET STRING (if any) - * and then allocates a new memory with the specified content (str/size). - * If size = -1, the size of the original string will be determined - * using strlen(str). - * If str equals to NULL, the function will silently clear the - * current contents of the OCTET STRING. - * Returns 0 if it was possible to perform operation, -1 otherwise. - */ -int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); - -/* Handy conversion from the C string into the OCTET STRING. */ -#define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) - -/* - * Allocate and fill the new OCTET STRING and return a pointer to the newly - * allocated object. NULL is permitted in str: the function will just allocate - * empty OCTET STRING. - */ -OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td, - const char *str, int size); - -/**************************** - * Internally useful stuff. * - ****************************/ - -typedef struct asn_OCTET_STRING_specifics_s { - /* - * Target structure description. - */ - unsigned struct_size; /* Size of the structure */ - unsigned ctx_offset; /* Offset of the asn_struct_ctx_t member */ - - enum asn_OS_Subvariant { - ASN_OSUBV_ANY, /* The open type (ANY) */ - ASN_OSUBV_BIT, /* BIT STRING */ - ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ - ASN_OSUBV_U16, /* 16-bit character (BMPString) */ - ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ - } subvariant; -} asn_OCTET_STRING_specifics_t; - -extern asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs; - -size_t OCTET_STRING_random_length_constrained( - const asn_TYPE_descriptor_t *, const asn_encoding_constraints_t *, - size_t max_length); - -#ifdef __cplusplus -} -#endif - -#endif /* _OCTET_STRING_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _OCTET_STRING_H_ +#define _OCTET_STRING_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OCTET_STRING { + uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ + size_t size; /* Size of the buffer */ + + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ +} OCTET_STRING_t; + +extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; +extern asn_TYPE_operation_t asn_OP_OCTET_STRING; + +asn_struct_free_f OCTET_STRING_free; + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f OCTET_STRING_print; +asn_struct_print_f OCTET_STRING_print_utf8; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f OCTET_STRING_compare; + +#define OCTET_STRING_constraint asn_generic_no_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f OCTET_STRING_decode_ber; +der_type_encoder_f OCTET_STRING_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ +xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ +xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ +xer_type_encoder_f OCTET_STRING_encode_xer; +xer_type_encoder_f OCTET_STRING_encode_xer_utf8; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f OCTET_STRING_encode_jer; +jer_type_encoder_f OCTET_STRING_encode_jer_utf8; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f OCTET_STRING_decode_oer; +oer_type_encoder_f OCTET_STRING_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f OCTET_STRING_decode_uper; +per_type_encoder_f OCTET_STRING_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f OCTET_STRING_decode_aper; +per_type_encoder_f OCTET_STRING_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f OCTET_STRING_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) +int OCTET_STRING_per_get_characters( + asn_per_data_t *po, + uint8_t *buf, + size_t units, + unsigned int bpc, + unsigned int unit_bits, + long lb, + long ub, + const asn_per_constraints_t *pc); + +int OCTET_STRING_per_put_characters( + asn_per_outp_t *po, + const uint8_t *buf, + size_t units, + unsigned int bpc, + unsigned int unit_bits, + long lb, + long ub, + const asn_per_constraints_t *pc); +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +/****************************** + * Handy conversion routines. * + ******************************/ + +/* + * This function clears the previous value of the OCTET STRING (if any) + * and then allocates a new memory with the specified content (str/size). + * If size = -1, the size of the original string will be determined + * using strlen(str). + * If str equals to NULL, the function will silently clear the + * current contents of the OCTET STRING. + * Returns 0 if it was possible to perform operation, -1 otherwise. + */ +int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); + +/* Handy conversion from the C string into the OCTET STRING. */ +#define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) + +/* + * Allocate and fill the new OCTET STRING and return a pointer to the newly + * allocated object. NULL is permitted in str: the function will just allocate + * empty OCTET STRING. + */ +OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td, + const char *str, int size); + +/**************************** + * Internally useful stuff. * + ****************************/ + +typedef struct asn_OCTET_STRING_specifics_s { + /* + * Target structure description. + */ + unsigned struct_size; /* Size of the structure */ + unsigned ctx_offset; /* Offset of the asn_struct_ctx_t member */ + + enum asn_OS_Subvariant { + ASN_OSUBV_ANY, /* The open type (ANY) */ + ASN_OSUBV_BIT, /* BIT STRING */ + ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ + ASN_OSUBV_U16, /* 16-bit character (BMPString) */ + ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ + } subvariant; +} asn_OCTET_STRING_specifics_t; + +extern asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs; + +size_t OCTET_STRING_random_length_constrained( + const asn_TYPE_descriptor_t *, const asn_encoding_constraints_t *, + size_t max_length); + +#if !defined(ASN_DISABLE_BER_SUPPORT) +struct _stack_el { + ber_tlv_len_t left; /* What's left to read (or -1) */ + ber_tlv_len_t got; /* What was actually processed */ + unsigned cont_level; /* Depth of subcontainment */ + int want_nulls; /* Want null "end of content" octets? */ + int bits_chopped; /* Flag in BIT STRING mode */ + ber_tlv_tag_t tag; /* For debugging purposes */ + struct _stack_el *prev; + struct _stack_el *next; +}; +struct _stack { + struct _stack_el *tail; + struct _stack_el *cur_ptr; +}; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _OCTET_STRING_H_ */ diff --git a/certgen/asncodec/OCTET_STRING_oer.c b/certgen/asncodec/OCTET_STRING_oer.c index 7244778..e69d0a6 100644 --- a/certgen/asncodec/OCTET_STRING_oer.c +++ b/certgen/asncodec/OCTET_STRING_oer.c @@ -1,171 +1,166 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include - -asn_dec_rval_t -OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **sptr, - const void *ptr, size_t size) { - const asn_OCTET_STRING_specifics_t *specs = - td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; - const asn_oer_constraints_t *cts = - constraints ? constraints : td->encoding_constraints.oer_constraints; - ssize_t ct_size = cts ? cts->size : -1; - asn_dec_rval_t rval = {RC_OK, 0}; - size_t expected_length = 0; - - size_t unit_bytes; - switch(specs->subvariant) { - default: - case ASN_OSUBV_BIT: - ASN_DEBUG("Invalid use of OCTET STRING to decode BIT STRING"); - ASN__DECODE_FAILED; - case ASN_OSUBV_ANY: - /* Fall through */ - case ASN_OSUBV_STR: - unit_bytes = 1; - break; - case ASN_OSUBV_U16: - unit_bytes = 2; - break; - case ASN_OSUBV_U32: - unit_bytes = 4; - break; - } - - (void)opt_codec_ctx; - - if(!st) { - st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); - if(!st) ASN__DECODE_FAILED; - } - - if(ct_size >= 0) { - expected_length = unit_bytes * ct_size; - } else { - /* - * X.696 (08/2015) #27.2 - * Encode length determinant as _number of octets_, but only - * if upper bound is not equal to lower bound. - */ - ssize_t len_len = oer_fetch_length(ptr, size, &expected_length); - if(len_len > 0) { - rval.consumed = len_len; - ptr = (const char *)ptr + len_len; - size -= len_len; - } else if(len_len == 0) { - ASN__DECODE_STARVED; - } else if(len_len < 0) { - ASN__DECODE_FAILED; - } - - if(expected_length % unit_bytes != 0) { - ASN_DEBUG( - "Data size %" ASN_PRI_SIZE " bytes is not consistent with multiplier %" ASN_PRI_SIZE "", - expected_length, unit_bytes); - ASN__DECODE_FAILED; - } - } - - if(size < expected_length) { - ASN__DECODE_STARVED; - } else { - uint8_t *buf = MALLOC(expected_length + 1); - if(buf == NULL) { - ASN__DECODE_FAILED; - } else { - memcpy(buf, ptr, expected_length); - buf[expected_length] = '\0'; - } - FREEMEM(st->buf); - st->buf = buf; - st->size = expected_length; - - rval.consumed += expected_length; - return rval; - } -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -OCTET_STRING_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, - const void *sptr, asn_app_consume_bytes_f *cb, - void *app_key) { - const asn_OCTET_STRING_specifics_t *specs = - td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_SPC_OCTET_STRING_specs; - const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; - const asn_oer_constraints_t *cts = - constraints ? constraints : td->encoding_constraints.oer_constraints; - ssize_t ct_size = cts ? cts->size : -1; - asn_enc_rval_t er = {0, 0, 0}; - - if(!st) ASN__ENCODE_FAILED; - - ASN_DEBUG("Encoding %s %" ASN_PRI_SIZE " as OCTET STRING", td ? td->name : "", st->size); - - if(ct_size >= 0) { - /* - * Check that available data matches the constraint - */ - size_t unit_bytes; - switch(specs->subvariant) { - default: - case ASN_OSUBV_BIT: - ASN_DEBUG("Invalid use of OCTET STRING to encode BIT STRING"); - ASN__ENCODE_FAILED; - case ASN_OSUBV_ANY: - /* Fall through */ - case ASN_OSUBV_STR: - unit_bytes = 1; - break; - case ASN_OSUBV_U16: - unit_bytes = 2; - break; - case ASN_OSUBV_U32: - unit_bytes = 4; - break; - } - - if(st->size != unit_bytes * (size_t)ct_size) { - ASN_DEBUG( - "Trying to encode %s (%" ASN_PRI_SIZE " bytes) which doesn't fit SIZE " - "constraint (%" ASN_PRI_SIZE ")", - td->name, st->size, ct_size); - ASN__ENCODE_FAILED; - } - } else { - /* - * X.696 (08/2015) #27.2 - * Encode length determinant as _number of octets_, but only - * if upper bound is not equal to lower bound. - */ - ssize_t ret = oer_serialize_length(st->size, cb, app_key); - if(ret < 0) { - ASN__ENCODE_FAILED; - } - er.encoded += ret; - } - - er.encoded += st->size; - if(cb(st->buf, st->size, app_key) < 0) { - ASN__ENCODE_FAILED; - } else { - ASN__ENCODED_OK(er); - } -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_dec_rval_t +OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **sptr, + const void *ptr, size_t size) { + const asn_OCTET_STRING_specifics_t *specs = + td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_SPC_OCTET_STRING_specs; + OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; + const asn_oer_constraints_t *cts = + constraints ? constraints : td->encoding_constraints.oer_constraints; + ssize_t ct_size = cts ? cts->size : -1; + asn_dec_rval_t rval = {RC_OK, 0}; + size_t expected_length = 0; + + size_t unit_bytes; + switch(specs->subvariant) { + default: + case ASN_OSUBV_BIT: + ASN_DEBUG("Invalid use of OCTET STRING to decode BIT STRING"); + ASN__DECODE_FAILED; + case ASN_OSUBV_ANY: + /* Fall through */ + case ASN_OSUBV_STR: + unit_bytes = 1; + break; + case ASN_OSUBV_U16: + unit_bytes = 2; + break; + case ASN_OSUBV_U32: + unit_bytes = 4; + break; + } + + (void)opt_codec_ctx; + + if(!st) { + st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); + if(!st) ASN__DECODE_FAILED; + } + + if(ct_size >= 0) { + expected_length = unit_bytes * ct_size; + } else { + /* + * X.696 (08/2015) #27.2 + * Encode length determinant as _number of octets_, but only + * if upper bound is not equal to lower bound. + */ + ssize_t len_len = oer_fetch_length(ptr, size, &expected_length); + if(len_len > 0) { + rval.consumed = len_len; + ptr = (const char *)ptr + len_len; + size -= len_len; + } else if(len_len == 0) { + ASN__DECODE_STARVED; + } else if(len_len < 0) { + ASN__DECODE_FAILED; + } + + if(expected_length % unit_bytes != 0) { + ASN_DEBUG( + "Data size %" ASN_PRI_SIZE " bytes is not consistent with multiplier %" ASN_PRI_SIZE "", + expected_length, unit_bytes); + ASN__DECODE_FAILED; + } + } + + if(size < expected_length) { + ASN__DECODE_STARVED; + } else { + uint8_t *buf = MALLOC(expected_length + 1); + if(buf == NULL) { + ASN__DECODE_FAILED; + } else { + memcpy(buf, ptr, expected_length); + buf[expected_length] = '\0'; + } + FREEMEM(st->buf); + st->buf = buf; + st->size = expected_length; + + rval.consumed += expected_length; + return rval; + } +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +OCTET_STRING_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, + const void *sptr, asn_app_consume_bytes_f *cb, + void *app_key) { + const asn_OCTET_STRING_specifics_t *specs = + td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_SPC_OCTET_STRING_specs; + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + const asn_oer_constraints_t *cts = + constraints ? constraints : td->encoding_constraints.oer_constraints; + ssize_t ct_size = cts ? cts->size : -1; + asn_enc_rval_t er = {0, 0, 0}; + + if(!st) ASN__ENCODE_FAILED; + + ASN_DEBUG("Encoding %s %" ASN_PRI_SIZE " as OCTET STRING", td ? td->name : "", st->size); + + if(ct_size >= 0) { + /* + * Check that available data matches the constraint + */ + size_t unit_bytes; + switch(specs->subvariant) { + default: + case ASN_OSUBV_BIT: + ASN_DEBUG("Invalid use of OCTET STRING to encode BIT STRING"); + ASN__ENCODE_FAILED; + case ASN_OSUBV_ANY: + /* Fall through */ + case ASN_OSUBV_STR: + unit_bytes = 1; + break; + case ASN_OSUBV_U16: + unit_bytes = 2; + break; + case ASN_OSUBV_U32: + unit_bytes = 4; + break; + } + + if(st->size != unit_bytes * (size_t)ct_size) { + ASN_DEBUG( + "Trying to encode %s (%" ASN_PRI_SIZE " bytes) which doesn't fit SIZE " + "constraint (%" ASN_PRI_SIZE ")", + td->name, st->size, ct_size); + ASN__ENCODE_FAILED; + } + } else { + /* + * X.696 (08/2015) #27.2 + * Encode length determinant as _number of octets_, but only + * if upper bound is not equal to lower bound. + */ + ssize_t ret = oer_serialize_length(st->size, cb, app_key); + if(ret < 0) { + ASN__ENCODE_FAILED; + } + er.encoded += ret; + } + + er.encoded += st->size; + if(cb(st->buf, st->size, app_key) < 0) { + ASN__ENCODE_FAILED; + } else { + ASN__ENCODED_OK(er); + } +} diff --git a/certgen/asncodec/OCTET_STRING_print.c b/certgen/asncodec/OCTET_STRING_print.c new file mode 100644 index 0000000..6daa33e --- /dev/null +++ b/certgen/asncodec/OCTET_STRING_print.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +OCTET_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + const char * const h2c = "0123456789ABCDEF"; + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + char scratch[16 * 3 + 4]; + char *p = scratch; + uint8_t *buf; + uint8_t *end; + size_t i; + + (void)td; /* Unused argument */ + + if(!st || (!st->buf && st->size)) + return (cb("", 8, app_key) < 0) ? -1 : 0; + + /* + * Dump the contents of the buffer in hexadecimal. + */ + buf = st->buf; + end = (buf == NULL)? NULL : buf + st->size; + for(i = 0; buf < end; buf++, i++) { + if(!(i % 16) && (i || st->size > 16)) { + if(cb(scratch, p - scratch, app_key) < 0) + return -1; + _i_INDENT(1); + p = scratch; + } + *p++ = h2c[(*buf >> 4) & 0x0F]; + *p++ = h2c[*buf & 0x0F]; + *p++ = 0x20; + } + + if(p > scratch) { + p--; /* Remove the tail space */ + if(cb(scratch, p - scratch, app_key) < 0) + return -1; + } + + return 0; +} + +int +OCTET_STRING_print_utf8(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, asn_app_consume_bytes_f *cb, + void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(st && (st->buf || !st->size)) { + return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0; + } else { + return (cb("", 8, app_key) < 0) ? -1 : 0; + } +} diff --git a/certgen/asncodec/OCTET_STRING_xer.c b/certgen/asncodec/OCTET_STRING_xer.c new file mode 100644 index 0000000..490f362 --- /dev/null +++ b/certgen/asncodec/OCTET_STRING_xer.c @@ -0,0 +1,627 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include /* for .bits_unused member */ + +asn_enc_rval_t +OCTET_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + const char * const h2c = "0123456789ABCDEF"; + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + asn_enc_rval_t er = { 0, 0, 0 }; + char scratch[16 * 3 + 4]; + char *p = scratch; + uint8_t *buf; + uint8_t *end; + size_t i; + + if(!st || (!st->buf && st->size)) + ASN__ENCODE_FAILED; + + er.encoded = 0; + + /* + * Dump the contents of the buffer in hexadecimal. + */ + buf = st->buf; + end = buf + st->size; + if(flags & XER_F_CANONICAL) { + char *scend = scratch + (sizeof(scratch) - 2); + for(; buf < end; buf++) { + if(p >= scend) { + ASN__CALLBACK(scratch, p - scratch); + p = scratch; + } + *p++ = h2c[(*buf >> 4) & 0x0F]; + *p++ = h2c[*buf & 0x0F]; + } + + ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */ + } else { + for(i = 0; buf < end; buf++, i++) { + if(!(i % 16) && (i || st->size > 16)) { + ASN__CALLBACK(scratch, p-scratch); + p = scratch; + ASN__TEXT_INDENT(1, ilevel); + } + *p++ = h2c[(*buf >> 4) & 0x0F]; + *p++ = h2c[*buf & 0x0F]; + *p++ = 0x20; + } + if(p - scratch) { + p--; /* Remove the tail space */ + ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */ + if(st->size > 16) + ASN__TEXT_INDENT(1, ilevel-1); + } + } + + ASN__ENCODED_OK(er); +cb_failed: + ASN__ENCODE_FAILED; +} + +static const struct OCTET_STRING__xer_escape_table_s { + const char *string; + int size; +} OCTET_STRING__xer_escape_table[] = { +#define OSXET(s) { s, sizeof(s) - 1 } + OSXET("\074\156\165\154\057\076"), /* */ + OSXET("\074\163\157\150\057\076"), /* */ + OSXET("\074\163\164\170\057\076"), /* */ + OSXET("\074\145\164\170\057\076"), /* */ + OSXET("\074\145\157\164\057\076"), /* */ + OSXET("\074\145\156\161\057\076"), /* */ + OSXET("\074\141\143\153\057\076"), /* */ + OSXET("\074\142\145\154\057\076"), /* */ + OSXET("\074\142\163\057\076"), /* */ + OSXET("\011"), /* \t */ + OSXET("\012"), /* \n */ + OSXET("\074\166\164\057\076"), /* */ + OSXET("\074\146\146\057\076"), /* */ + OSXET("\015"), /* \r */ + OSXET("\074\163\157\057\076"), /* */ + OSXET("\074\163\151\057\076"), /* */ + OSXET("\074\144\154\145\057\076"), /* */ + OSXET("\074\144\143\061\057\076"), /* */ + OSXET("\074\144\143\062\057\076"), /* */ + OSXET("\074\144\143\063\057\076"), /* */ + OSXET("\074\144\143\064\057\076"), /* */ + OSXET("\074\156\141\153\057\076"), /* */ + OSXET("\074\163\171\156\057\076"), /* */ + OSXET("\074\145\164\142\057\076"), /* */ + OSXET("\074\143\141\156\057\076"), /* */ + OSXET("\074\145\155\057\076"), /* */ + OSXET("\074\163\165\142\057\076"), /* */ + OSXET("\074\145\163\143\057\076"), /* */ + OSXET("\074\151\163\064\057\076"), /* */ + OSXET("\074\151\163\063\057\076"), /* */ + OSXET("\074\151\163\062\057\076"), /* */ + OSXET("\074\151\163\061\057\076"), /* */ + { 0, 0 }, /* " " */ + { 0, 0 }, /* ! */ + { 0, 0 }, /* \" */ + { 0, 0 }, /* # */ + { 0, 0 }, /* $ */ + { 0, 0 }, /* % */ + OSXET("\046\141\155\160\073"), /* & */ + { 0, 0 }, /* ' */ + {0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* ()*+,-./ */ + {0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* 01234567 */ + {0,0},{0,0},{0,0},{0,0}, /* 89:; */ + OSXET("\046\154\164\073"), /* < */ + { 0, 0 }, /* = */ + OSXET("\046\147\164\073"), /* > */ +}; + +static int +OS__check_escaped_control_char(const void *buf, int size) { + size_t i; + /* + * Inefficient algorithm which translates the escape sequences + * defined above into characters. Returns -1 if not found. + * TODO: replace by a faster algorithm (bsearch(), hash or + * nested table lookups). + */ + for(i = 0; i < 32 /* Don't spend time on the bottom half */; i++) { + const struct OCTET_STRING__xer_escape_table_s *el; + el = &OCTET_STRING__xer_escape_table[i]; + if(el->size == size && memcmp(buf, el->string, size) == 0) + return i; + } + return -1; +} + +static int +OCTET_STRING__handle_control_chars(void *struct_ptr, const void *chunk_buf, size_t chunk_size) { + /* + * This might be one of the escape sequences + * for control characters. Check it out. + * #11.15.5 + */ + int control_char = OS__check_escaped_control_char(chunk_buf,chunk_size); + if(control_char >= 0) { + OCTET_STRING_t *st = (OCTET_STRING_t *)struct_ptr; + void *p = REALLOC(st->buf, st->size + 2); + if(p) { + st->buf = (uint8_t *)p; + st->buf[st->size++] = control_char; + st->buf[st->size] = '\0'; /* nul-termination */ + return 0; + } + } + + return -1; /* No, it's not */ +} + +asn_enc_rval_t +OCTET_STRING_encode_xer_utf8(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + asn_enc_rval_t er = { 0, 0, 0 }; + uint8_t *buf, *end; + uint8_t *ss; /* Sequence start */ + ssize_t encoded_len = 0; + + (void)ilevel; /* Unused argument */ + (void)flags; /* Unused argument */ + + if(!st || (!st->buf && st->size)) + ASN__ENCODE_FAILED; + + buf = st->buf; + end = buf + st->size; + for(ss = buf; buf < end; buf++) { + unsigned int ch = *buf; + int s_len; /* Special encoding sequence length */ + + /* + * Escape certain characters: X.680/11.15 + */ + if(ch < sizeof(OCTET_STRING__xer_escape_table) + / sizeof(OCTET_STRING__xer_escape_table[0]) + && (s_len = OCTET_STRING__xer_escape_table[ch].size)) { + if(((buf - ss) && cb(ss, buf - ss, app_key) < 0) + || cb(OCTET_STRING__xer_escape_table[ch].string, s_len, app_key) < 0) + ASN__ENCODE_FAILED; + encoded_len += (buf - ss) + s_len; + ss = buf + 1; + } + } + + encoded_len += (buf - ss); + if((buf - ss) && cb(ss, buf - ss, app_key) < 0) + ASN__ENCODE_FAILED; + + er.encoded = encoded_len; + ASN__ENCODED_OK(er); +} + +/* + * Convert from hexadecimal format (cstring): "AB CD EF" + */ +static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) { + OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; + const char *chunk_stop = (const char *)chunk_buf; + const char *p = chunk_stop; + const char *pend = p + chunk_size; + unsigned int clv = 0; + int half = 0; /* Half bit */ + uint8_t *buf; + + /* Reallocate buffer according to high cap estimation */ + size_t new_size = st->size + (chunk_size + 1) / 2; + void *nptr = REALLOC(st->buf, new_size + 1); + if(!nptr) return -1; + st->buf = (uint8_t *)nptr; + buf = st->buf + st->size; + + /* + * If something like " a b c " appears here, the " a b":3 will be + * converted, and the rest skipped. That is, unless buf_size is greater + * than chunk_size, then it'll be equivalent to "ABC0". + */ + for(; p < pend; p++) { + int ch = *(const unsigned char *)p; + switch(ch) { + case 0x09: case 0x0a: case 0x0c: case 0x0d: + case 0x20: + /* Ignore whitespace */ + continue; + case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ + case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ + clv = (clv << 4) + (ch - 0x30); + break; + case 0x41: case 0x42: case 0x43: /* ABC */ + case 0x44: case 0x45: case 0x46: /* DEF */ + clv = (clv << 4) + (ch - 0x41 + 10); + break; + case 0x61: case 0x62: case 0x63: /* abc */ + case 0x64: case 0x65: case 0x66: /* def */ + clv = (clv << 4) + (ch - 0x61 + 10); + break; + default: + *buf = 0; /* JIC */ + return -1; + } + if(half++) { + half = 0; + *buf++ = clv; + chunk_stop = p + 1; + } + } + + /* + * Check partial decoding. + */ + if(half) { + if(have_more) { + /* + * Partial specification is fine, + * because no more more PXER_TEXT data is available. + */ + *buf++ = clv << 4; + chunk_stop = p; + } + } else { + chunk_stop = p; + } + + st->size = buf - st->buf; /* Adjust the buffer size */ + assert(st->size <= new_size); + st->buf[st->size] = 0; /* Courtesy termination */ + + return (chunk_stop - (const char *)chunk_buf); /* Converted size */ +} + +/* + * Convert from binary format: "00101011101" + */ +static ssize_t OCTET_STRING__convert_binary(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) { + BIT_STRING_t *st = (BIT_STRING_t *)sptr; + const char *p = (const char *)chunk_buf; + const char *pend = (p == NULL)? NULL : p + chunk_size; + int bits_unused = st->bits_unused & 0x7; + uint8_t *buf; + + /* Reallocate buffer according to high cap estimation */ + size_t new_size = st->size + (chunk_size + 7) / 8; + void *nptr = REALLOC(st->buf, new_size + 1); + if(!nptr) return -1; + st->buf = (uint8_t *)nptr; + buf = st->buf + st->size; + + (void)have_more; + + if(bits_unused == 0) + bits_unused = 8; + else if(st->size) + buf--; + + /* + * Convert series of 0 and 1 into the octet string. + */ + for(; p < pend; p++) { + int ch = *(const unsigned char *)p; + switch(ch) { + case 0x09: case 0x0a: case 0x0c: case 0x0d: + case 0x20: + /* Ignore whitespace */ + break; + case 0x30: + case 0x31: + if(bits_unused-- <= 0) { + *++buf = 0; /* Clean the cell */ + bits_unused = 7; + } + *buf |= (ch&1) << bits_unused; + break; + default: + st->bits_unused = bits_unused; + return -1; + } + } + + if(bits_unused == 8) { + st->size = buf - st->buf; + st->bits_unused = 0; + } else { + st->size = buf - st->buf + 1; + st->bits_unused = bits_unused; + } + + assert(st->size <= new_size); + st->buf[st->size] = 0; /* Courtesy termination */ + + return chunk_size; /* Converted in full */ +} + +/* + * Something like strtod(), but with stricter rules. + */ +static int +OS__strtoent(int base, const char *buf, const char *end, int32_t *ret_value) { + const int32_t last_unicode_codepoint = 0x10ffff; + int32_t val = 0; + const char *p; + + for(p = buf; p < end; p++) { + int ch = *p; + + switch(ch) { + case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ + case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ + val = val * base + (ch - 0x30); + break; + case 0x41: case 0x42: case 0x43: /* ABC */ + case 0x44: case 0x45: case 0x46: /* DEF */ + val = val * base + (ch - 0x41 + 10); + break; + case 0x61: case 0x62: case 0x63: /* abc */ + case 0x64: case 0x65: case 0x66: /* def */ + val = val * base + (ch - 0x61 + 10); + break; + case 0x3b: /* ';' */ + *ret_value = val; + return (p - buf) + 1; + default: + return -1; /* Character set error */ + } + + /* Value exceeds the Unicode range. */ + if(val > last_unicode_codepoint) { + return -1; + } + } + + *ret_value = -1; + return (p - buf); +} + +/* + * Convert from the plain UTF-8 format, expanding entity references: "2 < 3" + */ +static ssize_t +OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, + size_t chunk_size, int have_more) { + OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; + const char *p = (const char *)chunk_buf; + const char *pend = p + chunk_size; + uint8_t *buf; + + /* Reallocate buffer */ + size_t new_size = st->size + chunk_size; + void *nptr = REALLOC(st->buf, new_size + 1); + if(!nptr) return -1; + st->buf = (uint8_t *)nptr; + buf = st->buf + st->size; + + /* + * Convert series of 0 and 1 into the octet string. + */ + for(; p < pend; p++) { + int ch = *(const unsigned char *)p; + int len; /* Length of the rest of the chunk */ + + if(ch != 0x26 /* '&' */) { + *buf++ = ch; + continue; /* That was easy... */ + } + + /* + * Process entity reference. + */ + len = chunk_size - (p - (const char *)chunk_buf); + if(len == 1 /* "&" */) goto want_more; + if(p[1] == 0x23 /* '#' */) { + const char *pval; /* Pointer to start of digits */ + int32_t val = 0; /* Entity reference value */ + int base; + + if(len == 2 /* "&#" */) goto want_more; + if(p[2] == 0x78 /* 'x' */) + pval = p + 3, base = 16; + else + pval = p + 2, base = 10; + len = OS__strtoent(base, pval, p + len, &val); + if(len == -1) { + /* Invalid charset. Just copy verbatim. */ + *buf++ = ch; + continue; + } + if(!len || pval[len-1] != 0x3b) goto want_more; + assert(val > 0); + p += (pval - p) + len - 1; /* Advance past entref */ + + if(val < 0x80) { + *buf++ = (char)val; + } else if(val < 0x800) { + *buf++ = 0xc0 | ((val >> 6)); + *buf++ = 0x80 | ((val & 0x3f)); + } else if(val < 0x10000) { + *buf++ = 0xe0 | ((val >> 12)); + *buf++ = 0x80 | ((val >> 6) & 0x3f); + *buf++ = 0x80 | ((val & 0x3f)); + } else if(val < 0x200000) { + *buf++ = 0xf0 | ((val >> 18)); + *buf++ = 0x80 | ((val >> 12) & 0x3f); + *buf++ = 0x80 | ((val >> 6) & 0x3f); + *buf++ = 0x80 | ((val & 0x3f)); + } else if(val < 0x4000000) { + *buf++ = 0xf8 | ((val >> 24)); + *buf++ = 0x80 | ((val >> 18) & 0x3f); + *buf++ = 0x80 | ((val >> 12) & 0x3f); + *buf++ = 0x80 | ((val >> 6) & 0x3f); + *buf++ = 0x80 | ((val & 0x3f)); + } else { + *buf++ = 0xfc | ((val >> 30) & 0x1); + *buf++ = 0x80 | ((val >> 24) & 0x3f); + *buf++ = 0x80 | ((val >> 18) & 0x3f); + *buf++ = 0x80 | ((val >> 12) & 0x3f); + *buf++ = 0x80 | ((val >> 6) & 0x3f); + *buf++ = 0x80 | ((val & 0x3f)); + } + } else { + /* + * Ugly, limited parsing of & > < + */ + char *sc = (char *)memchr(p, 0x3b, len > 5 ? 5 : len); + if(!sc) goto want_more; + if((sc - p) == 4 + && p[1] == 0x61 /* 'a' */ + && p[2] == 0x6d /* 'm' */ + && p[3] == 0x70 /* 'p' */) { + *buf++ = 0x26; + p = sc; + continue; + } + if((sc - p) == 3) { + if(p[1] == 0x6c) { + *buf = 0x3c; /* '<' */ + } else if(p[1] == 0x67) { + *buf = 0x3e; /* '>' */ + } else { + /* Unsupported entity reference */ + *buf++ = ch; + continue; + } + if(p[2] != 0x74) { + /* Unsupported entity reference */ + *buf++ = ch; + continue; + } + buf++; + p = sc; + continue; + } + /* Unsupported entity reference */ + *buf++ = ch; + } + + continue; + want_more: + if(have_more) { + /* + * We know that no more data (of the same type) + * is coming. Copy the rest verbatim. + */ + *buf++ = ch; + continue; + } + chunk_size = (p - (const char *)chunk_buf); + /* Processing stalled: need more data */ + break; + } + + st->size = buf - st->buf; + assert(st->size <= new_size); + st->buf[st->size] = 0; /* Courtesy termination */ + + return chunk_size; /* Converted in full */ +} + +/* + * Decode OCTET STRING from the XML element's body. + */ +static asn_dec_rval_t +OCTET_STRING__decode_xer( + const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td, + void **sptr, const char *opt_mname, const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder)(void *struct_ptr, const void *chunk_buf, + size_t chunk_size), + ssize_t (*body_receiver)(void *struct_ptr, const void *chunk_buf, + size_t chunk_size, int have_more)) { + OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; + const asn_OCTET_STRING_specifics_t *specs = td->specifics + ? (const asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_SPC_OCTET_STRING_specs; + const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; + asn_struct_ctx_t *ctx; /* Per-structure parser context */ + asn_dec_rval_t rval; /* Return value from the decoder */ + int st_allocated; + + /* + * Create the string if does not exist. + */ + if(!st) { + st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); + *sptr = (void *)st; + if(!st) goto sta_failed; + st_allocated = 1; + } else { + st_allocated = 0; + } + if(!st->buf) { + /* This is separate from above section */ + st->buf = (uint8_t *)CALLOC(1, 1); + if(!st->buf) { + if(st_allocated) { + *sptr = 0; + goto stb_failed; + } else { + goto sta_failed; + } + } + } + + /* Restore parsing context */ + ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset); + + return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag, + buf_ptr, size, + opt_unexpected_tag_decoder, + body_receiver); + +stb_failed: + FREEMEM(st); +sta_failed: + rval.code = RC_FAIL; + rval.consumed = 0; + return rval; +} + +/* + * Decode OCTET STRING from the hexadecimal data. + */ +asn_dec_rval_t +OCTET_STRING_decode_xer_hex(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, + size_t size) { + return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, + buf_ptr, size, 0, + OCTET_STRING__convert_hexadecimal); +} + +/* + * Decode OCTET STRING from the binary (0/1) data. + */ +asn_dec_rval_t +OCTET_STRING_decode_xer_binary(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, + size_t size) { + return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, + buf_ptr, size, 0, + OCTET_STRING__convert_binary); +} + +/* + * Decode OCTET STRING from the string (ASCII/UTF-8) data. + */ +asn_dec_rval_t +OCTET_STRING_decode_xer_utf8(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, + size_t size) { + return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, + buf_ptr, size, + OCTET_STRING__handle_control_chars, + OCTET_STRING__convert_entrefs); +} diff --git a/certgen/asncodec/OPEN_TYPE.c b/certgen/asncodec/OPEN_TYPE.c index 6b126d5..c9afecf 100644 --- a/certgen/asncodec/OPEN_TYPE.c +++ b/certgen/asncodec/OPEN_TYPE.c @@ -1,402 +1,63 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include -#include -#include - -asn_TYPE_operation_t asn_OP_OPEN_TYPE = { - OPEN_TYPE_free, - OPEN_TYPE_print, - OPEN_TYPE_compare, - OPEN_TYPE_decode_ber, - OPEN_TYPE_encode_der, - OPEN_TYPE_decode_xer, - OPEN_TYPE_encode_xer, - 0, 0, /* No OER support, use "-gen-OER" to enable */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, 0, -#else - OPEN_TYPE_decode_uper, - OPEN_TYPE_encode_uper, -#endif - 0, /* Random fill is not supported for open type */ - 0, /* Use generic outmost tag fetcher */ -}; - -#undef ADVANCE -#define ADVANCE(num_bytes) \ - do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -asn_dec_rval_t -OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void *sptr, - const asn_TYPE_member_t *elm, const void *ptr, size_t size) { - size_t consumed_myself = 0; - asn_type_selector_result_t selected; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - void *inner_value; - asn_dec_rval_t rv; - - if(!(elm->flags & ATF_OPEN_TYPE)) { - ASN__DECODE_FAILED; - } - - if(!elm->type_selector) { - ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s", - td->name, elm->name, elm->type->name); - ASN__DECODE_FAILED; - } - - selected = elm->type_selector(td, sptr); - if(!selected.presence_index) { - ASN__DECODE_FAILED; - } - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); - } else { - memb_ptr = (char *)sptr + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - if(*memb_ptr2 != NULL) { - /* Make sure we reset the structure first before encoding */ - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) { - ASN__DECODE_FAILED; - } - } - - inner_value = - (char *)*memb_ptr2 - + elm->type->elements[selected.presence_index - 1].memb_offset; - - ASN_DEBUG("presence %d\n", selected.presence_index); - - rv = selected.type_descriptor->op->ber_decoder( - opt_codec_ctx, selected.type_descriptor, &inner_value, ptr, size, - elm->tag_mode); - ADVANCE(rv.consumed); - rv.consumed = 0; - switch(rv.code) { - case RC_OK: - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, - selected.presence_index) - == 0) { - rv.code = RC_OK; - rv.consumed = consumed_myself; - return rv; - } else { - /* Oh, now a full-blown failure failure */ - } - /* Fall through */ - case RC_FAIL: - rv.consumed = consumed_myself; - /* Fall through */ - case RC_WMORE: - break; - } - - if(*memb_ptr2) { - const asn_CHOICE_specifics_t *specs = - selected.type_descriptor->specifics; - if(elm->flags & ATF_POINTER) { - ASN_STRUCT_FREE(*selected.type_descriptor, inner_value); - *memb_ptr2 = NULL; - } else { - ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor, - inner_value); - memset(*memb_ptr2, 0, specs->struct_size); - } - } - return rv; -} - -asn_dec_rval_t -OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void *sptr, - const asn_TYPE_member_t *elm, const void *ptr, size_t size) { - size_t consumed_myself = 0; - asn_type_selector_result_t selected; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - void *inner_value; - asn_dec_rval_t rv; - - int xer_context = 0; - ssize_t ch_size; - pxer_chunk_type_e ch_type; - - if(!(elm->flags & ATF_OPEN_TYPE)) { - ASN__DECODE_FAILED; - } - - if(!elm->type_selector) { - ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s", - td->name, elm->name, elm->type->name); - ASN__DECODE_FAILED; - } - - selected = elm->type_selector(td, sptr); - if(!selected.presence_index) { - ASN__DECODE_FAILED; - } - - /* Fetch the pointer to this member */ - assert(elm->flags == ATF_OPEN_TYPE); - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); - } else { - memb_ptr = (char *)sptr + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - if(*memb_ptr2 != NULL) { - /* Make sure we reset the structure first before encoding */ - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) - != 0) { - ASN__DECODE_FAILED; - } - } - - /* - * Confirm wrapper. - */ - for(;;) { - ch_size = xer_next_token(&xer_context, ptr, size, &ch_type); - if(ch_size < 0) { - ASN__DECODE_FAILED; - } else { - switch(ch_type) { - case PXER_WMORE: - ASN__DECODE_STARVED; - case PXER_COMMENT: - case PXER_TEXT: - ADVANCE(ch_size); - continue; - case PXER_TAG: - break; - } - break; - } - } - - /* - * Wrapper value confirmed. - */ - switch(xer_check_tag(ptr, ch_size, elm->name)) { - case XCT_OPENING: - ADVANCE(ch_size); - break; - case XCT_BROKEN: - default: - ASN__DECODE_FAILED; - } - - inner_value = - (char *)*memb_ptr2 - + elm->type->elements[selected.presence_index - 1].memb_offset; - - rv = selected.type_descriptor->op->xer_decoder( - opt_codec_ctx, selected.type_descriptor, &inner_value, NULL, ptr, size); - ADVANCE(rv.consumed); - rv.consumed = 0; - switch(rv.code) { - case RC_OK: - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, - selected.presence_index) - == 0) { - break; - } else { - rv.code = RC_FAIL; - } - /* Fall through */ - case RC_FAIL: - /* Point to a best position where failure occurred */ - rv.consumed = consumed_myself; - /* Fall through */ - case RC_WMORE: - /* Wrt. rv.consumed==0: - * In case a genuine RC_WMORE, the whole Open Type decoding - * will have to be restarted. - */ - if(*memb_ptr2) { - const asn_CHOICE_specifics_t *specs = - selected.type_descriptor->specifics; - if(elm->flags & ATF_POINTER) { - ASN_STRUCT_FREE(*selected.type_descriptor, inner_value); - *memb_ptr2 = NULL; - } else { - ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor, - inner_value); - memset(*memb_ptr2, 0, specs->struct_size); - } - } - return rv; - } - - /* - * Finalize wrapper. - */ - for(;;) { - ch_size = xer_next_token(&xer_context, ptr, size, &ch_type); - if(ch_size < 0) { - ASN__DECODE_FAILED; - } else { - switch(ch_type) { - case PXER_WMORE: - ASN__DECODE_STARVED; - case PXER_COMMENT: - case PXER_TEXT: - ADVANCE(ch_size); - continue; - case PXER_TAG: - break; - } - break; - } - } - - /* - * Wrapper value confirmed. - */ - switch(xer_check_tag(ptr, ch_size, elm->name)) { - case XCT_CLOSING: - ADVANCE(ch_size); - break; - case XCT_BROKEN: - default: - ASN__DECODE_FAILED; - } - - rv.consumed += consumed_myself; - - return rv; -} - - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_dec_rval_t -OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void *sptr, - const asn_TYPE_member_t *elm, asn_per_data_t *pd) { - asn_type_selector_result_t selected; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - void *inner_value; - asn_dec_rval_t rv; - - if(!(elm->flags & ATF_OPEN_TYPE)) { - ASN__DECODE_FAILED; - } - - if(!elm->type_selector) { - ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s", - td->name, elm->name, elm->type->name); - ASN__DECODE_FAILED; - } - - selected = elm->type_selector(td, sptr); - if(!selected.presence_index) { - ASN__DECODE_FAILED; - } - - /* Fetch the pointer to this member */ - assert(elm->flags == ATF_OPEN_TYPE); - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); - } else { - memb_ptr = (char *)sptr + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - if(*memb_ptr2 != NULL) { - /* Make sure we reset the structure first before encoding */ - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) - != 0) { - ASN__DECODE_FAILED; - } - } - - inner_value = - (char *)*memb_ptr2 - + elm->type->elements[selected.presence_index - 1].memb_offset; - - rv = uper_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL, - &inner_value, pd); - switch(rv.code) { - case RC_OK: - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, - selected.presence_index) - == 0) { - break; - } else { - rv.code = RC_FAIL; - } - /* Fall through */ - case RC_WMORE: - case RC_FAIL: - if(*memb_ptr2) { - const asn_CHOICE_specifics_t *specs = - selected.type_descriptor->specifics; - if(elm->flags & ATF_POINTER) { - ASN_STRUCT_FREE(*selected.type_descriptor, inner_value); - *memb_ptr2 = NULL; - } else { - ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor, - inner_value); - memset(*memb_ptr2, 0, specs->struct_size); - } - } - } - return rv; -} - -asn_enc_rval_t -OPEN_TYPE_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, asn_per_outp_t *po) { - const void *memb_ptr; /* Pointer to the member */ - asn_TYPE_member_t *elm; /* CHOICE's element */ - asn_enc_rval_t er; - unsigned present; - - (void)constraints; - - present = CHOICE_variant_get_presence(td, sptr); - if(present == 0 || present > td->elements_count) { - ASN__ENCODE_FAILED; - } else { - present--; - } - - ASN_DEBUG("Encoding %s OPEN TYPE element %d", td->name, present); - - elm = &td->elements[present]; - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr = - *(const void *const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) ASN__ENCODE_FAILED; - } else { - memb_ptr = (const char *)sptr + elm->memb_offset; - } - - if(uper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) { - ASN__ENCODE_FAILED; - } - - er.encoded = 0; - ASN__ENCODED_OK(er); -} - - -#endif /* ASN_DISABLE_PER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +asn_TYPE_operation_t asn_OP_OPEN_TYPE = { + OPEN_TYPE_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + OPEN_TYPE_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OPEN_TYPE_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OPEN_TYPE_decode_ber, + OPEN_TYPE_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OPEN_TYPE_decode_xer, + OPEN_TYPE_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + OPEN_TYPE_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + OPEN_TYPE_decode_oer, + OPEN_TYPE_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + OPEN_TYPE_decode_uper, + OPEN_TYPE_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OPEN_TYPE_decode_aper, + OPEN_TYPE_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + 0, /* Random fill is not supported for open type */ +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; diff --git a/certgen/asncodec/OPEN_TYPE.h b/certgen/asncodec/OPEN_TYPE.h index 96d5303..5e97977 100644 --- a/certgen/asncodec/OPEN_TYPE.h +++ b/certgen/asncodec/OPEN_TYPE.h @@ -1,63 +1,117 @@ -/*- - * Copyright (c) 2017-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_OPEN_TYPE_H -#define ASN_OPEN_TYPE_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define OPEN_TYPE_free CHOICE_free -#define OPEN_TYPE_print CHOICE_print -#define OPEN_TYPE_compare CHOICE_compare -#define OPEN_TYPE_constraint CHOICE_constraint -#define OPEN_TYPE_decode_ber NULL -#define OPEN_TYPE_encode_der CHOICE_encode_der -#define OPEN_TYPE_decode_xer NULL -#define OPEN_TYPE_encode_xer CHOICE_encode_xer -#define OPEN_TYPE_decode_uper NULL - -extern asn_TYPE_operation_t asn_OP_OPEN_TYPE; - -/* - * Decode an Open Type which is potentially constraiend - * by the other members of the parent structure. - */ -asn_dec_rval_t OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *parent_type, - void *parent_structure, - const asn_TYPE_member_t *element, - const void *ptr, size_t size); - -asn_dec_rval_t OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *parent_type, - void *parent_structure, - const asn_TYPE_member_t *element, - const void *ptr, size_t size); - -asn_dec_rval_t OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *parent_type, - void *parent_structure, - asn_TYPE_member_t *element, const void *ptr, - size_t size); - -asn_dec_rval_t OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *parent_type, - void *parent_structure, - const asn_TYPE_member_t *element, - asn_per_data_t *pd); - -asn_enc_rval_t OPEN_TYPE_encode_uper( - const asn_TYPE_descriptor_t *type_descriptor, - const asn_per_constraints_t *constraints, const void *struct_ptr, - asn_per_outp_t *per_output); - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_OPEN_TYPE_H */ +/*- + * Copyright (c) 2017-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_OPEN_TYPE_H +#define ASN_OPEN_TYPE_H + +#include +///////////#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Decode an Open Type which is potentially constraiend + * by the other members of the parent structure. + */ + +#undef ADVANCE +#define ADVANCE(num_bytes) \ + do { \ + size_t num = num_bytes; \ + ptr = ((const char *)ptr) + num; \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +#define OPEN_TYPE_free CHOICE_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +#define OPEN_TYPE_print CHOICE_print +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define OPEN_TYPE_compare CHOICE_compare + +#define OPEN_TYPE_constraint CHOICE_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +asn_dec_rval_t OPEN_TYPE_ber_get( + const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *parent_type, + void *parent_structure, + const asn_TYPE_member_t *element, + const void *ptr, size_t size); +#define OPEN_TYPE_decode_ber NULL +#define OPEN_TYPE_encode_der CHOICE_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +asn_dec_rval_t OPEN_TYPE_xer_get( + const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *parent_type, + void *parent_structure, + const asn_TYPE_member_t *element, + const void *ptr, size_t size); +#define OPEN_TYPE_decode_xer NULL +#define OPEN_TYPE_encode_xer CHOICE_encode_xer +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +#define OPEN_TYPE_encode_jer CHOICE_encode_jer +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +asn_dec_rval_t OPEN_TYPE_oer_get( + const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *parent_type, + void *parent_structure, + asn_TYPE_member_t *element, const void *ptr, + size_t size); +#define OPEN_TYPE_decode_oer NULL +#define OPEN_TYPE_encode_oer CHOICE_encode_oer +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +asn_dec_rval_t OPEN_TYPE_uper_get( + const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *parent_type, + void *parent_structure, + const asn_TYPE_member_t *element, + asn_per_data_t *pd); +#define OPEN_TYPE_decode_uper NULL +asn_enc_rval_t OPEN_TYPE_encode_uper( + const asn_TYPE_descriptor_t *type_descriptor, + const asn_per_constraints_t *constraints, const void *struct_ptr, + asn_per_outp_t *per_output); +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +asn_dec_rval_t OPEN_TYPE_aper_get( + const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *parent_type, + void *parent_structure, + const asn_TYPE_member_t *element, + asn_per_data_t *pd); +#define OPEN_TYPE_decode_aper NULL +asn_enc_rval_t OPEN_TYPE_encode_aper( + const asn_TYPE_descriptor_t *type_descriptor, + const asn_per_constraints_t *constraints, const void *struct_ptr, + asn_per_outp_t *per_output); + +int OPEN_TYPE_aper_is_unknown_type( + const asn_TYPE_descriptor_t *td, + void *sptr, + const asn_TYPE_member_t *elm); + +asn_dec_rval_t OPEN_TYPE_aper_unknown_type_discard_bytes( + asn_per_data_t *pd); +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +extern asn_TYPE_operation_t asn_OP_OPEN_TYPE; + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_OPEN_TYPE_H */ diff --git a/certgen/asncodec/OPEN_TYPE_oer.c b/certgen/asncodec/OPEN_TYPE_oer.c index 129ca8b..05a5eaa 100644 --- a/certgen/asncodec/OPEN_TYPE_oer.c +++ b/certgen/asncodec/OPEN_TYPE_oer.c @@ -1,92 +1,91 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include -#include - -asn_dec_rval_t -OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void *sptr, - asn_TYPE_member_t *elm, const void *ptr, size_t size) { - asn_type_selector_result_t selected; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - void *inner_value; - asn_dec_rval_t rv; - size_t ot_ret; - - - if(!(elm->flags & ATF_OPEN_TYPE)) { - ASN__DECODE_FAILED; - } - - if(!elm->type_selector) { - ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s", - td->name, elm->name, elm->type->name); - ASN__DECODE_FAILED; - } - - selected = elm->type_selector(td, sptr); - if(!selected.presence_index) { - ASN__DECODE_FAILED; - } - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); - } else { - memb_ptr = (char *)sptr + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - if(*memb_ptr2 != NULL) { - /* Make sure we reset the structure first before encoding */ - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) { - ASN__DECODE_FAILED; - } - } - - inner_value = - (char *)*memb_ptr2 - + elm->type->elements[selected.presence_index - 1].memb_offset; - - ot_ret = oer_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL, - &inner_value, ptr, size); - switch(ot_ret) { - default: - if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, - selected.presence_index) - == 0) { - rv.code = RC_OK; - rv.consumed = ot_ret; - return rv; - } else { - /* Oh, now a full-blown failure failure */ - } - /* Fall through */ - case -1: - rv.code = RC_FAIL; - rv.consumed = ot_ret; - break; - case 0: - rv.code = RC_WMORE; - rv.consumed = 0; - break; - } - - if(*memb_ptr2) { - const asn_CHOICE_specifics_t *specs = - selected.type_descriptor->specifics; - if(elm->flags & ATF_POINTER) { - ASN_STRUCT_FREE(*selected.type_descriptor, inner_value); - *memb_ptr2 = NULL; - } else { - ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor, - inner_value); - memset(*memb_ptr2, 0, specs->struct_size); - } - } - return rv; -} +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +asn_dec_rval_t +OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void *sptr, + asn_TYPE_member_t *elm, const void *ptr, size_t size) { + asn_type_selector_result_t selected; + void *memb_ptr; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ + void *inner_value; + asn_dec_rval_t rv; + size_t ot_ret; + + + if(!(elm->flags & ATF_OPEN_TYPE)) { + ASN__DECODE_FAILED; + } + + if(!elm->type_selector) { + ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s", + td->name, elm->name, elm->type->name); + ASN__DECODE_FAILED; + } + + selected = elm->type_selector(td, sptr); + if(!selected.presence_index) { + ASN__DECODE_FAILED; + } + + /* Fetch the pointer to this member */ + if(elm->flags & ATF_POINTER) { + memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); + } else { + memb_ptr = (char *)sptr + elm->memb_offset; + memb_ptr2 = &memb_ptr; + } + if(*memb_ptr2 != NULL) { + /* Make sure we reset the structure first before encoding */ + if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) { + ASN__DECODE_FAILED; + } + } + + inner_value = + (char *)*memb_ptr2 + + elm->type->elements[selected.presence_index - 1].memb_offset; + + ot_ret = oer_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL, + &inner_value, ptr, size); + switch(ot_ret) { + default: + if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, + selected.presence_index) + == 0) { + rv.code = RC_OK; + rv.consumed = ot_ret; + return rv; + } else { + /* Oh, now a full-blown failure failure */ + } + /* Fall through */ + case -1: + rv.code = RC_FAIL; + rv.consumed = ot_ret; + break; + case 0: + rv.code = RC_WMORE; + rv.consumed = 0; + break; + } + + if(*memb_ptr2) { + const asn_CHOICE_specifics_t *specs = + selected.type_descriptor->specifics; + if(elm->flags & ATF_POINTER) { + ASN_STRUCT_FREE(*selected.type_descriptor, inner_value); + *memb_ptr2 = NULL; + } else { + ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor, + inner_value); + memset(*memb_ptr2, 0, specs->struct_size); + } + } + return rv; +} diff --git a/certgen/asncodec/OPEN_TYPE_xer.c b/certgen/asncodec/OPEN_TYPE_xer.c new file mode 100644 index 0000000..fc38562 --- /dev/null +++ b/certgen/asncodec/OPEN_TYPE_xer.c @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +asn_dec_rval_t +OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void *sptr, + const asn_TYPE_member_t *elm, const void *ptr, size_t size) { + size_t consumed_myself = 0; + asn_type_selector_result_t selected; + void *memb_ptr; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ + void *inner_value; + asn_dec_rval_t rv; + + int xer_context = 0; + ssize_t ch_size; + pxer_chunk_type_e ch_type; + + if(!(elm->flags & ATF_OPEN_TYPE)) { + ASN__DECODE_FAILED; + } + + if(!elm->type_selector) { + ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s", + td->name, elm->name, elm->type->name); + ASN__DECODE_FAILED; + } + + selected = elm->type_selector(td, sptr); + if(!selected.presence_index) { + ASN__DECODE_FAILED; + } + + /* Fetch the pointer to this member */ + assert(elm->flags == ATF_OPEN_TYPE); + if(elm->flags & ATF_POINTER) { + memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); + } else { + memb_ptr = (char *)sptr + elm->memb_offset; + memb_ptr2 = &memb_ptr; + } + if(*memb_ptr2 != NULL) { + /* Make sure we reset the structure first before encoding */ + if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) + != 0) { + ASN__DECODE_FAILED; + } + } + + /* + * Confirm wrapper. + */ + for(;;) { + ch_size = xer_next_token(&xer_context, ptr, size, &ch_type); + if(ch_size < 0) { + ASN__DECODE_FAILED; + } else { + switch(ch_type) { + case PXER_WMORE: + ASN__DECODE_STARVED; + case PXER_COMMENT: + case PXER_TEXT: + ADVANCE(ch_size); + continue; + case PXER_TAG: + break; + } + break; + } + } + + /* + * Wrapper value confirmed. + */ + switch(xer_check_tag(ptr, ch_size, elm->name)) { + case XCT_OPENING: + ADVANCE(ch_size); + break; + case XCT_BROKEN: + default: + ASN__DECODE_FAILED; + } + + inner_value = + (char *)*memb_ptr2 + + elm->type->elements[selected.presence_index - 1].memb_offset; + + rv = selected.type_descriptor->op->xer_decoder( + opt_codec_ctx, selected.type_descriptor, &inner_value, NULL, ptr, size); + ADVANCE(rv.consumed); + rv.consumed = 0; + switch(rv.code) { + case RC_OK: + if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, + selected.presence_index) + == 0) { + break; + } else { + rv.code = RC_FAIL; + } + /* Fall through */ + case RC_FAIL: + /* Point to a best position where failure occurred */ + rv.consumed = consumed_myself; + /* Fall through */ + case RC_WMORE: + /* Wrt. rv.consumed==0: + * In case a genuine RC_WMORE, the whole Open Type decoding + * will have to be restarted. + */ + if(*memb_ptr2) { + if(elm->flags & ATF_POINTER) { + ASN_STRUCT_FREE(*selected.type_descriptor, inner_value); + *memb_ptr2 = NULL; + } else { + ASN_STRUCT_RESET(*selected.type_descriptor, + inner_value); + } + } + return rv; + } + + /* + * Finalize wrapper. + */ + for(;;) { + ch_size = xer_next_token(&xer_context, ptr, size, &ch_type); + if(ch_size < 0) { + ASN__DECODE_FAILED; + } else { + switch(ch_type) { + case PXER_WMORE: + ASN__DECODE_STARVED; + case PXER_COMMENT: + case PXER_TEXT: + ADVANCE(ch_size); + continue; + case PXER_TAG: + break; + } + break; + } + } + + /* + * Wrapper value confirmed. + */ + switch(xer_check_tag(ptr, ch_size, elm->name)) { + case XCT_CLOSING: + ADVANCE(ch_size); + break; + case XCT_BROKEN: + default: + ASN__DECODE_FAILED; + } + + rv.consumed += consumed_myself; + + return rv; +} diff --git a/certgen/asncodec/ObjectDescriptor.c b/certgen/asncodec/ObjectDescriptor.c new file mode 100644 index 0000000..c311a92 --- /dev/null +++ b/certgen/asncodec/ObjectDescriptor.c @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * ObjectDescriptor basic type description. + */ +static const ber_tlv_tag_t asn_DEF_ObjectDescriptor_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), /* [UNIVERSAL 7] IMPLICIT ... */ + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ +}; +asn_TYPE_operation_t asn_OP_ObjectDescriptor = { + OCTET_STRING_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + OCTET_STRING_print_utf8, /* Treat as ASCII subset (it's not) */ +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OCTET_STRING_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OCTET_STRING_decode_xer_utf8, + OCTET_STRING_encode_xer_utf8, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + OCTET_STRING_encode_jer_utf8, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, + 0, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OCTET_STRING_decode_aper, + OCTET_STRING_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + 0, /* Not supported for ObjectDescriptor */ +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_ObjectDescriptor = { + "ObjectDescriptor", + "ObjectDescriptor", + &asn_OP_ObjectDescriptor, + asn_DEF_ObjectDescriptor_tags, + sizeof(asn_DEF_ObjectDescriptor_tags) + / sizeof(asn_DEF_ObjectDescriptor_tags[0]) - 1, + asn_DEF_ObjectDescriptor_tags, + sizeof(asn_DEF_ObjectDescriptor_tags) + / sizeof(asn_DEF_ObjectDescriptor_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_unknown_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; diff --git a/certgen/asncodec/ObjectDescriptor.h b/certgen/asncodec/ObjectDescriptor.h new file mode 100644 index 0000000..852c45d --- /dev/null +++ b/certgen/asncodec/ObjectDescriptor.h @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _ObjectDescriptor_H_ +#define _ObjectDescriptor_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef GraphicString_t ObjectDescriptor_t; /* Implemented via GraphicString */ + +extern asn_TYPE_descriptor_t asn_DEF_ObjectDescriptor; +extern asn_TYPE_operation_t asn_OP_ObjectDescriptor; + +#define ObjectDescriptor_free OCTET_STRING_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +#define ObjectDescriptor_print OCTET_STRING_print_utf8 +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define ObjectDescriptor_constraint asn_generic_unknown_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define ObjectDescriptor_decode_ber OCTET_STRING_decode_ber +#define ObjectDescriptor_encode_der OCTET_STRING_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define ObjectDescriptor_decode_xer OCTET_STRING_decode_xer_utf8 +#define ObjectDescriptor_encode_xer OCTET_STRING_encode_xer_utf8 +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +#define ObjectDescriptor_encode_jer OCTET_STRING_encode_jer_utf8 +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +#define ObjectDescriptor_decode_uper OCTET_STRING_decode_uper +#define ObjectDescriptor_encode_uper OCTET_STRING_encode_uper +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#define ObjectDescriptor_decode_aper OCTET_STRING_decode_aper +#define ObjectDescriptor_encode_aper OCTET_STRING_encode_aper +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _ObjectDescriptor_H_ */ diff --git a/certgen/asncodec/One28BitCcmCiphertext.c b/certgen/asncodec/One28BitCcmCiphertext.c new file mode 100644 index 0000000..7682a6a --- /dev/null +++ b/certgen/asncodec/One28BitCcmCiphertext.c @@ -0,0 +1,115 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "One28BitCcmCiphertext.h" + +static int +memb_nonce_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 12)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_nonce_constr_2 CC_NOTUSED = { + { 0, 0 }, + 12 /* (SIZE(12..12)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_One28BitCcmCiphertext_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct One28BitCcmCiphertext, nonce), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_nonce_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_nonce_constraint_1 + }, + 0, 0, /* No default value */ + "nonce" + }, + { ATF_NOFLAGS, 0, offsetof(struct One28BitCcmCiphertext, ccmCiphertext), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Opaque, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ccmCiphertext" + }, +}; +static const ber_tlv_tag_t asn_DEF_One28BitCcmCiphertext_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_One28BitCcmCiphertext_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nonce */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ccmCiphertext */ +}; +asn_SEQUENCE_specifics_t asn_SPC_One28BitCcmCiphertext_specs_1 = { + sizeof(struct One28BitCcmCiphertext), + offsetof(struct One28BitCcmCiphertext, _asn_ctx), + asn_MAP_One28BitCcmCiphertext_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_One28BitCcmCiphertext = { + "One28BitCcmCiphertext", + "One28BitCcmCiphertext", + &asn_OP_SEQUENCE, + asn_DEF_One28BitCcmCiphertext_tags_1, + sizeof(asn_DEF_One28BitCcmCiphertext_tags_1) + /sizeof(asn_DEF_One28BitCcmCiphertext_tags_1[0]), /* 1 */ + asn_DEF_One28BitCcmCiphertext_tags_1, /* Same as above */ + sizeof(asn_DEF_One28BitCcmCiphertext_tags_1) + /sizeof(asn_DEF_One28BitCcmCiphertext_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_One28BitCcmCiphertext_1, + 2, /* Elements count */ + &asn_SPC_One28BitCcmCiphertext_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/One28BitCcmCiphertext.h b/certgen/asncodec/One28BitCcmCiphertext.h new file mode 100644 index 0000000..0c93c56 --- /dev/null +++ b/certgen/asncodec/One28BitCcmCiphertext.h @@ -0,0 +1,42 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include "Opaque.h" +#include +#ifndef _One28BitCcmCiphertext_H_ +#define _One28BitCcmCiphertext_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* One28BitCcmCiphertext */ +typedef struct One28BitCcmCiphertext { + OCTET_STRING_t nonce; + Opaque_t ccmCiphertext; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} One28BitCcmCiphertext_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_One28BitCcmCiphertext; +extern asn_SEQUENCE_specifics_t asn_SPC_One28BitCcmCiphertext_specs_1; +extern asn_TYPE_member_t asn_MBR_One28BitCcmCiphertext_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _One28BitCcmCiphertext_H_ */ +#include diff --git a/certgen/asncodec/OneEightyDegreeInt.c b/certgen/asncodec/OneEightyDegreeInt.c index 2bba4c8..1cd9180 100644 --- a/certgen/asncodec/OneEightyDegreeInt.c +++ b/certgen/asncodec/OneEightyDegreeInt.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "OneEightyDegreeInt.h" @@ -36,9 +36,11 @@ OneEightyDegreeInt_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_OneEightyDegreeInt_constr_1 CC_NOTUSED = { { 4, 0 } /* (-1799999999..1800000001) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_OneEightyDegreeInt_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_OneEightyDegreeInt = { asn_DEF_OneEightyDegreeInt_tags_1, /* Same as above */ sizeof(asn_DEF_OneEightyDegreeInt_tags_1) /sizeof(asn_DEF_OneEightyDegreeInt_tags_1[0]), /* 1 */ - { &asn_OER_type_OneEightyDegreeInt_constr_1, 0, OneEightyDegreeInt_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_OneEightyDegreeInt_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OneEightyDegreeInt_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/OneEightyDegreeInt.h b/certgen/asncodec/OneEightyDegreeInt.h index bc9ff22..2f8a9ee 100644 --- a/certgen/asncodec/OneEightyDegreeInt.h +++ b/certgen/asncodec/OneEightyDegreeInt.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _OneEightyDegreeInt_H_ #define _OneEightyDegreeInt_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -33,8 +33,6 @@ extern asn_TYPE_descriptor_t asn_DEF_OneEightyDegreeInt; asn_struct_free_f OneEightyDegreeInt_free; asn_struct_print_f OneEightyDegreeInt_print; asn_constr_check_f OneEightyDegreeInt_constraint; -ber_type_decoder_f OneEightyDegreeInt_decode_ber; -der_type_encoder_f OneEightyDegreeInt_encode_der; xer_type_decoder_f OneEightyDegreeInt_decode_xer; xer_type_encoder_f OneEightyDegreeInt_encode_xer; oer_type_decoder_f OneEightyDegreeInt_decode_oer; diff --git a/certgen/asncodec/Opaque.c b/certgen/asncodec/Opaque.c index 0ad9f3e..8b900f5 100644 --- a/certgen/asncodec/Opaque.c +++ b/certgen/asncodec/Opaque.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Opaque.h" @@ -24,7 +24,15 @@ asn_TYPE_descriptor_t asn_DEF_Opaque = { asn_DEF_Opaque_tags_1, /* Same as above */ sizeof(asn_DEF_Opaque_tags_1) /sizeof(asn_DEF_Opaque_tags_1[0]), /* 1 */ - { 0, 0, OCTET_STRING_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OCTET_STRING_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/Opaque.h b/certgen/asncodec/Opaque.h index fb84aef..813299d 100644 --- a/certgen/asncodec/Opaque.h +++ b/certgen/asncodec/Opaque.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Opaque_H_ #define _Opaque_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Opaque; asn_struct_free_f Opaque_free; asn_struct_print_f Opaque_print; asn_constr_check_f Opaque_constraint; -ber_type_decoder_f Opaque_decode_ber; -der_type_encoder_f Opaque_encode_der; xer_type_decoder_f Opaque_decode_xer; xer_type_encoder_f Opaque_encode_xer; oer_type_decoder_f Opaque_decode_oer; diff --git a/certgen/asncodec/OperatingOrganizationId.c b/certgen/asncodec/OperatingOrganizationId.c new file mode 100644 index 0000000..232397c --- /dev/null +++ b/certgen/asncodec/OperatingOrganizationId.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "OperatingOrganizationId.h" + +/* + * This type is implemented using OBJECT_IDENTIFIER, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_OperatingOrganizationId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_OperatingOrganizationId = { + "OperatingOrganizationId", + "OperatingOrganizationId", + &asn_OP_OBJECT_IDENTIFIER, + asn_DEF_OperatingOrganizationId_tags_1, + sizeof(asn_DEF_OperatingOrganizationId_tags_1) + /sizeof(asn_DEF_OperatingOrganizationId_tags_1[0]), /* 1 */ + asn_DEF_OperatingOrganizationId_tags_1, /* Same as above */ + sizeof(asn_DEF_OperatingOrganizationId_tags_1) + /sizeof(asn_DEF_OperatingOrganizationId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OBJECT_IDENTIFIER_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/OperatingOrganizationId.h b/certgen/asncodec/OperatingOrganizationId.h new file mode 100644 index 0000000..2dce7bf --- /dev/null +++ b/certgen/asncodec/OperatingOrganizationId.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _OperatingOrganizationId_H_ +#define _OperatingOrganizationId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* OperatingOrganizationId */ +typedef OBJECT_IDENTIFIER_t OperatingOrganizationId_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_OperatingOrganizationId; +asn_struct_free_f OperatingOrganizationId_free; +asn_struct_print_f OperatingOrganizationId_print; +asn_constr_check_f OperatingOrganizationId_constraint; +xer_type_decoder_f OperatingOrganizationId_decode_xer; +xer_type_encoder_f OperatingOrganizationId_encode_xer; +oer_type_decoder_f OperatingOrganizationId_decode_oer; +oer_type_encoder_f OperatingOrganizationId_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _OperatingOrganizationId_H_ */ +#include diff --git a/certgen/asncodec/PKRecipientInfo.c b/certgen/asncodec/PKRecipientInfo.c index 661b9e7..a0124d2 100644 --- a/certgen/asncodec/PKRecipientInfo.c +++ b/certgen/asncodec/PKRecipientInfo.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PKRecipientInfo.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_PKRecipientInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "recipientId" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_PKRecipientInfo_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_EncryptedDataEncryptionKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "encKey" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_PKRecipientInfo = { asn_DEF_PKRecipientInfo_tags_1, /* Same as above */ sizeof(asn_DEF_PKRecipientInfo_tags_1) /sizeof(asn_DEF_PKRecipientInfo_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_PKRecipientInfo_1, 2, /* Elements count */ &asn_SPC_PKRecipientInfo_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/PKRecipientInfo.h b/certgen/asncodec/PKRecipientInfo.h index fb4001d..1d40d0f 100644 --- a/certgen/asncodec/PKRecipientInfo.h +++ b/certgen/asncodec/PKRecipientInfo.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _PKRecipientInfo_H_ -#define _PKRecipientInfo_H_ - - -#include /* Including external dependencies */ #include "HashedId8.h" #include "EncryptedDataEncryptionKey.h" #include +#ifndef _PKRecipientInfo_H_ +#define _PKRecipientInfo_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/PduFunctionalType.c b/certgen/asncodec/PduFunctionalType.c new file mode 100644 index 0000000..d059549 --- /dev/null +++ b/certgen/asncodec/PduFunctionalType.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "PduFunctionalType.h" + +int +PduFunctionalType_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 255)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using NativeInteger, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_PduFunctionalType_constr_1 CC_NOTUSED = { + { 1, 1 } /* (0..255) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_PduFunctionalType_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_PduFunctionalType = { + "PduFunctionalType", + "PduFunctionalType", + &asn_OP_NativeInteger, + asn_DEF_PduFunctionalType_tags_1, + sizeof(asn_DEF_PduFunctionalType_tags_1) + /sizeof(asn_DEF_PduFunctionalType_tags_1[0]), /* 1 */ + asn_DEF_PduFunctionalType_tags_1, /* Same as above */ + sizeof(asn_DEF_PduFunctionalType_tags_1) + /sizeof(asn_DEF_PduFunctionalType_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_PduFunctionalType_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + PduFunctionalType_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/PduFunctionalType.h b/certgen/asncodec/PduFunctionalType.h new file mode 100644 index 0000000..9a6f6b1 --- /dev/null +++ b/certgen/asncodec/PduFunctionalType.h @@ -0,0 +1,42 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _PduFunctionalType_H_ +#define _PduFunctionalType_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* PduFunctionalType */ +typedef long PduFunctionalType_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_PduFunctionalType; +asn_struct_free_f PduFunctionalType_free; +asn_struct_print_f PduFunctionalType_print; +asn_constr_check_f PduFunctionalType_constraint; +xer_type_decoder_f PduFunctionalType_decode_xer; +xer_type_encoder_f PduFunctionalType_encode_xer; +oer_type_decoder_f PduFunctionalType_decode_oer; +oer_type_encoder_f PduFunctionalType_encode_oer; +#define PduFunctionalType_tlsHandshake ((PduFunctionalType_t)1) +#define PduFunctionalType_iso21177ExtendedAuth ((PduFunctionalType_t)2) +#define PduFunctionalType_iso21177SessionExtension ((PduFunctionalType_t)3) + +#ifdef __cplusplus +} +#endif + +#endif /* _PduFunctionalType_H_ */ +#include diff --git a/certgen/asncodec/PgSsp.c b/certgen/asncodec/PgSsp.c new file mode 100644 index 0000000..960fc88 --- /dev/null +++ b/certgen/asncodec/PgSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "PgSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_PgSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct PgSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_PgSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_PgSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_PgSsp_specs_1 = { + sizeof(struct PgSsp), + offsetof(struct PgSsp, _asn_ctx), + asn_MAP_PgSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_PgSsp = { + "PgSsp", + "PgSsp", + &asn_OP_SEQUENCE, + asn_DEF_PgSsp_tags_1, + sizeof(asn_DEF_PgSsp_tags_1) + /sizeof(asn_DEF_PgSsp_tags_1[0]), /* 1 */ + asn_DEF_PgSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_PgSsp_tags_1) + /sizeof(asn_DEF_PgSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_PgSsp_1, + 1, /* Elements count */ + &asn_SPC_PgSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/PgSsp.h b/certgen/asncodec/PgSsp.h new file mode 100644 index 0000000..bff5a17 --- /dev/null +++ b/certgen/asncodec/PgSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _PgSsp_H_ +#define _PgSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* PgSsp */ +typedef struct PgSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} PgSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_PgSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_PgSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_PgSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _PgSsp_H_ */ +#include diff --git a/certgen/asncodec/PolygonalRegion.c b/certgen/asncodec/PolygonalRegion.c index 5a6459f..6c8362a 100644 --- a/certgen/asncodec/PolygonalRegion.c +++ b/certgen/asncodec/PolygonalRegion.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PolygonalRegion.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_PolygonalRegion_constr_1 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(3..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_PolygonalRegion_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_TwoDLocation, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -39,7 +49,15 @@ asn_TYPE_descriptor_t asn_DEF_PolygonalRegion = { asn_DEF_PolygonalRegion_tags_1, /* Same as above */ sizeof(asn_DEF_PolygonalRegion_tags_1) /sizeof(asn_DEF_PolygonalRegion_tags_1[0]), /* 1 */ - { &asn_OER_type_PolygonalRegion_constr_1, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_PolygonalRegion_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_PolygonalRegion_1, 1, /* Single element */ &asn_SPC_PolygonalRegion_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/PolygonalRegion.h b/certgen/asncodec/PolygonalRegion.h index aec4371..4ef4a1c 100644 --- a/certgen/asncodec/PolygonalRegion.h +++ b/certgen/asncodec/PolygonalRegion.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _PolygonalRegion_H_ #define _PolygonalRegion_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/PreLinkageValue.c b/certgen/asncodec/PreLinkageValue.c new file mode 100644 index 0000000..d62f094 --- /dev/null +++ b/certgen/asncodec/PreLinkageValue.c @@ -0,0 +1,70 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "PreLinkageValue.h" + +int +PreLinkageValue_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 9)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using OCTET_STRING, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_PreLinkageValue_constr_1 CC_NOTUSED = { + { 0, 0 }, + 9 /* (SIZE(9..9)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_PreLinkageValue_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_PreLinkageValue = { + "PreLinkageValue", + "PreLinkageValue", + &asn_OP_OCTET_STRING, + asn_DEF_PreLinkageValue_tags_1, + sizeof(asn_DEF_PreLinkageValue_tags_1) + /sizeof(asn_DEF_PreLinkageValue_tags_1[0]), /* 1 */ + asn_DEF_PreLinkageValue_tags_1, /* Same as above */ + sizeof(asn_DEF_PreLinkageValue_tags_1) + /sizeof(asn_DEF_PreLinkageValue_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_PreLinkageValue_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + PreLinkageValue_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/PreLinkageValue.h b/certgen/asncodec/PreLinkageValue.h new file mode 100644 index 0000000..ae95a49 --- /dev/null +++ b/certgen/asncodec/PreLinkageValue.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _PreLinkageValue_H_ +#define _PreLinkageValue_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* PreLinkageValue */ +typedef OCTET_STRING_t PreLinkageValue_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_PreLinkageValue; +asn_struct_free_f PreLinkageValue_free; +asn_struct_print_f PreLinkageValue_print; +asn_constr_check_f PreLinkageValue_constraint; +xer_type_decoder_f PreLinkageValue_decode_xer; +xer_type_encoder_f PreLinkageValue_encode_xer; +oer_type_decoder_f PreLinkageValue_decode_oer; +oer_type_encoder_f PreLinkageValue_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _PreLinkageValue_H_ */ +#include diff --git a/certgen/asncodec/PreSharedKeyRecipientInfo.c b/certgen/asncodec/PreSharedKeyRecipientInfo.c index e6ffbb6..bd66531 100644 --- a/certgen/asncodec/PreSharedKeyRecipientInfo.c +++ b/certgen/asncodec/PreSharedKeyRecipientInfo.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PreSharedKeyRecipientInfo.h" @@ -37,9 +37,11 @@ PreSharedKeyRecipientInfo_constraint(const asn_TYPE_descriptor_t *td, const void * This type is implemented using HashedId8, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_PreSharedKeyRecipientInfo_constr_1 CC_NOTUSED = { { 0, 0 }, 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_PreSharedKeyRecipientInfo_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_PreSharedKeyRecipientInfo = { asn_DEF_PreSharedKeyRecipientInfo_tags_1, /* Same as above */ sizeof(asn_DEF_PreSharedKeyRecipientInfo_tags_1) /sizeof(asn_DEF_PreSharedKeyRecipientInfo_tags_1[0]), /* 1 */ - { &asn_OER_type_PreSharedKeyRecipientInfo_constr_1, 0, PreSharedKeyRecipientInfo_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_PreSharedKeyRecipientInfo_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + PreSharedKeyRecipientInfo_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/PreSharedKeyRecipientInfo.h b/certgen/asncodec/PreSharedKeyRecipientInfo.h index 45822a8..4ba8c12 100644 --- a/certgen/asncodec/PreSharedKeyRecipientInfo.h +++ b/certgen/asncodec/PreSharedKeyRecipientInfo.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "HashedId8.h" #ifndef _PreSharedKeyRecipientInfo_H_ #define _PreSharedKeyRecipientInfo_H_ #include -/* Including external dependencies */ -#include "HashedId8.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_PreSharedKeyRecipientInfo; asn_struct_free_f PreSharedKeyRecipientInfo_free; asn_struct_print_f PreSharedKeyRecipientInfo_print; asn_constr_check_f PreSharedKeyRecipientInfo_constraint; -ber_type_decoder_f PreSharedKeyRecipientInfo_decode_ber; -der_type_encoder_f PreSharedKeyRecipientInfo_encode_der; xer_type_decoder_f PreSharedKeyRecipientInfo_decode_xer; xer_type_encoder_f PreSharedKeyRecipientInfo_encode_xer; oer_type_decoder_f PreSharedKeyRecipientInfo_decode_oer; diff --git a/certgen/asncodec/Psid.c b/certgen/asncodec/Psid.c index 0a6a571..a91d0ea 100644 --- a/certgen/asncodec/Psid.c +++ b/certgen/asncodec/Psid.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Psid.h" @@ -33,42 +33,13 @@ Psid_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Psid_constr_1 CC_NOTUSED = { { 0, 1 } /* (0..MAX) */, -1}; -static const asn_INTEGER_enum_map_t asn_MAP_Psid_value2enum_1[] = { - { 36, 3, "cam" }, - { 37, 4, "denm" }, - { 38, 7, "generic" }, - { 137, 4, "spat" }, - { 138, 3, "map" }, - { 139, 3, "ivi" }, - { 140, 3, "tlc" }, - { 141, 7, "gn-mgmt" }, - { 622, 3, "crl" }, - { 623, 8, "cert-req" }, - { 624, 3, "ctl" } -}; -static const unsigned int asn_MAP_Psid_enum2value_1[] = { - 0, /* cam(36) */ - 9, /* cert-req(623) */ - 8, /* crl(622) */ - 10, /* ctl(624) */ - 1, /* denm(37) */ - 2, /* generic(38) */ - 7, /* gn-mgmt(141) */ - 5, /* ivi(139) */ - 4, /* map(138) */ - 3, /* spat(137) */ - 6 /* tlc(140) */ -}; - +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ const asn_INTEGER_specifics_t asn_SPC_Psid_specs_1 = { - asn_MAP_Psid_value2enum_1, /* "tag" => N; sorted by tag */ - asn_MAP_Psid_enum2value_1, /* N => "tag"; sorted by N */ - 11, /* Number of elements in the maps */ - 0, - 0, + 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; @@ -85,7 +56,15 @@ asn_TYPE_descriptor_t asn_DEF_Psid = { asn_DEF_Psid_tags_1, /* Same as above */ sizeof(asn_DEF_Psid_tags_1) /sizeof(asn_DEF_Psid_tags_1[0]), /* 1 */ - { &asn_OER_type_Psid_constr_1, 0, Psid_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Psid_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Psid_constraint + }, 0, 0, /* No members */ &asn_SPC_Psid_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/Psid.h b/certgen/asncodec/Psid.h index d914087..85ba7fc 100644 --- a/certgen/asncodec/Psid.h +++ b/certgen/asncodec/Psid.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Psid_H_ #define _Psid_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -27,8 +27,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_Psid_specs_1; asn_struct_free_f Psid_free; asn_struct_print_f Psid_print; asn_constr_check_f Psid_constraint; -ber_type_decoder_f Psid_decode_ber; -der_type_encoder_f Psid_encode_der; xer_type_decoder_f Psid_decode_xer; xer_type_encoder_f Psid_encode_xer; oer_type_decoder_f Psid_decode_oer; diff --git a/certgen/asncodec/PsidGroupPermissions.c b/certgen/asncodec/PsidGroupPermissions.c index dceaf2b..b364dab 100644 --- a/certgen/asncodec/PsidGroupPermissions.c +++ b/certgen/asncodec/PsidGroupPermissions.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PsidGroupPermissions.h" @@ -51,29 +51,21 @@ static int asn_DFL_4_set_0(void **sptr) { *st = 0; return 0; } -static int asn_DFL_5_cmp_0(const void *sptr) { - uint8_t def_buf[] = { 0 }; - BIT_STRING_t defv = { def_buf, 1, 7 }; - return BIT_STRING_compare(&asn_DEF_EndEntityType, sptr, &defv); -} - -static int asn_DFL_5_set_0(void **sptr) { - BIT_STRING_t * st = *(BIT_STRING_t **)sptr; - if (!st) { - st = (*sptr = CALLOC(1, sizeof(*st))); - if (!st) return -1; - } - OCTET_STRING_fromBuf((OCTET_STRING_t *)st, "\x0", 1); - return 0; -} - asn_TYPE_member_t asn_MBR_PsidGroupPermissions_1[] = { { ATF_NOFLAGS, 0, offsetof(struct PsidGroupPermissions, subjectPermissions), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_SubjectPermissions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "subjectPermissions" }, @@ -82,7 +74,15 @@ asn_TYPE_member_t asn_MBR_PsidGroupPermissions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, &asn_DFL_3_cmp_1, /* Compare DEFAULT 1 */ &asn_DFL_3_set_1, /* Set DEFAULT 1 */ "minChainLength" @@ -92,7 +92,15 @@ asn_TYPE_member_t asn_MBR_PsidGroupPermissions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, &asn_DFL_4_cmp_0, /* Compare DEFAULT 0 */ &asn_DFL_4_set_0, /* Set DEFAULT 0 */ "chainLengthRange" @@ -102,9 +110,16 @@ asn_TYPE_member_t asn_MBR_PsidGroupPermissions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EndEntityType, 0, - { 0, 0, 0 }, - asn_DFL_5_cmp_0, - asn_DFL_5_set_0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ "eeType" }, }; @@ -127,7 +142,6 @@ asn_SEQUENCE_specifics_t asn_SPC_PsidGroupPermissions_specs_1 = { 3, 0, /* Root/Additions */ -1, /* First extension addition */ }; - asn_TYPE_descriptor_t asn_DEF_PsidGroupPermissions = { "PsidGroupPermissions", "PsidGroupPermissions", @@ -138,7 +152,15 @@ asn_TYPE_descriptor_t asn_DEF_PsidGroupPermissions = { asn_DEF_PsidGroupPermissions_tags_1, /* Same as above */ sizeof(asn_DEF_PsidGroupPermissions_tags_1) /sizeof(asn_DEF_PsidGroupPermissions_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_PsidGroupPermissions_1, 4, /* Elements count */ &asn_SPC_PsidGroupPermissions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/PsidGroupPermissions.h b/certgen/asncodec/PsidGroupPermissions.h index cb8268a..b335f34 100644 --- a/certgen/asncodec/PsidGroupPermissions.h +++ b/certgen/asncodec/PsidGroupPermissions.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _PsidGroupPermissions_H_ -#define _PsidGroupPermissions_H_ - - -#include /* Including external dependencies */ #include "SubjectPermissions.h" #include #include "EndEntityType.h" #include +#ifndef _PsidGroupPermissions_H_ +#define _PsidGroupPermissions_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -24,9 +24,9 @@ extern "C" { /* PsidGroupPermissions */ typedef struct PsidGroupPermissions { SubjectPermissions_t subjectPermissions; - long *minChainLength /* DEFAULT 1 */; - long chainLengthRange /* DEFAULT 0 */; - EndEntityType_t *eeType /* DEFAULT '00'HH */; + long *minChainLength; /* DEFAULT 1 */ + long chainLengthRange; /* DEFAULT 0 */ + EndEntityType_t *eeType; /* DEFAULT {app} */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/PsidSsp.c b/certgen/asncodec/PsidSsp.c index e62d408..d4d1c86 100644 --- a/certgen/asncodec/PsidSsp.c +++ b/certgen/asncodec/PsidSsp.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PsidSsp.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_PsidSsp_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Psid, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "psid" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_PsidSsp_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_ServiceSpecificPermissions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ssp" }, @@ -44,59 +60,27 @@ asn_SEQUENCE_specifics_t asn_SPC_PsidSsp_specs_1 = { 1, 0, /* Root/Additions */ -1, /* First extension addition */ }; - -static int -PsidSsp_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, -asn_app_consume_bytes_f *cb, void *app_key); - -static asn_TYPE_operation_t asn_OP_PsidSsp = { - SEQUENCE_free, - PsidSsp_print, - SEQUENCE_compare, - SEQUENCE_decode_ber, - SEQUENCE_encode_der, - SEQUENCE_decode_xer, - SEQUENCE_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - SEQUENCE_decode_oer, - SEQUENCE_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - SEQUENCE_decode_uper, - SEQUENCE_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - SEQUENCE_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; - asn_TYPE_descriptor_t asn_DEF_PsidSsp = { "PsidSsp", "PsidSsp", - &asn_OP_PsidSsp, + &asn_OP_SEQUENCE, asn_DEF_PsidSsp_tags_1, sizeof(asn_DEF_PsidSsp_tags_1) /sizeof(asn_DEF_PsidSsp_tags_1[0]), /* 1 */ asn_DEF_PsidSsp_tags_1, /* Same as above */ sizeof(asn_DEF_PsidSsp_tags_1) /sizeof(asn_DEF_PsidSsp_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_PsidSsp_1, 2, /* Elements count */ &asn_SPC_PsidSsp_specs_1 /* Additional specs */ }; -extern Psid_t _global_psid_value; - -static int -PsidSsp_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, -asn_app_consume_bytes_f *cb, void *app_key) { - PsidSsp_t * s = (PsidSsp_t *)sptr; - _global_psid_value = s->psid; - return SEQUENCE_print(td, sptr, ilevel, cb, app_key); -} diff --git a/certgen/asncodec/PsidSsp.h b/certgen/asncodec/PsidSsp.h index ded2066..876bb68 100644 --- a/certgen/asncodec/PsidSsp.h +++ b/certgen/asncodec/PsidSsp.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Psid.h" +#include #ifndef _PsidSsp_H_ #define _PsidSsp_H_ #include -/* Including external dependencies */ -#include "Psid.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -25,7 +25,7 @@ struct ServiceSpecificPermissions; /* PsidSsp */ typedef struct PsidSsp { Psid_t psid; - struct ServiceSpecificPermissions *ssp /* OPTIONAL */; + struct ServiceSpecificPermissions *ssp; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/PsidSspRange.c b/certgen/asncodec/PsidSspRange.c index 6831b1f..0d1b3f8 100644 --- a/certgen/asncodec/PsidSspRange.c +++ b/certgen/asncodec/PsidSspRange.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PsidSspRange.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_PsidSspRange_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Psid, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "psid" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_PsidSspRange_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_SspRange, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "sspRange" }, @@ -44,58 +60,27 @@ asn_SEQUENCE_specifics_t asn_SPC_PsidSspRange_specs_1 = { 1, 0, /* Root/Additions */ -1, /* First extension addition */ }; - -static int PsidSspRange_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key); - -Psid_t _global_psid_value = 0; - -static asn_TYPE_operation_t asn_OP_PsidSspRange = { - SEQUENCE_free, - PsidSspRange_print, - SEQUENCE_compare, - SEQUENCE_decode_ber, - SEQUENCE_encode_der, - SEQUENCE_decode_xer, - SEQUENCE_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - SEQUENCE_decode_oer, - SEQUENCE_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - SEQUENCE_decode_uper, - SEQUENCE_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - SEQUENCE_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; - asn_TYPE_descriptor_t asn_DEF_PsidSspRange = { "PsidSspRange", "PsidSspRange", - &asn_OP_PsidSspRange, + &asn_OP_SEQUENCE, asn_DEF_PsidSspRange_tags_1, sizeof(asn_DEF_PsidSspRange_tags_1) /sizeof(asn_DEF_PsidSspRange_tags_1[0]), /* 1 */ asn_DEF_PsidSspRange_tags_1, /* Same as above */ sizeof(asn_DEF_PsidSspRange_tags_1) /sizeof(asn_DEF_PsidSspRange_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_PsidSspRange_1, 2, /* Elements count */ &asn_SPC_PsidSspRange_specs_1 /* Additional specs */ }; -static int -PsidSspRange_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, -asn_app_consume_bytes_f *cb, void *app_key) { - PsidSspRange_t * s = (PsidSspRange_t *)sptr; - _global_psid_value = s->psid; - return SEQUENCE_print(td, sptr, ilevel, cb, app_key); -} diff --git a/certgen/asncodec/PsidSspRange.h b/certgen/asncodec/PsidSspRange.h index 38bbbe1..fed0881 100644 --- a/certgen/asncodec/PsidSspRange.h +++ b/certgen/asncodec/PsidSspRange.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Psid.h" +#include #ifndef _PsidSspRange_H_ #define _PsidSspRange_H_ #include -/* Including external dependencies */ -#include "Psid.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -25,7 +25,7 @@ struct SspRange; /* PsidSspRange */ typedef struct PsidSspRange { Psid_t psid; - struct SspRange *sspRange /* OPTIONAL */; + struct SspRange *sspRange; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/PublicEncryptionKey.c b/certgen/asncodec/PublicEncryptionKey.c index ba3a719..9fe8e9a 100644 --- a/certgen/asncodec/PublicEncryptionKey.c +++ b/certgen/asncodec/PublicEncryptionKey.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PublicEncryptionKey.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_PublicEncryptionKey_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SymmAlgorithm, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "supportedSymmAlg" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_PublicEncryptionKey_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_BasePublicEncryptionKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "publicKey" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_PublicEncryptionKey = { asn_DEF_PublicEncryptionKey_tags_1, /* Same as above */ sizeof(asn_DEF_PublicEncryptionKey_tags_1) /sizeof(asn_DEF_PublicEncryptionKey_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_PublicEncryptionKey_1, 2, /* Elements count */ &asn_SPC_PublicEncryptionKey_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/PublicEncryptionKey.h b/certgen/asncodec/PublicEncryptionKey.h index 68e1bc9..872c4aa 100644 --- a/certgen/asncodec/PublicEncryptionKey.h +++ b/certgen/asncodec/PublicEncryptionKey.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _PublicEncryptionKey_H_ -#define _PublicEncryptionKey_H_ - - -#include /* Including external dependencies */ #include "SymmAlgorithm.h" #include "BasePublicEncryptionKey.h" #include +#ifndef _PublicEncryptionKey_H_ +#define _PublicEncryptionKey_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/PublicKeys.c b/certgen/asncodec/PublicKeys.c index 58ccd7c..fab3946 100644 --- a/certgen/asncodec/PublicKeys.c +++ b/certgen/asncodec/PublicKeys.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PublicKeys.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_PublicKeys_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_PublicVerificationKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "verificationKey" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_PublicKeys_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PublicEncryptionKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "encryptionKey" }, @@ -54,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_PublicKeys = { asn_DEF_PublicKeys_tags_1, /* Same as above */ sizeof(asn_DEF_PublicKeys_tags_1) /sizeof(asn_DEF_PublicKeys_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_PublicKeys_1, 2, /* Elements count */ &asn_SPC_PublicKeys_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/PublicKeys.h b/certgen/asncodec/PublicKeys.h index 0a2d8a5..67177b7 100644 --- a/certgen/asncodec/PublicKeys.h +++ b/certgen/asncodec/PublicKeys.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "PublicVerificationKey.h" +#include #ifndef _PublicKeys_H_ #define _PublicKeys_H_ #include -/* Including external dependencies */ -#include "PublicVerificationKey.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -25,7 +25,7 @@ struct PublicEncryptionKey; /* PublicKeys */ typedef struct PublicKeys { PublicVerificationKey_t verificationKey; - struct PublicEncryptionKey *encryptionKey /* OPTIONAL */; + struct PublicEncryptionKey *encryptionKey; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/PublicVerificationKey.c b/certgen/asncodec/PublicVerificationKey.c index 0e2dcab..0577ce2 100644 --- a/certgen/asncodec/PublicVerificationKey.c +++ b/certgen/asncodec/PublicVerificationKey.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "PublicVerificationKey.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_PublicVerificationKey_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_PublicVerificationKey_1[] = { { ATF_NOFLAGS, 0, offsetof(struct PublicVerificationKey, choice.ecdsaNistP256), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP256CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecdsaNistP256" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_PublicVerificationKey_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP256CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecdsaBrainpoolP256r1" }, @@ -34,15 +52,59 @@ asn_TYPE_member_t asn_MBR_PublicVerificationKey_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_EccP384CurvePoint, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecdsaBrainpoolP384r1" }, + { ATF_NOFLAGS, 0, offsetof(struct PublicVerificationKey, choice.ecdsaNistP384), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_EccP384CurvePoint, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ecdsaNistP384" + }, + { ATF_NOFLAGS, 0, offsetof(struct PublicVerificationKey, choice.ecsigSm2), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_EccP256CurvePoint, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ecsigSm2" + }, }; static const asn_TYPE_tag2member_t asn_MAP_PublicVerificationKey_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ecdsaNistP256 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ecdsaBrainpoolP256r1 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ecdsaBrainpoolP384r1 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ecdsaBrainpoolP384r1 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ecdsaNistP384 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* ecsigSm2 */ }; asn_CHOICE_specifics_t asn_SPC_PublicVerificationKey_specs_1 = { sizeof(struct PublicVerificationKey), @@ -50,7 +112,7 @@ asn_CHOICE_specifics_t asn_SPC_PublicVerificationKey_specs_1 = { offsetof(struct PublicVerificationKey, present), sizeof(((struct PublicVerificationKey *)0)->present), asn_MAP_PublicVerificationKey_tag2el_1, - 3, /* Count of tags in the map */ + 5, /* Count of tags in the map */ 0, 0, 2 /* Extensions start */ }; @@ -62,9 +124,17 @@ asn_TYPE_descriptor_t asn_DEF_PublicVerificationKey = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_PublicVerificationKey_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_PublicVerificationKey_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_PublicVerificationKey_1, - 3, /* Elements count */ + 5, /* Elements count */ &asn_SPC_PublicVerificationKey_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/PublicVerificationKey.h b/certgen/asncodec/PublicVerificationKey.h index 360648f..b8035f0 100644 --- a/certgen/asncodec/PublicVerificationKey.h +++ b/certgen/asncodec/PublicVerificationKey.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _PublicVerificationKey_H_ -#define _PublicVerificationKey_H_ - - -#include /* Including external dependencies */ #include "EccP256CurvePoint.h" #include "EccP384CurvePoint.h" #include +#ifndef _PublicVerificationKey_H_ +#define _PublicVerificationKey_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -26,7 +26,9 @@ typedef enum PublicVerificationKey_PR { PublicVerificationKey_PR_ecdsaNistP256, PublicVerificationKey_PR_ecdsaBrainpoolP256r1, /* Extensions may appear below */ - PublicVerificationKey_PR_ecdsaBrainpoolP384r1 + PublicVerificationKey_PR_ecdsaBrainpoolP384r1, + PublicVerificationKey_PR_ecdsaNistP384, + PublicVerificationKey_PR_ecsigSm2 } PublicVerificationKey_PR; /* PublicVerificationKey */ @@ -40,6 +42,8 @@ typedef struct PublicVerificationKey { * possible extensions are below. */ EccP384CurvePoint_t ecdsaBrainpoolP384r1; + EccP384CurvePoint_t ecdsaNistP384; + EccP256CurvePoint_t ecsigSm2; } choice; /* Context for parsing across buffer boundaries */ @@ -49,7 +53,7 @@ typedef struct PublicVerificationKey { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_PublicVerificationKey; extern asn_CHOICE_specifics_t asn_SPC_PublicVerificationKey_specs_1; -extern asn_TYPE_member_t asn_MBR_PublicVerificationKey_1[3]; +extern asn_TYPE_member_t asn_MBR_PublicVerificationKey_1[5]; #ifdef __cplusplus } diff --git a/certgen/asncodec/RaAcaCertRequest.c b/certgen/asncodec/RaAcaCertRequest.c new file mode 100644 index 0000000..4b8e6d6 --- /dev/null +++ b/certgen/asncodec/RaAcaCertRequest.c @@ -0,0 +1,230 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaAcaCertRequest.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_tbsCert_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_tbsCert_constr_8 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_RaAcaCertRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RaAcaCertRequest, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaAcaCertRequest, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaAcaCertRequest, type), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CertificateType, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "type" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaAcaCertRequest, flags), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaAcaCertRequestFlags, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "flags" + }, + { ATF_POINTER, 2, offsetof(struct RaAcaCertRequest, linkageInfo), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LinkageInfo, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "linkageInfo" + }, + { ATF_POINTER, 1, offsetof(struct RaAcaCertRequest, certEncKey), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_PublicEncryptionKey, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certEncKey" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaAcaCertRequest, tbsCert), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedCertificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_tbsCert_constr_8, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_tbsCert_constraint_1 + }, + 0, 0, /* No default value */ + "tbsCert" + }, +}; +static const int asn_MAP_RaAcaCertRequest_oms_1[] = { 4, 5 }; +static const ber_tlv_tag_t asn_DEF_RaAcaCertRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_RaAcaCertRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* type */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* flags */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* linkageInfo */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* certEncKey */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* tbsCert */ +}; +asn_SEQUENCE_specifics_t asn_SPC_RaAcaCertRequest_specs_1 = { + sizeof(struct RaAcaCertRequest), + offsetof(struct RaAcaCertRequest, _asn_ctx), + asn_MAP_RaAcaCertRequest_tag2el_1, + 7, /* Count of tags in the map */ + asn_MAP_RaAcaCertRequest_oms_1, /* Optional members */ + 2, 0, /* Root/Additions */ + 7, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_RaAcaCertRequest = { + "RaAcaCertRequest", + "RaAcaCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_RaAcaCertRequest_tags_1, + sizeof(asn_DEF_RaAcaCertRequest_tags_1) + /sizeof(asn_DEF_RaAcaCertRequest_tags_1[0]), /* 1 */ + asn_DEF_RaAcaCertRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_RaAcaCertRequest_tags_1) + /sizeof(asn_DEF_RaAcaCertRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_RaAcaCertRequest_1, + 7, /* Elements count */ + &asn_SPC_RaAcaCertRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaAcaCertRequest.h b/certgen/asncodec/RaAcaCertRequest.h new file mode 100644 index 0000000..dffec11 --- /dev/null +++ b/certgen/asncodec/RaAcaCertRequest.h @@ -0,0 +1,62 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "CertificateType.h" +#include "RaAcaCertRequestFlags.h" +#include "ToBeSignedCertificate.h" +#include +#ifndef _RaAcaCertRequest_H_ +#define _RaAcaCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct LinkageInfo; +struct PublicEncryptionKey; + +/* RaAcaCertRequest */ +typedef struct RaAcaCertRequest { + Uint8_t version; + Time32_t generationTime; + CertificateType_t type; + RaAcaCertRequestFlags_t flags; + struct LinkageInfo *linkageInfo; /* OPTIONAL */ + struct PublicEncryptionKey *certEncKey; /* OPTIONAL */ + ToBeSignedCertificate_t tbsCert; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} RaAcaCertRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaAcaCertRequest; +extern asn_SEQUENCE_specifics_t asn_SPC_RaAcaCertRequest_specs_1; +extern asn_TYPE_member_t asn_MBR_RaAcaCertRequest_1[7]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "LinkageInfo.h" +#include "PublicEncryptionKey.h" + +#endif /* _RaAcaCertRequest_H_ */ +#include diff --git a/certgen/asncodec/RaAcaCertRequestFlags.c b/certgen/asncodec/RaAcaCertRequestFlags.c new file mode 100644 index 0000000..bab315e --- /dev/null +++ b/certgen/asncodec/RaAcaCertRequestFlags.c @@ -0,0 +1,75 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaAcaCertRequestFlags.h" + +int +RaAcaCertRequestFlags_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + if(st->size > 0) { + /* Size in bits */ + size = 8 * st->size - (st->bits_unused & 0x07); + } else { + size = 0; + } + + if((size == 8)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using BIT_STRING, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RaAcaCertRequestFlags_constr_1 CC_NOTUSED = { + { 0, 0 }, + 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RaAcaCertRequestFlags_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RaAcaCertRequestFlags = { + "RaAcaCertRequestFlags", + "RaAcaCertRequestFlags", + &asn_OP_BIT_STRING, + asn_DEF_RaAcaCertRequestFlags_tags_1, + sizeof(asn_DEF_RaAcaCertRequestFlags_tags_1) + /sizeof(asn_DEF_RaAcaCertRequestFlags_tags_1[0]), /* 1 */ + asn_DEF_RaAcaCertRequestFlags_tags_1, /* Same as above */ + sizeof(asn_DEF_RaAcaCertRequestFlags_tags_1) + /sizeof(asn_DEF_RaAcaCertRequestFlags_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RaAcaCertRequestFlags_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RaAcaCertRequestFlags_constraint + }, + 0, 0, /* Defined elsewhere */ + &asn_SPC_BIT_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaAcaCertRequestFlags.h b/certgen/asncodec/RaAcaCertRequestFlags.h new file mode 100644 index 0000000..fa7990c --- /dev/null +++ b/certgen/asncodec/RaAcaCertRequestFlags.h @@ -0,0 +1,45 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1AcaRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _RaAcaCertRequestFlags_H_ +#define _RaAcaCertRequestFlags_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum RaAcaCertRequestFlags { + RaAcaCertRequestFlags_butterflyExplicit = 0, + RaAcaCertRequestFlags_cubk = 1 +} e_RaAcaCertRequestFlags; + +/* RaAcaCertRequestFlags */ +typedef BIT_STRING_t RaAcaCertRequestFlags_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaAcaCertRequestFlags; +asn_struct_free_f RaAcaCertRequestFlags_free; +asn_struct_print_f RaAcaCertRequestFlags_print; +asn_constr_check_f RaAcaCertRequestFlags_constraint; +xer_type_decoder_f RaAcaCertRequestFlags_decode_xer; +xer_type_encoder_f RaAcaCertRequestFlags_encode_xer; +oer_type_decoder_f RaAcaCertRequestFlags_decode_oer; +oer_type_encoder_f RaAcaCertRequestFlags_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaAcaCertRequestFlags_H_ */ +#include diff --git a/certgen/asncodec/RaAcaCertRequestSpdu.c b/certgen/asncodec/RaAcaCertRequestSpdu.c new file mode 100644 index 0000000..7d2a604 --- /dev/null +++ b/certgen/asncodec/RaAcaCertRequestSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaAcaCertRequestSpdu.h" + +int +RaAcaCertRequestSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_SignedCertRequest_290P1, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RaAcaCertRequestSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RaAcaCertRequestSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RaAcaCertRequestSpdu = { + "RaAcaCertRequestSpdu", + "RaAcaCertRequestSpdu", + &asn_OP_SEQUENCE, + asn_DEF_RaAcaCertRequestSpdu_tags_1, + sizeof(asn_DEF_RaAcaCertRequestSpdu_tags_1) + /sizeof(asn_DEF_RaAcaCertRequestSpdu_tags_1[0]), /* 1 */ + asn_DEF_RaAcaCertRequestSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_RaAcaCertRequestSpdu_tags_1) + /sizeof(asn_DEF_RaAcaCertRequestSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RaAcaCertRequestSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RaAcaCertRequestSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaAcaCertRequestSpdu.h b/certgen/asncodec/RaAcaCertRequestSpdu.h new file mode 100644 index 0000000..a9e2461 --- /dev/null +++ b/certgen/asncodec/RaAcaCertRequestSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-SignedCertRequest.h" +#ifndef _RaAcaCertRequestSpdu_H_ +#define _RaAcaCertRequestSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaAcaCertRequestSpdu */ +typedef Ieee1609Dot2Data_SignedCertRequest_290P1_t RaAcaCertRequestSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaAcaCertRequestSpdu; +asn_struct_free_f RaAcaCertRequestSpdu_free; +asn_struct_print_f RaAcaCertRequestSpdu_print; +asn_constr_check_f RaAcaCertRequestSpdu_constraint; +xer_type_decoder_f RaAcaCertRequestSpdu_decode_xer; +xer_type_encoder_f RaAcaCertRequestSpdu_encode_xer; +oer_type_decoder_f RaAcaCertRequestSpdu_decode_oer; +oer_type_encoder_f RaAcaCertRequestSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaAcaCertRequestSpdu_H_ */ +#include diff --git a/certgen/asncodec/RaCamBatchRequest.c b/certgen/asncodec/RaCamBatchRequest.c new file mode 100644 index 0000000..ae131df --- /dev/null +++ b/certgen/asncodec/RaCamBatchRequest.c @@ -0,0 +1,216 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaCamBatchRequest.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_eeId_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 5)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_eeId_constr_3 CC_NOTUSED = { + { 0, 0 }, + 5 /* (SIZE(5..5)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_periodList_4[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_periodList_tags_4[] = { + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_periodList_specs_4 = { + sizeof(struct RaCamBatchRequest__periodList), + offsetof(struct RaCamBatchRequest__periodList, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_periodList_4 = { + "periodList", + "periodList", + &asn_OP_SEQUENCE_OF, + asn_DEF_periodList_tags_4, + sizeof(asn_DEF_periodList_tags_4) + /sizeof(asn_DEF_periodList_tags_4[0]) - 1, /* 1 */ + asn_DEF_periodList_tags_4, /* Same as above */ + sizeof(asn_DEF_periodList_tags_4) + /sizeof(asn_DEF_periodList_tags_4[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_periodList_4, + 1, /* Single element */ + &asn_SPC_periodList_specs_4 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_RaCamBatchRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RaCamBatchRequest, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaCamBatchRequest, eeId), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_eeId_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_eeId_constraint_1 + }, + 0, 0, /* No default value */ + "eeId" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaCamBatchRequest, periodList), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + 0, + &asn_DEF_periodList_4, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "periodList" + }, +}; +static const ber_tlv_tag_t asn_DEF_RaCamBatchRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_RaCamBatchRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* eeId */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* periodList */ +}; +asn_SEQUENCE_specifics_t asn_SPC_RaCamBatchRequest_specs_1 = { + sizeof(struct RaCamBatchRequest), + offsetof(struct RaCamBatchRequest, _asn_ctx), + asn_MAP_RaCamBatchRequest_tag2el_1, + 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 3, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_RaCamBatchRequest = { + "RaCamBatchRequest", + "RaCamBatchRequest", + &asn_OP_SEQUENCE, + asn_DEF_RaCamBatchRequest_tags_1, + sizeof(asn_DEF_RaCamBatchRequest_tags_1) + /sizeof(asn_DEF_RaCamBatchRequest_tags_1[0]), /* 1 */ + asn_DEF_RaCamBatchRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_RaCamBatchRequest_tags_1) + /sizeof(asn_DEF_RaCamBatchRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_RaCamBatchRequest_1, + 3, /* Elements count */ + &asn_SPC_RaCamBatchRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaCamBatchRequest.h b/certgen/asncodec/RaCamBatchRequest.h new file mode 100644 index 0000000..05da416 --- /dev/null +++ b/certgen/asncodec/RaCamBatchRequest.h @@ -0,0 +1,55 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CamRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#include "IValue.h" +#include +#include +#include +#ifndef _RaCamBatchRequest_H_ +#define _RaCamBatchRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaCamBatchRequest */ +typedef struct RaCamBatchRequest { + Uint8_t version; + OCTET_STRING_t eeId; + struct RaCamBatchRequest__periodList { + A_SEQUENCE_OF(IValue_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } periodList; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} RaCamBatchRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaCamBatchRequest; +extern asn_SEQUENCE_specifics_t asn_SPC_RaCamBatchRequest_specs_1; +extern asn_TYPE_member_t asn_MBR_RaCamBatchRequest_1[3]; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaCamBatchRequest_H_ */ +#include diff --git a/certgen/asncodec/RaEeCertAck.c b/certgen/asncodec/RaEeCertAck.c new file mode 100644 index 0000000..a5d6c55 --- /dev/null +++ b/certgen/asncodec/RaEeCertAck.c @@ -0,0 +1,170 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaEeCertAck.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_RaEeCertAck_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertAck, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertAck, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertAck, requestHash), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "requestHash" + }, + { ATF_POINTER, 1, offsetof(struct RaEeCertAck, firstI), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "firstI" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertAck, nextDlTime), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "nextDlTime" + }, +}; +static const int asn_MAP_RaEeCertAck_oms_1[] = { 3 }; +static const ber_tlv_tag_t asn_DEF_RaEeCertAck_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_RaEeCertAck_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* requestHash */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* firstI */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* nextDlTime */ +}; +asn_SEQUENCE_specifics_t asn_SPC_RaEeCertAck_specs_1 = { + sizeof(struct RaEeCertAck), + offsetof(struct RaEeCertAck, _asn_ctx), + asn_MAP_RaEeCertAck_tag2el_1, + 5, /* Count of tags in the map */ + asn_MAP_RaEeCertAck_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 5, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_RaEeCertAck = { + "RaEeCertAck", + "RaEeCertAck", + &asn_OP_SEQUENCE, + asn_DEF_RaEeCertAck_tags_1, + sizeof(asn_DEF_RaEeCertAck_tags_1) + /sizeof(asn_DEF_RaEeCertAck_tags_1[0]), /* 1 */ + asn_DEF_RaEeCertAck_tags_1, /* Same as above */ + sizeof(asn_DEF_RaEeCertAck_tags_1) + /sizeof(asn_DEF_RaEeCertAck_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_RaEeCertAck_1, + 5, /* Elements count */ + &asn_SPC_RaEeCertAck_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaEeCertAck.h b/certgen/asncodec/RaEeCertAck.h new file mode 100644 index 0000000..64290be --- /dev/null +++ b/certgen/asncodec/RaEeCertAck.h @@ -0,0 +1,51 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "HashedId8.h" +#include "IValue.h" +#include +#ifndef _RaEeCertAck_H_ +#define _RaEeCertAck_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaEeCertAck */ +typedef struct RaEeCertAck { + Uint8_t version; + Time32_t generationTime; + HashedId8_t requestHash; + IValue_t *firstI; /* OPTIONAL */ + Time32_t nextDlTime; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} RaEeCertAck_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaEeCertAck; +extern asn_SEQUENCE_specifics_t asn_SPC_RaEeCertAck_specs_1; +extern asn_TYPE_member_t asn_MBR_RaEeCertAck_1[5]; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaEeCertAck_H_ */ +#include diff --git a/certgen/asncodec/RaEeCertAckSpdu.c b/certgen/asncodec/RaEeCertAckSpdu.c new file mode 100644 index 0000000..159929c --- /dev/null +++ b/certgen/asncodec/RaEeCertAckSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaEeCertAckSpdu.h" + +int +RaEeCertAckSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RaEeCertAckSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RaEeCertAckSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RaEeCertAckSpdu = { + "RaEeCertAckSpdu", + "RaEeCertAckSpdu", + &asn_OP_SEQUENCE, + asn_DEF_RaEeCertAckSpdu_tags_1, + sizeof(asn_DEF_RaEeCertAckSpdu_tags_1) + /sizeof(asn_DEF_RaEeCertAckSpdu_tags_1[0]), /* 1 */ + asn_DEF_RaEeCertAckSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_RaEeCertAckSpdu_tags_1) + /sizeof(asn_DEF_RaEeCertAckSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RaEeCertAckSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RaEeCertAckSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaEeCertAckSpdu.h b/certgen/asncodec/RaEeCertAckSpdu.h new file mode 100644 index 0000000..a15737a --- /dev/null +++ b/certgen/asncodec/RaEeCertAckSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _RaEeCertAckSpdu_H_ +#define _RaEeCertAckSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaEeCertAckSpdu */ +typedef Ieee1609Dot2Data_Signed_228P2_t RaEeCertAckSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaEeCertAckSpdu; +asn_struct_free_f RaEeCertAckSpdu_free; +asn_struct_print_f RaEeCertAckSpdu_print; +asn_constr_check_f RaEeCertAckSpdu_constraint; +xer_type_decoder_f RaEeCertAckSpdu_decode_xer; +xer_type_encoder_f RaEeCertAckSpdu_encode_xer; +oer_type_decoder_f RaEeCertAckSpdu_decode_oer; +oer_type_encoder_f RaEeCertAckSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaEeCertAckSpdu_H_ */ +#include diff --git a/certgen/asncodec/RaEeCertAndAcpcInfoSpdu.c b/certgen/asncodec/RaEeCertAndAcpcInfoSpdu.c new file mode 100644 index 0000000..634c584 --- /dev/null +++ b/certgen/asncodec/RaEeCertAndAcpcInfoSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaEeCertAndAcpcInfoSpdu.h" + +int +RaEeCertAndAcpcInfoSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RaEeCertAndAcpcInfoSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RaEeCertAndAcpcInfoSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RaEeCertAndAcpcInfoSpdu = { + "RaEeCertAndAcpcInfoSpdu", + "RaEeCertAndAcpcInfoSpdu", + &asn_OP_SEQUENCE, + asn_DEF_RaEeCertAndAcpcInfoSpdu_tags_1, + sizeof(asn_DEF_RaEeCertAndAcpcInfoSpdu_tags_1) + /sizeof(asn_DEF_RaEeCertAndAcpcInfoSpdu_tags_1[0]), /* 1 */ + asn_DEF_RaEeCertAndAcpcInfoSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_RaEeCertAndAcpcInfoSpdu_tags_1) + /sizeof(asn_DEF_RaEeCertAndAcpcInfoSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RaEeCertAndAcpcInfoSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RaEeCertAndAcpcInfoSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaEeCertAndAcpcInfoSpdu.h b/certgen/asncodec/RaEeCertAndAcpcInfoSpdu.h new file mode 100644 index 0000000..81b1ba0 --- /dev/null +++ b/certgen/asncodec/RaEeCertAndAcpcInfoSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _RaEeCertAndAcpcInfoSpdu_H_ +#define _RaEeCertAndAcpcInfoSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaEeCertAndAcpcInfoSpdu */ +typedef Ieee1609Dot2Data_Signed_228P2_t RaEeCertAndAcpcInfoSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaEeCertAndAcpcInfoSpdu; +asn_struct_free_f RaEeCertAndAcpcInfoSpdu_free; +asn_struct_print_f RaEeCertAndAcpcInfoSpdu_print; +asn_constr_check_f RaEeCertAndAcpcInfoSpdu_constraint; +xer_type_decoder_f RaEeCertAndAcpcInfoSpdu_decode_xer; +xer_type_encoder_f RaEeCertAndAcpcInfoSpdu_encode_xer; +oer_type_decoder_f RaEeCertAndAcpcInfoSpdu_decode_oer; +oer_type_encoder_f RaEeCertAndAcpcInfoSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaEeCertAndAcpcInfoSpdu_H_ */ +#include diff --git a/certgen/asncodec/RaEeCertInfo.c b/certgen/asncodec/RaEeCertInfo.c new file mode 100644 index 0000000..94976d2 --- /dev/null +++ b/certgen/asncodec/RaEeCertInfo.c @@ -0,0 +1,188 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaEeCertInfo.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_RaEeCertInfo_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertInfo, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertInfo, generationTime), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "generationTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertInfo, currentI), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "currentI" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertInfo, requestHash), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "requestHash" + }, + { ATF_NOFLAGS, 0, offsetof(struct RaEeCertInfo, nextDlTime), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "nextDlTime" + }, + { ATF_POINTER, 1, offsetof(struct RaEeCertInfo, acpcTreeId), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcpcTreeId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "acpcTreeId" + }, +}; +static const int asn_MAP_RaEeCertInfo_oms_1[] = { 5 }; +static const ber_tlv_tag_t asn_DEF_RaEeCertInfo_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_RaEeCertInfo_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* generationTime */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* currentI */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* requestHash */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* nextDlTime */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* acpcTreeId */ +}; +asn_SEQUENCE_specifics_t asn_SPC_RaEeCertInfo_specs_1 = { + sizeof(struct RaEeCertInfo), + offsetof(struct RaEeCertInfo, _asn_ctx), + asn_MAP_RaEeCertInfo_tag2el_1, + 6, /* Count of tags in the map */ + asn_MAP_RaEeCertInfo_oms_1, /* Optional members */ + 1, 0, /* Root/Additions */ + 6, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_RaEeCertInfo = { + "RaEeCertInfo", + "RaEeCertInfo", + &asn_OP_SEQUENCE, + asn_DEF_RaEeCertInfo_tags_1, + sizeof(asn_DEF_RaEeCertInfo_tags_1) + /sizeof(asn_DEF_RaEeCertInfo_tags_1[0]), /* 1 */ + asn_DEF_RaEeCertInfo_tags_1, /* Same as above */ + sizeof(asn_DEF_RaEeCertInfo_tags_1) + /sizeof(asn_DEF_RaEeCertInfo_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_RaEeCertInfo_1, + 6, /* Elements count */ + &asn_SPC_RaEeCertInfo_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaEeCertInfo.h b/certgen/asncodec/RaEeCertInfo.h new file mode 100644 index 0000000..58aae3e --- /dev/null +++ b/certgen/asncodec/RaEeCertInfo.h @@ -0,0 +1,53 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1EeRaInterface" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "Time32.h" +#include "IValue.h" +#include "HashedId8.h" +#include "AcpcTreeId.h" +#include +#ifndef _RaEeCertInfo_H_ +#define _RaEeCertInfo_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaEeCertInfo */ +typedef struct RaEeCertInfo { + Uint8_t version; + Time32_t generationTime; + IValue_t currentI; + HashedId8_t requestHash; + Time32_t nextDlTime; + AcpcTreeId_t *acpcTreeId; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} RaEeCertInfo_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaEeCertInfo; +extern asn_SEQUENCE_specifics_t asn_SPC_RaEeCertInfo_specs_1; +extern asn_TYPE_member_t asn_MBR_RaEeCertInfo_1[6]; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaEeCertInfo_H_ */ +#include diff --git a/certgen/asncodec/RaEeCertInfoSpdu.c b/certgen/asncodec/RaEeCertInfoSpdu.c new file mode 100644 index 0000000..e1024bb --- /dev/null +++ b/certgen/asncodec/RaEeCertInfoSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaEeCertInfoSpdu.h" + +int +RaEeCertInfoSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Unsecured_216P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RaEeCertInfoSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RaEeCertInfoSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RaEeCertInfoSpdu = { + "RaEeCertInfoSpdu", + "RaEeCertInfoSpdu", + &asn_OP_SEQUENCE, + asn_DEF_RaEeCertInfoSpdu_tags_1, + sizeof(asn_DEF_RaEeCertInfoSpdu_tags_1) + /sizeof(asn_DEF_RaEeCertInfoSpdu_tags_1[0]), /* 1 */ + asn_DEF_RaEeCertInfoSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_RaEeCertInfoSpdu_tags_1) + /sizeof(asn_DEF_RaEeCertInfoSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RaEeCertInfoSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RaEeCertInfoSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaEeCertInfoSpdu.h b/certgen/asncodec/RaEeCertInfoSpdu.h new file mode 100644 index 0000000..968ade8 --- /dev/null +++ b/certgen/asncodec/RaEeCertInfoSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Unsecured.h" +#ifndef _RaEeCertInfoSpdu_H_ +#define _RaEeCertInfoSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaEeCertInfoSpdu */ +typedef Ieee1609Dot2Data_Unsecured_216P0_t RaEeCertInfoSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaEeCertInfoSpdu; +asn_struct_free_f RaEeCertInfoSpdu_free; +asn_struct_print_f RaEeCertInfoSpdu_print; +asn_constr_check_f RaEeCertInfoSpdu_constraint; +xer_type_decoder_f RaEeCertInfoSpdu_decode_xer; +xer_type_encoder_f RaEeCertInfoSpdu_encode_xer; +oer_type_decoder_f RaEeCertInfoSpdu_decode_oer; +oer_type_encoder_f RaEeCertInfoSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaEeCertInfoSpdu_H_ */ +#include diff --git a/certgen/asncodec/RaEeEnrollmentCertAckSpdu.c b/certgen/asncodec/RaEeEnrollmentCertAckSpdu.c new file mode 100644 index 0000000..61caa27 --- /dev/null +++ b/certgen/asncodec/RaEeEnrollmentCertAckSpdu.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaEeEnrollmentCertAckSpdu.h" + +int +RaEeEnrollmentCertAckSpdu_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RaEeEnrollmentCertAckSpdu_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RaEeEnrollmentCertAckSpdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RaEeEnrollmentCertAckSpdu = { + "RaEeEnrollmentCertAckSpdu", + "RaEeEnrollmentCertAckSpdu", + &asn_OP_SEQUENCE, + asn_DEF_RaEeEnrollmentCertAckSpdu_tags_1, + sizeof(asn_DEF_RaEeEnrollmentCertAckSpdu_tags_1) + /sizeof(asn_DEF_RaEeEnrollmentCertAckSpdu_tags_1[0]), /* 1 */ + asn_DEF_RaEeEnrollmentCertAckSpdu_tags_1, /* Same as above */ + sizeof(asn_DEF_RaEeEnrollmentCertAckSpdu_tags_1) + /sizeof(asn_DEF_RaEeEnrollmentCertAckSpdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RaEeEnrollmentCertAckSpdu_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RaEeEnrollmentCertAckSpdu_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaEeEnrollmentCertAckSpdu.h b/certgen/asncodec/RaEeEnrollmentCertAckSpdu.h new file mode 100644 index 0000000..8f74385 --- /dev/null +++ b/certgen/asncodec/RaEeEnrollmentCertAckSpdu.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _RaEeEnrollmentCertAckSpdu_H_ +#define _RaEeEnrollmentCertAckSpdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaEeEnrollmentCertAckSpdu */ +typedef Ieee1609Dot2Data_Signed_228P2_t RaEeEnrollmentCertAckSpdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaEeEnrollmentCertAckSpdu; +asn_struct_free_f RaEeEnrollmentCertAckSpdu_free; +asn_struct_print_f RaEeEnrollmentCertAckSpdu_print; +asn_constr_check_f RaEeEnrollmentCertAckSpdu_constraint; +xer_type_decoder_f RaEeEnrollmentCertAckSpdu_decode_xer; +xer_type_encoder_f RaEeEnrollmentCertAckSpdu_encode_xer; +oer_type_decoder_f RaEeEnrollmentCertAckSpdu_decode_oer; +oer_type_encoder_f RaEeEnrollmentCertAckSpdu_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaEeEnrollmentCertAckSpdu_H_ */ +#include diff --git a/certgen/asncodec/RaSsp.c b/certgen/asncodec/RaSsp.c new file mode 100644 index 0000000..422fd9d --- /dev/null +++ b/certgen/asncodec/RaSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RaSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_RaSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RaSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_RaSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_RaSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_RaSsp_specs_1 = { + sizeof(struct RaSsp), + offsetof(struct RaSsp, _asn_ctx), + asn_MAP_RaSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_RaSsp = { + "RaSsp", + "RaSsp", + &asn_OP_SEQUENCE, + asn_DEF_RaSsp_tags_1, + sizeof(asn_DEF_RaSsp_tags_1) + /sizeof(asn_DEF_RaSsp_tags_1[0]), /* 1 */ + asn_DEF_RaSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_RaSsp_tags_1) + /sizeof(asn_DEF_RaSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_RaSsp_1, + 1, /* Elements count */ + &asn_SPC_RaSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RaSsp.h b/certgen/asncodec/RaSsp.h new file mode 100644 index 0000000..3b78d9d --- /dev/null +++ b/certgen/asncodec/RaSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _RaSsp_H_ +#define _RaSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RaSsp */ +typedef struct RaSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} RaSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RaSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_RaSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_RaSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _RaSsp_H_ */ +#include diff --git a/certgen/asncodec/RcaCertificateTrustListMessage.c b/certgen/asncodec/RcaCertificateTrustListMessage.c index 357c74d..9232ec6 100644 --- a/certgen/asncodec/RcaCertificateTrustListMessage.c +++ b/certgen/asncodec/RcaCertificateTrustListMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "RcaCertificateTrustListMessage.h" @@ -27,12 +27,14 @@ RcaCertificateTrustListMessage_constraint(const asn_TYPE_descriptor_t *td, const } /* - * This type is implemented using EtsiTs103097Data_Signed_60P0, + * This type is implemented using EtsiTs103097Data_Signed_63P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_RcaCertificateTrustListMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_RcaCertificateTrustListMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_RcaCertificateTrustListMessage = { asn_DEF_RcaCertificateTrustListMessage_tags_1, /* Same as above */ sizeof(asn_DEF_RcaCertificateTrustListMessage_tags_1) /sizeof(asn_DEF_RcaCertificateTrustListMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_RcaCertificateTrustListMessage_constr_1, 0, RcaCertificateTrustListMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RcaCertificateTrustListMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RcaCertificateTrustListMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/RcaCertificateTrustListMessage.h b/certgen/asncodec/RcaCertificateTrustListMessage.h index 1026cbd..c9e0e91 100644 --- a/certgen/asncodec/RcaCertificateTrustListMessage.h +++ b/certgen/asncodec/RcaCertificateTrustListMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" #ifndef _RcaCertificateTrustListMessage_H_ #define _RcaCertificateTrustListMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Signed.h" - #ifdef __cplusplus extern "C" { #endif /* RcaCertificateTrustListMessage */ -typedef EtsiTs103097Data_Signed_60P0_t RcaCertificateTrustListMessage_t; +typedef EtsiTs103097Data_Signed_63P0_t RcaCertificateTrustListMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_RcaCertificateTrustListMessage; asn_struct_free_f RcaCertificateTrustListMessage_free; asn_struct_print_f RcaCertificateTrustListMessage_print; asn_constr_check_f RcaCertificateTrustListMessage_constraint; -ber_type_decoder_f RcaCertificateTrustListMessage_decode_ber; -der_type_encoder_f RcaCertificateTrustListMessage_encode_der; xer_type_decoder_f RcaCertificateTrustListMessage_decode_xer; xer_type_encoder_f RcaCertificateTrustListMessage_encode_xer; oer_type_decoder_f RcaCertificateTrustListMessage_decode_oer; diff --git a/certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.c b/certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.c new file mode 100644 index 0000000..7846819 --- /dev/null +++ b/certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RcaDoubleSignedLinkCertificateMessage.h" + +int +RcaDoubleSignedLinkCertificateMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_Signed_63P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RcaDoubleSignedLinkCertificateMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RcaDoubleSignedLinkCertificateMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RcaDoubleSignedLinkCertificateMessage = { + "RcaDoubleSignedLinkCertificateMessage", + "RcaDoubleSignedLinkCertificateMessage", + &asn_OP_SEQUENCE, + asn_DEF_RcaDoubleSignedLinkCertificateMessage_tags_1, + sizeof(asn_DEF_RcaDoubleSignedLinkCertificateMessage_tags_1) + /sizeof(asn_DEF_RcaDoubleSignedLinkCertificateMessage_tags_1[0]), /* 1 */ + asn_DEF_RcaDoubleSignedLinkCertificateMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_RcaDoubleSignedLinkCertificateMessage_tags_1) + /sizeof(asn_DEF_RcaDoubleSignedLinkCertificateMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RcaDoubleSignedLinkCertificateMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RcaDoubleSignedLinkCertificateMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.h b/certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.h new file mode 100644 index 0000000..0e8155b --- /dev/null +++ b/certgen/asncodec/RcaDoubleSignedLinkCertificateMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" +#ifndef _RcaDoubleSignedLinkCertificateMessage_H_ +#define _RcaDoubleSignedLinkCertificateMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RcaDoubleSignedLinkCertificateMessage */ +typedef EtsiTs103097Data_Signed_63P0_t RcaDoubleSignedLinkCertificateMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RcaDoubleSignedLinkCertificateMessage; +asn_struct_free_f RcaDoubleSignedLinkCertificateMessage_free; +asn_struct_print_f RcaDoubleSignedLinkCertificateMessage_print; +asn_constr_check_f RcaDoubleSignedLinkCertificateMessage_constraint; +xer_type_decoder_f RcaDoubleSignedLinkCertificateMessage_decode_xer; +xer_type_encoder_f RcaDoubleSignedLinkCertificateMessage_encode_xer; +oer_type_decoder_f RcaDoubleSignedLinkCertificateMessage_decode_oer; +oer_type_encoder_f RcaDoubleSignedLinkCertificateMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RcaDoubleSignedLinkCertificateMessage_H_ */ +#include diff --git a/certgen/asncodec/RcaSingleSignedLinkCertificateMessage.c b/certgen/asncodec/RcaSingleSignedLinkCertificateMessage.c new file mode 100644 index 0000000..4b34b43 --- /dev/null +++ b/certgen/asncodec/RcaSingleSignedLinkCertificateMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RcaSingleSignedLinkCertificateMessage.h" + +int +RcaSingleSignedLinkCertificateMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_Signed_63P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_RcaSingleSignedLinkCertificateMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_RcaSingleSignedLinkCertificateMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_RcaSingleSignedLinkCertificateMessage = { + "RcaSingleSignedLinkCertificateMessage", + "RcaSingleSignedLinkCertificateMessage", + &asn_OP_SEQUENCE, + asn_DEF_RcaSingleSignedLinkCertificateMessage_tags_1, + sizeof(asn_DEF_RcaSingleSignedLinkCertificateMessage_tags_1) + /sizeof(asn_DEF_RcaSingleSignedLinkCertificateMessage_tags_1[0]), /* 1 */ + asn_DEF_RcaSingleSignedLinkCertificateMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_RcaSingleSignedLinkCertificateMessage_tags_1) + /sizeof(asn_DEF_RcaSingleSignedLinkCertificateMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RcaSingleSignedLinkCertificateMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + RcaSingleSignedLinkCertificateMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RcaSingleSignedLinkCertificateMessage.h b/certgen/asncodec/RcaSingleSignedLinkCertificateMessage.h new file mode 100644 index 0000000..b78abf4 --- /dev/null +++ b/certgen/asncodec/RcaSingleSignedLinkCertificateMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" +#ifndef _RcaSingleSignedLinkCertificateMessage_H_ +#define _RcaSingleSignedLinkCertificateMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RcaSingleSignedLinkCertificateMessage */ +typedef EtsiTs103097Data_Signed_63P0_t RcaSingleSignedLinkCertificateMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RcaSingleSignedLinkCertificateMessage; +asn_struct_free_f RcaSingleSignedLinkCertificateMessage_free; +asn_struct_print_f RcaSingleSignedLinkCertificateMessage_print; +asn_constr_check_f RcaSingleSignedLinkCertificateMessage_constraint; +xer_type_decoder_f RcaSingleSignedLinkCertificateMessage_decode_xer; +xer_type_encoder_f RcaSingleSignedLinkCertificateMessage_encode_xer; +oer_type_decoder_f RcaSingleSignedLinkCertificateMessage_decode_oer; +oer_type_encoder_f RcaSingleSignedLinkCertificateMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _RcaSingleSignedLinkCertificateMessage_H_ */ +#include diff --git a/certgen/asncodec/RecipientInfo.c b/certgen/asncodec/RecipientInfo.c index 3f4d0f9..a759529 100644 --- a/certgen/asncodec/RecipientInfo.c +++ b/certgen/asncodec/RecipientInfo.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "RecipientInfo.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_RecipientInfo_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_RecipientInfo_1[] = { { ATF_NOFLAGS, 0, offsetof(struct RecipientInfo, choice.pskRecipInfo), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_PreSharedKeyRecipientInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "pskRecipInfo" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_RecipientInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SymmRecipientInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "symmRecipInfo" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_RecipientInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PKRecipientInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certRecipInfo" }, @@ -43,7 +69,15 @@ asn_TYPE_member_t asn_MBR_RecipientInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PKRecipientInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "signedDataRecipInfo" }, @@ -52,7 +86,15 @@ asn_TYPE_member_t asn_MBR_RecipientInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PKRecipientInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "rekRecipInfo" }, @@ -82,7 +124,15 @@ asn_TYPE_descriptor_t asn_DEF_RecipientInfo = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_RecipientInfo_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_RecipientInfo_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_RecipientInfo_1, 5, /* Elements count */ &asn_SPC_RecipientInfo_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/RecipientInfo.h b/certgen/asncodec/RecipientInfo.h index 3895bb5..9155c38 100644 --- a/certgen/asncodec/RecipientInfo.h +++ b/certgen/asncodec/RecipientInfo.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _RecipientInfo_H_ -#define _RecipientInfo_H_ - - -#include /* Including external dependencies */ #include "PreSharedKeyRecipientInfo.h" #include "SymmRecipientInfo.h" #include "PKRecipientInfo.h" #include +#ifndef _RecipientInfo_H_ +#define _RecipientInfo_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/ReconstructionValue.c b/certgen/asncodec/ReconstructionValue.c new file mode 100644 index 0000000..51abd81 --- /dev/null +++ b/certgen/asncodec/ReconstructionValue.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ReconstructionValue.h" + +/* + * This type is implemented using EccP256CurvePoint, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ReconstructionValue_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_descriptor_t asn_DEF_ReconstructionValue = { + "ReconstructionValue", + "ReconstructionValue", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_EccP256CurvePoint_1, + 5, /* Elements count */ + &asn_SPC_EccP256CurvePoint_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ReconstructionValue.h b/certgen/asncodec/ReconstructionValue.h new file mode 100644 index 0000000..4c96c8c --- /dev/null +++ b/certgen/asncodec/ReconstructionValue.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EccP256CurvePoint.h" +#ifndef _ReconstructionValue_H_ +#define _ReconstructionValue_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ReconstructionValue */ +typedef EccP256CurvePoint_t ReconstructionValue_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ReconstructionValue; +asn_struct_free_f ReconstructionValue_free; +asn_struct_print_f ReconstructionValue_print; +asn_constr_check_f ReconstructionValue_constraint; +xer_type_decoder_f ReconstructionValue_decode_xer; +xer_type_encoder_f ReconstructionValue_encode_xer; +oer_type_decoder_f ReconstructionValue_decode_oer; +oer_type_encoder_f ReconstructionValue_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ReconstructionValue_H_ */ +#include diff --git a/certgen/asncodec/RectangularRegion.c b/certgen/asncodec/RectangularRegion.c index 829b532..1101598 100644 --- a/certgen/asncodec/RectangularRegion.c +++ b/certgen/asncodec/RectangularRegion.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "RectangularRegion.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_RectangularRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_TwoDLocation, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "northWest" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_RectangularRegion_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_TwoDLocation, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "southEast" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_RectangularRegion = { asn_DEF_RectangularRegion_tags_1, /* Same as above */ sizeof(asn_DEF_RectangularRegion_tags_1) /sizeof(asn_DEF_RectangularRegion_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_RectangularRegion_1, 2, /* Elements count */ &asn_SPC_RectangularRegion_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/RectangularRegion.h b/certgen/asncodec/RectangularRegion.h index 2a89cf4..bda7587 100644 --- a/certgen/asncodec/RectangularRegion.h +++ b/certgen/asncodec/RectangularRegion.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "TwoDLocation.h" +#include #ifndef _RectangularRegion_H_ #define _RectangularRegion_H_ #include -/* Including external dependencies */ -#include "TwoDLocation.h" -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/RegionAndSubregions.c b/certgen/asncodec/RegionAndSubregions.c index e2ffbd5..9081c21 100644 --- a/certgen/asncodec/RegionAndSubregions.c +++ b/certgen/asncodec/RegionAndSubregions.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "RegionAndSubregions.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_RegionAndSubregions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Uint8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "region" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_RegionAndSubregions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfUint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "subregions" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_RegionAndSubregions = { asn_DEF_RegionAndSubregions_tags_1, /* Same as above */ sizeof(asn_DEF_RegionAndSubregions_tags_1) /sizeof(asn_DEF_RegionAndSubregions_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_RegionAndSubregions_1, 2, /* Elements count */ &asn_SPC_RegionAndSubregions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/RegionAndSubregions.h b/certgen/asncodec/RegionAndSubregions.h index dfd0df6..1f14faf 100644 --- a/certgen/asncodec/RegionAndSubregions.h +++ b/certgen/asncodec/RegionAndSubregions.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _RegionAndSubregions_H_ -#define _RegionAndSubregions_H_ - - -#include /* Including external dependencies */ #include "Uint8.h" #include "SequenceOfUint16.h" #include +#ifndef _RegionAndSubregions_H_ +#define _RegionAndSubregions_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/RootCaEntry.c b/certgen/asncodec/RootCaEntry.c index 0cccead..5f732cb 100644 --- a/certgen/asncodec/RootCaEntry.c +++ b/certgen/asncodec/RootCaEntry.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "RootCaEntry.h" @@ -13,18 +13,34 @@ asn_TYPE_member_t asn_MBR_RootCaEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "selfsignedRootCa" }, - { ATF_POINTER, 1, offsetof(struct RootCaEntry, linkRootCaCertificate), + { ATF_POINTER, 1, offsetof(struct RootCaEntry, successorTo), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ - "linkRootCaCertificate" + "successorTo" }, }; static const int asn_MAP_RootCaEntry_oms_1[] = { 1 }; @@ -33,7 +49,7 @@ static const ber_tlv_tag_t asn_DEF_RootCaEntry_tags_1[] = { }; static const asn_TYPE_tag2member_t asn_MAP_RootCaEntry_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* selfsignedRootCa */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* linkRootCaCertificate */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* successorTo */ }; asn_SEQUENCE_specifics_t asn_SPC_RootCaEntry_specs_1 = { sizeof(struct RootCaEntry), @@ -54,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_RootCaEntry = { asn_DEF_RootCaEntry_tags_1, /* Same as above */ sizeof(asn_DEF_RootCaEntry_tags_1) /sizeof(asn_DEF_RootCaEntry_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_RootCaEntry_1, 2, /* Elements count */ &asn_SPC_RootCaEntry_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/RootCaEntry.h b/certgen/asncodec/RootCaEntry.h index 9fd4493..7459d6f 100644 --- a/certgen/asncodec/RootCaEntry.h +++ b/certgen/asncodec/RootCaEntry.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Certificate.h" +#include #ifndef _RootCaEntry_H_ #define _RootCaEntry_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Certificate.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -25,7 +25,7 @@ struct EtsiTs103097Certificate; /* RootCaEntry */ typedef struct RootCaEntry { EtsiTs103097Certificate_t selfsignedRootCa; - struct EtsiTs103097Certificate *linkRootCaCertificate /* OPTIONAL */; + struct EtsiTs103097Certificate *successorTo; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; diff --git a/certgen/asncodec/RootCaSsp.c b/certgen/asncodec/RootCaSsp.c new file mode 100644 index 0000000..7318463 --- /dev/null +++ b/certgen/asncodec/RootCaSsp.c @@ -0,0 +1,96 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "RootCaSsp.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_RootCaSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RootCaSsp, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, +}; +static const ber_tlv_tag_t asn_DEF_RootCaSsp_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_RootCaSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* version */ +}; +asn_SEQUENCE_specifics_t asn_SPC_RootCaSsp_specs_1 = { + sizeof(struct RootCaSsp), + offsetof(struct RootCaSsp, _asn_ctx), + asn_MAP_RootCaSsp_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_RootCaSsp = { + "RootCaSsp", + "RootCaSsp", + &asn_OP_SEQUENCE, + asn_DEF_RootCaSsp_tags_1, + sizeof(asn_DEF_RootCaSsp_tags_1) + /sizeof(asn_DEF_RootCaSsp_tags_1[0]), /* 1 */ + asn_DEF_RootCaSsp_tags_1, /* Same as above */ + sizeof(asn_DEF_RootCaSsp_tags_1) + /sizeof(asn_DEF_RootCaSsp_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_RootCaSsp_1, + 1, /* Elements count */ + &asn_SPC_RootCaSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/RootCaSsp.h b/certgen/asncodec/RootCaSsp.h new file mode 100644 index 0000000..b0990b6 --- /dev/null +++ b/certgen/asncodec/RootCaSsp.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include +#ifndef _RootCaSsp_H_ +#define _RootCaSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* RootCaSsp */ +typedef struct RootCaSsp { + Uint8_t version; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} RootCaSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_RootCaSsp; +extern asn_SEQUENCE_specifics_t asn_SPC_RootCaSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_RootCaSsp_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _RootCaSsp_H_ */ +#include diff --git a/certgen/asncodec/ScmsPdu-EeEcaCertRequest.c b/certgen/asncodec/ScmsPdu-EeEcaCertRequest.c new file mode 100644 index 0000000..8a61052 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-EeEcaCertRequest.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ScmsPdu-EeEcaCertRequest.h" + +int +ScmsPdu_EeEcaCertRequest_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu_Scoped_204P1, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScmsPdu_EeEcaCertRequest_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ScmsPdu_EeEcaCertRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu_EeEcaCertRequest = { + "ScmsPdu-EeEcaCertRequest", + "ScmsPdu-EeEcaCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_EeEcaCertRequest_tags_1, + sizeof(asn_DEF_ScmsPdu_EeEcaCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_EeEcaCertRequest_tags_1[0]), /* 1 */ + asn_DEF_ScmsPdu_EeEcaCertRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_EeEcaCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_EeEcaCertRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScmsPdu_EeEcaCertRequest_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScmsPdu_EeEcaCertRequest_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ScmsPdu-EeEcaCertRequest.h b/certgen/asncodec/ScmsPdu-EeEcaCertRequest.h new file mode 100644 index 0000000..d408172 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-EeEcaCertRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ScmsPdu-Scoped.h" +#ifndef _ScmsPdu_EeEcaCertRequest_H_ +#define _ScmsPdu_EeEcaCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ScmsPdu-EeEcaCertRequest */ +typedef ScmsPdu_Scoped_204P1_t ScmsPdu_EeEcaCertRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu_EeEcaCertRequest; +asn_struct_free_f ScmsPdu_EeEcaCertRequest_free; +asn_struct_print_f ScmsPdu_EeEcaCertRequest_print; +asn_constr_check_f ScmsPdu_EeEcaCertRequest_constraint; +xer_type_decoder_f ScmsPdu_EeEcaCertRequest_decode_xer; +xer_type_encoder_f ScmsPdu_EeEcaCertRequest_encode_xer; +oer_type_decoder_f ScmsPdu_EeEcaCertRequest_decode_oer; +oer_type_encoder_f ScmsPdu_EeEcaCertRequest_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ScmsPdu_EeEcaCertRequest_H_ */ +#include diff --git a/certgen/asncodec/ScmsPdu-EeRaCertRequest.c b/certgen/asncodec/ScmsPdu-EeRaCertRequest.c new file mode 100644 index 0000000..99c0f17 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-EeRaCertRequest.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ScmsPdu-EeRaCertRequest.h" + +int +ScmsPdu_EeRaCertRequest_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu_Scoped_204P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScmsPdu_EeRaCertRequest_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ScmsPdu_EeRaCertRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu_EeRaCertRequest = { + "ScmsPdu-EeRaCertRequest", + "ScmsPdu-EeRaCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_EeRaCertRequest_tags_1, + sizeof(asn_DEF_ScmsPdu_EeRaCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_EeRaCertRequest_tags_1[0]), /* 1 */ + asn_DEF_ScmsPdu_EeRaCertRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_EeRaCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_EeRaCertRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScmsPdu_EeRaCertRequest_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScmsPdu_EeRaCertRequest_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ScmsPdu-EeRaCertRequest.h b/certgen/asncodec/ScmsPdu-EeRaCertRequest.h new file mode 100644 index 0000000..5ba75f4 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-EeRaCertRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ScmsPdu-Scoped.h" +#ifndef _ScmsPdu_EeRaCertRequest_H_ +#define _ScmsPdu_EeRaCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ScmsPdu-EeRaCertRequest */ +typedef ScmsPdu_Scoped_204P2_t ScmsPdu_EeRaCertRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu_EeRaCertRequest; +asn_struct_free_f ScmsPdu_EeRaCertRequest_free; +asn_struct_print_f ScmsPdu_EeRaCertRequest_print; +asn_constr_check_f ScmsPdu_EeRaCertRequest_constraint; +xer_type_decoder_f ScmsPdu_EeRaCertRequest_decode_xer; +xer_type_encoder_f ScmsPdu_EeRaCertRequest_encode_xer; +oer_type_decoder_f ScmsPdu_EeRaCertRequest_decode_oer; +oer_type_encoder_f ScmsPdu_EeRaCertRequest_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ScmsPdu_EeRaCertRequest_H_ */ +#include diff --git a/certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.c b/certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.c new file mode 100644 index 0000000..63fb0be --- /dev/null +++ b/certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ScmsPdu-EeRaSuccessorEnrollmentCertRequest.h" + +int +ScmsPdu_EeRaSuccessorEnrollmentCertRequest_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu_Scoped_204P2, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest = { + "ScmsPdu-EeRaSuccessorEnrollmentCertRequest", + "ScmsPdu-EeRaSuccessorEnrollmentCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_tags_1, + sizeof(asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_tags_1[0]), /* 1 */ + asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScmsPdu_EeRaSuccessorEnrollmentCertRequest_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScmsPdu_EeRaSuccessorEnrollmentCertRequest_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.h b/certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.h new file mode 100644 index 0000000..2c92cf7 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-EeRaSuccessorEnrollmentCertRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ScmsPdu-Scoped.h" +#ifndef _ScmsPdu_EeRaSuccessorEnrollmentCertRequest_H_ +#define _ScmsPdu_EeRaSuccessorEnrollmentCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ScmsPdu-EeRaSuccessorEnrollmentCertRequest */ +typedef ScmsPdu_Scoped_204P2_t ScmsPdu_EeRaSuccessorEnrollmentCertRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu_EeRaSuccessorEnrollmentCertRequest; +asn_struct_free_f ScmsPdu_EeRaSuccessorEnrollmentCertRequest_free; +asn_struct_print_f ScmsPdu_EeRaSuccessorEnrollmentCertRequest_print; +asn_constr_check_f ScmsPdu_EeRaSuccessorEnrollmentCertRequest_constraint; +xer_type_decoder_f ScmsPdu_EeRaSuccessorEnrollmentCertRequest_decode_xer; +xer_type_encoder_f ScmsPdu_EeRaSuccessorEnrollmentCertRequest_encode_xer; +oer_type_decoder_f ScmsPdu_EeRaSuccessorEnrollmentCertRequest_decode_oer; +oer_type_encoder_f ScmsPdu_EeRaSuccessorEnrollmentCertRequest_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ScmsPdu_EeRaSuccessorEnrollmentCertRequest_H_ */ +#include diff --git a/certgen/asncodec/ScmsPdu-RaAcaCertRequest.c b/certgen/asncodec/ScmsPdu-RaAcaCertRequest.c new file mode 100644 index 0000000..2143d72 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-RaAcaCertRequest.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ScmsPdu-RaAcaCertRequest.h" + +int +ScmsPdu_RaAcaCertRequest_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu_Scoped_204P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScmsPdu_RaAcaCertRequest_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ScmsPdu_RaAcaCertRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu_RaAcaCertRequest = { + "ScmsPdu-RaAcaCertRequest", + "ScmsPdu-RaAcaCertRequest", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_RaAcaCertRequest_tags_1, + sizeof(asn_DEF_ScmsPdu_RaAcaCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_RaAcaCertRequest_tags_1[0]), /* 1 */ + asn_DEF_ScmsPdu_RaAcaCertRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_RaAcaCertRequest_tags_1) + /sizeof(asn_DEF_ScmsPdu_RaAcaCertRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScmsPdu_RaAcaCertRequest_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScmsPdu_RaAcaCertRequest_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ScmsPdu-RaAcaCertRequest.h b/certgen/asncodec/ScmsPdu-RaAcaCertRequest.h new file mode 100644 index 0000000..9c5c055 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-RaAcaCertRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ScmsPdu-Scoped.h" +#ifndef _ScmsPdu_RaAcaCertRequest_H_ +#define _ScmsPdu_RaAcaCertRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ScmsPdu-RaAcaCertRequest */ +typedef ScmsPdu_Scoped_204P0_t ScmsPdu_RaAcaCertRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu_RaAcaCertRequest; +asn_struct_free_f ScmsPdu_RaAcaCertRequest_free; +asn_struct_print_f ScmsPdu_RaAcaCertRequest_print; +asn_constr_check_f ScmsPdu_RaAcaCertRequest_constraint; +xer_type_decoder_f ScmsPdu_RaAcaCertRequest_decode_xer; +xer_type_encoder_f ScmsPdu_RaAcaCertRequest_encode_xer; +oer_type_decoder_f ScmsPdu_RaAcaCertRequest_decode_oer; +oer_type_encoder_f ScmsPdu_RaAcaCertRequest_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ScmsPdu_RaAcaCertRequest_H_ */ +#include diff --git a/certgen/asncodec/ScmsPdu-Scoped.c b/certgen/asncodec/ScmsPdu-Scoped.c new file mode 100644 index 0000000..60a8bdf --- /dev/null +++ b/certgen/asncodec/ScmsPdu-Scoped.c @@ -0,0 +1,174 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ScmsPdu-Scoped.h" + +int +ScmsPdu_Scoped_204P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu, + * so here we adjust the DEF accordingly. + */ +int +ScmsPdu_Scoped_204P1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu, + * so here we adjust the DEF accordingly. + */ +int +ScmsPdu_Scoped_204P2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScmsPdu_Scoped_204P0_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScmsPdu_Scoped_204P1_constr_2 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScmsPdu_Scoped_204P2_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ScmsPdu_Scoped_204P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu_Scoped_204P0 = { + "ScmsPdu-Scoped", + "ScmsPdu-Scoped", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_Scoped_204P0_tags_1, + sizeof(asn_DEF_ScmsPdu_Scoped_204P0_tags_1) + /sizeof(asn_DEF_ScmsPdu_Scoped_204P0_tags_1[0]), /* 1 */ + asn_DEF_ScmsPdu_Scoped_204P0_tags_1, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_Scoped_204P0_tags_1) + /sizeof(asn_DEF_ScmsPdu_Scoped_204P0_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScmsPdu_Scoped_204P0_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScmsPdu_Scoped_204P0_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_ScmsPdu_Scoped_204P1_tags_2[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu_Scoped_204P1 = { + "ScmsPdu-Scoped", + "ScmsPdu-Scoped", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_Scoped_204P1_tags_2, + sizeof(asn_DEF_ScmsPdu_Scoped_204P1_tags_2) + /sizeof(asn_DEF_ScmsPdu_Scoped_204P1_tags_2[0]), /* 1 */ + asn_DEF_ScmsPdu_Scoped_204P1_tags_2, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_Scoped_204P1_tags_2) + /sizeof(asn_DEF_ScmsPdu_Scoped_204P1_tags_2[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScmsPdu_Scoped_204P1_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScmsPdu_Scoped_204P1_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + +static const ber_tlv_tag_t asn_DEF_ScmsPdu_Scoped_204P2_tags_3[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu_Scoped_204P2 = { + "ScmsPdu-Scoped", + "ScmsPdu-Scoped", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_Scoped_204P2_tags_3, + sizeof(asn_DEF_ScmsPdu_Scoped_204P2_tags_3) + /sizeof(asn_DEF_ScmsPdu_Scoped_204P2_tags_3[0]), /* 1 */ + asn_DEF_ScmsPdu_Scoped_204P2_tags_3, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_Scoped_204P2_tags_3) + /sizeof(asn_DEF_ScmsPdu_Scoped_204P2_tags_3[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScmsPdu_Scoped_204P2_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScmsPdu_Scoped_204P2_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ScmsPdu-Scoped.h b/certgen/asncodec/ScmsPdu-Scoped.h new file mode 100644 index 0000000..7e3a429 --- /dev/null +++ b/certgen/asncodec/ScmsPdu-Scoped.h @@ -0,0 +1,57 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ScmsPdu.h" +#ifndef _ScmsPdu_Scoped_H_ +#define _ScmsPdu_Scoped_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ScmsPdu-Scoped */ +typedef ScmsPdu_t ScmsPdu_Scoped_204P0_t; +typedef ScmsPdu_t ScmsPdu_Scoped_204P1_t; +typedef ScmsPdu_t ScmsPdu_Scoped_204P2_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu_Scoped_204P0; +asn_struct_free_f ScmsPdu_Scoped_204P0_free; +asn_struct_print_f ScmsPdu_Scoped_204P0_print; +asn_constr_check_f ScmsPdu_Scoped_204P0_constraint; +xer_type_decoder_f ScmsPdu_Scoped_204P0_decode_xer; +xer_type_encoder_f ScmsPdu_Scoped_204P0_encode_xer; +oer_type_decoder_f ScmsPdu_Scoped_204P0_decode_oer; +oer_type_encoder_f ScmsPdu_Scoped_204P0_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu_Scoped_204P1; +asn_struct_free_f ScmsPdu_Scoped_204P1_free; +asn_struct_print_f ScmsPdu_Scoped_204P1_print; +asn_constr_check_f ScmsPdu_Scoped_204P1_constraint; +xer_type_decoder_f ScmsPdu_Scoped_204P1_decode_xer; +xer_type_encoder_f ScmsPdu_Scoped_204P1_encode_xer; +oer_type_decoder_f ScmsPdu_Scoped_204P1_decode_oer; +oer_type_encoder_f ScmsPdu_Scoped_204P1_encode_oer; +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu_Scoped_204P2; +asn_struct_free_f ScmsPdu_Scoped_204P2_free; +asn_struct_print_f ScmsPdu_Scoped_204P2_print; +asn_constr_check_f ScmsPdu_Scoped_204P2_constraint; +xer_type_decoder_f ScmsPdu_Scoped_204P2_decode_xer; +xer_type_encoder_f ScmsPdu_Scoped_204P2_encode_xer; +oer_type_decoder_f ScmsPdu_Scoped_204P2_decode_oer; +oer_type_encoder_f ScmsPdu_Scoped_204P2_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ScmsPdu_Scoped_H_ */ +#include diff --git a/certgen/asncodec/ScmsPdu.c b/certgen/asncodec/ScmsPdu.c new file mode 100644 index 0000000..8cdc25b --- /dev/null +++ b/certgen/asncodec/ScmsPdu.c @@ -0,0 +1,354 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ScmsPdu.h" + +static int +memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value == 2)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_content_constr_3 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = { + { 1, 1 } /* (2..2) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_content_3[] = { + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.aca_ee), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_AcaEeInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "aca-ee" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.aca_la), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaLaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "aca-la" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.aca_ma), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaMaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "aca-ma" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.aca_ra), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_AcaRaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "aca-ra" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.cert), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_CertManagementPdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "cert" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.eca_ee), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_EcaEeInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "eca-ee" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.ee_ma), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeMaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ee-ma" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.ee_ra), + (ASN_TAG_CLASS_CONTEXT | (7 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_EeRaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ee-ra" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.la_ma), + (ASN_TAG_CLASS_CONTEXT | (8 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaMaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "la-ma" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.la_ra), + (ASN_TAG_CLASS_CONTEXT | (9 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaRaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "la-ra" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu__content, choice.ma_ra), + (ASN_TAG_CLASS_CONTEXT | (10 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_MaRaInterfacePdu, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ma-ra" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_content_tag2el_3[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* aca-ee */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* aca-la */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* aca-ma */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* aca-ra */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* cert */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* eca-ee */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* ee-ma */ + { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* ee-ra */ + { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* la-ma */ + { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* la-ra */ + { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 } /* ma-ra */ +}; +static asn_CHOICE_specifics_t asn_SPC_content_specs_3 = { + sizeof(struct ScmsPdu__content), + offsetof(struct ScmsPdu__content, _asn_ctx), + offsetof(struct ScmsPdu__content, present), + sizeof(((struct ScmsPdu__content *)0)->present), + asn_MAP_content_tag2el_3, + 11, /* Count of tags in the map */ + 0, 0, + 11 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_content_3 = { + "content", + "content", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_content_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_content_3, + 11, /* Elements count */ + &asn_SPC_content_specs_3 /* Additional specs */ +}; + +asn_TYPE_member_t asn_MBR_ScmsPdu_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu, version), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_version_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_version_constraint_1 + }, + 0, 0, /* No default value */ + "version" + }, + { ATF_NOFLAGS, 0, offsetof(struct ScmsPdu, content), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_content_3, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "content" + }, +}; +static const ber_tlv_tag_t asn_DEF_ScmsPdu_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ScmsPdu_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* content */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ScmsPdu_specs_1 = { + sizeof(struct ScmsPdu), + offsetof(struct ScmsPdu, _asn_ctx), + asn_MAP_ScmsPdu_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ScmsPdu = { + "ScmsPdu", + "ScmsPdu", + &asn_OP_SEQUENCE, + asn_DEF_ScmsPdu_tags_1, + sizeof(asn_DEF_ScmsPdu_tags_1) + /sizeof(asn_DEF_ScmsPdu_tags_1[0]), /* 1 */ + asn_DEF_ScmsPdu_tags_1, /* Same as above */ + sizeof(asn_DEF_ScmsPdu_tags_1) + /sizeof(asn_DEF_ScmsPdu_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ScmsPdu.h b/certgen/asncodec/ScmsPdu.h new file mode 100644 index 0000000..b50bd0b --- /dev/null +++ b/certgen/asncodec/ScmsPdu.h @@ -0,0 +1,93 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint8.h" +#include "AcaEeInterfacePdu.h" +#include "AcaLaInterfacePdu.h" +#include "AcaMaInterfacePdu.h" +#include "AcaRaInterfacePdu.h" +#include "CertManagementPdu.h" +#include "EcaEeInterfacePdu.h" +#include "EeMaInterfacePdu.h" +#include "EeRaInterfacePdu.h" +#include "LaMaInterfacePdu.h" +#include "LaRaInterfacePdu.h" +#include "MaRaInterfacePdu.h" +#include +#include +#ifndef _ScmsPdu_H_ +#define _ScmsPdu_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum ScmsPdu__content_PR { + ScmsPdu__content_PR_NOTHING, /* No components present */ + ScmsPdu__content_PR_aca_ee, + ScmsPdu__content_PR_aca_la, + ScmsPdu__content_PR_aca_ma, + ScmsPdu__content_PR_aca_ra, + ScmsPdu__content_PR_cert, + ScmsPdu__content_PR_eca_ee, + ScmsPdu__content_PR_ee_ma, + ScmsPdu__content_PR_ee_ra, + ScmsPdu__content_PR_la_ma, + ScmsPdu__content_PR_la_ra, + ScmsPdu__content_PR_ma_ra + /* Extensions may appear below */ + +} ScmsPdu__content_PR; + +/* ScmsPdu */ +typedef struct ScmsPdu { + Uint8_t version; + struct ScmsPdu__content { + ScmsPdu__content_PR present; + union ScmsPdu__content_u { + AcaEeInterfacePdu_t aca_ee; + AcaLaInterfacePdu_t aca_la; + AcaMaInterfacePdu_t aca_ma; + AcaRaInterfacePdu_t aca_ra; + CertManagementPdu_t cert; + EcaEeInterfacePdu_t eca_ee; + EeMaInterfacePdu_t ee_ma; + EeRaInterfacePdu_t ee_ra; + LaMaInterfacePdu_t la_ma; + LaRaInterfacePdu_t la_ra; + MaRaInterfacePdu_t ma_ra; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } content; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ScmsPdu_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ScmsPdu; +extern asn_SEQUENCE_specifics_t asn_SPC_ScmsPdu_specs_1; +extern asn_TYPE_member_t asn_MBR_ScmsPdu_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ScmsPdu_H_ */ +#include diff --git a/certgen/asncodec/ScopedCertificateRequest.c b/certgen/asncodec/ScopedCertificateRequest.c new file mode 100644 index 0000000..4fa9b92 --- /dev/null +++ b/certgen/asncodec/ScopedCertificateRequest.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ScopedCertificateRequest.h" + +int +ScopedCertificateRequest_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using ScmsPdu, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ScopedCertificateRequest_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_ScopedCertificateRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ScopedCertificateRequest = { + "ScopedCertificateRequest", + "ScopedCertificateRequest", + &asn_OP_SEQUENCE, + asn_DEF_ScopedCertificateRequest_tags_1, + sizeof(asn_DEF_ScopedCertificateRequest_tags_1) + /sizeof(asn_DEF_ScopedCertificateRequest_tags_1[0]), /* 1 */ + asn_DEF_ScopedCertificateRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_ScopedCertificateRequest_tags_1) + /sizeof(asn_DEF_ScopedCertificateRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ScopedCertificateRequest_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ScopedCertificateRequest_constraint + }, + asn_MBR_ScmsPdu_1, + 2, /* Elements count */ + &asn_SPC_ScmsPdu_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ScopedCertificateRequest.h b/certgen/asncodec/ScopedCertificateRequest.h new file mode 100644 index 0000000..e149125 --- /dev/null +++ b/certgen/asncodec/ScopedCertificateRequest.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ScmsPdu.h" +#ifndef _ScopedCertificateRequest_H_ +#define _ScopedCertificateRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ScopedCertificateRequest */ +typedef ScmsPdu_t ScopedCertificateRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ScopedCertificateRequest; +asn_struct_free_f ScopedCertificateRequest_free; +asn_struct_print_f ScopedCertificateRequest_print; +asn_constr_check_f ScopedCertificateRequest_constraint; +xer_type_decoder_f ScopedCertificateRequest_decode_xer; +xer_type_encoder_f ScopedCertificateRequest_encode_xer; +oer_type_decoder_f ScopedCertificateRequest_decode_oer; +oer_type_encoder_f ScopedCertificateRequest_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ScopedCertificateRequest_H_ */ +#include diff --git a/certgen/asncodec/SecuredCrl.c b/certgen/asncodec/SecuredCrl.c new file mode 100644 index 0000000..cfc2f34 --- /dev/null +++ b/certgen/asncodec/SecuredCrl.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Crl" + * found in "asn1/ieee1609.2/Ieee1609Dot2Crl.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SecuredCrl.h" + +int +SecuredCrl_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SecuredCrl_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_SecuredCrl_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_SecuredCrl = { + "SecuredCrl", + "SecuredCrl", + &asn_OP_SEQUENCE, + asn_DEF_SecuredCrl_tags_1, + sizeof(asn_DEF_SecuredCrl_tags_1) + /sizeof(asn_DEF_SecuredCrl_tags_1[0]), /* 1 */ + asn_DEF_SecuredCrl_tags_1, /* Same as above */ + sizeof(asn_DEF_SecuredCrl_tags_1) + /sizeof(asn_DEF_SecuredCrl_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SecuredCrl_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SecuredCrl_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SecuredCrl.h b/certgen/asncodec/SecuredCrl.h new file mode 100644 index 0000000..77ce216 --- /dev/null +++ b/certgen/asncodec/SecuredCrl.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Crl" + * found in "asn1/ieee1609.2/Ieee1609Dot2Crl.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data.h" +#ifndef _SecuredCrl_H_ +#define _SecuredCrl_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SecuredCrl */ +typedef Ieee1609Dot2Data_t SecuredCrl_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SecuredCrl; +asn_struct_free_f SecuredCrl_free; +asn_struct_print_f SecuredCrl_print; +asn_constr_check_f SecuredCrl_constraint; +xer_type_decoder_f SecuredCrl_decode_xer; +xer_type_encoder_f SecuredCrl_encode_xer; +oer_type_decoder_f SecuredCrl_decode_oer; +oer_type_encoder_f SecuredCrl_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SecuredCrl_H_ */ +#include diff --git a/certgen/asncodec/SecurityMgmtPsid.c b/certgen/asncodec/SecurityMgmtPsid.c new file mode 100644 index 0000000..f522c4f --- /dev/null +++ b/certgen/asncodec/SecurityMgmtPsid.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SecurityMgmtPsid.h" + +int +SecurityMgmtPsid_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const unsigned long *)sptr; + + if((value == 35)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using Psid, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SecurityMgmtPsid_constr_1 CC_NOTUSED = { + { 1, 1 } /* (35..35) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_SecurityMgmtPsid_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_SecurityMgmtPsid = { + "SecurityMgmtPsid", + "SecurityMgmtPsid", + &asn_OP_NativeInteger, + asn_DEF_SecurityMgmtPsid_tags_1, + sizeof(asn_DEF_SecurityMgmtPsid_tags_1) + /sizeof(asn_DEF_SecurityMgmtPsid_tags_1[0]), /* 1 */ + asn_DEF_SecurityMgmtPsid_tags_1, /* Same as above */ + sizeof(asn_DEF_SecurityMgmtPsid_tags_1) + /sizeof(asn_DEF_SecurityMgmtPsid_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SecurityMgmtPsid_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SecurityMgmtPsid_constraint + }, + 0, 0, /* No members */ + &asn_SPC_Psid_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SecurityMgmtPsid.h b/certgen/asncodec/SecurityMgmtPsid.h new file mode 100644 index 0000000..e5294a4 --- /dev/null +++ b/certgen/asncodec/SecurityMgmtPsid.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Psid.h" +#ifndef _SecurityMgmtPsid_H_ +#define _SecurityMgmtPsid_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SecurityMgmtPsid */ +typedef Psid_t SecurityMgmtPsid_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SecurityMgmtPsid; +asn_struct_free_f SecurityMgmtPsid_free; +asn_struct_print_f SecurityMgmtPsid_print; +asn_constr_check_f SecurityMgmtPsid_constraint; +xer_type_decoder_f SecurityMgmtPsid_decode_xer; +xer_type_encoder_f SecurityMgmtPsid_encode_xer; +oer_type_decoder_f SecurityMgmtPsid_decode_oer; +oer_type_encoder_f SecurityMgmtPsid_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SecurityMgmtPsid_H_ */ +#include diff --git a/certgen/asncodec/SecurityMgmtSsp.c b/certgen/asncodec/SecurityMgmtSsp.c new file mode 100644 index 0000000..a80ed67 --- /dev/null +++ b/certgen/asncodec/SecurityMgmtSsp.c @@ -0,0 +1,302 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SecurityMgmtSsp.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SecurityMgmtSsp_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_SecurityMgmtSsp_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.elector), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ElectorSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "elector" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.root), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RootCaSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "root" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.pg), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_PgSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "pg" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.ica), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IcaSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ica" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.eca), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EcaSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "eca" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.aca), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_AcaSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "aca" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.crl), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CrlSignerSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "crl" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.dcm), + (ASN_TAG_CLASS_CONTEXT | (7 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_DcmSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "dcm" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.la), + (ASN_TAG_CLASS_CONTEXT | (8 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LaSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "la" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.lop), + (ASN_TAG_CLASS_CONTEXT | (9 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LopSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "lop" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.ma), + (ASN_TAG_CLASS_CONTEXT | (10 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_MaSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ma" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.ra), + (ASN_TAG_CLASS_CONTEXT | (11 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RaSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ra" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.ee), + (ASN_TAG_CLASS_CONTEXT | (12 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EeSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ee" + }, + { ATF_NOFLAGS, 0, offsetof(struct SecurityMgmtSsp, choice.dc), + (ASN_TAG_CLASS_CONTEXT | (13 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_DcSsp, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "dc" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_SecurityMgmtSsp_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* elector */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* root */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* pg */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ica */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* eca */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* aca */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* crl */ + { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* dcm */ + { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* la */ + { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* lop */ + { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 }, /* ma */ + { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 }, /* ra */ + { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 12, 0, 0 }, /* ee */ + { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 13, 0, 0 } /* dc */ +}; +asn_CHOICE_specifics_t asn_SPC_SecurityMgmtSsp_specs_1 = { + sizeof(struct SecurityMgmtSsp), + offsetof(struct SecurityMgmtSsp, _asn_ctx), + offsetof(struct SecurityMgmtSsp, present), + sizeof(((struct SecurityMgmtSsp *)0)->present), + asn_MAP_SecurityMgmtSsp_tag2el_1, + 14, /* Count of tags in the map */ + 0, 0, + 13 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_SecurityMgmtSsp = { + "SecurityMgmtSsp", + "SecurityMgmtSsp", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SecurityMgmtSsp_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_SecurityMgmtSsp_1, + 14, /* Elements count */ + &asn_SPC_SecurityMgmtSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SecurityMgmtSsp.h b/certgen/asncodec/SecurityMgmtSsp.h new file mode 100644 index 0000000..36c30de --- /dev/null +++ b/certgen/asncodec/SecurityMgmtSsp.h @@ -0,0 +1,93 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ElectorSsp.h" +#include "RootCaSsp.h" +#include "PgSsp.h" +#include "IcaSsp.h" +#include "EcaSsp.h" +#include "AcaSsp.h" +#include "CrlSignerSsp.h" +#include "DcmSsp.h" +#include "LaSsp.h" +#include "LopSsp.h" +#include "MaSsp.h" +#include "RaSsp.h" +#include "EeSsp.h" +#include "DcSsp.h" +#include +#ifndef _SecurityMgmtSsp_H_ +#define _SecurityMgmtSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum SecurityMgmtSsp_PR { + SecurityMgmtSsp_PR_NOTHING, /* No components present */ + SecurityMgmtSsp_PR_elector, + SecurityMgmtSsp_PR_root, + SecurityMgmtSsp_PR_pg, + SecurityMgmtSsp_PR_ica, + SecurityMgmtSsp_PR_eca, + SecurityMgmtSsp_PR_aca, + SecurityMgmtSsp_PR_crl, + SecurityMgmtSsp_PR_dcm, + SecurityMgmtSsp_PR_la, + SecurityMgmtSsp_PR_lop, + SecurityMgmtSsp_PR_ma, + SecurityMgmtSsp_PR_ra, + SecurityMgmtSsp_PR_ee, + /* Extensions may appear below */ + SecurityMgmtSsp_PR_dc +} SecurityMgmtSsp_PR; + +/* SecurityMgmtSsp */ +typedef struct SecurityMgmtSsp { + SecurityMgmtSsp_PR present; + union SecurityMgmtSsp_u { + ElectorSsp_t elector; + RootCaSsp_t root; + PgSsp_t pg; + IcaSsp_t ica; + EcaSsp_t eca; + AcaSsp_t aca; + CrlSignerSsp_t crl; + DcmSsp_t dcm; + LaSsp_t la; + LopSsp_t lop; + MaSsp_t ma; + RaSsp_t ra; + EeSsp_t ee; + /* + * This type is extensible, + * possible extensions are below. + */ + DcSsp_t dc; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SecurityMgmtSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SecurityMgmtSsp; +extern asn_CHOICE_specifics_t asn_SPC_SecurityMgmtSsp_specs_1; +extern asn_TYPE_member_t asn_MBR_SecurityMgmtSsp_1[14]; + +#ifdef __cplusplus +} +#endif + +#endif /* _SecurityMgmtSsp_H_ */ +#include diff --git a/certgen/asncodec/SeedEvolutionFunctionIdentifier.c b/certgen/asncodec/SeedEvolutionFunctionIdentifier.c new file mode 100644 index 0000000..e4a0735 --- /dev/null +++ b/certgen/asncodec/SeedEvolutionFunctionIdentifier.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SeedEvolutionFunctionIdentifier.h" + +/* + * This type is implemented using NULL, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_SeedEvolutionFunctionIdentifier_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_SeedEvolutionFunctionIdentifier = { + "SeedEvolutionFunctionIdentifier", + "SeedEvolutionFunctionIdentifier", + &asn_OP_NULL, + asn_DEF_SeedEvolutionFunctionIdentifier_tags_1, + sizeof(asn_DEF_SeedEvolutionFunctionIdentifier_tags_1) + /sizeof(asn_DEF_SeedEvolutionFunctionIdentifier_tags_1[0]), /* 1 */ + asn_DEF_SeedEvolutionFunctionIdentifier_tags_1, /* Same as above */ + sizeof(asn_DEF_SeedEvolutionFunctionIdentifier_tags_1) + /sizeof(asn_DEF_SeedEvolutionFunctionIdentifier_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NULL_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/SeedEvolutionFunctionIdentifier.h b/certgen/asncodec/SeedEvolutionFunctionIdentifier.h new file mode 100644 index 0000000..fc7a4c1 --- /dev/null +++ b/certgen/asncodec/SeedEvolutionFunctionIdentifier.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _SeedEvolutionFunctionIdentifier_H_ +#define _SeedEvolutionFunctionIdentifier_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SeedEvolutionFunctionIdentifier */ +typedef NULL_t SeedEvolutionFunctionIdentifier_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SeedEvolutionFunctionIdentifier; +asn_struct_free_f SeedEvolutionFunctionIdentifier_free; +asn_struct_print_f SeedEvolutionFunctionIdentifier_print; +asn_constr_check_f SeedEvolutionFunctionIdentifier_constraint; +xer_type_decoder_f SeedEvolutionFunctionIdentifier_decode_xer; +xer_type_encoder_f SeedEvolutionFunctionIdentifier_encode_xer; +oer_type_decoder_f SeedEvolutionFunctionIdentifier_decode_oer; +oer_type_encoder_f SeedEvolutionFunctionIdentifier_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SeedEvolutionFunctionIdentifier_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfAppExtensions.c b/certgen/asncodec/SequenceOfAppExtensions.c new file mode 100644 index 0000000..7e3376a --- /dev/null +++ b/certgen/asncodec/SequenceOfAppExtensions.c @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfAppExtensions.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SequenceOfAppExtensions_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_SequenceOfAppExtensions_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_AppExtension, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfAppExtensions_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfAppExtensions_specs_1 = { + sizeof(struct SequenceOfAppExtensions), + offsetof(struct SequenceOfAppExtensions, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfAppExtensions = { + "SequenceOfAppExtensions", + "SequenceOfAppExtensions", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfAppExtensions_tags_1, + sizeof(asn_DEF_SequenceOfAppExtensions_tags_1) + /sizeof(asn_DEF_SequenceOfAppExtensions_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfAppExtensions_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfAppExtensions_tags_1) + /sizeof(asn_DEF_SequenceOfAppExtensions_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SequenceOfAppExtensions_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfAppExtensions_1, + 1, /* Single element */ + &asn_SPC_SequenceOfAppExtensions_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfAppExtensions.h b/certgen/asncodec/SequenceOfAppExtensions.h new file mode 100644 index 0000000..c811893 --- /dev/null +++ b/certgen/asncodec/SequenceOfAppExtensions.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfAppExtensions_H_ +#define _SequenceOfAppExtensions_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct AppExtension; + +/* SequenceOfAppExtensions */ +typedef struct SequenceOfAppExtensions { + A_SEQUENCE_OF(struct AppExtension) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfAppExtensions_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfAppExtensions; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfAppExtensions_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfAppExtensions_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "AppExtension.h" + +#endif /* _SequenceOfAppExtensions_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfCertIssueExtensions.c b/certgen/asncodec/SequenceOfCertIssueExtensions.c new file mode 100644 index 0000000..1f7e0a2 --- /dev/null +++ b/certgen/asncodec/SequenceOfCertIssueExtensions.c @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfCertIssueExtensions.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SequenceOfCertIssueExtensions_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_SequenceOfCertIssueExtensions_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_CertIssueExtension, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfCertIssueExtensions_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfCertIssueExtensions_specs_1 = { + sizeof(struct SequenceOfCertIssueExtensions), + offsetof(struct SequenceOfCertIssueExtensions, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfCertIssueExtensions = { + "SequenceOfCertIssueExtensions", + "SequenceOfCertIssueExtensions", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfCertIssueExtensions_tags_1, + sizeof(asn_DEF_SequenceOfCertIssueExtensions_tags_1) + /sizeof(asn_DEF_SequenceOfCertIssueExtensions_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfCertIssueExtensions_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfCertIssueExtensions_tags_1) + /sizeof(asn_DEF_SequenceOfCertIssueExtensions_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SequenceOfCertIssueExtensions_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfCertIssueExtensions_1, + 1, /* Single element */ + &asn_SPC_SequenceOfCertIssueExtensions_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfCertIssueExtensions.h b/certgen/asncodec/SequenceOfCertIssueExtensions.h new file mode 100644 index 0000000..62dcd2c --- /dev/null +++ b/certgen/asncodec/SequenceOfCertIssueExtensions.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfCertIssueExtensions_H_ +#define _SequenceOfCertIssueExtensions_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct CertIssueExtension; + +/* SequenceOfCertIssueExtensions */ +typedef struct SequenceOfCertIssueExtensions { + A_SEQUENCE_OF(struct CertIssueExtension) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfCertIssueExtensions_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfCertIssueExtensions; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfCertIssueExtensions_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfCertIssueExtensions_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "CertIssueExtension.h" + +#endif /* _SequenceOfCertIssueExtensions_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfCertRequestExtensions.c b/certgen/asncodec/SequenceOfCertRequestExtensions.c new file mode 100644 index 0000000..1d9d5b9 --- /dev/null +++ b/certgen/asncodec/SequenceOfCertRequestExtensions.c @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfCertRequestExtensions.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SequenceOfCertRequestExtensions_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_SequenceOfCertRequestExtensions_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_CertRequestExtension, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfCertRequestExtensions_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfCertRequestExtensions_specs_1 = { + sizeof(struct SequenceOfCertRequestExtensions), + offsetof(struct SequenceOfCertRequestExtensions, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfCertRequestExtensions = { + "SequenceOfCertRequestExtensions", + "SequenceOfCertRequestExtensions", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfCertRequestExtensions_tags_1, + sizeof(asn_DEF_SequenceOfCertRequestExtensions_tags_1) + /sizeof(asn_DEF_SequenceOfCertRequestExtensions_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfCertRequestExtensions_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfCertRequestExtensions_tags_1) + /sizeof(asn_DEF_SequenceOfCertRequestExtensions_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SequenceOfCertRequestExtensions_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfCertRequestExtensions_1, + 1, /* Single element */ + &asn_SPC_SequenceOfCertRequestExtensions_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfCertRequestExtensions.h b/certgen/asncodec/SequenceOfCertRequestExtensions.h new file mode 100644 index 0000000..68251d2 --- /dev/null +++ b/certgen/asncodec/SequenceOfCertRequestExtensions.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfCertRequestExtensions_H_ +#define _SequenceOfCertRequestExtensions_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct CertRequestExtension; + +/* SequenceOfCertRequestExtensions */ +typedef struct SequenceOfCertRequestExtensions { + A_SEQUENCE_OF(struct CertRequestExtension) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfCertRequestExtensions_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfCertRequestExtensions; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfCertRequestExtensions_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfCertRequestExtensions_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "CertRequestExtension.h" + +#endif /* _SequenceOfCertRequestExtensions_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfCertificate.c b/certgen/asncodec/SequenceOfCertificate.c index 3d5f232..83b9571 100644 --- a/certgen/asncodec/SequenceOfCertificate.c +++ b/certgen/asncodec/SequenceOfCertificate.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfCertificate.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfCertificate_1[] = { 0, &asn_DEF_Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfCertificate = { asn_DEF_SequenceOfCertificate_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfCertificate_tags_1) /sizeof(asn_DEF_SequenceOfCertificate_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfCertificate_1, 1, /* Single element */ &asn_SPC_SequenceOfCertificate_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfCertificate.h b/certgen/asncodec/SequenceOfCertificate.h index a46ffb2..f25abd2 100644 --- a/certgen/asncodec/SequenceOfCertificate.h +++ b/certgen/asncodec/SequenceOfCertificate.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfCertificate_H_ #define _SequenceOfCertificate_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfCrlInfoStatus.c b/certgen/asncodec/SequenceOfCrlInfoStatus.c new file mode 100644 index 0000000..8f19a81 --- /dev/null +++ b/certgen/asncodec/SequenceOfCrlInfoStatus.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfCrlInfoStatus.h" + +asn_TYPE_member_t asn_MBR_SequenceOfCrlInfoStatus_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_CrlInfoStatus, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfCrlInfoStatus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfCrlInfoStatus_specs_1 = { + sizeof(struct SequenceOfCrlInfoStatus), + offsetof(struct SequenceOfCrlInfoStatus, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfCrlInfoStatus = { + "SequenceOfCrlInfoStatus", + "SequenceOfCrlInfoStatus", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfCrlInfoStatus_tags_1, + sizeof(asn_DEF_SequenceOfCrlInfoStatus_tags_1) + /sizeof(asn_DEF_SequenceOfCrlInfoStatus_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfCrlInfoStatus_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfCrlInfoStatus_tags_1) + /sizeof(asn_DEF_SequenceOfCrlInfoStatus_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfCrlInfoStatus_1, + 1, /* Single element */ + &asn_SPC_SequenceOfCrlInfoStatus_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfCrlInfoStatus.h b/certgen/asncodec/SequenceOfCrlInfoStatus.h new file mode 100644 index 0000000..c713f60 --- /dev/null +++ b/certgen/asncodec/SequenceOfCrlInfoStatus.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfCrlInfoStatus_H_ +#define _SequenceOfCrlInfoStatus_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct CrlInfoStatus; + +/* SequenceOfCrlInfoStatus */ +typedef struct SequenceOfCrlInfoStatus { + A_SEQUENCE_OF(struct CrlInfoStatus) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfCrlInfoStatus_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfCrlInfoStatus; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfCrlInfoStatus_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfCrlInfoStatus_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "CrlInfoStatus.h" + +#endif /* _SequenceOfCrlInfoStatus_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfCtlInfoStatus.c b/certgen/asncodec/SequenceOfCtlInfoStatus.c new file mode 100644 index 0000000..e60f47b --- /dev/null +++ b/certgen/asncodec/SequenceOfCtlInfoStatus.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfCtlInfoStatus.h" + +asn_TYPE_member_t asn_MBR_SequenceOfCtlInfoStatus_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_CtlInfoStatus, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfCtlInfoStatus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfCtlInfoStatus_specs_1 = { + sizeof(struct SequenceOfCtlInfoStatus), + offsetof(struct SequenceOfCtlInfoStatus, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfCtlInfoStatus = { + "SequenceOfCtlInfoStatus", + "SequenceOfCtlInfoStatus", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfCtlInfoStatus_tags_1, + sizeof(asn_DEF_SequenceOfCtlInfoStatus_tags_1) + /sizeof(asn_DEF_SequenceOfCtlInfoStatus_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfCtlInfoStatus_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfCtlInfoStatus_tags_1) + /sizeof(asn_DEF_SequenceOfCtlInfoStatus_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfCtlInfoStatus_1, + 1, /* Single element */ + &asn_SPC_SequenceOfCtlInfoStatus_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfCtlInfoStatus.h b/certgen/asncodec/SequenceOfCtlInfoStatus.h new file mode 100644 index 0000000..ddec7d6 --- /dev/null +++ b/certgen/asncodec/SequenceOfCtlInfoStatus.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfCtlInfoStatus_H_ +#define _SequenceOfCtlInfoStatus_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct CtlInfoStatus; + +/* SequenceOfCtlInfoStatus */ +typedef struct SequenceOfCtlInfoStatus { + A_SEQUENCE_OF(struct CtlInfoStatus) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfCtlInfoStatus_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfCtlInfoStatus; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfCtlInfoStatus_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfCtlInfoStatus_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "CtlInfoStatus.h" + +#endif /* _SequenceOfCtlInfoStatus_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfGroupCrlEntry.c b/certgen/asncodec/SequenceOfGroupCrlEntry.c new file mode 100644 index 0000000..dbda7d5 --- /dev/null +++ b/certgen/asncodec/SequenceOfGroupCrlEntry.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfGroupCrlEntry.h" + +asn_TYPE_member_t asn_MBR_SequenceOfGroupCrlEntry_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_GroupCrlEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfGroupCrlEntry_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfGroupCrlEntry_specs_1 = { + sizeof(struct SequenceOfGroupCrlEntry), + offsetof(struct SequenceOfGroupCrlEntry, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfGroupCrlEntry = { + "SequenceOfGroupCrlEntry", + "SequenceOfGroupCrlEntry", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfGroupCrlEntry_tags_1, + sizeof(asn_DEF_SequenceOfGroupCrlEntry_tags_1) + /sizeof(asn_DEF_SequenceOfGroupCrlEntry_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfGroupCrlEntry_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfGroupCrlEntry_tags_1) + /sizeof(asn_DEF_SequenceOfGroupCrlEntry_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfGroupCrlEntry_1, + 1, /* Single element */ + &asn_SPC_SequenceOfGroupCrlEntry_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfGroupCrlEntry.h b/certgen/asncodec/SequenceOfGroupCrlEntry.h new file mode 100644 index 0000000..ee10198 --- /dev/null +++ b/certgen/asncodec/SequenceOfGroupCrlEntry.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfGroupCrlEntry_H_ +#define _SequenceOfGroupCrlEntry_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct GroupCrlEntry; + +/* SequenceOfGroupCrlEntry */ +typedef struct SequenceOfGroupCrlEntry { + A_SEQUENCE_OF(struct GroupCrlEntry) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfGroupCrlEntry_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfGroupCrlEntry; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfGroupCrlEntry_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfGroupCrlEntry_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "GroupCrlEntry.h" + +#endif /* _SequenceOfGroupCrlEntry_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.c b/certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.c new file mode 100644 index 0000000..cd5a9fb --- /dev/null +++ b/certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfGroupSingleSeedCrlEntry.h" + +asn_TYPE_member_t asn_MBR_SequenceOfGroupSingleSeedCrlEntry_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_GroupSingleSeedCrlEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfGroupSingleSeedCrlEntry_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfGroupSingleSeedCrlEntry_specs_1 = { + sizeof(struct SequenceOfGroupSingleSeedCrlEntry), + offsetof(struct SequenceOfGroupSingleSeedCrlEntry, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfGroupSingleSeedCrlEntry = { + "SequenceOfGroupSingleSeedCrlEntry", + "SequenceOfGroupSingleSeedCrlEntry", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfGroupSingleSeedCrlEntry_tags_1, + sizeof(asn_DEF_SequenceOfGroupSingleSeedCrlEntry_tags_1) + /sizeof(asn_DEF_SequenceOfGroupSingleSeedCrlEntry_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfGroupSingleSeedCrlEntry_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfGroupSingleSeedCrlEntry_tags_1) + /sizeof(asn_DEF_SequenceOfGroupSingleSeedCrlEntry_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfGroupSingleSeedCrlEntry_1, + 1, /* Single element */ + &asn_SPC_SequenceOfGroupSingleSeedCrlEntry_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.h b/certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.h new file mode 100644 index 0000000..a939e79 --- /dev/null +++ b/certgen/asncodec/SequenceOfGroupSingleSeedCrlEntry.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfGroupSingleSeedCrlEntry_H_ +#define _SequenceOfGroupSingleSeedCrlEntry_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct GroupSingleSeedCrlEntry; + +/* SequenceOfGroupSingleSeedCrlEntry */ +typedef struct SequenceOfGroupSingleSeedCrlEntry { + A_SEQUENCE_OF(struct GroupSingleSeedCrlEntry) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfGroupSingleSeedCrlEntry_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfGroupSingleSeedCrlEntry; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfGroupSingleSeedCrlEntry_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfGroupSingleSeedCrlEntry_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "GroupSingleSeedCrlEntry.h" + +#endif /* _SequenceOfGroupSingleSeedCrlEntry_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfHashBasedRevocationInfo.c b/certgen/asncodec/SequenceOfHashBasedRevocationInfo.c new file mode 100644 index 0000000..9d9587b --- /dev/null +++ b/certgen/asncodec/SequenceOfHashBasedRevocationInfo.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfHashBasedRevocationInfo.h" + +asn_TYPE_member_t asn_MBR_SequenceOfHashBasedRevocationInfo_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_HashBasedRevocationInfo, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfHashBasedRevocationInfo_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfHashBasedRevocationInfo_specs_1 = { + sizeof(struct SequenceOfHashBasedRevocationInfo), + offsetof(struct SequenceOfHashBasedRevocationInfo, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfHashBasedRevocationInfo = { + "SequenceOfHashBasedRevocationInfo", + "SequenceOfHashBasedRevocationInfo", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfHashBasedRevocationInfo_tags_1, + sizeof(asn_DEF_SequenceOfHashBasedRevocationInfo_tags_1) + /sizeof(asn_DEF_SequenceOfHashBasedRevocationInfo_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfHashBasedRevocationInfo_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfHashBasedRevocationInfo_tags_1) + /sizeof(asn_DEF_SequenceOfHashBasedRevocationInfo_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfHashBasedRevocationInfo_1, + 1, /* Single element */ + &asn_SPC_SequenceOfHashBasedRevocationInfo_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfHashBasedRevocationInfo.h b/certgen/asncodec/SequenceOfHashBasedRevocationInfo.h new file mode 100644 index 0000000..ff356d5 --- /dev/null +++ b/certgen/asncodec/SequenceOfHashBasedRevocationInfo.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfHashBasedRevocationInfo_H_ +#define _SequenceOfHashBasedRevocationInfo_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct HashBasedRevocationInfo; + +/* SequenceOfHashBasedRevocationInfo */ +typedef struct SequenceOfHashBasedRevocationInfo { + A_SEQUENCE_OF(struct HashBasedRevocationInfo) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfHashBasedRevocationInfo_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfHashBasedRevocationInfo; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfHashBasedRevocationInfo_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfHashBasedRevocationInfo_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "HashBasedRevocationInfo.h" + +#endif /* _SequenceOfHashBasedRevocationInfo_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfHashedId3.c b/certgen/asncodec/SequenceOfHashedId3.c index 10b4e32..aceede8 100644 --- a/certgen/asncodec/SequenceOfHashedId3.c +++ b/certgen/asncodec/SequenceOfHashedId3.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfHashedId3.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfHashedId3_1[] = { 0, &asn_DEF_HashedId3, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfHashedId3 = { asn_DEF_SequenceOfHashedId3_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfHashedId3_tags_1) /sizeof(asn_DEF_SequenceOfHashedId3_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfHashedId3_1, 1, /* Single element */ &asn_SPC_SequenceOfHashedId3_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfHashedId3.h b/certgen/asncodec/SequenceOfHashedId3.h index 6c2887f..7225ff0 100644 --- a/certgen/asncodec/SequenceOfHashedId3.h +++ b/certgen/asncodec/SequenceOfHashedId3.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SequenceOfHashedId3_H_ -#define _SequenceOfHashedId3_H_ - - -#include /* Including external dependencies */ #include "HashedId3.h" #include #include +#ifndef _SequenceOfHashedId3_H_ +#define _SequenceOfHashedId3_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SequenceOfIMaxGroup.c b/certgen/asncodec/SequenceOfIMaxGroup.c new file mode 100644 index 0000000..da8fffc --- /dev/null +++ b/certgen/asncodec/SequenceOfIMaxGroup.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfIMaxGroup.h" + +asn_TYPE_member_t asn_MBR_SequenceOfIMaxGroup_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_IMaxGroup, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfIMaxGroup_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfIMaxGroup_specs_1 = { + sizeof(struct SequenceOfIMaxGroup), + offsetof(struct SequenceOfIMaxGroup, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfIMaxGroup = { + "SequenceOfIMaxGroup", + "SequenceOfIMaxGroup", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfIMaxGroup_tags_1, + sizeof(asn_DEF_SequenceOfIMaxGroup_tags_1) + /sizeof(asn_DEF_SequenceOfIMaxGroup_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfIMaxGroup_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfIMaxGroup_tags_1) + /sizeof(asn_DEF_SequenceOfIMaxGroup_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfIMaxGroup_1, + 1, /* Single element */ + &asn_SPC_SequenceOfIMaxGroup_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfIMaxGroup.h b/certgen/asncodec/SequenceOfIMaxGroup.h new file mode 100644 index 0000000..2d497ec --- /dev/null +++ b/certgen/asncodec/SequenceOfIMaxGroup.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfIMaxGroup_H_ +#define _SequenceOfIMaxGroup_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct IMaxGroup; + +/* SequenceOfIMaxGroup */ +typedef struct SequenceOfIMaxGroup { + A_SEQUENCE_OF(struct IMaxGroup) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfIMaxGroup_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfIMaxGroup; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfIMaxGroup_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfIMaxGroup_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "IMaxGroup.h" + +#endif /* _SequenceOfIMaxGroup_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfIdentifiedRegion.c b/certgen/asncodec/SequenceOfIdentifiedRegion.c index cff74ed..13fe578 100644 --- a/certgen/asncodec/SequenceOfIdentifiedRegion.c +++ b/certgen/asncodec/SequenceOfIdentifiedRegion.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfIdentifiedRegion.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfIdentifiedRegion_1[] = { 0, &asn_DEF_IdentifiedRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfIdentifiedRegion = { asn_DEF_SequenceOfIdentifiedRegion_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfIdentifiedRegion_tags_1) /sizeof(asn_DEF_SequenceOfIdentifiedRegion_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfIdentifiedRegion_1, 1, /* Single element */ &asn_SPC_SequenceOfIdentifiedRegion_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfIdentifiedRegion.h b/certgen/asncodec/SequenceOfIdentifiedRegion.h index 05ea518..90161ad 100644 --- a/certgen/asncodec/SequenceOfIdentifiedRegion.h +++ b/certgen/asncodec/SequenceOfIdentifiedRegion.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfIdentifiedRegion_H_ #define _SequenceOfIdentifiedRegion_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfIndividualRevocation.c b/certgen/asncodec/SequenceOfIndividualRevocation.c new file mode 100644 index 0000000..f09dc90 --- /dev/null +++ b/certgen/asncodec/SequenceOfIndividualRevocation.c @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfIndividualRevocation.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SequenceOfIndividualRevocation_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_SequenceOfIndividualRevocation_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_IndividualRevocation, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfIndividualRevocation_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfIndividualRevocation_specs_1 = { + sizeof(struct SequenceOfIndividualRevocation), + offsetof(struct SequenceOfIndividualRevocation, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfIndividualRevocation = { + "SequenceOfIndividualRevocation", + "SequenceOfIndividualRevocation", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfIndividualRevocation_tags_1, + sizeof(asn_DEF_SequenceOfIndividualRevocation_tags_1) + /sizeof(asn_DEF_SequenceOfIndividualRevocation_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfIndividualRevocation_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfIndividualRevocation_tags_1) + /sizeof(asn_DEF_SequenceOfIndividualRevocation_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SequenceOfIndividualRevocation_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfIndividualRevocation_1, + 1, /* Single element */ + &asn_SPC_SequenceOfIndividualRevocation_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfIndividualRevocation.h b/certgen/asncodec/SequenceOfIndividualRevocation.h new file mode 100644 index 0000000..d20df82 --- /dev/null +++ b/certgen/asncodec/SequenceOfIndividualRevocation.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfIndividualRevocation_H_ +#define _SequenceOfIndividualRevocation_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct IndividualRevocation; + +/* SequenceOfIndividualRevocation */ +typedef struct SequenceOfIndividualRevocation { + A_SEQUENCE_OF(struct IndividualRevocation) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfIndividualRevocation_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfIndividualRevocation; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfIndividualRevocation_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfIndividualRevocation_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "IndividualRevocation.h" + +#endif /* _SequenceOfIndividualRevocation_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfJMaxGroup.c b/certgen/asncodec/SequenceOfJMaxGroup.c new file mode 100644 index 0000000..7d85f7a --- /dev/null +++ b/certgen/asncodec/SequenceOfJMaxGroup.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfJMaxGroup.h" + +asn_TYPE_member_t asn_MBR_SequenceOfJMaxGroup_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_JMaxGroup, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfJMaxGroup_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfJMaxGroup_specs_1 = { + sizeof(struct SequenceOfJMaxGroup), + offsetof(struct SequenceOfJMaxGroup, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfJMaxGroup = { + "SequenceOfJMaxGroup", + "SequenceOfJMaxGroup", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfJMaxGroup_tags_1, + sizeof(asn_DEF_SequenceOfJMaxGroup_tags_1) + /sizeof(asn_DEF_SequenceOfJMaxGroup_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfJMaxGroup_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfJMaxGroup_tags_1) + /sizeof(asn_DEF_SequenceOfJMaxGroup_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfJMaxGroup_1, + 1, /* Single element */ + &asn_SPC_SequenceOfJMaxGroup_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfJMaxGroup.h b/certgen/asncodec/SequenceOfJMaxGroup.h new file mode 100644 index 0000000..498a69d --- /dev/null +++ b/certgen/asncodec/SequenceOfJMaxGroup.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfJMaxGroup_H_ +#define _SequenceOfJMaxGroup_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct JMaxGroup; + +/* SequenceOfJMaxGroup */ +typedef struct SequenceOfJMaxGroup { + A_SEQUENCE_OF(struct JMaxGroup) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfJMaxGroup_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfJMaxGroup; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfJMaxGroup_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfJMaxGroup_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "JMaxGroup.h" + +#endif /* _SequenceOfJMaxGroup_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfLAGroup.c b/certgen/asncodec/SequenceOfLAGroup.c new file mode 100644 index 0000000..ae99692 --- /dev/null +++ b/certgen/asncodec/SequenceOfLAGroup.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfLAGroup.h" + +asn_TYPE_member_t asn_MBR_SequenceOfLAGroup_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_LAGroup, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfLAGroup_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfLAGroup_specs_1 = { + sizeof(struct SequenceOfLAGroup), + offsetof(struct SequenceOfLAGroup, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfLAGroup = { + "SequenceOfLAGroup", + "SequenceOfLAGroup", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfLAGroup_tags_1, + sizeof(asn_DEF_SequenceOfLAGroup_tags_1) + /sizeof(asn_DEF_SequenceOfLAGroup_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfLAGroup_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfLAGroup_tags_1) + /sizeof(asn_DEF_SequenceOfLAGroup_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfLAGroup_1, + 1, /* Single element */ + &asn_SPC_SequenceOfLAGroup_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfLAGroup.h b/certgen/asncodec/SequenceOfLAGroup.h new file mode 100644 index 0000000..6ad4efa --- /dev/null +++ b/certgen/asncodec/SequenceOfLAGroup.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfLAGroup_H_ +#define _SequenceOfLAGroup_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct LAGroup; + +/* SequenceOfLAGroup */ +typedef struct SequenceOfLAGroup { + A_SEQUENCE_OF(struct LAGroup) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfLAGroup_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfLAGroup; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfLAGroup_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfLAGroup_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "LAGroup.h" + +#endif /* _SequenceOfLAGroup_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfLinkageSeed.c b/certgen/asncodec/SequenceOfLinkageSeed.c new file mode 100644 index 0000000..7a648b8 --- /dev/null +++ b/certgen/asncodec/SequenceOfLinkageSeed.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfLinkageSeed.h" + +asn_TYPE_member_t asn_MBR_SequenceOfLinkageSeed_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_LinkageSeed, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfLinkageSeed_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfLinkageSeed_specs_1 = { + sizeof(struct SequenceOfLinkageSeed), + offsetof(struct SequenceOfLinkageSeed, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfLinkageSeed = { + "SequenceOfLinkageSeed", + "SequenceOfLinkageSeed", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfLinkageSeed_tags_1, + sizeof(asn_DEF_SequenceOfLinkageSeed_tags_1) + /sizeof(asn_DEF_SequenceOfLinkageSeed_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfLinkageSeed_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfLinkageSeed_tags_1) + /sizeof(asn_DEF_SequenceOfLinkageSeed_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfLinkageSeed_1, + 1, /* Single element */ + &asn_SPC_SequenceOfLinkageSeed_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfLinkageSeed.h b/certgen/asncodec/SequenceOfLinkageSeed.h new file mode 100644 index 0000000..c1a677a --- /dev/null +++ b/certgen/asncodec/SequenceOfLinkageSeed.h @@ -0,0 +1,41 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "LinkageSeed.h" +#include +#include +#ifndef _SequenceOfLinkageSeed_H_ +#define _SequenceOfLinkageSeed_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SequenceOfLinkageSeed */ +typedef struct SequenceOfLinkageSeed { + A_SEQUENCE_OF(LinkageSeed_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfLinkageSeed_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfLinkageSeed; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfLinkageSeed_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfLinkageSeed_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _SequenceOfLinkageSeed_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfMaInfoStatus.c b/certgen/asncodec/SequenceOfMaInfoStatus.c new file mode 100644 index 0000000..ab9c443 --- /dev/null +++ b/certgen/asncodec/SequenceOfMaInfoStatus.c @@ -0,0 +1,60 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfMaInfoStatus.h" + +asn_TYPE_member_t asn_MBR_SequenceOfMaInfoStatus_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_MaInfoStatus, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfMaInfoStatus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfMaInfoStatus_specs_1 = { + sizeof(struct SequenceOfMaInfoStatus), + offsetof(struct SequenceOfMaInfoStatus, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfMaInfoStatus = { + "SequenceOfMaInfoStatus", + "SequenceOfMaInfoStatus", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfMaInfoStatus_tags_1, + sizeof(asn_DEF_SequenceOfMaInfoStatus_tags_1) + /sizeof(asn_DEF_SequenceOfMaInfoStatus_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfMaInfoStatus_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfMaInfoStatus_tags_1) + /sizeof(asn_DEF_SequenceOfMaInfoStatus_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfMaInfoStatus_1, + 1, /* Single element */ + &asn_SPC_SequenceOfMaInfoStatus_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfMaInfoStatus.h b/certgen/asncodec/SequenceOfMaInfoStatus.h new file mode 100644 index 0000000..59694ed --- /dev/null +++ b/certgen/asncodec/SequenceOfMaInfoStatus.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _SequenceOfMaInfoStatus_H_ +#define _SequenceOfMaInfoStatus_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct MaInfoStatus; + +/* SequenceOfMaInfoStatus */ +typedef struct SequenceOfMaInfoStatus { + A_SEQUENCE_OF(struct MaInfoStatus) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfMaInfoStatus_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfMaInfoStatus; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfMaInfoStatus_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfMaInfoStatus_1[1]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "MaInfoStatus.h" + +#endif /* _SequenceOfMaInfoStatus_H_ */ +#include diff --git a/certgen/asncodec/SequenceOfOctetString.c b/certgen/asncodec/SequenceOfOctetString.c index 14772d0..1702e8f 100644 --- a/certgen/asncodec/SequenceOfOctetString.c +++ b/certgen/asncodec/SequenceOfOctetString.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfOctetString.h" @@ -28,19 +28,31 @@ memb_OCTET_STRING_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_Member_constr_2 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SequenceOfOctetString_constr_1 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SequenceOfOctetString_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_Member_constr_2, 0, memb_OCTET_STRING_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_Member_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_OCTET_STRING_constraint_1 + }, 0, 0, /* No default value */ "" }, @@ -63,7 +75,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfOctetString = { asn_DEF_SequenceOfOctetString_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfOctetString_tags_1) /sizeof(asn_DEF_SequenceOfOctetString_tags_1[0]), /* 1 */ - { &asn_OER_type_SequenceOfOctetString_constr_1, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SequenceOfOctetString_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfOctetString_1, 1, /* Single element */ &asn_SPC_SequenceOfOctetString_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfOctetString.h b/certgen/asncodec/SequenceOfOctetString.h index a6ad45c..f180157 100644 --- a/certgen/asncodec/SequenceOfOctetString.h +++ b/certgen/asncodec/SequenceOfOctetString.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SequenceOfOctetString_H_ -#define _SequenceOfOctetString_H_ - - -#include /* Including external dependencies */ #include #include #include +#ifndef _SequenceOfOctetString_H_ +#define _SequenceOfOctetString_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SequenceOfPsid.c b/certgen/asncodec/SequenceOfPsid.c index 0e5ba78..2f9b34c 100644 --- a/certgen/asncodec/SequenceOfPsid.c +++ b/certgen/asncodec/SequenceOfPsid.c @@ -1,19 +1,27 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfPsid.h" -static asn_TYPE_member_t asn_MBR_SequenceOfPsid_1[] = { +asn_TYPE_member_t asn_MBR_SequenceOfPsid_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Psid, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -21,7 +29,7 @@ static asn_TYPE_member_t asn_MBR_SequenceOfPsid_1[] = { static const ber_tlv_tag_t asn_DEF_SequenceOfPsid_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -static asn_SET_OF_specifics_t asn_SPC_SequenceOfPsid_specs_1 = { +asn_SET_OF_specifics_t asn_SPC_SequenceOfPsid_specs_1 = { sizeof(struct SequenceOfPsid), offsetof(struct SequenceOfPsid, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfPsid = { asn_DEF_SequenceOfPsid_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfPsid_tags_1) /sizeof(asn_DEF_SequenceOfPsid_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfPsid_1, 1, /* Single element */ &asn_SPC_SequenceOfPsid_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfPsid.h b/certgen/asncodec/SequenceOfPsid.h index a253b80..a38f98a 100644 --- a/certgen/asncodec/SequenceOfPsid.h +++ b/certgen/asncodec/SequenceOfPsid.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SequenceOfPsid_H_ -#define _SequenceOfPsid_H_ - - -#include /* Including external dependencies */ #include "Psid.h" #include #include +#ifndef _SequenceOfPsid_H_ +#define _SequenceOfPsid_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -30,6 +30,8 @@ typedef struct SequenceOfPsid { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SequenceOfPsid; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfPsid_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfPsid_1[1]; #ifdef __cplusplus } diff --git a/certgen/asncodec/SequenceOfPsidGroupPermissions.c b/certgen/asncodec/SequenceOfPsidGroupPermissions.c index 6300510..37bcb86 100644 --- a/certgen/asncodec/SequenceOfPsidGroupPermissions.c +++ b/certgen/asncodec/SequenceOfPsidGroupPermissions.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfPsidGroupPermissions.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfPsidGroupPermissions_1[] = { 0, &asn_DEF_PsidGroupPermissions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfPsidGroupPermissions = { asn_DEF_SequenceOfPsidGroupPermissions_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfPsidGroupPermissions_tags_1) /sizeof(asn_DEF_SequenceOfPsidGroupPermissions_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfPsidGroupPermissions_1, 1, /* Single element */ &asn_SPC_SequenceOfPsidGroupPermissions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfPsidGroupPermissions.h b/certgen/asncodec/SequenceOfPsidGroupPermissions.h index 193bb6b..e114faa 100644 --- a/certgen/asncodec/SequenceOfPsidGroupPermissions.h +++ b/certgen/asncodec/SequenceOfPsidGroupPermissions.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfPsidGroupPermissions_H_ #define _SequenceOfPsidGroupPermissions_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfPsidSsp.c b/certgen/asncodec/SequenceOfPsidSsp.c index 7561ba2..96eafe1 100644 --- a/certgen/asncodec/SequenceOfPsidSsp.c +++ b/certgen/asncodec/SequenceOfPsidSsp.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfPsidSsp.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfPsidSsp_1[] = { 0, &asn_DEF_PsidSsp, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfPsidSsp = { asn_DEF_SequenceOfPsidSsp_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfPsidSsp_tags_1) /sizeof(asn_DEF_SequenceOfPsidSsp_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfPsidSsp_1, 1, /* Single element */ &asn_SPC_SequenceOfPsidSsp_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfPsidSsp.h b/certgen/asncodec/SequenceOfPsidSsp.h index d7f9a59..e0a90e6 100644 --- a/certgen/asncodec/SequenceOfPsidSsp.h +++ b/certgen/asncodec/SequenceOfPsidSsp.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfPsidSsp_H_ #define _SequenceOfPsidSsp_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfPsidSspRange.c b/certgen/asncodec/SequenceOfPsidSspRange.c index 77aba01..53905ab 100644 --- a/certgen/asncodec/SequenceOfPsidSspRange.c +++ b/certgen/asncodec/SequenceOfPsidSspRange.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfPsidSspRange.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfPsidSspRange_1[] = { 0, &asn_DEF_PsidSspRange, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfPsidSspRange = { asn_DEF_SequenceOfPsidSspRange_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfPsidSspRange_tags_1) /sizeof(asn_DEF_SequenceOfPsidSspRange_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfPsidSspRange_1, 1, /* Single element */ &asn_SPC_SequenceOfPsidSspRange_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfPsidSspRange.h b/certgen/asncodec/SequenceOfPsidSspRange.h index 01b5729..fdad0d1 100644 --- a/certgen/asncodec/SequenceOfPsidSspRange.h +++ b/certgen/asncodec/SequenceOfPsidSspRange.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfPsidSspRange_H_ #define _SequenceOfPsidSspRange_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfRecipientInfo.c b/certgen/asncodec/SequenceOfRecipientInfo.c index e1fcaee..82dcbba 100644 --- a/certgen/asncodec/SequenceOfRecipientInfo.c +++ b/certgen/asncodec/SequenceOfRecipientInfo.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfRecipientInfo.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfRecipientInfo_1[] = { 0, &asn_DEF_RecipientInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfRecipientInfo = { asn_DEF_SequenceOfRecipientInfo_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfRecipientInfo_tags_1) /sizeof(asn_DEF_SequenceOfRecipientInfo_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfRecipientInfo_1, 1, /* Single element */ &asn_SPC_SequenceOfRecipientInfo_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfRecipientInfo.h b/certgen/asncodec/SequenceOfRecipientInfo.h index 291a06c..93e8c15 100644 --- a/certgen/asncodec/SequenceOfRecipientInfo.h +++ b/certgen/asncodec/SequenceOfRecipientInfo.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfRecipientInfo_H_ #define _SequenceOfRecipientInfo_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfRectangularRegion.c b/certgen/asncodec/SequenceOfRectangularRegion.c index dd02eec..1d719f6 100644 --- a/certgen/asncodec/SequenceOfRectangularRegion.c +++ b/certgen/asncodec/SequenceOfRectangularRegion.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfRectangularRegion.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfRectangularRegion_1[] = { 0, &asn_DEF_RectangularRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfRectangularRegion = { asn_DEF_SequenceOfRectangularRegion_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfRectangularRegion_tags_1) /sizeof(asn_DEF_SequenceOfRectangularRegion_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfRectangularRegion_1, 1, /* Single element */ &asn_SPC_SequenceOfRectangularRegion_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfRectangularRegion.h b/certgen/asncodec/SequenceOfRectangularRegion.h index 1e4c3e9..c8c951d 100644 --- a/certgen/asncodec/SequenceOfRectangularRegion.h +++ b/certgen/asncodec/SequenceOfRectangularRegion.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfRectangularRegion_H_ #define _SequenceOfRectangularRegion_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfRegionAndSubregions.c b/certgen/asncodec/SequenceOfRegionAndSubregions.c index 56f1ce7..d630210 100644 --- a/certgen/asncodec/SequenceOfRegionAndSubregions.c +++ b/certgen/asncodec/SequenceOfRegionAndSubregions.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfRegionAndSubregions.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfRegionAndSubregions_1[] = { 0, &asn_DEF_RegionAndSubregions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfRegionAndSubregions = { asn_DEF_SequenceOfRegionAndSubregions_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfRegionAndSubregions_tags_1) /sizeof(asn_DEF_SequenceOfRegionAndSubregions_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfRegionAndSubregions_1, 1, /* Single element */ &asn_SPC_SequenceOfRegionAndSubregions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfRegionAndSubregions.h b/certgen/asncodec/SequenceOfRegionAndSubregions.h index e620479..d085d92 100644 --- a/certgen/asncodec/SequenceOfRegionAndSubregions.h +++ b/certgen/asncodec/SequenceOfRegionAndSubregions.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SequenceOfRegionAndSubregions_H_ #define _SequenceOfRegionAndSubregions_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/SequenceOfUint16.c b/certgen/asncodec/SequenceOfUint16.c index 68c35be..ca10d91 100644 --- a/certgen/asncodec/SequenceOfUint16.c +++ b/certgen/asncodec/SequenceOfUint16.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfUint16.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfUint16_1[] = { 0, &asn_DEF_Uint16, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfUint16 = { asn_DEF_SequenceOfUint16_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfUint16_tags_1) /sizeof(asn_DEF_SequenceOfUint16_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfUint16_1, 1, /* Single element */ &asn_SPC_SequenceOfUint16_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfUint16.h b/certgen/asncodec/SequenceOfUint16.h index 20e5694..8d4ff80 100644 --- a/certgen/asncodec/SequenceOfUint16.h +++ b/certgen/asncodec/SequenceOfUint16.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SequenceOfUint16_H_ -#define _SequenceOfUint16_H_ - - -#include /* Including external dependencies */ #include "Uint16.h" #include #include +#ifndef _SequenceOfUint16_H_ +#define _SequenceOfUint16_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SequenceOfUint8.c b/certgen/asncodec/SequenceOfUint8.c index f26a747..2be1077 100644 --- a/certgen/asncodec/SequenceOfUint8.c +++ b/certgen/asncodec/SequenceOfUint8.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SequenceOfUint8.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SequenceOfUint8_1[] = { 0, &asn_DEF_Uint8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -36,7 +44,15 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOfUint8 = { asn_DEF_SequenceOfUint8_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOfUint8_tags_1) /sizeof(asn_DEF_SequenceOfUint8_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_SequenceOfUint8_1, 1, /* Single element */ &asn_SPC_SequenceOfUint8_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SequenceOfUint8.h b/certgen/asncodec/SequenceOfUint8.h index a02285f..ce1f32e 100644 --- a/certgen/asncodec/SequenceOfUint8.h +++ b/certgen/asncodec/SequenceOfUint8.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SequenceOfUint8_H_ -#define _SequenceOfUint8_H_ - - -#include /* Including external dependencies */ #include "Uint8.h" #include #include +#ifndef _SequenceOfUint8_H_ +#define _SequenceOfUint8_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SequenceOfX509Certificate.c b/certgen/asncodec/SequenceOfX509Certificate.c new file mode 100644 index 0000000..bdf2474 --- /dev/null +++ b/certgen/asncodec/SequenceOfX509Certificate.c @@ -0,0 +1,65 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SequenceOfX509Certificate.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SequenceOfX509Certificate_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1 /* (SIZE(1..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_SequenceOfX509Certificate_1[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_X509Certificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "" + }, +}; +static const ber_tlv_tag_t asn_DEF_SequenceOfX509Certificate_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_SET_OF_specifics_t asn_SPC_SequenceOfX509Certificate_specs_1 = { + sizeof(struct SequenceOfX509Certificate), + offsetof(struct SequenceOfX509Certificate, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +asn_TYPE_descriptor_t asn_DEF_SequenceOfX509Certificate = { + "SequenceOfX509Certificate", + "SequenceOfX509Certificate", + &asn_OP_SEQUENCE_OF, + asn_DEF_SequenceOfX509Certificate_tags_1, + sizeof(asn_DEF_SequenceOfX509Certificate_tags_1) + /sizeof(asn_DEF_SequenceOfX509Certificate_tags_1[0]), /* 1 */ + asn_DEF_SequenceOfX509Certificate_tags_1, /* Same as above */ + sizeof(asn_DEF_SequenceOfX509Certificate_tags_1) + /sizeof(asn_DEF_SequenceOfX509Certificate_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SequenceOfX509Certificate_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, + asn_MBR_SequenceOfX509Certificate_1, + 1, /* Single element */ + &asn_SPC_SequenceOfX509Certificate_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SequenceOfX509Certificate.h b/certgen/asncodec/SequenceOfX509Certificate.h new file mode 100644 index 0000000..f3a973a --- /dev/null +++ b/certgen/asncodec/SequenceOfX509Certificate.h @@ -0,0 +1,41 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "X509Certificate.h" +#include +#include +#ifndef _SequenceOfX509Certificate_H_ +#define _SequenceOfX509Certificate_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SequenceOfX509Certificate */ +typedef struct SequenceOfX509Certificate { + A_SEQUENCE_OF(X509Certificate_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SequenceOfX509Certificate_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SequenceOfX509Certificate; +extern asn_SET_OF_specifics_t asn_SPC_SequenceOfX509Certificate_specs_1; +extern asn_TYPE_member_t asn_MBR_SequenceOfX509Certificate_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _SequenceOfX509Certificate_H_ */ +#include diff --git a/certgen/asncodec/ServiceSpecificPermissions.c b/certgen/asncodec/ServiceSpecificPermissions.c index cb46158..ff2ecca 100644 --- a/certgen/asncodec/ServiceSpecificPermissions.c +++ b/certgen/asncodec/ServiceSpecificPermissions.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ServiceSpecificPermissions.h" @@ -28,19 +28,31 @@ memb_opaque_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_opaque_constr_2 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(0..MAX)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_ServiceSpecificPermissions_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_ServiceSpecificPermissions_1[] = { { ATF_NOFLAGS, 0, offsetof(struct ServiceSpecificPermissions, choice.opaque), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_opaque_constr_2, 0, memb_opaque_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_opaque_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_opaque_constraint_1 + }, 0, 0, /* No default value */ "opaque" }, @@ -49,7 +61,15 @@ asn_TYPE_member_t asn_MBR_ServiceSpecificPermissions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BitmapSsp, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "bitmapSsp" }, @@ -76,7 +96,15 @@ asn_TYPE_descriptor_t asn_DEF_ServiceSpecificPermissions = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_ServiceSpecificPermissions_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ServiceSpecificPermissions_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_ServiceSpecificPermissions_1, 2, /* Elements count */ &asn_SPC_ServiceSpecificPermissions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ServiceSpecificPermissions.h b/certgen/asncodec/ServiceSpecificPermissions.h index 9e1f96c..aa25f9d 100644 --- a/certgen/asncodec/ServiceSpecificPermissions.h +++ b/certgen/asncodec/ServiceSpecificPermissions.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _ServiceSpecificPermissions_H_ -#define _ServiceSpecificPermissions_H_ - - -#include /* Including external dependencies */ #include #include "BitmapSsp.h" #include +#ifndef _ServiceSpecificPermissions_H_ +#define _ServiceSpecificPermissions_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SharedAtRequest.c b/certgen/asncodec/SharedAtRequest.c index 7b455d4..58452df 100644 --- a/certgen/asncodec/SharedAtRequest.c +++ b/certgen/asncodec/SharedAtRequest.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SharedAtRequest.h" @@ -52,19 +52,31 @@ memb_requestedSubjectAttributes_constraint_1(const asn_TYPE_descriptor_t *td, co return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); } +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_keyTag_constr_3 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_requestedSubjectAttributes_constr_5 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SharedAtRequest_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SharedAtRequest, eaId), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "eaId" }, @@ -73,7 +85,15 @@ asn_TYPE_member_t asn_MBR_SharedAtRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_keyTag_constr_3, 0, memb_keyTag_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_keyTag_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_keyTag_constraint_1 + }, 0, 0, /* No default value */ "keyTag" }, @@ -82,7 +102,15 @@ asn_TYPE_member_t asn_MBR_SharedAtRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CertificateFormat, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificateFormat" }, @@ -91,7 +119,15 @@ asn_TYPE_member_t asn_MBR_SharedAtRequest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CertificateSubjectAttributes, 0, - { &asn_OER_memb_requestedSubjectAttributes_constr_5, 0, memb_requestedSubjectAttributes_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_requestedSubjectAttributes_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_requestedSubjectAttributes_constraint_1 + }, 0, 0, /* No default value */ "requestedSubjectAttributes" }, @@ -123,7 +159,15 @@ asn_TYPE_descriptor_t asn_DEF_SharedAtRequest = { asn_DEF_SharedAtRequest_tags_1, /* Same as above */ sizeof(asn_DEF_SharedAtRequest_tags_1) /sizeof(asn_DEF_SharedAtRequest_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_SharedAtRequest_1, 4, /* Elements count */ &asn_SPC_SharedAtRequest_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SharedAtRequest.h b/certgen/asncodec/SharedAtRequest.h index 6f3a336..58ee62c 100644 --- a/certgen/asncodec/SharedAtRequest.h +++ b/certgen/asncodec/SharedAtRequest.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TypesAuthorization" - * found in "../asn1/EtsiTs102941/EtsiTs102941TypesAuthorization.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SharedAtRequest_H_ -#define _SharedAtRequest_H_ - - -#include /* Including external dependencies */ #include "HashedId8.h" @@ -17,6 +12,11 @@ #include "CertificateFormat.h" #include "CertificateSubjectAttributes.h" #include +#ifndef _SharedAtRequest_H_ +#define _SharedAtRequest_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/Signature.c b/certgen/asncodec/Signature.c index 5c18174..3790a1b 100644 --- a/certgen/asncodec/Signature.c +++ b/certgen/asncodec/Signature.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Signature.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Signature_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_Signature_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Signature, choice.ecdsaNistP256Signature), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EcdsaP256Signature, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecdsaNistP256Signature" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_Signature_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EcdsaP256Signature, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecdsaBrainpoolP256r1Signature" }, @@ -34,15 +52,59 @@ asn_TYPE_member_t asn_MBR_Signature_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EcdsaP384Signature, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "ecdsaBrainpoolP384r1Signature" }, + { ATF_NOFLAGS, 0, offsetof(struct Signature, choice.ecdsaNistP384Signature), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EcdsaP384Signature, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ecdsaNistP384Signature" + }, + { ATF_NOFLAGS, 0, offsetof(struct Signature, choice.sm2Signature), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_EcsigP256Signature, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sm2Signature" + }, }; static const asn_TYPE_tag2member_t asn_MAP_Signature_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ecdsaNistP256Signature */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ecdsaBrainpoolP256r1Signature */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ecdsaBrainpoolP384r1Signature */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ecdsaBrainpoolP384r1Signature */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ecdsaNistP384Signature */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* sm2Signature */ }; asn_CHOICE_specifics_t asn_SPC_Signature_specs_1 = { sizeof(struct Signature), @@ -50,7 +112,7 @@ asn_CHOICE_specifics_t asn_SPC_Signature_specs_1 = { offsetof(struct Signature, present), sizeof(((struct Signature *)0)->present), asn_MAP_Signature_tag2el_1, - 3, /* Count of tags in the map */ + 5, /* Count of tags in the map */ 0, 0, 2 /* Extensions start */ }; @@ -62,9 +124,17 @@ asn_TYPE_descriptor_t asn_DEF_Signature = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_Signature_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Signature_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_Signature_1, - 3, /* Elements count */ + 5, /* Elements count */ &asn_SPC_Signature_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/Signature.h b/certgen/asncodec/Signature.h index 22fb184..9acfd52 100644 --- a/certgen/asncodec/Signature.h +++ b/certgen/asncodec/Signature.h @@ -1,20 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _Signature_H_ -#define _Signature_H_ - - -#include /* Including external dependencies */ #include "EcdsaP256Signature.h" #include "EcdsaP384Signature.h" +#include "EcsigP256Signature.h" #include +#ifndef _Signature_H_ +#define _Signature_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -26,7 +27,9 @@ typedef enum Signature_PR { Signature_PR_ecdsaNistP256Signature, Signature_PR_ecdsaBrainpoolP256r1Signature, /* Extensions may appear below */ - Signature_PR_ecdsaBrainpoolP384r1Signature + Signature_PR_ecdsaBrainpoolP384r1Signature, + Signature_PR_ecdsaNistP384Signature, + Signature_PR_sm2Signature } Signature_PR; /* Signature */ @@ -40,6 +43,8 @@ typedef struct Signature { * possible extensions are below. */ EcdsaP384Signature_t ecdsaBrainpoolP384r1Signature; + EcdsaP384Signature_t ecdsaNistP384Signature; + EcsigP256Signature_t sm2Signature; } choice; /* Context for parsing across buffer boundaries */ @@ -49,7 +54,7 @@ typedef struct Signature { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Signature; extern asn_CHOICE_specifics_t asn_SPC_Signature_specs_1; -extern asn_TYPE_member_t asn_MBR_Signature_1[3]; +extern asn_TYPE_member_t asn_MBR_Signature_1[5]; #ifdef __cplusplus } diff --git a/certgen/asncodec/SignedAprvBinaryTree.c b/certgen/asncodec/SignedAprvBinaryTree.c new file mode 100644 index 0000000..c082f02 --- /dev/null +++ b/certgen/asncodec/SignedAprvBinaryTree.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SignedAprvBinaryTree.h" + +int +SignedAprvBinaryTree_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P1, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SignedAprvBinaryTree_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_SignedAprvBinaryTree_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_SignedAprvBinaryTree = { + "SignedAprvBinaryTree", + "SignedAprvBinaryTree", + &asn_OP_SEQUENCE, + asn_DEF_SignedAprvBinaryTree_tags_1, + sizeof(asn_DEF_SignedAprvBinaryTree_tags_1) + /sizeof(asn_DEF_SignedAprvBinaryTree_tags_1[0]), /* 1 */ + asn_DEF_SignedAprvBinaryTree_tags_1, /* Same as above */ + sizeof(asn_DEF_SignedAprvBinaryTree_tags_1) + /sizeof(asn_DEF_SignedAprvBinaryTree_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SignedAprvBinaryTree_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SignedAprvBinaryTree_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SignedAprvBinaryTree.h b/certgen/asncodec/SignedAprvBinaryTree.h new file mode 100644 index 0000000..be160f0 --- /dev/null +++ b/certgen/asncodec/SignedAprvBinaryTree.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _SignedAprvBinaryTree_H_ +#define _SignedAprvBinaryTree_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SignedAprvBinaryTree */ +typedef Ieee1609Dot2Data_Signed_228P1_t SignedAprvBinaryTree_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SignedAprvBinaryTree; +asn_struct_free_f SignedAprvBinaryTree_free; +asn_struct_print_f SignedAprvBinaryTree_print; +asn_constr_check_f SignedAprvBinaryTree_constraint; +xer_type_decoder_f SignedAprvBinaryTree_decode_xer; +xer_type_encoder_f SignedAprvBinaryTree_encode_xer; +oer_type_decoder_f SignedAprvBinaryTree_decode_oer; +oer_type_encoder_f SignedAprvBinaryTree_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SignedAprvBinaryTree_H_ */ +#include diff --git a/certgen/asncodec/SignedCertificateRequest.c b/certgen/asncodec/SignedCertificateRequest.c new file mode 100644 index 0000000..3a8a6d0 --- /dev/null +++ b/certgen/asncodec/SignedCertificateRequest.c @@ -0,0 +1,120 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SignedCertificateRequest.h" + +static asn_TYPE_member_t asn_MBR_SignedCertificateRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct SignedCertificateRequest, hashAlgorithmId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashAlgorithm, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "hashAlgorithmId" + }, + { ATF_NOFLAGS, 0, offsetof(struct SignedCertificateRequest, tbsRequest), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ScopedCertificateRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "tbsRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct SignedCertificateRequest, signer), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_SignerIdentifier, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "signer" + }, + { ATF_NOFLAGS, 0, offsetof(struct SignedCertificateRequest, signature), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_Signature, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "signature" + }, +}; +static const ber_tlv_tag_t asn_DEF_SignedCertificateRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_SignedCertificateRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* hashAlgorithmId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* tbsRequest */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* signer */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* signature */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_SignedCertificateRequest_specs_1 = { + sizeof(struct SignedCertificateRequest), + offsetof(struct SignedCertificateRequest, _asn_ctx), + asn_MAP_SignedCertificateRequest_tag2el_1, + 4, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_SignedCertificateRequest = { + "SignedCertificateRequest", + "SignedCertificateRequest", + &asn_OP_SEQUENCE, + asn_DEF_SignedCertificateRequest_tags_1, + sizeof(asn_DEF_SignedCertificateRequest_tags_1) + /sizeof(asn_DEF_SignedCertificateRequest_tags_1[0]), /* 1 */ + asn_DEF_SignedCertificateRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_SignedCertificateRequest_tags_1) + /sizeof(asn_DEF_SignedCertificateRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_SignedCertificateRequest_1, + 4, /* Elements count */ + &asn_SPC_SignedCertificateRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SignedCertificateRequest.h b/certgen/asncodec/SignedCertificateRequest.h new file mode 100644 index 0000000..d79b3fc --- /dev/null +++ b/certgen/asncodec/SignedCertificateRequest.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashAlgorithm.h" +#include "ScopedCertificateRequest.h" +#include "SignerIdentifier.h" +#include "Signature.h" +#include +#ifndef _SignedCertificateRequest_H_ +#define _SignedCertificateRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SignedCertificateRequest */ +typedef struct SignedCertificateRequest { + HashAlgorithm_t hashAlgorithmId; + ScopedCertificateRequest_t tbsRequest; + SignerIdentifier_t signer; + Signature_t signature; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SignedCertificateRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SignedCertificateRequest; + +#ifdef __cplusplus +} +#endif + +#endif /* _SignedCertificateRequest_H_ */ +#include diff --git a/certgen/asncodec/SignedData.c b/certgen/asncodec/SignedData.c index dba3039..8989ac0 100644 --- a/certgen/asncodec/SignedData.c +++ b/certgen/asncodec/SignedData.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SignedData.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SignedData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HashAlgorithm, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "hashId" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_SignedData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ToBeSignedData, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "tbsData" }, @@ -31,7 +47,15 @@ asn_TYPE_member_t asn_MBR_SignedData_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_SignerIdentifier, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "signer" }, @@ -40,7 +64,15 @@ asn_TYPE_member_t asn_MBR_SignedData_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_Signature, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "signature" }, @@ -72,7 +104,15 @@ asn_TYPE_descriptor_t asn_DEF_SignedData = { asn_DEF_SignedData_tags_1, /* Same as above */ sizeof(asn_DEF_SignedData_tags_1) /sizeof(asn_DEF_SignedData_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_SignedData_1, 4, /* Elements count */ &asn_SPC_SignedData_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SignedData.h b/certgen/asncodec/SignedData.h index 90d2969..9be3c08 100644 --- a/certgen/asncodec/SignedData.h +++ b/certgen/asncodec/SignedData.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SignedData_H_ -#define _SignedData_H_ - - -#include /* Including external dependencies */ #include "HashAlgorithm.h" #include "SignerIdentifier.h" #include "Signature.h" #include +#ifndef _SignedData_H_ +#define _SignedData_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SignedDataPayload.c b/certgen/asncodec/SignedDataPayload.c index 7c4345c..e86a9bd 100644 --- a/certgen/asncodec/SignedDataPayload.c +++ b/certgen/asncodec/SignedDataPayload.c @@ -1,50 +1,86 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SignedDataPayload.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SignedDataPayload_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SignedDataPayload_1[] = { - { ATF_POINTER, 2, offsetof(struct SignedDataPayload, data), + { ATF_POINTER, 3, offsetof(struct SignedDataPayload, data), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Ieee1609Dot2Data, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "data" }, - { ATF_POINTER, 1, offsetof(struct SignedDataPayload, extDataHash), + { ATF_POINTER, 2, offsetof(struct SignedDataPayload, extDataHash), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_HashedData, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "extDataHash" }, + { ATF_POINTER, 1, offsetof(struct SignedDataPayload, omitted), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_NULL, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "omitted" + }, }; -static const int asn_MAP_SignedDataPayload_oms_1[] = { 0, 1 }; +static const int asn_MAP_SignedDataPayload_oms_1[] = { 0, 1, 2 }; static const ber_tlv_tag_t asn_DEF_SignedDataPayload_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static const asn_TYPE_tag2member_t asn_MAP_SignedDataPayload_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* data */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* extDataHash */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* extDataHash */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* omitted */ }; asn_SEQUENCE_specifics_t asn_SPC_SignedDataPayload_specs_1 = { sizeof(struct SignedDataPayload), offsetof(struct SignedDataPayload, _asn_ctx), asn_MAP_SignedDataPayload_tag2el_1, - 2, /* Count of tags in the map */ + 3, /* Count of tags in the map */ asn_MAP_SignedDataPayload_oms_1, /* Optional members */ - 2, 0, /* Root/Additions */ + 2, 1, /* Root/Additions */ 2, /* First extension addition */ }; asn_TYPE_descriptor_t asn_DEF_SignedDataPayload = { @@ -57,9 +93,17 @@ asn_TYPE_descriptor_t asn_DEF_SignedDataPayload = { asn_DEF_SignedDataPayload_tags_1, /* Same as above */ sizeof(asn_DEF_SignedDataPayload_tags_1) /sizeof(asn_DEF_SignedDataPayload_tags_1[0]), /* 1 */ - { &asn_OER_type_SignedDataPayload_constr_1, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SignedDataPayload_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_SignedDataPayload_1, - 2, /* Elements count */ + 3, /* Elements count */ &asn_SPC_SignedDataPayload_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/SignedDataPayload.h b/certgen/asncodec/SignedDataPayload.h index 0fb9647..ce3f22d 100644 --- a/certgen/asncodec/SignedDataPayload.h +++ b/certgen/asncodec/SignedDataPayload.h @@ -1,19 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SignedDataPayload_H_ #define _SignedDataPayload_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -24,12 +25,13 @@ struct HashedData; /* SignedDataPayload */ typedef struct SignedDataPayload { - struct Ieee1609Dot2Data *data /* OPTIONAL */; - struct HashedData *extDataHash /* OPTIONAL */; + struct Ieee1609Dot2Data *data; /* OPTIONAL */ + struct HashedData *extDataHash; /* OPTIONAL */ /* * This type is extensible, * possible extensions are below. */ + NULL_t *omitted; /* OPTIONAL */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; @@ -38,7 +40,7 @@ typedef struct SignedDataPayload { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SignedDataPayload; extern asn_SEQUENCE_specifics_t asn_SPC_SignedDataPayload_specs_1; -extern asn_TYPE_member_t asn_MBR_SignedDataPayload_1[2]; +extern asn_TYPE_member_t asn_MBR_SignedDataPayload_1[3]; #ifdef __cplusplus } diff --git a/certgen/asncodec/SignedIndividualAprv.c b/certgen/asncodec/SignedIndividualAprv.c new file mode 100644 index 0000000..1ac8e64 --- /dev/null +++ b/certgen/asncodec/SignedIndividualAprv.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SignedIndividualAprv.h" + +int +SignedIndividualAprv_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Signed_228P1, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SignedIndividualAprv_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_SignedIndividualAprv_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_SignedIndividualAprv = { + "SignedIndividualAprv", + "SignedIndividualAprv", + &asn_OP_SEQUENCE, + asn_DEF_SignedIndividualAprv_tags_1, + sizeof(asn_DEF_SignedIndividualAprv_tags_1) + /sizeof(asn_DEF_SignedIndividualAprv_tags_1[0]), /* 1 */ + asn_DEF_SignedIndividualAprv_tags_1, /* Same as above */ + sizeof(asn_DEF_SignedIndividualAprv_tags_1) + /sizeof(asn_DEF_SignedIndividualAprv_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SignedIndividualAprv_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SignedIndividualAprv_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SignedIndividualAprv.h b/certgen/asncodec/SignedIndividualAprv.h new file mode 100644 index 0000000..63bae3f --- /dev/null +++ b/certgen/asncodec/SignedIndividualAprv.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Signed.h" +#ifndef _SignedIndividualAprv_H_ +#define _SignedIndividualAprv_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SignedIndividualAprv */ +typedef Ieee1609Dot2Data_Signed_228P1_t SignedIndividualAprv_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SignedIndividualAprv; +asn_struct_free_f SignedIndividualAprv_free; +asn_struct_print_f SignedIndividualAprv_print; +asn_constr_check_f SignedIndividualAprv_constraint; +xer_type_decoder_f SignedIndividualAprv_decode_xer; +xer_type_encoder_f SignedIndividualAprv_encode_xer; +oer_type_decoder_f SignedIndividualAprv_decode_oer; +oer_type_encoder_f SignedIndividualAprv_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SignedIndividualAprv_H_ */ +#include diff --git a/certgen/asncodec/SignedX509CertificateRequest.c b/certgen/asncodec/SignedX509CertificateRequest.c new file mode 100644 index 0000000..031ff2e --- /dev/null +++ b/certgen/asncodec/SignedX509CertificateRequest.c @@ -0,0 +1,120 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SignedX509CertificateRequest.h" + +static asn_TYPE_member_t asn_MBR_SignedX509CertificateRequest_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct SignedX509CertificateRequest, hashAlgorithmId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashAlgorithm, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "hashAlgorithmId" + }, + { ATF_NOFLAGS, 0, offsetof(struct SignedX509CertificateRequest, tbsRequest), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ScopedCertificateRequest, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "tbsRequest" + }, + { ATF_NOFLAGS, 0, offsetof(struct SignedX509CertificateRequest, signer), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_X509SignerIdentifier, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "signer" + }, + { ATF_NOFLAGS, 0, offsetof(struct SignedX509CertificateRequest, signature), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_Signature, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "signature" + }, +}; +static const ber_tlv_tag_t asn_DEF_SignedX509CertificateRequest_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_SignedX509CertificateRequest_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* hashAlgorithmId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* tbsRequest */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* signer */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* signature */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_SignedX509CertificateRequest_specs_1 = { + sizeof(struct SignedX509CertificateRequest), + offsetof(struct SignedX509CertificateRequest, _asn_ctx), + asn_MAP_SignedX509CertificateRequest_tag2el_1, + 4, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_SignedX509CertificateRequest = { + "SignedX509CertificateRequest", + "SignedX509CertificateRequest", + &asn_OP_SEQUENCE, + asn_DEF_SignedX509CertificateRequest_tags_1, + sizeof(asn_DEF_SignedX509CertificateRequest_tags_1) + /sizeof(asn_DEF_SignedX509CertificateRequest_tags_1[0]), /* 1 */ + asn_DEF_SignedX509CertificateRequest_tags_1, /* Same as above */ + sizeof(asn_DEF_SignedX509CertificateRequest_tags_1) + /sizeof(asn_DEF_SignedX509CertificateRequest_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_SignedX509CertificateRequest_1, + 4, /* Elements count */ + &asn_SPC_SignedX509CertificateRequest_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SignedX509CertificateRequest.h b/certgen/asncodec/SignedX509CertificateRequest.h new file mode 100644 index 0000000..b49756e --- /dev/null +++ b/certgen/asncodec/SignedX509CertificateRequest.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "HashAlgorithm.h" +#include "ScopedCertificateRequest.h" +#include "X509SignerIdentifier.h" +#include "Signature.h" +#include +#ifndef _SignedX509CertificateRequest_H_ +#define _SignedX509CertificateRequest_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SignedX509CertificateRequest */ +typedef struct SignedX509CertificateRequest { + HashAlgorithm_t hashAlgorithmId; + ScopedCertificateRequest_t tbsRequest; + X509SignerIdentifier_t signer; + Signature_t signature; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SignedX509CertificateRequest_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SignedX509CertificateRequest; + +#ifdef __cplusplus +} +#endif + +#endif /* _SignedX509CertificateRequest_H_ */ +#include diff --git a/certgen/asncodec/SignerIdentifier.c b/certgen/asncodec/SignerIdentifier.c index 02ee679..cba0ed4 100644 --- a/certgen/asncodec/SignerIdentifier.c +++ b/certgen/asncodec/SignerIdentifier.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SignerIdentifier.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SignerIdentifier_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SignerIdentifier_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SignerIdentifier, choice.digest), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "digest" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_SignerIdentifier_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfCertificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certificate" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_SignerIdentifier_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NULL, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "self" }, @@ -62,7 +88,15 @@ asn_TYPE_descriptor_t asn_DEF_SignerIdentifier = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_SignerIdentifier_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SignerIdentifier_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_SignerIdentifier_1, 3, /* Elements count */ &asn_SPC_SignerIdentifier_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SignerIdentifier.h b/certgen/asncodec/SignerIdentifier.h index 763a88a..85b4c31 100644 --- a/certgen/asncodec/SignerIdentifier.h +++ b/certgen/asncodec/SignerIdentifier.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SignerIdentifier_H_ -#define _SignerIdentifier_H_ - - -#include /* Including external dependencies */ #include "HashedId8.h" #include "SequenceOfCertificate.h" #include #include +#ifndef _SignerIdentifier_H_ +#define _SignerIdentifier_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SignerSelf.c b/certgen/asncodec/SignerSelf.c new file mode 100644 index 0000000..d6f21ff --- /dev/null +++ b/certgen/asncodec/SignerSelf.c @@ -0,0 +1,59 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SignerSelf.h" + +int +SignerSelf_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using SignerIdentifier, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SignerSelf_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_descriptor_t asn_DEF_SignerSelf = { + "SignerSelf", + "SignerSelf", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SignerSelf_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SignerSelf_constraint + }, + asn_MBR_SignerIdentifier_1, + 3, /* Elements count */ + &asn_SPC_SignerIdentifier_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SignerSelf.h b/certgen/asncodec/SignerSelf.h new file mode 100644 index 0000000..2f28745 --- /dev/null +++ b/certgen/asncodec/SignerSelf.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "SignerIdentifier.h" +#ifndef _SignerSelf_H_ +#define _SignerSelf_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SignerSelf */ +typedef SignerIdentifier_t SignerSelf_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SignerSelf; +asn_struct_free_f SignerSelf_free; +asn_struct_print_f SignerSelf_print; +asn_constr_check_f SignerSelf_constraint; +xer_type_decoder_f SignerSelf_decode_xer; +xer_type_encoder_f SignerSelf_encode_xer; +oer_type_decoder_f SignerSelf_decode_oer; +oer_type_encoder_f SignerSelf_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SignerSelf_H_ */ +#include diff --git a/certgen/asncodec/SignerSingleCert.c b/certgen/asncodec/SignerSingleCert.c new file mode 100644 index 0000000..b2fa679 --- /dev/null +++ b/certgen/asncodec/SignerSingleCert.c @@ -0,0 +1,59 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SignerSingleCert.h" + +int +SignerSingleCert_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using SignerIdentifier, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SignerSingleCert_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_descriptor_t asn_DEF_SignerSingleCert = { + "SignerSingleCert", + "SignerSingleCert", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SignerSingleCert_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SignerSingleCert_constraint + }, + asn_MBR_SignerIdentifier_1, + 3, /* Elements count */ + &asn_SPC_SignerIdentifier_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SignerSingleCert.h b/certgen/asncodec/SignerSingleCert.h new file mode 100644 index 0000000..d208173 --- /dev/null +++ b/certgen/asncodec/SignerSingleCert.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "SignerIdentifier.h" +#ifndef _SignerSingleCert_H_ +#define _SignerSingleCert_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SignerSingleCert */ +typedef SignerIdentifier_t SignerSingleCert_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SignerSingleCert; +asn_struct_free_f SignerSingleCert_free; +asn_struct_print_f SignerSingleCert_print; +asn_constr_check_f SignerSingleCert_constraint; +xer_type_decoder_f SignerSingleCert_decode_xer; +xer_type_encoder_f SignerSingleCert_encode_xer; +oer_type_decoder_f SignerSingleCert_decode_oer; +oer_type_encoder_f SignerSingleCert_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SignerSingleCert_H_ */ +#include diff --git a/certgen/asncodec/SignerSingleX509Cert.c b/certgen/asncodec/SignerSingleX509Cert.c new file mode 100644 index 0000000..037e21d --- /dev/null +++ b/certgen/asncodec/SignerSingleX509Cert.c @@ -0,0 +1,59 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "SignerSingleX509Cert.h" + +int +SignerSingleX509Cert_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using X509SignerIdentifier, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_SignerSingleX509Cert_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_descriptor_t asn_DEF_SignerSingleX509Cert = { + "SignerSingleX509Cert", + "SignerSingleX509Cert", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SignerSingleX509Cert_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SignerSingleX509Cert_constraint + }, + asn_MBR_X509SignerIdentifier_1, + 1, /* Elements count */ + &asn_SPC_X509SignerIdentifier_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/SignerSingleX509Cert.h b/certgen/asncodec/SignerSingleX509Cert.h new file mode 100644 index 0000000..d76d985 --- /dev/null +++ b/certgen/asncodec/SignerSingleX509Cert.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "X509SignerIdentifier.h" +#ifndef _SignerSingleX509Cert_H_ +#define _SignerSingleX509Cert_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SignerSingleX509Cert */ +typedef X509SignerIdentifier_t SignerSingleX509Cert_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SignerSingleX509Cert; +asn_struct_free_f SignerSingleX509Cert_free; +asn_struct_print_f SignerSingleX509Cert_print; +asn_constr_check_f SignerSingleX509Cert_constraint; +xer_type_decoder_f SignerSingleX509Cert_decode_xer; +xer_type_encoder_f SignerSingleX509Cert_encode_xer; +oer_type_decoder_f SignerSingleX509Cert_decode_oer; +oer_type_encoder_f SignerSingleX509Cert_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _SignerSingleX509Cert_H_ */ +#include diff --git a/certgen/asncodec/SingleEtsiTs103097Certificate.c b/certgen/asncodec/SingleEtsiTs103097Certificate.c deleted file mode 100644 index b623532..0000000 --- a/certgen/asncodec/SingleEtsiTs103097Certificate.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` - */ - -#include "SingleEtsiTs103097Certificate.h" - -static asn_TYPE_member_t asn_MBR_SingleEtsiTs103097Certificate_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct SingleEtsiTs103097Certificate, only), - (ASN_TAG_CLASS_CONTEXT | (0 << 2)), - -1, /* IMPLICIT tag at current level */ - &asn_DEF_EtsiTs103097Certificate, - 0, - { 0, 0, 0 }, - 0, 0, /* No default value */ - "only" - }, -}; -static const ber_tlv_tag_t asn_DEF_SingleEtsiTs103097Certificate_tags_1[] = { - (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) -}; -static const asn_TYPE_tag2member_t asn_MAP_SingleEtsiTs103097Certificate_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* only */ -}; -static asn_SEQUENCE_specifics_t asn_SPC_SingleEtsiTs103097Certificate_specs_1 = { - sizeof(struct SingleEtsiTs103097Certificate), - offsetof(struct SingleEtsiTs103097Certificate, _asn_ctx), - asn_MAP_SingleEtsiTs103097Certificate_tag2el_1, - 1, /* Count of tags in the map */ - 0, 0, 0, /* Optional elements (not needed) */ - -1, /* First extension addition */ -}; -asn_TYPE_descriptor_t asn_DEF_SingleEtsiTs103097Certificate = { - "SingleEtsiTs103097Certificate", - "SingleEtsiTs103097Certificate", - &asn_OP_SEQUENCE, - asn_DEF_SingleEtsiTs103097Certificate_tags_1, - sizeof(asn_DEF_SingleEtsiTs103097Certificate_tags_1) - /sizeof(asn_DEF_SingleEtsiTs103097Certificate_tags_1[0]), /* 1 */ - asn_DEF_SingleEtsiTs103097Certificate_tags_1, /* Same as above */ - sizeof(asn_DEF_SingleEtsiTs103097Certificate_tags_1) - /sizeof(asn_DEF_SingleEtsiTs103097Certificate_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, - asn_MBR_SingleEtsiTs103097Certificate_1, - 1, /* Elements count */ - &asn_SPC_SingleEtsiTs103097Certificate_specs_1 /* Additional specs */ -}; - diff --git a/certgen/asncodec/SingleEtsiTs103097Certificate.h b/certgen/asncodec/SingleEtsiTs103097Certificate.h deleted file mode 100644 index de3a450..0000000 --- a/certgen/asncodec/SingleEtsiTs103097Certificate.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "EtsiTs103097Module" - * found in "../asn1/EtsiTs103097/EtsiTs103097Module.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` - */ - -#ifndef _SingleEtsiTs103097Certificate_H_ -#define _SingleEtsiTs103097Certificate_H_ - - -#include - -/* Including external dependencies */ -#include "EtsiTs103097Certificate.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* SingleEtsiTs103097Certificate */ -typedef struct SingleEtsiTs103097Certificate { - EtsiTs103097Certificate_t only; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SingleEtsiTs103097Certificate_t; - -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SingleEtsiTs103097Certificate; - -#ifdef __cplusplus -} -#endif - -#endif /* _SingleEtsiTs103097Certificate_H_ */ -#include diff --git a/certgen/asncodec/SspRange.c b/certgen/asncodec/SspRange.c index 3bc5e06..7719b5a 100644 --- a/certgen/asncodec/SspRange.c +++ b/certgen/asncodec/SspRange.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SspRange.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SspRange_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SspRange_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SspRange, choice.opaque), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfOctetString, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "opaque" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_SspRange_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NULL, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "all" }, @@ -34,7 +52,15 @@ asn_TYPE_member_t asn_MBR_SspRange_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BitmapSspRange, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "bitmapSspRange" }, @@ -62,7 +88,15 @@ asn_TYPE_descriptor_t asn_DEF_SspRange = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_SspRange_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SspRange_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_SspRange_1, 3, /* Elements count */ &asn_SPC_SspRange_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SspRange.h b/certgen/asncodec/SspRange.h index 588d53d..c022bc6 100644 --- a/certgen/asncodec/SspRange.h +++ b/certgen/asncodec/SspRange.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SspRange_H_ -#define _SspRange_H_ - - -#include /* Including external dependencies */ #include "SequenceOfOctetString.h" #include #include "BitmapSspRange.h" #include +#ifndef _SspRange_H_ +#define _SspRange_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SubjectAssurance.c b/certgen/asncodec/SubjectAssurance.c index 43cf0cc..2d24b9b 100644 --- a/certgen/asncodec/SubjectAssurance.c +++ b/certgen/asncodec/SubjectAssurance.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SubjectAssurance.h" @@ -37,9 +37,11 @@ SubjectAssurance_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SubjectAssurance_constr_1 CC_NOTUSED = { { 0, 0 }, 1 /* (SIZE(1..1)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_SubjectAssurance_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; @@ -53,7 +55,15 @@ asn_TYPE_descriptor_t asn_DEF_SubjectAssurance = { asn_DEF_SubjectAssurance_tags_1, /* Same as above */ sizeof(asn_DEF_SubjectAssurance_tags_1) /sizeof(asn_DEF_SubjectAssurance_tags_1[0]), /* 1 */ - { &asn_OER_type_SubjectAssurance_constr_1, 0, SubjectAssurance_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SubjectAssurance_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SubjectAssurance_constraint + }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ }; diff --git a/certgen/asncodec/SubjectAssurance.h b/certgen/asncodec/SubjectAssurance.h index aecd7ca..2650bf2 100644 --- a/certgen/asncodec/SubjectAssurance.h +++ b/certgen/asncodec/SubjectAssurance.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _SubjectAssurance_H_ #define _SubjectAssurance_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_SubjectAssurance; asn_struct_free_f SubjectAssurance_free; asn_struct_print_f SubjectAssurance_print; asn_constr_check_f SubjectAssurance_constraint; -ber_type_decoder_f SubjectAssurance_decode_ber; -der_type_encoder_f SubjectAssurance_encode_der; xer_type_decoder_f SubjectAssurance_decode_xer; xer_type_encoder_f SubjectAssurance_encode_xer; oer_type_decoder_f SubjectAssurance_decode_oer; diff --git a/certgen/asncodec/SubjectPermissions.c b/certgen/asncodec/SubjectPermissions.c index 6472ff3..40db0e2 100644 --- a/certgen/asncodec/SubjectPermissions.c +++ b/certgen/asncodec/SubjectPermissions.c @@ -1,22 +1,32 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SubjectPermissions.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SubjectPermissions_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SubjectPermissions_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SubjectPermissions, choice.Explicit), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfPsidSspRange, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "explicit" }, @@ -25,7 +35,15 @@ asn_TYPE_member_t asn_MBR_SubjectPermissions_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NULL, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "all" }, @@ -52,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_SubjectPermissions = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_SubjectPermissions_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SubjectPermissions_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_SubjectPermissions_1, 2, /* Elements count */ &asn_SPC_SubjectPermissions_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SubjectPermissions.h b/certgen/asncodec/SubjectPermissions.h index a3f1c18..df91261 100644 --- a/certgen/asncodec/SubjectPermissions.h +++ b/certgen/asncodec/SubjectPermissions.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SubjectPermissions_H_ -#define _SubjectPermissions_H_ - - -#include /* Including external dependencies */ #include "SequenceOfPsidSspRange.h" #include #include +#ifndef _SubjectPermissions_H_ +#define _SubjectPermissions_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SymmAlgorithm.c b/certgen/asncodec/SymmAlgorithm.c index a7b9ecf..c775d52 100644 --- a/certgen/asncodec/SymmAlgorithm.c +++ b/certgen/asncodec/SymmAlgorithm.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SymmAlgorithm.h" @@ -11,21 +11,25 @@ * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SymmAlgorithm_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const asn_INTEGER_enum_map_t asn_MAP_SymmAlgorithm_value2enum_1[] = { - { 0, 9, "aes128Ccm" } + { 0, 9, "aes128Ccm" }, + { 1, 6, "sm4Ccm" } /* This list is extensible */ }; static const unsigned int asn_MAP_SymmAlgorithm_enum2value_1[] = { - 0 /* aes128Ccm(0) */ + 0, /* aes128Ccm(0) */ + 1 /* sm4Ccm(1) */ /* This list is extensible */ }; const asn_INTEGER_specifics_t asn_SPC_SymmAlgorithm_specs_1 = { asn_MAP_SymmAlgorithm_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_SymmAlgorithm_enum2value_1, /* N => "tag"; sorted by N */ - 1, /* Number of elements in the maps */ + 2, /* Number of elements in the maps */ 2, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ @@ -44,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_SymmAlgorithm = { asn_DEF_SymmAlgorithm_tags_1, /* Same as above */ sizeof(asn_DEF_SymmAlgorithm_tags_1) /sizeof(asn_DEF_SymmAlgorithm_tags_1[0]), /* 1 */ - { &asn_OER_type_SymmAlgorithm_constr_1, 0, NativeEnumerated_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SymmAlgorithm_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeEnumerated_constraint + }, 0, 0, /* Defined elsewhere */ &asn_SPC_SymmAlgorithm_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/SymmAlgorithm.h b/certgen/asncodec/SymmAlgorithm.h index 34c2e1a..8582fe0 100644 --- a/certgen/asncodec/SymmAlgorithm.h +++ b/certgen/asncodec/SymmAlgorithm.h @@ -1,29 +1,30 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _SymmAlgorithm_H_ #define _SymmAlgorithm_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum SymmAlgorithm { - SymmAlgorithm_aes128Ccm = 0 + SymmAlgorithm_aes128Ccm = 0, /* * Enumeration is extensible */ + SymmAlgorithm_sm4Ccm = 1 } e_SymmAlgorithm; /* SymmAlgorithm */ @@ -35,8 +36,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_SymmAlgorithm_specs_1; asn_struct_free_f SymmAlgorithm_free; asn_struct_print_f SymmAlgorithm_print; asn_constr_check_f SymmAlgorithm_constraint; -ber_type_decoder_f SymmAlgorithm_decode_ber; -der_type_encoder_f SymmAlgorithm_encode_der; xer_type_decoder_f SymmAlgorithm_decode_xer; xer_type_encoder_f SymmAlgorithm_encode_xer; oer_type_decoder_f SymmAlgorithm_decode_oer; diff --git a/certgen/asncodec/SymmRecipientInfo.c b/certgen/asncodec/SymmRecipientInfo.c index 95e218b..b8243c4 100644 --- a/certgen/asncodec/SymmRecipientInfo.c +++ b/certgen/asncodec/SymmRecipientInfo.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SymmRecipientInfo.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_SymmRecipientInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId8, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "recipientId" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_SymmRecipientInfo_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_SymmetricCiphertext, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "encKey" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_SymmRecipientInfo = { asn_DEF_SymmRecipientInfo_tags_1, /* Same as above */ sizeof(asn_DEF_SymmRecipientInfo_tags_1) /sizeof(asn_DEF_SymmRecipientInfo_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_SymmRecipientInfo_1, 2, /* Elements count */ &asn_SPC_SymmRecipientInfo_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/SymmRecipientInfo.h b/certgen/asncodec/SymmRecipientInfo.h index 89d9923..ad72553 100644 --- a/certgen/asncodec/SymmRecipientInfo.h +++ b/certgen/asncodec/SymmRecipientInfo.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _SymmRecipientInfo_H_ -#define _SymmRecipientInfo_H_ - - -#include /* Including external dependencies */ #include "HashedId8.h" #include "SymmetricCiphertext.h" #include +#ifndef _SymmRecipientInfo_H_ +#define _SymmRecipientInfo_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/SymmetricCiphertext.c b/certgen/asncodec/SymmetricCiphertext.c index 0680a49..0255261 100644 --- a/certgen/asncodec/SymmetricCiphertext.c +++ b/certgen/asncodec/SymmetricCiphertext.c @@ -1,28 +1,56 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SymmetricCiphertext.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SymmetricCiphertext_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SymmetricCiphertext_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SymmetricCiphertext, choice.aes128ccm), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ - &asn_DEF_AesCcmCiphertext, + &asn_DEF_One28BitCcmCiphertext, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "aes128ccm" }, + { ATF_NOFLAGS, 0, offsetof(struct SymmetricCiphertext, choice.sm4Ccm), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_One28BitCcmCiphertext, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sm4Ccm" + }, }; static const asn_TYPE_tag2member_t asn_MAP_SymmetricCiphertext_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* aes128ccm */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* aes128ccm */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sm4Ccm */ }; asn_CHOICE_specifics_t asn_SPC_SymmetricCiphertext_specs_1 = { sizeof(struct SymmetricCiphertext), @@ -30,7 +58,7 @@ asn_CHOICE_specifics_t asn_SPC_SymmetricCiphertext_specs_1 = { offsetof(struct SymmetricCiphertext, present), sizeof(((struct SymmetricCiphertext *)0)->present), asn_MAP_SymmetricCiphertext_tag2el_1, - 1, /* Count of tags in the map */ + 2, /* Count of tags in the map */ 0, 0, 1 /* Extensions start */ }; @@ -42,9 +70,17 @@ asn_TYPE_descriptor_t asn_DEF_SymmetricCiphertext = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_SymmetricCiphertext_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SymmetricCiphertext_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_SymmetricCiphertext_1, - 1, /* Elements count */ + 2, /* Elements count */ &asn_SPC_SymmetricCiphertext_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/SymmetricCiphertext.h b/certgen/asncodec/SymmetricCiphertext.h index b36d3bd..2b6044a 100644 --- a/certgen/asncodec/SymmetricCiphertext.h +++ b/certgen/asncodec/SymmetricCiphertext.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "One28BitCcmCiphertext.h" +#include #ifndef _SymmetricCiphertext_H_ #define _SymmetricCiphertext_H_ #include -/* Including external dependencies */ -#include "AesCcmCiphertext.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -22,20 +22,21 @@ extern "C" { /* Dependencies */ typedef enum SymmetricCiphertext_PR { SymmetricCiphertext_PR_NOTHING, /* No components present */ - SymmetricCiphertext_PR_aes128ccm + SymmetricCiphertext_PR_aes128ccm, /* Extensions may appear below */ - + SymmetricCiphertext_PR_sm4Ccm } SymmetricCiphertext_PR; /* SymmetricCiphertext */ typedef struct SymmetricCiphertext { SymmetricCiphertext_PR present; union SymmetricCiphertext_u { - AesCcmCiphertext_t aes128ccm; + One28BitCcmCiphertext_t aes128ccm; /* * This type is extensible, * possible extensions are below. */ + One28BitCcmCiphertext_t sm4Ccm; } choice; /* Context for parsing across buffer boundaries */ @@ -45,7 +46,7 @@ typedef struct SymmetricCiphertext { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SymmetricCiphertext; extern asn_CHOICE_specifics_t asn_SPC_SymmetricCiphertext_specs_1; -extern asn_TYPE_member_t asn_MBR_SymmetricCiphertext_1[1]; +extern asn_TYPE_member_t asn_MBR_SymmetricCiphertext_1[2]; #ifdef __cplusplus } diff --git a/certgen/asncodec/SymmetricEncryptionKey.c b/certgen/asncodec/SymmetricEncryptionKey.c index f572729..24f6b15 100644 --- a/certgen/asncodec/SymmetricEncryptionKey.c +++ b/certgen/asncodec/SymmetricEncryptionKey.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "SymmetricEncryptionKey.h" @@ -33,25 +33,86 @@ memb_aes128Ccm_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } } +static int +memb_sm4Ccm_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + size = st->size; + + if((size == 16)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_memb_aes128Ccm_constr_2 CC_NOTUSED = { { 0, 0 }, 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_sm4Ccm_constr_4 CC_NOTUSED = { + { 0, 0 }, + 16 /* (SIZE(16..16)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_SymmetricEncryptionKey_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_SymmetricEncryptionKey_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SymmetricEncryptionKey, choice.aes128Ccm), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, 0, - { &asn_OER_memb_aes128Ccm_constr_2, 0, memb_aes128Ccm_constraint_1 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_aes128Ccm_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_aes128Ccm_constraint_1 + }, 0, 0, /* No default value */ "aes128Ccm" }, + { ATF_NOFLAGS, 0, offsetof(struct SymmetricEncryptionKey, choice.sm4Ccm), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_OCTET_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_sm4Ccm_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_sm4Ccm_constraint_1 + }, + 0, 0, /* No default value */ + "sm4Ccm" + }, }; static const asn_TYPE_tag2member_t asn_MAP_SymmetricEncryptionKey_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* aes128Ccm */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* aes128Ccm */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sm4Ccm */ }; asn_CHOICE_specifics_t asn_SPC_SymmetricEncryptionKey_specs_1 = { sizeof(struct SymmetricEncryptionKey), @@ -59,7 +120,7 @@ asn_CHOICE_specifics_t asn_SPC_SymmetricEncryptionKey_specs_1 = { offsetof(struct SymmetricEncryptionKey, present), sizeof(((struct SymmetricEncryptionKey *)0)->present), asn_MAP_SymmetricEncryptionKey_tag2el_1, - 1, /* Count of tags in the map */ + 2, /* Count of tags in the map */ 0, 0, 1 /* Extensions start */ }; @@ -71,9 +132,17 @@ asn_TYPE_descriptor_t asn_DEF_SymmetricEncryptionKey = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_SymmetricEncryptionKey_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_SymmetricEncryptionKey_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_SymmetricEncryptionKey_1, - 1, /* Elements count */ + 2, /* Elements count */ &asn_SPC_SymmetricEncryptionKey_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/SymmetricEncryptionKey.h b/certgen/asncodec/SymmetricEncryptionKey.h index f146067..01ef07f 100644 --- a/certgen/asncodec/SymmetricEncryptionKey.h +++ b/certgen/asncodec/SymmetricEncryptionKey.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include +#include #ifndef _SymmetricEncryptionKey_H_ #define _SymmetricEncryptionKey_H_ #include -/* Including external dependencies */ -#include -#include - #ifdef __cplusplus extern "C" { #endif @@ -22,9 +22,9 @@ extern "C" { /* Dependencies */ typedef enum SymmetricEncryptionKey_PR { SymmetricEncryptionKey_PR_NOTHING, /* No components present */ - SymmetricEncryptionKey_PR_aes128Ccm + SymmetricEncryptionKey_PR_aes128Ccm, /* Extensions may appear below */ - + SymmetricEncryptionKey_PR_sm4Ccm } SymmetricEncryptionKey_PR; /* SymmetricEncryptionKey */ @@ -36,6 +36,7 @@ typedef struct SymmetricEncryptionKey { * This type is extensible, * possible extensions are below. */ + OCTET_STRING_t sm4Ccm; } choice; /* Context for parsing across buffer boundaries */ @@ -45,7 +46,7 @@ typedef struct SymmetricEncryptionKey { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SymmetricEncryptionKey; extern asn_CHOICE_specifics_t asn_SPC_SymmetricEncryptionKey_specs_1; -extern asn_TYPE_member_t asn_MBR_SymmetricEncryptionKey_1[1]; +extern asn_TYPE_member_t asn_MBR_SymmetricEncryptionKey_1[2]; #ifdef __cplusplus } diff --git a/certgen/asncodec/TestCertificate.c b/certgen/asncodec/TestCertificate.c new file mode 100644 index 0000000..d1a737d --- /dev/null +++ b/certgen/asncodec/TestCertificate.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "TestCertificate.h" + +int +TestCertificate_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Certificate, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_TestCertificate_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_TestCertificate_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_TestCertificate = { + "TestCertificate", + "TestCertificate", + &asn_OP_SEQUENCE, + asn_DEF_TestCertificate_tags_1, + sizeof(asn_DEF_TestCertificate_tags_1) + /sizeof(asn_DEF_TestCertificate_tags_1[0]), /* 1 */ + asn_DEF_TestCertificate_tags_1, /* Same as above */ + sizeof(asn_DEF_TestCertificate_tags_1) + /sizeof(asn_DEF_TestCertificate_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_TestCertificate_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + TestCertificate_constraint + }, + asn_MBR_CertificateBase_1, + 5, /* Elements count */ + &asn_SPC_CertificateBase_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/TestCertificate.h b/certgen/asncodec/TestCertificate.h new file mode 100644 index 0000000..4674042 --- /dev/null +++ b/certgen/asncodec/TestCertificate.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Certificate.h" +#ifndef _TestCertificate_H_ +#define _TestCertificate_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* TestCertificate */ +typedef Certificate_t TestCertificate_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_TestCertificate; +asn_struct_free_f TestCertificate_free; +asn_struct_print_f TestCertificate_print; +asn_constr_check_f TestCertificate_constraint; +xer_type_decoder_f TestCertificate_decode_xer; +xer_type_encoder_f TestCertificate_encode_xer; +oer_type_decoder_f TestCertificate_decode_oer; +oer_type_encoder_f TestCertificate_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _TestCertificate_H_ */ +#include diff --git a/certgen/asncodec/TestSecurityMgmtSsp.c b/certgen/asncodec/TestSecurityMgmtSsp.c new file mode 100644 index 0000000..84d852c --- /dev/null +++ b/certgen/asncodec/TestSecurityMgmtSsp.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "TestSecurityMgmtSsp.h" + +/* + * This type is implemented using SecurityMgmtSsp, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_TestSecurityMgmtSsp_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_descriptor_t asn_DEF_TestSecurityMgmtSsp = { + "TestSecurityMgmtSsp", + "TestSecurityMgmtSsp", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_SecurityMgmtSsp_1, + 14, /* Elements count */ + &asn_SPC_SecurityMgmtSsp_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/TestSecurityMgmtSsp.h b/certgen/asncodec/TestSecurityMgmtSsp.h new file mode 100644 index 0000000..36f6da8 --- /dev/null +++ b/certgen/asncodec/TestSecurityMgmtSsp.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "SecurityMgmtSsp.h" +#ifndef _TestSecurityMgmtSsp_H_ +#define _TestSecurityMgmtSsp_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* TestSecurityMgmtSsp */ +typedef SecurityMgmtSsp_t TestSecurityMgmtSsp_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_TestSecurityMgmtSsp; +asn_struct_free_f TestSecurityMgmtSsp_free; +asn_struct_print_f TestSecurityMgmtSsp_print; +asn_constr_check_f TestSecurityMgmtSsp_constraint; +xer_type_decoder_f TestSecurityMgmtSsp_decode_xer; +xer_type_encoder_f TestSecurityMgmtSsp_encode_xer; +oer_type_decoder_f TestSecurityMgmtSsp_decode_oer; +oer_type_encoder_f TestSecurityMgmtSsp_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _TestSecurityMgmtSsp_H_ */ +#include diff --git a/certgen/asncodec/ThreeDLocation.c b/certgen/asncodec/ThreeDLocation.c index b28e5d4..5aa2ff6 100644 --- a/certgen/asncodec/ThreeDLocation.c +++ b/certgen/asncodec/ThreeDLocation.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ThreeDLocation.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_ThreeDLocation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Latitude, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "latitude" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_ThreeDLocation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Longitude, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "longitude" }, @@ -31,7 +47,15 @@ asn_TYPE_member_t asn_MBR_ThreeDLocation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Elevation, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "elevation" }, @@ -62,7 +86,15 @@ asn_TYPE_descriptor_t asn_DEF_ThreeDLocation = { asn_DEF_ThreeDLocation_tags_1, /* Same as above */ sizeof(asn_DEF_ThreeDLocation_tags_1) /sizeof(asn_DEF_ThreeDLocation_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_ThreeDLocation_1, 3, /* Elements count */ &asn_SPC_ThreeDLocation_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ThreeDLocation.h b/certgen/asncodec/ThreeDLocation.h index 0714dc3..96870a1 100644 --- a/certgen/asncodec/ThreeDLocation.h +++ b/certgen/asncodec/ThreeDLocation.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _ThreeDLocation_H_ -#define _ThreeDLocation_H_ - - -#include /* Including external dependencies */ #include "Latitude.h" #include "Longitude.h" #include "Elevation.h" #include +#ifndef _ThreeDLocation_H_ +#define _ThreeDLocation_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/Time32.c b/certgen/asncodec/Time32.c index 3eb0321..d5788b2 100644 --- a/certgen/asncodec/Time32.c +++ b/certgen/asncodec/Time32.c @@ -1,12 +1,11 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Time32.h" -#include "../mkgmtime.h" int Time32_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, @@ -28,65 +27,34 @@ Time32_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using Uint32, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Time32_constr_1 CC_NOTUSED = { { 4, 1 } /* (0..4294967295) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Time32_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; - -asn_TYPE_operation_t asn_OP_Time32 = { - NativeInteger_free, - Time32_print, - NativeInteger_compare, - NativeInteger_decode_ber, - NativeInteger_encode_der, - NativeInteger_decode_xer, - NativeInteger_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - NativeInteger_decode_oer, /* OER decoder */ - NativeInteger_encode_oer, /* Canonical OER encoder */ -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - NativeInteger_decode_uper, /* Unaligned PER decoder */ - NativeInteger_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - NativeInteger_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; - asn_TYPE_descriptor_t asn_DEF_Time32 = { "Time32", "Time32", - &asn_OP_Time32, + &asn_OP_NativeInteger, asn_DEF_Time32_tags_1, sizeof(asn_DEF_Time32_tags_1) /sizeof(asn_DEF_Time32_tags_1[0]), /* 1 */ asn_DEF_Time32_tags_1, /* Same as above */ sizeof(asn_DEF_Time32_tags_1) /sizeof(asn_DEF_Time32_tags_1[0]), /* 1 */ - { &asn_OER_type_Time32_constr_1, 0, Time32_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Time32_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Time32_constraint + }, 0, 0, /* No members */ &asn_SPC_Uint32_specs_1 /* Additional specs */ }; -int Time32_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - int ret = NativeInteger_print(td, sptr, ilevel, cb, app_key); - if (ret == 0){ - const long *native = (const long *)sptr; - const char * s = stritsdate32(*native); - if (cb(" -- ", 4, app_key) < 0) return -1; - if (cb(s, strlen(s), app_key) < 0) return -1; - } - return ret; -} diff --git a/certgen/asncodec/Time32.h b/certgen/asncodec/Time32.h index 4bfa29a..42f7883 100644 --- a/certgen/asncodec/Time32.h +++ b/certgen/asncodec/Time32.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Uint32.h" #ifndef _Time32_H_ #define _Time32_H_ #include -/* Including external dependencies */ -#include "Uint32.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Time32; asn_struct_free_f Time32_free; asn_struct_print_f Time32_print; asn_constr_check_f Time32_constraint; -ber_type_decoder_f Time32_decode_ber; -der_type_encoder_f Time32_encode_der; xer_type_decoder_f Time32_decode_xer; xer_type_encoder_f Time32_encode_xer; oer_type_decoder_f Time32_decode_oer; diff --git a/certgen/asncodec/Time64.c b/certgen/asncodec/Time64.c index 553ed97..cd08919 100644 --- a/certgen/asncodec/Time64.c +++ b/certgen/asncodec/Time64.c @@ -1,12 +1,11 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Time64.h" -#include "../mkgmtime.h" int Time64_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, @@ -28,7 +27,7 @@ Time64_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if((value >= 0 && value <= 18446744073709551615)) { + if((value >= 0 && value <= 18446744073709551615ULL)) { /* Constraint check succeeded */ return 0; } else { @@ -43,73 +42,34 @@ Time64_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using Uint64, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Time64_constr_1 CC_NOTUSED = { - { 8, 1 } /* (0..18446744073709551615) */, + { 8, 1 } /* (0..18446744073709551615ULL) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Time64_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; - -asn_TYPE_operation_t asn_OP_Time64 = { - INTEGER_free, - Time64_print, - INTEGER_compare, - ber_decode_primitive, - INTEGER_encode_der, - INTEGER_decode_xer, - INTEGER_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - INTEGER_decode_oer, /* OER decoder */ - INTEGER_encode_oer, /* Canonical OER encoder */ -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - INTEGER_decode_uper, /* Unaligned PER decoder */ - INTEGER_encode_uper, /* Unaligned PER encoder */ -#endif /* ASN_DISABLE_PER_SUPPORT */ - INTEGER_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; - asn_TYPE_descriptor_t asn_DEF_Time64 = { "Time64", "Time64", - &asn_OP_Time64, + &asn_OP_INTEGER, asn_DEF_Time64_tags_1, sizeof(asn_DEF_Time64_tags_1) /sizeof(asn_DEF_Time64_tags_1[0]), /* 1 */ asn_DEF_Time64_tags_1, /* Same as above */ sizeof(asn_DEF_Time64_tags_1) /sizeof(asn_DEF_Time64_tags_1[0]), /* 1 */ - { &asn_OER_type_Time64_constr_1, 0, Time64_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Time64_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Time64_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; -int Time64_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - const asn_INTEGER_specifics_t *specs = - (const asn_INTEGER_specifics_t *)td->specifics; - const INTEGER_t *st = (const INTEGER_t *)sptr; - int ret = INTEGER_print(td, sptr, ilevel, cb, app_key); - if (ret == 0){ - if (st && st->buf){ - intmax_t value; - if (specs && specs->field_unsigned) - ret = asn_INTEGER2umax(st, (uintmax_t *)&value); - else - ret = asn_INTEGER2imax(st, &value); - if (ret == 0) { - const char * s = stritsdate64(value); - if (cb(" -- ", 4, app_key) < 0) return -1; - if (cb(s, strlen(s), app_key) < 0) return -1; - } - } - } - return ret; -} diff --git a/certgen/asncodec/Time64.h b/certgen/asncodec/Time64.h index 8d6d3ac..1376fa8 100644 --- a/certgen/asncodec/Time64.h +++ b/certgen/asncodec/Time64.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "Uint64.h" #ifndef _Time64_H_ #define _Time64_H_ #include -/* Including external dependencies */ -#include "Uint64.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Time64; asn_struct_free_f Time64_free; asn_struct_print_f Time64_print; asn_constr_check_f Time64_constraint; -ber_type_decoder_f Time64_decode_ber; -der_type_encoder_f Time64_encode_der; xer_type_decoder_f Time64_decode_xer; xer_type_encoder_f Time64_encode_xer; oer_type_decoder_f Time64_decode_oer; diff --git a/certgen/asncodec/TlmCertificateTrustListMessage.c b/certgen/asncodec/TlmCertificateTrustListMessage.c index 87f5de8..6765ea4 100644 --- a/certgen/asncodec/TlmCertificateTrustListMessage.c +++ b/certgen/asncodec/TlmCertificateTrustListMessage.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "TlmCertificateTrustListMessage.h" @@ -27,12 +27,14 @@ TlmCertificateTrustListMessage_constraint(const asn_TYPE_descriptor_t *td, const } /* - * This type is implemented using EtsiTs103097Data_Signed_60P0, + * This type is implemented using EtsiTs103097Data_Signed_63P0, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_TlmCertificateTrustListMessage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_TlmCertificateTrustListMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_TlmCertificateTrustListMessage = { asn_DEF_TlmCertificateTrustListMessage_tags_1, /* Same as above */ sizeof(asn_DEF_TlmCertificateTrustListMessage_tags_1) /sizeof(asn_DEF_TlmCertificateTrustListMessage_tags_1[0]), /* 1 */ - { &asn_OER_type_TlmCertificateTrustListMessage_constr_1, 0, TlmCertificateTrustListMessage_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_TlmCertificateTrustListMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + TlmCertificateTrustListMessage_constraint + }, asn_MBR_Ieee1609Dot2Data_1, 2, /* Elements count */ &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/TlmCertificateTrustListMessage.h b/certgen/asncodec/TlmCertificateTrustListMessage.h index 0df76db..e6cf8ec 100644 --- a/certgen/asncodec/TlmCertificateTrustListMessage.h +++ b/certgen/asncodec/TlmCertificateTrustListMessage.h @@ -1,33 +1,31 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941MessagesCa" - * found in "../asn1/EtsiTs102941/EtsiTs102941MessagesCA.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" #ifndef _TlmCertificateTrustListMessage_H_ #define _TlmCertificateTrustListMessage_H_ #include -/* Including external dependencies */ -#include "EtsiTs103097Data-Signed.h" - #ifdef __cplusplus extern "C" { #endif /* TlmCertificateTrustListMessage */ -typedef EtsiTs103097Data_Signed_60P0_t TlmCertificateTrustListMessage_t; +typedef EtsiTs103097Data_Signed_63P0_t TlmCertificateTrustListMessage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_TlmCertificateTrustListMessage; asn_struct_free_f TlmCertificateTrustListMessage_free; asn_struct_print_f TlmCertificateTrustListMessage_print; asn_constr_check_f TlmCertificateTrustListMessage_constraint; -ber_type_decoder_f TlmCertificateTrustListMessage_decode_ber; -der_type_encoder_f TlmCertificateTrustListMessage_encode_der; xer_type_decoder_f TlmCertificateTrustListMessage_decode_xer; xer_type_encoder_f TlmCertificateTrustListMessage_encode_xer; oer_type_decoder_f TlmCertificateTrustListMessage_decode_oer; diff --git a/certgen/asncodec/TlmEntry.c b/certgen/asncodec/TlmEntry.c index 0fabea2..f2d5536 100644 --- a/certgen/asncodec/TlmEntry.c +++ b/certgen/asncodec/TlmEntry.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "TlmEntry.h" @@ -13,25 +13,49 @@ asn_TYPE_member_t asn_MBR_TlmEntry_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "selfSignedTLMCertificate" }, - { ATF_POINTER, 1, offsetof(struct TlmEntry, linkTLMCertificate), + { ATF_POINTER, 1, offsetof(struct TlmEntry, successorTo), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EtsiTs103097Certificate, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ - "linkTLMCertificate" + "successorTo" }, { ATF_NOFLAGS, 0, offsetof(struct TlmEntry, accessPoint), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_Url, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "accessPoint" }, @@ -42,7 +66,7 @@ static const ber_tlv_tag_t asn_DEF_TlmEntry_tags_1[] = { }; static const asn_TYPE_tag2member_t asn_MAP_TlmEntry_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* selfSignedTLMCertificate */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* linkTLMCertificate */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* successorTo */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* accessPoint */ }; asn_SEQUENCE_specifics_t asn_SPC_TlmEntry_specs_1 = { @@ -64,7 +88,15 @@ asn_TYPE_descriptor_t asn_DEF_TlmEntry = { asn_DEF_TlmEntry_tags_1, /* Same as above */ sizeof(asn_DEF_TlmEntry_tags_1) /sizeof(asn_DEF_TlmEntry_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_TlmEntry_1, 3, /* Elements count */ &asn_SPC_TlmEntry_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/TlmEntry.h b/certgen/asncodec/TlmEntry.h index 44eb60d..09b8d83 100644 --- a/certgen/asncodec/TlmEntry.h +++ b/certgen/asncodec/TlmEntry.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _TlmEntry_H_ -#define _TlmEntry_H_ - - -#include /* Including external dependencies */ #include "EtsiTs103097Certificate.h" #include "Url.h" #include +#ifndef _TlmEntry_H_ +#define _TlmEntry_H_ + + +#include #ifdef __cplusplus extern "C" { @@ -26,7 +26,7 @@ struct EtsiTs103097Certificate; /* TlmEntry */ typedef struct TlmEntry { EtsiTs103097Certificate_t selfSignedTLMCertificate; - struct EtsiTs103097Certificate *linkTLMCertificate /* OPTIONAL */; + struct EtsiTs103097Certificate *successorTo; /* OPTIONAL */ Url_t accessPoint; /* Context for parsing across buffer boundaries */ diff --git a/certgen/asncodec/TlmLinkCertificateMessage.c b/certgen/asncodec/TlmLinkCertificateMessage.c new file mode 100644 index 0000000..1106be8 --- /dev/null +++ b/certgen/asncodec/TlmLinkCertificateMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "TlmLinkCertificateMessage.h" + +int +TlmLinkCertificateMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_Signed_63P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_TlmLinkCertificateMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_TlmLinkCertificateMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_TlmLinkCertificateMessage = { + "TlmLinkCertificateMessage", + "TlmLinkCertificateMessage", + &asn_OP_SEQUENCE, + asn_DEF_TlmLinkCertificateMessage_tags_1, + sizeof(asn_DEF_TlmLinkCertificateMessage_tags_1) + /sizeof(asn_DEF_TlmLinkCertificateMessage_tags_1[0]), /* 1 */ + asn_DEF_TlmLinkCertificateMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_TlmLinkCertificateMessage_tags_1) + /sizeof(asn_DEF_TlmLinkCertificateMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_TlmLinkCertificateMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + TlmLinkCertificateMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/TlmLinkCertificateMessage.h b/certgen/asncodec/TlmLinkCertificateMessage.h new file mode 100644 index 0000000..aec5e25 --- /dev/null +++ b/certgen/asncodec/TlmLinkCertificateMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-Signed.h" +#ifndef _TlmLinkCertificateMessage_H_ +#define _TlmLinkCertificateMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* TlmLinkCertificateMessage */ +typedef EtsiTs103097Data_Signed_63P0_t TlmLinkCertificateMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_TlmLinkCertificateMessage; +asn_struct_free_f TlmLinkCertificateMessage_free; +asn_struct_print_f TlmLinkCertificateMessage_print; +asn_constr_check_f TlmLinkCertificateMessage_constraint; +xer_type_decoder_f TlmLinkCertificateMessage_decode_xer; +xer_type_encoder_f TlmLinkCertificateMessage_encode_xer; +oer_type_decoder_f TlmLinkCertificateMessage_decode_oer; +oer_type_encoder_f TlmLinkCertificateMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _TlmLinkCertificateMessage_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedCertificate.c b/certgen/asncodec/ToBeSignedCertificate.c index 020992d..3ef054b 100644 --- a/certgen/asncodec/ToBeSignedCertificate.c +++ b/certgen/asncodec/ToBeSignedCertificate.c @@ -1,22 +1,68 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ToBeSignedCertificate.h" +static int +memb_flags_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; + size_t size; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + if(st->size > 0) { + /* Size in bits */ + size = 8 * st->size - (st->bits_unused & 0x07); + } else { + size = 0; + } + + if((size == 8)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_flags_constr_15 CC_NOTUSED = { + { 0, 0 }, + 8 /* (SIZE(8..8)) */}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_ToBeSignedCertificate_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedCertificate, id), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_CertificateId, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "id" }, @@ -25,7 +71,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HashedId3, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "cracaId" }, @@ -34,7 +88,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_CrlSeries, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "crlSeries" }, @@ -43,7 +105,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ValidityPeriod, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "validityPeriod" }, @@ -52,7 +122,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_GeographicRegion, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "region" }, @@ -61,7 +139,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SubjectAssurance, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "assuranceLevel" }, @@ -70,7 +156,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfPsidSsp, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "appPermissions" }, @@ -79,7 +173,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfPsidGroupPermissions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certIssuePermissions" }, @@ -88,7 +190,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SequenceOfPsidGroupPermissions, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "certRequestPermissions" }, @@ -97,7 +207,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NULL, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "canRequestRollover" }, @@ -106,7 +224,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_PublicEncryptionKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "encryptionKey" }, @@ -115,12 +241,88 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_VerificationKeyIndicator, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "verifyKeyIndicator" }, + { ATF_POINTER, 4, offsetof(struct ToBeSignedCertificate, flags), + (ASN_TAG_CLASS_CONTEXT | (12 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_BIT_STRING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_flags_constr_15, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_flags_constraint_1 + }, + 0, 0, /* No default value */ + "flags" + }, + { ATF_POINTER, 3, offsetof(struct ToBeSignedCertificate, appExtensions), + (ASN_TAG_CLASS_CONTEXT | (13 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfAppExtensions, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "appExtensions" + }, + { ATF_POINTER, 2, offsetof(struct ToBeSignedCertificate, certIssueExtensions), + (ASN_TAG_CLASS_CONTEXT | (14 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfCertIssueExtensions, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certIssueExtensions" + }, + { ATF_POINTER, 1, offsetof(struct ToBeSignedCertificate, certRequestExtension), + (ASN_TAG_CLASS_CONTEXT | (15 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfCertRequestExtensions, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certRequestExtension" + }, }; -static const int asn_MAP_ToBeSignedCertificate_oms_1[] = { 4, 5, 6, 7, 8, 9, 10 }; +static const int asn_MAP_ToBeSignedCertificate_oms_1[] = { 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15 }; static const ber_tlv_tag_t asn_DEF_ToBeSignedCertificate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -136,15 +338,19 @@ static const asn_TYPE_tag2member_t asn_MAP_ToBeSignedCertificate_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* certRequestPermissions */ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* canRequestRollover */ { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 }, /* encryptionKey */ - { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 } /* verifyKeyIndicator */ + { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 }, /* verifyKeyIndicator */ + { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 12, 0, 0 }, /* flags */ + { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 13, 0, 0 }, /* appExtensions */ + { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 14, 0, 0 }, /* certIssueExtensions */ + { (ASN_TAG_CLASS_CONTEXT | (15 << 2)), 15, 0, 0 } /* certRequestExtension */ }; asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedCertificate_specs_1 = { sizeof(struct ToBeSignedCertificate), offsetof(struct ToBeSignedCertificate, _asn_ctx), asn_MAP_ToBeSignedCertificate_tag2el_1, - 12, /* Count of tags in the map */ + 16, /* Count of tags in the map */ asn_MAP_ToBeSignedCertificate_oms_1, /* Optional members */ - 7, 0, /* Root/Additions */ + 7, 4, /* Root/Additions */ 12, /* First extension addition */ }; asn_TYPE_descriptor_t asn_DEF_ToBeSignedCertificate = { @@ -157,9 +363,17 @@ asn_TYPE_descriptor_t asn_DEF_ToBeSignedCertificate = { asn_DEF_ToBeSignedCertificate_tags_1, /* Same as above */ sizeof(asn_DEF_ToBeSignedCertificate_tags_1) /sizeof(asn_DEF_ToBeSignedCertificate_tags_1[0]), /* 1 */ - { &asn_OER_type_ToBeSignedCertificate_constr_1, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ToBeSignedCertificate_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_ToBeSignedCertificate_1, - 12, /* Elements count */ + 16, /* Elements count */ &asn_SPC_ToBeSignedCertificate_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/ToBeSignedCertificate.h b/certgen/asncodec/ToBeSignedCertificate.h index f5e13b8..d75dd99 100644 --- a/certgen/asncodec/ToBeSignedCertificate.h +++ b/certgen/asncodec/ToBeSignedCertificate.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _ToBeSignedCertificate_H_ -#define _ToBeSignedCertificate_H_ - - -#include /* Including external dependencies */ #include "CertificateId.h" @@ -19,17 +14,34 @@ #include "SubjectAssurance.h" #include #include "VerificationKeyIndicator.h" +#include +#include "SequenceOfAppExtensions.h" +#include "SequenceOfCertIssueExtensions.h" +#include "SequenceOfCertRequestExtensions.h" #include +#ifndef _ToBeSignedCertificate_H_ +#define _ToBeSignedCertificate_H_ + + +#include #ifdef __cplusplus extern "C" { #endif +/* Dependencies */ +typedef enum ToBeSignedCertificate__flags { + ToBeSignedCertificate__flags_usesCubk = 0 +} e_ToBeSignedCertificate__flags; + /* Forward declarations */ struct GeographicRegion; struct SequenceOfPsidSsp; struct SequenceOfPsidGroupPermissions; struct PublicEncryptionKey; +struct SequenceOfAppExtensions; +struct SequenceOfCertIssueExtensions; +struct SequenceOfCertRequestExtensions; /* ToBeSignedCertificate */ typedef struct ToBeSignedCertificate { @@ -37,18 +49,22 @@ typedef struct ToBeSignedCertificate { HashedId3_t cracaId; CrlSeries_t crlSeries; ValidityPeriod_t validityPeriod; - struct GeographicRegion *region /* OPTIONAL */; - SubjectAssurance_t *assuranceLevel /* OPTIONAL */; - struct SequenceOfPsidSsp *appPermissions /* OPTIONAL */; - struct SequenceOfPsidGroupPermissions *certIssuePermissions /* OPTIONAL */; - struct SequenceOfPsidGroupPermissions *certRequestPermissions /* OPTIONAL */; - NULL_t *canRequestRollover /* OPTIONAL */; - struct PublicEncryptionKey *encryptionKey /* OPTIONAL */; + struct GeographicRegion *region; /* OPTIONAL */ + SubjectAssurance_t *assuranceLevel; /* OPTIONAL */ + struct SequenceOfPsidSsp *appPermissions; /* OPTIONAL */ + struct SequenceOfPsidGroupPermissions *certIssuePermissions; /* OPTIONAL */ + struct SequenceOfPsidGroupPermissions *certRequestPermissions; /* OPTIONAL */ + NULL_t *canRequestRollover; /* OPTIONAL */ + struct PublicEncryptionKey *encryptionKey; /* OPTIONAL */ VerificationKeyIndicator_t verifyKeyIndicator; /* * This type is extensible, * possible extensions are below. */ + BIT_STRING_t *flags; /* OPTIONAL */ + struct SequenceOfAppExtensions *appExtensions; + struct SequenceOfCertIssueExtensions *certIssueExtensions; + struct SequenceOfCertRequestExtensions *certRequestExtension; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; @@ -57,7 +73,7 @@ typedef struct ToBeSignedCertificate { /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedCertificate; extern asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedCertificate_specs_1; -extern asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[12]; +extern asn_TYPE_member_t asn_MBR_ToBeSignedCertificate_1[16]; #ifdef __cplusplus } diff --git a/certgen/asncodec/ToBeSignedCrl.c b/certgen/asncodec/ToBeSignedCrl.c index 6ec7172..0c4b833 100644 --- a/certgen/asncodec/ToBeSignedCrl.c +++ b/certgen/asncodec/ToBeSignedCrl.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ToBeSignedCrl.h" @@ -13,7 +13,15 @@ static asn_TYPE_member_t asn_MBR_entries_5[] = { 0, &asn_DEF_CrlEntry, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "" }, @@ -38,7 +46,15 @@ asn_TYPE_descriptor_t asn_DEF_entries_5 = { asn_DEF_entries_tags_5, /* Same as above */ sizeof(asn_DEF_entries_tags_5) /sizeof(asn_DEF_entries_tags_5[0]), /* 2 */ - { 0, 0, SEQUENCE_OF_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_OF_constraint + }, asn_MBR_entries_5, 1, /* Single element */ &asn_SPC_entries_specs_5 /* Additional specs */ @@ -50,7 +66,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCrl_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Version, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "version" }, @@ -59,7 +83,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCrl_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Time32, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "thisUpdate" }, @@ -68,7 +100,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCrl_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Time32, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "nextUpdate" }, @@ -77,7 +117,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedCrl_1[] = { 0, &asn_DEF_entries_5, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "entries" }, @@ -109,7 +157,15 @@ asn_TYPE_descriptor_t asn_DEF_ToBeSignedCrl = { asn_DEF_ToBeSignedCrl_tags_1, /* Same as above */ sizeof(asn_DEF_ToBeSignedCrl_tags_1) /sizeof(asn_DEF_ToBeSignedCrl_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_ToBeSignedCrl_1, 4, /* Elements count */ &asn_SPC_ToBeSignedCrl_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ToBeSignedCrl.h b/certgen/asncodec/ToBeSignedCrl.h index c3691a9..0e29d27 100644 --- a/certgen/asncodec/ToBeSignedCrl.h +++ b/certgen/asncodec/ToBeSignedCrl.h @@ -1,15 +1,10 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _ToBeSignedCrl_H_ -#define _ToBeSignedCrl_H_ - - -#include /* Including external dependencies */ #include "Version.h" @@ -18,6 +13,11 @@ #include #include #include +#ifndef _ToBeSignedCrl_H_ +#define _ToBeSignedCrl_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/ToBeSignedCtlSignature.c b/certgen/asncodec/ToBeSignedCtlSignature.c new file mode 100644 index 0000000..4a0c9a6 --- /dev/null +++ b/certgen/asncodec/ToBeSignedCtlSignature.c @@ -0,0 +1,120 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ToBeSignedCtlSignature.h" + +asn_TYPE_member_t asn_MBR_ToBeSignedCtlSignature_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedCtlSignature, ctlSeriesId), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CtlSeriesId, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ctlSeriesId" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedCtlSignature, ctlType), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Ieee1609dot2dot1MsctlType, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "ctlType" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedCtlSignature, sequenceNumber), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_CtlSequenceNumber, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "sequenceNumber" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedCtlSignature, tbsCtlHash), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_HashedId48, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "tbsCtlHash" + }, +}; +static const ber_tlv_tag_t asn_DEF_ToBeSignedCtlSignature_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ToBeSignedCtlSignature_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ctlSeriesId */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ctlType */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sequenceNumber */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* tbsCtlHash */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedCtlSignature_specs_1 = { + sizeof(struct ToBeSignedCtlSignature), + offsetof(struct ToBeSignedCtlSignature, _asn_ctx), + asn_MAP_ToBeSignedCtlSignature_tag2el_1, + 4, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ToBeSignedCtlSignature = { + "ToBeSignedCtlSignature", + "ToBeSignedCtlSignature", + &asn_OP_SEQUENCE, + asn_DEF_ToBeSignedCtlSignature_tags_1, + sizeof(asn_DEF_ToBeSignedCtlSignature_tags_1) + /sizeof(asn_DEF_ToBeSignedCtlSignature_tags_1[0]), /* 1 */ + asn_DEF_ToBeSignedCtlSignature_tags_1, /* Same as above */ + sizeof(asn_DEF_ToBeSignedCtlSignature_tags_1) + /sizeof(asn_DEF_ToBeSignedCtlSignature_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ToBeSignedCtlSignature_1, + 4, /* Elements count */ + &asn_SPC_ToBeSignedCtlSignature_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ToBeSignedCtlSignature.h b/certgen/asncodec/ToBeSignedCtlSignature.h new file mode 100644 index 0000000..f0e0067 --- /dev/null +++ b/certgen/asncodec/ToBeSignedCtlSignature.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1CertManagement" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "CtlSeriesId.h" +#include "Ieee1609dot2dot1MsctlType.h" +#include "CtlSequenceNumber.h" +#include "HashedId48.h" +#include +#ifndef _ToBeSignedCtlSignature_H_ +#define _ToBeSignedCtlSignature_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ToBeSignedCtlSignature */ +typedef struct ToBeSignedCtlSignature { + CtlSeriesId_t ctlSeriesId; + Ieee1609dot2dot1MsctlType_t ctlType; + CtlSequenceNumber_t sequenceNumber; + HashedId48_t tbsCtlHash; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ToBeSignedCtlSignature_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedCtlSignature; +extern asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedCtlSignature_specs_1; +extern asn_TYPE_member_t asn_MBR_ToBeSignedCtlSignature_1[4]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ToBeSignedCtlSignature_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedData.c b/certgen/asncodec/ToBeSignedData.c index 2ee821c..70efb8b 100644 --- a/certgen/asncodec/ToBeSignedData.c +++ b/certgen/asncodec/ToBeSignedData.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ToBeSignedData.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_SignedDataPayload, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "payload" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_ToBeSignedData_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_HeaderInfo, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "headerInfo" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_ToBeSignedData = { asn_DEF_ToBeSignedData_tags_1, /* Same as above */ sizeof(asn_DEF_ToBeSignedData_tags_1) /sizeof(asn_DEF_ToBeSignedData_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_ToBeSignedData_1, 2, /* Elements count */ &asn_SPC_ToBeSignedData_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ToBeSignedData.h b/certgen/asncodec/ToBeSignedData.h index a89433f..83b854f 100644 --- a/certgen/asncodec/ToBeSignedData.h +++ b/certgen/asncodec/ToBeSignedData.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "HeaderInfo.h" +#include #ifndef _ToBeSignedData_H_ #define _ToBeSignedData_H_ #include -/* Including external dependencies */ -#include "HeaderInfo.h" -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/certgen/asncodec/ToBeSignedHashIdCrl.c b/certgen/asncodec/ToBeSignedHashIdCrl.c new file mode 100644 index 0000000..fb7b1a4 --- /dev/null +++ b/certgen/asncodec/ToBeSignedHashIdCrl.c @@ -0,0 +1,84 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ToBeSignedHashIdCrl.h" + +asn_TYPE_member_t asn_MBR_ToBeSignedHashIdCrl_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedHashIdCrl, crlSerial), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "crlSerial" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedHashIdCrl, entries), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfHashBasedRevocationInfo, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "entries" + }, +}; +static const ber_tlv_tag_t asn_DEF_ToBeSignedHashIdCrl_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ToBeSignedHashIdCrl_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* crlSerial */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* entries */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedHashIdCrl_specs_1 = { + sizeof(struct ToBeSignedHashIdCrl), + offsetof(struct ToBeSignedHashIdCrl, _asn_ctx), + asn_MAP_ToBeSignedHashIdCrl_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ToBeSignedHashIdCrl = { + "ToBeSignedHashIdCrl", + "ToBeSignedHashIdCrl", + &asn_OP_SEQUENCE, + asn_DEF_ToBeSignedHashIdCrl_tags_1, + sizeof(asn_DEF_ToBeSignedHashIdCrl_tags_1) + /sizeof(asn_DEF_ToBeSignedHashIdCrl_tags_1[0]), /* 1 */ + asn_DEF_ToBeSignedHashIdCrl_tags_1, /* Same as above */ + sizeof(asn_DEF_ToBeSignedHashIdCrl_tags_1) + /sizeof(asn_DEF_ToBeSignedHashIdCrl_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ToBeSignedHashIdCrl_1, + 2, /* Elements count */ + &asn_SPC_ToBeSignedHashIdCrl_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ToBeSignedHashIdCrl.h b/certgen/asncodec/ToBeSignedHashIdCrl.h new file mode 100644 index 0000000..14b39cb --- /dev/null +++ b/certgen/asncodec/ToBeSignedHashIdCrl.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint32.h" +#include "SequenceOfHashBasedRevocationInfo.h" +#include +#ifndef _ToBeSignedHashIdCrl_H_ +#define _ToBeSignedHashIdCrl_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ToBeSignedHashIdCrl */ +typedef struct ToBeSignedHashIdCrl { + Uint32_t crlSerial; + SequenceOfHashBasedRevocationInfo_t entries; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ToBeSignedHashIdCrl_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedHashIdCrl; +extern asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedHashIdCrl_specs_1; +extern asn_TYPE_member_t asn_MBR_ToBeSignedHashIdCrl_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ToBeSignedHashIdCrl_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedLinkCertificate.c b/certgen/asncodec/ToBeSignedLinkCertificate.c new file mode 100644 index 0000000..b12c36c --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkCertificate.c @@ -0,0 +1,84 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesLinkCertificate" + * found in "asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ToBeSignedLinkCertificate.h" + +asn_TYPE_member_t asn_MBR_ToBeSignedLinkCertificate_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkCertificate, expiryTime), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Time32, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "expiryTime" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkCertificate, certificateHash), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_HashedData, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certificateHash" + }, +}; +static const ber_tlv_tag_t asn_DEF_ToBeSignedLinkCertificate_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ToBeSignedLinkCertificate_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* expiryTime */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* certificateHash */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedLinkCertificate_specs_1 = { + sizeof(struct ToBeSignedLinkCertificate), + offsetof(struct ToBeSignedLinkCertificate, _asn_ctx), + asn_MAP_ToBeSignedLinkCertificate_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 2, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkCertificate = { + "ToBeSignedLinkCertificate", + "ToBeSignedLinkCertificate", + &asn_OP_SEQUENCE, + asn_DEF_ToBeSignedLinkCertificate_tags_1, + sizeof(asn_DEF_ToBeSignedLinkCertificate_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkCertificate_tags_1[0]), /* 1 */ + asn_DEF_ToBeSignedLinkCertificate_tags_1, /* Same as above */ + sizeof(asn_DEF_ToBeSignedLinkCertificate_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkCertificate_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ToBeSignedLinkCertificate_1, + 2, /* Elements count */ + &asn_SPC_ToBeSignedLinkCertificate_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ToBeSignedLinkCertificate.h b/certgen/asncodec/ToBeSignedLinkCertificate.h new file mode 100644 index 0000000..7c38859 --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkCertificate.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesLinkCertificate" + * found in "asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Time32.h" +#include "HashedData.h" +#include +#ifndef _ToBeSignedLinkCertificate_H_ +#define _ToBeSignedLinkCertificate_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ToBeSignedLinkCertificate */ +typedef struct ToBeSignedLinkCertificate { + Time32_t expiryTime; + HashedData_t certificateHash; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ToBeSignedLinkCertificate_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkCertificate; +extern asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedLinkCertificate_specs_1; +extern asn_TYPE_member_t asn_MBR_ToBeSignedLinkCertificate_1[2]; + +#ifdef __cplusplus +} +#endif + +#endif /* _ToBeSignedLinkCertificate_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedLinkCertificateRca.c b/certgen/asncodec/ToBeSignedLinkCertificateRca.c new file mode 100644 index 0000000..b49c7cc --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkCertificateRca.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesLinkCertificate" + * found in "asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ToBeSignedLinkCertificateRca.h" + +/* + * This type is implemented using ToBeSignedLinkCertificate, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_ToBeSignedLinkCertificateRca_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkCertificateRca = { + "ToBeSignedLinkCertificateRca", + "ToBeSignedLinkCertificateRca", + &asn_OP_SEQUENCE, + asn_DEF_ToBeSignedLinkCertificateRca_tags_1, + sizeof(asn_DEF_ToBeSignedLinkCertificateRca_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkCertificateRca_tags_1[0]), /* 1 */ + asn_DEF_ToBeSignedLinkCertificateRca_tags_1, /* Same as above */ + sizeof(asn_DEF_ToBeSignedLinkCertificateRca_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkCertificateRca_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ToBeSignedLinkCertificate_1, + 2, /* Elements count */ + &asn_SPC_ToBeSignedLinkCertificate_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ToBeSignedLinkCertificateRca.h b/certgen/asncodec/ToBeSignedLinkCertificateRca.h new file mode 100644 index 0000000..3fa36fa --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkCertificateRca.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesLinkCertificate" + * found in "asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ToBeSignedLinkCertificate.h" +#ifndef _ToBeSignedLinkCertificateRca_H_ +#define _ToBeSignedLinkCertificateRca_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ToBeSignedLinkCertificateRca */ +typedef ToBeSignedLinkCertificate_t ToBeSignedLinkCertificateRca_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkCertificateRca; +asn_struct_free_f ToBeSignedLinkCertificateRca_free; +asn_struct_print_f ToBeSignedLinkCertificateRca_print; +asn_constr_check_f ToBeSignedLinkCertificateRca_constraint; +xer_type_decoder_f ToBeSignedLinkCertificateRca_decode_xer; +xer_type_encoder_f ToBeSignedLinkCertificateRca_encode_xer; +oer_type_decoder_f ToBeSignedLinkCertificateRca_decode_oer; +oer_type_encoder_f ToBeSignedLinkCertificateRca_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ToBeSignedLinkCertificateRca_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedLinkCertificateTlm.c b/certgen/asncodec/ToBeSignedLinkCertificateTlm.c new file mode 100644 index 0000000..5fec078 --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkCertificateTlm.c @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesLinkCertificate" + * found in "asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ToBeSignedLinkCertificateTlm.h" + +/* + * This type is implemented using ToBeSignedLinkCertificate, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_ToBeSignedLinkCertificateTlm_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkCertificateTlm = { + "ToBeSignedLinkCertificateTlm", + "ToBeSignedLinkCertificateTlm", + &asn_OP_SEQUENCE, + asn_DEF_ToBeSignedLinkCertificateTlm_tags_1, + sizeof(asn_DEF_ToBeSignedLinkCertificateTlm_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkCertificateTlm_tags_1[0]), /* 1 */ + asn_DEF_ToBeSignedLinkCertificateTlm_tags_1, /* Same as above */ + sizeof(asn_DEF_ToBeSignedLinkCertificateTlm_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkCertificateTlm_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ToBeSignedLinkCertificate_1, + 2, /* Elements count */ + &asn_SPC_ToBeSignedLinkCertificate_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ToBeSignedLinkCertificateTlm.h b/certgen/asncodec/ToBeSignedLinkCertificateTlm.h new file mode 100644 index 0000000..ebad095 --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkCertificateTlm.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941TypesLinkCertificate" + * found in "asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ToBeSignedLinkCertificate.h" +#ifndef _ToBeSignedLinkCertificateTlm_H_ +#define _ToBeSignedLinkCertificateTlm_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ToBeSignedLinkCertificateTlm */ +typedef ToBeSignedLinkCertificate_t ToBeSignedLinkCertificateTlm_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkCertificateTlm; +asn_struct_free_f ToBeSignedLinkCertificateTlm_free; +asn_struct_print_f ToBeSignedLinkCertificateTlm_print; +asn_constr_check_f ToBeSignedLinkCertificateTlm_constraint; +xer_type_decoder_f ToBeSignedLinkCertificateTlm_decode_xer; +xer_type_encoder_f ToBeSignedLinkCertificateTlm_encode_xer; +oer_type_decoder_f ToBeSignedLinkCertificateTlm_decode_oer; +oer_type_encoder_f ToBeSignedLinkCertificateTlm_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _ToBeSignedLinkCertificateTlm_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedLinkageValueCrl.c b/certgen/asncodec/ToBeSignedLinkageValueCrl.c new file mode 100644 index 0000000..f588bd9 --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkageValueCrl.c @@ -0,0 +1,145 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ToBeSignedLinkageValueCrl.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ToBeSignedLinkageValueCrl_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_ToBeSignedLinkageValueCrl_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkageValueCrl, iRev), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "iRev" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkageValueCrl, indexWithinI), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "indexWithinI" + }, + { ATF_POINTER, 3, offsetof(struct ToBeSignedLinkageValueCrl, individual), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfJMaxGroup, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "individual" + }, + { ATF_POINTER, 2, offsetof(struct ToBeSignedLinkageValueCrl, groups), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfGroupCrlEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "groups" + }, + { ATF_POINTER, 1, offsetof(struct ToBeSignedLinkageValueCrl, groupsSingleSeed), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfGroupSingleSeedCrlEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "groupsSingleSeed" + }, +}; +static const int asn_MAP_ToBeSignedLinkageValueCrl_oms_1[] = { 2, 3, 4 }; +static const ber_tlv_tag_t asn_DEF_ToBeSignedLinkageValueCrl_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ToBeSignedLinkageValueCrl_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iRev */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* indexWithinI */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* individual */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* groups */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* groupsSingleSeed */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedLinkageValueCrl_specs_1 = { + sizeof(struct ToBeSignedLinkageValueCrl), + offsetof(struct ToBeSignedLinkageValueCrl, _asn_ctx), + asn_MAP_ToBeSignedLinkageValueCrl_tag2el_1, + 5, /* Count of tags in the map */ + asn_MAP_ToBeSignedLinkageValueCrl_oms_1, /* Optional members */ + 2, 1, /* Root/Additions */ + 4, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkageValueCrl = { + "ToBeSignedLinkageValueCrl", + "ToBeSignedLinkageValueCrl", + &asn_OP_SEQUENCE, + asn_DEF_ToBeSignedLinkageValueCrl_tags_1, + sizeof(asn_DEF_ToBeSignedLinkageValueCrl_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkageValueCrl_tags_1[0]), /* 1 */ + asn_DEF_ToBeSignedLinkageValueCrl_tags_1, /* Same as above */ + sizeof(asn_DEF_ToBeSignedLinkageValueCrl_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkageValueCrl_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ToBeSignedLinkageValueCrl_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ToBeSignedLinkageValueCrl_1, + 5, /* Elements count */ + &asn_SPC_ToBeSignedLinkageValueCrl_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ToBeSignedLinkageValueCrl.h b/certgen/asncodec/ToBeSignedLinkageValueCrl.h new file mode 100644 index 0000000..1624aa1 --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkageValueCrl.h @@ -0,0 +1,59 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "IValue.h" +#include "Uint8.h" +#include +#ifndef _ToBeSignedLinkageValueCrl_H_ +#define _ToBeSignedLinkageValueCrl_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct SequenceOfJMaxGroup; +struct SequenceOfGroupCrlEntry; +struct SequenceOfGroupSingleSeedCrlEntry; + +/* ToBeSignedLinkageValueCrl */ +typedef struct ToBeSignedLinkageValueCrl { + IValue_t iRev; + Uint8_t indexWithinI; + struct SequenceOfJMaxGroup *individual; /* OPTIONAL */ + struct SequenceOfGroupCrlEntry *groups; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + struct SequenceOfGroupSingleSeedCrlEntry *groupsSingleSeed; /* OPTIONAL */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ToBeSignedLinkageValueCrl_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkageValueCrl; +extern asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedLinkageValueCrl_specs_1; +extern asn_TYPE_member_t asn_MBR_ToBeSignedLinkageValueCrl_1[5]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "SequenceOfJMaxGroup.h" +#include "SequenceOfGroupCrlEntry.h" +#include "SequenceOfGroupSingleSeedCrlEntry.h" + +#endif /* _ToBeSignedLinkageValueCrl_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.c b/certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.c new file mode 100644 index 0000000..c7e44ae --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.c @@ -0,0 +1,181 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "ToBeSignedLinkageValueCrlWithAlgIdentifier.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_ToBeSignedLinkageValueCrlWithAlgIdentifier_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_ToBeSignedLinkageValueCrlWithAlgIdentifier_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, iRev), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_IValue, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "iRev" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, indexWithinI), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_Uint8, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "indexWithinI" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, seedEvolution), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SeedEvolutionFunctionIdentifier, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "seedEvolution" + }, + { ATF_NOFLAGS, 0, offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, lvGeneration), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_LvGenerationFunctionIdentifier, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "lvGeneration" + }, + { ATF_POINTER, 3, offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, individual), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfJMaxGroup, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "individual" + }, + { ATF_POINTER, 2, offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, groups), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfGroupCrlEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "groups" + }, + { ATF_POINTER, 1, offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, groupsSingleSeed), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfGroupSingleSeedCrlEntry, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "groupsSingleSeed" + }, +}; +static const int asn_MAP_ToBeSignedLinkageValueCrlWithAlgIdentifier_oms_1[] = { 4, 5, 6 }; +static const ber_tlv_tag_t asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_ToBeSignedLinkageValueCrlWithAlgIdentifier_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iRev */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* indexWithinI */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* seedEvolution */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* lvGeneration */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* individual */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* groups */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* groupsSingleSeed */ +}; +asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedLinkageValueCrlWithAlgIdentifier_specs_1 = { + sizeof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier), + offsetof(struct ToBeSignedLinkageValueCrlWithAlgIdentifier, _asn_ctx), + asn_MAP_ToBeSignedLinkageValueCrlWithAlgIdentifier_tag2el_1, + 7, /* Count of tags in the map */ + asn_MAP_ToBeSignedLinkageValueCrlWithAlgIdentifier_oms_1, /* Optional members */ + 3, 0, /* Root/Additions */ + 7, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier = { + "ToBeSignedLinkageValueCrlWithAlgIdentifier", + "ToBeSignedLinkageValueCrlWithAlgIdentifier", + &asn_OP_SEQUENCE, + asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier_tags_1, + sizeof(asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier_tags_1[0]), /* 1 */ + asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier_tags_1, /* Same as above */ + sizeof(asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier_tags_1) + /sizeof(asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ToBeSignedLinkageValueCrlWithAlgIdentifier_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_ToBeSignedLinkageValueCrlWithAlgIdentifier_1, + 7, /* Elements count */ + &asn_SPC_ToBeSignedLinkageValueCrlWithAlgIdentifier_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.h b/certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.h new file mode 100644 index 0000000..e5c7d82 --- /dev/null +++ b/certgen/asncodec/ToBeSignedLinkageValueCrlWithAlgIdentifier.h @@ -0,0 +1,63 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "IValue.h" +#include "Uint8.h" +#include "SeedEvolutionFunctionIdentifier.h" +#include "LvGenerationFunctionIdentifier.h" +#include +#ifndef _ToBeSignedLinkageValueCrlWithAlgIdentifier_H_ +#define _ToBeSignedLinkageValueCrlWithAlgIdentifier_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct SequenceOfJMaxGroup; +struct SequenceOfGroupCrlEntry; +struct SequenceOfGroupSingleSeedCrlEntry; + +/* ToBeSignedLinkageValueCrlWithAlgIdentifier */ +typedef struct ToBeSignedLinkageValueCrlWithAlgIdentifier { + IValue_t iRev; + Uint8_t indexWithinI; + SeedEvolutionFunctionIdentifier_t seedEvolution; + LvGenerationFunctionIdentifier_t lvGeneration; + struct SequenceOfJMaxGroup *individual; /* OPTIONAL */ + struct SequenceOfGroupCrlEntry *groups; /* OPTIONAL */ + struct SequenceOfGroupSingleSeedCrlEntry *groupsSingleSeed; /* OPTIONAL */ + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ToBeSignedLinkageValueCrlWithAlgIdentifier_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier; +extern asn_SEQUENCE_specifics_t asn_SPC_ToBeSignedLinkageValueCrlWithAlgIdentifier_specs_1; +extern asn_TYPE_member_t asn_MBR_ToBeSignedLinkageValueCrlWithAlgIdentifier_1[7]; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "SequenceOfJMaxGroup.h" +#include "SequenceOfGroupCrlEntry.h" +#include "SequenceOfGroupSingleSeedCrlEntry.h" + +#endif /* _ToBeSignedLinkageValueCrlWithAlgIdentifier_H_ */ +#include diff --git a/certgen/asncodec/ToBeSignedRcaCtl.c b/certgen/asncodec/ToBeSignedRcaCtl.c index fe3170b..2a1ff53 100644 --- a/certgen/asncodec/ToBeSignedRcaCtl.c +++ b/certgen/asncodec/ToBeSignedRcaCtl.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ToBeSignedRcaCtl.h" @@ -30,9 +30,11 @@ ToBeSignedRcaCtl_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using CtlFormat, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_ToBeSignedRcaCtl_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_ToBeSignedRcaCtl_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_ToBeSignedRcaCtl = { asn_DEF_ToBeSignedRcaCtl_tags_1, /* Same as above */ sizeof(asn_DEF_ToBeSignedRcaCtl_tags_1) /sizeof(asn_DEF_ToBeSignedRcaCtl_tags_1[0]), /* 1 */ - { &asn_OER_type_ToBeSignedRcaCtl_constr_1, 0, ToBeSignedRcaCtl_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ToBeSignedRcaCtl_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ToBeSignedRcaCtl_constraint + }, asn_MBR_CtlFormat_1, 5, /* Elements count */ &asn_SPC_CtlFormat_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ToBeSignedRcaCtl.h b/certgen/asncodec/ToBeSignedRcaCtl.h index 7e9ed11..6fda6c0 100644 --- a/certgen/asncodec/ToBeSignedRcaCtl.h +++ b/certgen/asncodec/ToBeSignedRcaCtl.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "CtlFormat.h" #ifndef _ToBeSignedRcaCtl_H_ #define _ToBeSignedRcaCtl_H_ #include -/* Including external dependencies */ -#include "CtlFormat.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedRcaCtl; asn_struct_free_f ToBeSignedRcaCtl_free; asn_struct_print_f ToBeSignedRcaCtl_print; asn_constr_check_f ToBeSignedRcaCtl_constraint; -ber_type_decoder_f ToBeSignedRcaCtl_decode_ber; -der_type_encoder_f ToBeSignedRcaCtl_encode_der; xer_type_decoder_f ToBeSignedRcaCtl_decode_xer; xer_type_encoder_f ToBeSignedRcaCtl_encode_xer; oer_type_decoder_f ToBeSignedRcaCtl_decode_oer; diff --git a/certgen/asncodec/ToBeSignedTlmCtl.c b/certgen/asncodec/ToBeSignedTlmCtl.c index 2bbdf5c..02c6a45 100644 --- a/certgen/asncodec/ToBeSignedTlmCtl.c +++ b/certgen/asncodec/ToBeSignedTlmCtl.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ToBeSignedTlmCtl.h" @@ -30,9 +30,11 @@ ToBeSignedTlmCtl_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using CtlFormat, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_ToBeSignedTlmCtl_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_ToBeSignedTlmCtl_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; @@ -46,7 +48,15 @@ asn_TYPE_descriptor_t asn_DEF_ToBeSignedTlmCtl = { asn_DEF_ToBeSignedTlmCtl_tags_1, /* Same as above */ sizeof(asn_DEF_ToBeSignedTlmCtl_tags_1) /sizeof(asn_DEF_ToBeSignedTlmCtl_tags_1[0]), /* 1 */ - { &asn_OER_type_ToBeSignedTlmCtl_constr_1, 0, ToBeSignedTlmCtl_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_ToBeSignedTlmCtl_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + ToBeSignedTlmCtl_constraint + }, asn_MBR_CtlFormat_1, 5, /* Elements count */ &asn_SPC_CtlFormat_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ToBeSignedTlmCtl.h b/certgen/asncodec/ToBeSignedTlmCtl.h index b10ffb3..599cfa4 100644 --- a/certgen/asncodec/ToBeSignedTlmCtl.h +++ b/certgen/asncodec/ToBeSignedTlmCtl.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "CtlFormat.h" #ifndef _ToBeSignedTlmCtl_H_ #define _ToBeSignedTlmCtl_H_ #include -/* Including external dependencies */ -#include "CtlFormat.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_ToBeSignedTlmCtl; asn_struct_free_f ToBeSignedTlmCtl_free; asn_struct_print_f ToBeSignedTlmCtl_print; asn_constr_check_f ToBeSignedTlmCtl_constraint; -ber_type_decoder_f ToBeSignedTlmCtl_decode_ber; -der_type_encoder_f ToBeSignedTlmCtl_encode_der; xer_type_decoder_f ToBeSignedTlmCtl_decode_xer; xer_type_encoder_f ToBeSignedTlmCtl_encode_xer; oer_type_decoder_f ToBeSignedTlmCtl_decode_oer; diff --git a/certgen/asncodec/TwoDLocation.c b/certgen/asncodec/TwoDLocation.c index c43cc32..0169fa3 100644 --- a/certgen/asncodec/TwoDLocation.c +++ b/certgen/asncodec/TwoDLocation.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "TwoDLocation.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_TwoDLocation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Latitude, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "latitude" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_TwoDLocation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Longitude, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "longitude" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_TwoDLocation = { asn_DEF_TwoDLocation_tags_1, /* Same as above */ sizeof(asn_DEF_TwoDLocation_tags_1) /sizeof(asn_DEF_TwoDLocation_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_TwoDLocation_1, 2, /* Elements count */ &asn_SPC_TwoDLocation_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/TwoDLocation.h b/certgen/asncodec/TwoDLocation.h index 8f7417f..ab29b95 100644 --- a/certgen/asncodec/TwoDLocation.h +++ b/certgen/asncodec/TwoDLocation.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _TwoDLocation_H_ -#define _TwoDLocation_H_ - - -#include /* Including external dependencies */ #include "Latitude.h" #include "Longitude.h" #include +#ifndef _TwoDLocation_H_ +#define _TwoDLocation_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/TypeSpecificCrlContents.c b/certgen/asncodec/TypeSpecificCrlContents.c new file mode 100644 index 0000000..ee72c6e --- /dev/null +++ b/certgen/asncodec/TypeSpecificCrlContents.c @@ -0,0 +1,158 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "TypeSpecificCrlContents.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_TypeSpecificCrlContents_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_TypeSpecificCrlContents_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct TypeSpecificCrlContents, choice.fullHashCrl), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedHashIdCrl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "fullHashCrl" + }, + { ATF_NOFLAGS, 0, offsetof(struct TypeSpecificCrlContents, choice.deltaHashCrl), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedHashIdCrl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "deltaHashCrl" + }, + { ATF_NOFLAGS, 0, offsetof(struct TypeSpecificCrlContents, choice.fullLinkedCrl), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedLinkageValueCrl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "fullLinkedCrl" + }, + { ATF_NOFLAGS, 0, offsetof(struct TypeSpecificCrlContents, choice.deltaLinkedCrl), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedLinkageValueCrl, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "deltaLinkedCrl" + }, + { ATF_NOFLAGS, 0, offsetof(struct TypeSpecificCrlContents, choice.fullLinkedCrlWithAlg), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "fullLinkedCrlWithAlg" + }, + { ATF_NOFLAGS, 0, offsetof(struct TypeSpecificCrlContents, choice.deltaLinkedCrlWithAlg), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ToBeSignedLinkageValueCrlWithAlgIdentifier, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "deltaLinkedCrlWithAlg" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_TypeSpecificCrlContents_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* fullHashCrl */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* deltaHashCrl */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* fullLinkedCrl */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* deltaLinkedCrl */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* fullLinkedCrlWithAlg */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* deltaLinkedCrlWithAlg */ +}; +asn_CHOICE_specifics_t asn_SPC_TypeSpecificCrlContents_specs_1 = { + sizeof(struct TypeSpecificCrlContents), + offsetof(struct TypeSpecificCrlContents, _asn_ctx), + offsetof(struct TypeSpecificCrlContents, present), + sizeof(((struct TypeSpecificCrlContents *)0)->present), + asn_MAP_TypeSpecificCrlContents_tag2el_1, + 6, /* Count of tags in the map */ + 0, 0, + 4 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_TypeSpecificCrlContents = { + "TypeSpecificCrlContents", + "TypeSpecificCrlContents", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_TypeSpecificCrlContents_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_TypeSpecificCrlContents_1, + 6, /* Elements count */ + &asn_SPC_TypeSpecificCrlContents_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/TypeSpecificCrlContents.h b/certgen/asncodec/TypeSpecificCrlContents.h new file mode 100644 index 0000000..2d69311 --- /dev/null +++ b/certgen/asncodec/TypeSpecificCrlContents.h @@ -0,0 +1,66 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2CrlBaseTypes" + * found in "asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "ToBeSignedHashIdCrl.h" +#include "ToBeSignedLinkageValueCrl.h" +#include "ToBeSignedLinkageValueCrlWithAlgIdentifier.h" +#include +#ifndef _TypeSpecificCrlContents_H_ +#define _TypeSpecificCrlContents_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum TypeSpecificCrlContents_PR { + TypeSpecificCrlContents_PR_NOTHING, /* No components present */ + TypeSpecificCrlContents_PR_fullHashCrl, + TypeSpecificCrlContents_PR_deltaHashCrl, + TypeSpecificCrlContents_PR_fullLinkedCrl, + TypeSpecificCrlContents_PR_deltaLinkedCrl, + /* Extensions may appear below */ + TypeSpecificCrlContents_PR_fullLinkedCrlWithAlg, + TypeSpecificCrlContents_PR_deltaLinkedCrlWithAlg +} TypeSpecificCrlContents_PR; + +/* TypeSpecificCrlContents */ +typedef struct TypeSpecificCrlContents { + TypeSpecificCrlContents_PR present; + union TypeSpecificCrlContents_u { + ToBeSignedHashIdCrl_t fullHashCrl; + ToBeSignedHashIdCrl_t deltaHashCrl; + ToBeSignedLinkageValueCrl_t fullLinkedCrl; + ToBeSignedLinkageValueCrl_t deltaLinkedCrl; + /* + * This type is extensible, + * possible extensions are below. + */ + ToBeSignedLinkageValueCrlWithAlgIdentifier_t fullLinkedCrlWithAlg; + ToBeSignedLinkageValueCrlWithAlgIdentifier_t deltaLinkedCrlWithAlg; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} TypeSpecificCrlContents_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_TypeSpecificCrlContents; +extern asn_CHOICE_specifics_t asn_SPC_TypeSpecificCrlContents_specs_1; +extern asn_TYPE_member_t asn_MBR_TypeSpecificCrlContents_1[6]; + +#ifdef __cplusplus +} +#endif + +#endif /* _TypeSpecificCrlContents_H_ */ +#include diff --git a/certgen/asncodec/UTF8String.c b/certgen/asncodec/UTF8String.c index d6bee76..51923b7 100644 --- a/certgen/asncodec/UTF8String.c +++ b/certgen/asncodec/UTF8String.c @@ -1,290 +1,224 @@ -/*- - * Copyright (c) 2003, 2004, 2006 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -/* - * UTF8String basic type description. - */ -static const ber_tlv_tag_t asn_DEF_UTF8String_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), /* [UNIVERSAL 12] IMPLICIT ...*/ - (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */ -}; -asn_TYPE_operation_t asn_OP_UTF8String = { - OCTET_STRING_free, - UTF8String_print, - OCTET_STRING_compare, - OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ - OCTET_STRING_encode_der, - OCTET_STRING_decode_xer_utf8, - OCTET_STRING_encode_xer_utf8, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - OCTET_STRING_decode_oer, - OCTET_STRING_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - OCTET_STRING_decode_uper, - OCTET_STRING_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - UTF8String_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; -asn_TYPE_descriptor_t asn_DEF_UTF8String = { - "UTF8String", - "UTF8String", - &asn_OP_UTF8String, - asn_DEF_UTF8String_tags, - sizeof(asn_DEF_UTF8String_tags) - / sizeof(asn_DEF_UTF8String_tags[0]) - 1, - asn_DEF_UTF8String_tags, - sizeof(asn_DEF_UTF8String_tags) - / sizeof(asn_DEF_UTF8String_tags[0]), - { 0, 0, UTF8String_constraint }, - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -/* - * This is the table of length expectations. - * The second half of this table is only applicable to the long sequences. - */ -static const int UTF8String_ht[2][16] = { - { /* 0x0 ... 0x7 */ - /* 0000..0111 */ - 1, 1, 1, 1, 1, 1, 1, 1, - /* 1000..1011(0), 1100..1101(2), 1110(3), 1111(-1) */ - 0, 0, 0, 0, 2, 2, 3, -1 }, - { /* 0xF0 .. 0xF7 */ - /* 11110000..11110111 */ - 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 6, 6, -1, -1 } -}; -static const int32_t UTF8String_mv[7] = { 0, 0, - 0x00000080, - 0x00000800, - 0x00010000, - 0x00200000, - 0x04000000 -}; - -/* Internal aliases for return codes */ -#define U8E_TRUNC -1 /* UTF-8 sequence truncated */ -#define U8E_ILLSTART -2 /* Illegal UTF-8 sequence start */ -#define U8E_NOTCONT -3 /* Continuation expectation failed */ -#define U8E_NOTMIN -4 /* Not minimal length encoding */ -#define U8E_EINVAL -5 /* Invalid arguments */ - -int -UTF8String_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - ssize_t len = UTF8String_length((const UTF8String_t *)sptr); - switch(len) { - case U8E_EINVAL: - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given", td->name); - break; - case U8E_TRUNC: - ASN__CTFAIL(app_key, td, sptr, - "%s: truncated UTF-8 sequence (%s:%d)", - td->name, __FILE__, __LINE__); - break; - case U8E_ILLSTART: - ASN__CTFAIL(app_key, td, sptr, - "%s: UTF-8 illegal start of encoding (%s:%d)", - td->name, __FILE__, __LINE__); - break; - case U8E_NOTCONT: - ASN__CTFAIL(app_key, td, sptr, - "%s: UTF-8 not continuation (%s:%d)", - td->name, __FILE__, __LINE__); - break; - case U8E_NOTMIN: - ASN__CTFAIL(app_key, td, sptr, - "%s: UTF-8 not minimal sequence (%s:%d)", - td->name, __FILE__, __LINE__); - break; - } - return (len < 0) ? -1 : 0; -} - -static ssize_t -UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen) { - size_t length; - uint8_t *buf = st->buf; - uint8_t *end = buf + st->size; - uint32_t *dstend = dst + dstlen; - - for(length = 0; buf < end; length++) { - int ch = *buf; - uint8_t *cend; - int32_t value; - int want; - - /* Compute the sequence length */ - want = UTF8String_ht[0][ch >> 4]; - switch(want) { - case -1: - /* Second half of the table, long sequence */ - want = UTF8String_ht[1][ch & 0x0F]; - if(want != -1) break; - /* Fall through */ - case 0: - return U8E_ILLSTART; - } - - /* assert(want >= 1 && want <= 6) */ - - /* Check character sequence length */ - if(buf + want > end) return U8E_TRUNC; - - value = ch & (0xff >> want); - cend = buf + want; - for(buf++; buf < cend; buf++) { - ch = *buf; - if(ch < 0x80 || ch > 0xbf) return U8E_NOTCONT; - value = (value << 6) | (ch & 0x3F); - } - if(value < UTF8String_mv[want]) - return U8E_NOTMIN; - if(dst < dstend) - *dst++ = value; /* Record value */ - } - - if(dst < dstend) *dst = 0; /* zero-terminate */ - - return length; -} - - -ssize_t -UTF8String_length(const UTF8String_t *st) { - if(st && st->buf) { - return UTF8String__process(st, 0, 0); - } else { - return U8E_EINVAL; - } -} - -size_t -UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen) { - if(st && st->buf) { - ssize_t ret = UTF8String__process(st, dst, dstlen); - return (ret < 0) ? 0 : ret; - } else { - return 0; - } -} - -int -UTF8String_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - const UTF8String_t *st = (const UTF8String_t *)sptr; - - (void)td; /* Unused argument */ - (void)ilevel; /* Unused argument */ - - if(st && st->buf) { - return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0; - } else { - return (cb("", 8, app_key) < 0) ? -1 : 0; - } -} - - -/* - * Biased function for randomizing UTF-8 sequences. - */ -static size_t -UTF8String__random_char(uint8_t *b, size_t size) { - static const struct rnd_value { - const char *value; - size_t size; - } values[] = {{"\0", 1}, - {"\x01", 1}, - {"\x7f", 1}, - {"\xc2\xa2", 2}, - {"\xe2\x82\xac", 3}, - {"\xf0\x90\x8d\x88", 4}, - {"\xf4\x8f\xbf\xbf", 4}}; - - const struct rnd_value *v; - size_t max_idx = 0; - - switch(size) { - case 0: - assert(size != 0); - return 0; - case 1: - max_idx = 2; - break; - case 2: - max_idx = 3; - break; - default: - case 4: - max_idx = sizeof(values) / sizeof(values[0]) - 1; - break; - } - - v = &values[asn_random_between(0, max_idx)]; - memcpy(b, v->value, v->size); - return v->size; -} - -asn_random_fill_result_t -UTF8String_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constraints, - size_t max_length) { - asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - uint8_t *buf; - uint8_t *bend; - uint8_t *b; - size_t rnd_len; - size_t idx; - UTF8String_t *st; - - if(max_length == 0 && !*sptr) return result_skipped; - - /* Figure out how far we should go */ - rnd_len = OCTET_STRING_random_length_constrained(td, constraints, - max_length / 4); - - buf = CALLOC(4, rnd_len + 1); - if(!buf) return result_failed; - - bend = &buf[4 * rnd_len]; - - for(b = buf, idx = 0; idx < rnd_len; idx++) { - b += UTF8String__random_char(b, (bend - b)); - } - *(uint8_t *)b = 0; - - if(*sptr) { - st = *sptr; - FREEMEM(st->buf); - } else { - st = (OCTET_STRING_t *)(*sptr = CALLOC(1, sizeof(UTF8String_t))); - if(!st) { - FREEMEM(buf); - return result_failed; - } - } - - st->buf = buf; - st->size = b - buf; - - assert(UTF8String_length(st) == (ssize_t)rnd_len); - - return result_ok; -} +/*- + * Copyright (c) 2003, 2004, 2006 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * UTF8String basic type description. + */ +static const ber_tlv_tag_t asn_DEF_UTF8String_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), /* [UNIVERSAL 12] IMPLICIT ...*/ + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */ +}; +asn_TYPE_operation_t asn_OP_UTF8String = { + OCTET_STRING_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + UTF8String_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + OCTET_STRING_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + OCTET_STRING_decode_xer_utf8, + OCTET_STRING_encode_xer_utf8, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + OCTET_STRING_encode_jer_utf8, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + OCTET_STRING_decode_oer, + OCTET_STRING_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + OCTET_STRING_decode_aper, + OCTET_STRING_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + UTF8String_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_UTF8String = { + "UTF8String", + "UTF8String", + &asn_OP_UTF8String, + asn_DEF_UTF8String_tags, + sizeof(asn_DEF_UTF8String_tags) + / sizeof(asn_DEF_UTF8String_tags[0]) - 1, + asn_DEF_UTF8String_tags, + sizeof(asn_DEF_UTF8String_tags) + / sizeof(asn_DEF_UTF8String_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + UTF8String_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +/* + * This is the table of length expectations. + * The second half of this table is only applicable to the long sequences. + */ +static const int UTF8String_ht[2][16] = { + { /* 0x0 ... 0x7 */ + /* 0000..0111 */ + 1, 1, 1, 1, 1, 1, 1, 1, + /* 1000..1011(0), 1100..1101(2), 1110(3), 1111(-1) */ + 0, 0, 0, 0, 2, 2, 3, -1 }, + { /* 0xF0 .. 0xF7 */ + /* 11110000..11110111 */ + 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 6, 6, -1, -1 } +}; +static const int32_t UTF8String_mv[7] = { 0, 0, + 0x00000080, + 0x00000800, + 0x00010000, + 0x00200000, + 0x04000000 +}; + +/* Internal aliases for return codes */ +#define U8E_TRUNC -1 /* UTF-8 sequence truncated */ +#define U8E_ILLSTART -2 /* Illegal UTF-8 sequence start */ +#define U8E_NOTCONT -3 /* Continuation expectation failed */ +#define U8E_NOTMIN -4 /* Not minimal length encoding */ +#define U8E_EINVAL -5 /* Invalid arguments */ + +int +UTF8String_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + ssize_t len = UTF8String_length((const UTF8String_t *)sptr); + switch(len) { + case U8E_EINVAL: + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given", td->name); + break; + case U8E_TRUNC: + ASN__CTFAIL(app_key, td, sptr, + "%s: truncated UTF-8 sequence (%s:%d)", + td->name, __FILE__, __LINE__); + break; + case U8E_ILLSTART: + ASN__CTFAIL(app_key, td, sptr, + "%s: UTF-8 illegal start of encoding (%s:%d)", + td->name, __FILE__, __LINE__); + break; + case U8E_NOTCONT: + ASN__CTFAIL(app_key, td, sptr, + "%s: UTF-8 not continuation (%s:%d)", + td->name, __FILE__, __LINE__); + break; + case U8E_NOTMIN: + ASN__CTFAIL(app_key, td, sptr, + "%s: UTF-8 not minimal sequence (%s:%d)", + td->name, __FILE__, __LINE__); + break; + } + return (len < 0) ? -1 : 0; +} + +static ssize_t +UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen) { + size_t length = 0; + uint8_t *buf = (st == NULL)? NULL : st->buf; + uint8_t *end = (buf == NULL)? NULL : buf + st->size; + uint32_t *dstend = (dst == NULL)? NULL : dst + dstlen; + + for(length = 0; buf < end; length++) { + int ch = *buf; + uint8_t *cend; + int32_t value; + int want; + + /* Compute the sequence length */ + want = UTF8String_ht[0][ch >> 4]; + switch(want) { + case -1: + /* Second half of the table, long sequence */ + want = UTF8String_ht[1][ch & 0x0F]; + if(want != -1) break; + /* Fall through */ + case 0: + return U8E_ILLSTART; + } + + /* assert(want >= 1 && want <= 6) */ + + /* Check character sequence length */ + if(buf + want > end) return U8E_TRUNC; + + value = ch & (0xff >> want); + cend = buf + want; + for(buf++; buf < cend; buf++) { + ch = *buf; + if(ch < 0x80 || ch > 0xbf) return U8E_NOTCONT; + value = (value << 6) | (ch & 0x3F); + } + if(value < UTF8String_mv[want]) + return U8E_NOTMIN; + if(dst < dstend) + *dst++ = value; /* Record value */ + } + + if(dst < dstend) *dst = 0; /* zero-terminate */ + + return length; +} + + +ssize_t +UTF8String_length(const UTF8String_t *st) { + if(st && st->buf) { + return UTF8String__process(st, 0, 0); + } else { + return U8E_EINVAL; + } +} + +size_t +UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen) { + if(st && st->buf) { + ssize_t ret = UTF8String__process(st, dst, dstlen); + return (ret < 0) ? 0 : ret; + } else { + return 0; + } +} + diff --git a/certgen/asncodec/UTF8String.h b/certgen/asncodec/UTF8String.h index 1ba3b78..3a31def 100644 --- a/certgen/asncodec/UTF8String.h +++ b/certgen/asncodec/UTF8String.h @@ -1,61 +1,84 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _UTF8String_H_ -#define _UTF8String_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */ - -extern asn_TYPE_descriptor_t asn_DEF_UTF8String; -extern asn_TYPE_operation_t asn_OP_UTF8String; - -asn_struct_print_f UTF8String_print; -asn_constr_check_f UTF8String_constraint; -asn_random_fill_f UTF8String_random_fill; - -#define UTF8String_free OCTET_STRING_free -#define UTF8String_compare OCTET_STRING_compare -#define UTF8String_constraint UTF8String_constraint -#define UTF8String_decode_ber OCTET_STRING_decode_ber -#define UTF8String_encode_der OCTET_STRING_encode_der -#define UTF8String_decode_xer OCTET_STRING_decode_xer_utf8 -#define UTF8String_encode_xer OCTET_STRING_encode_xer_utf8 -#define UTF8String_decode_uper OCTET_STRING_decode_uper -#define UTF8String_encode_uper OCTET_STRING_encode_uper - -/* - * Returns length of the given UTF-8 string in characters, - * or a negative error code: - * -1: UTF-8 sequence truncated - * -2: Illegal UTF-8 sequence start - * -3: Continuation expectation failed - * -4: Not minimal length encoding - * -5: Invalid arguments - */ -ssize_t UTF8String_length(const UTF8String_t *st); - -/* - * Convert the UTF-8 string into a sequence of wide characters. - * Returns the number of characters necessary. - * Returned value might be greater than dstlen. - * In case of conversion error, 0 is returned. - * - * If st points to a valid UTF-8 string, calling - * UTF8String_to_wcs(st, 0, 0); - * is equivalent to - * UTF8String_length(const UTF8String_t *st); - */ -size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen); - -#ifdef __cplusplus -} -#endif - -#endif /* _UTF8String_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _UTF8String_H_ +#define _UTF8String_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */ + +extern asn_TYPE_descriptor_t asn_DEF_UTF8String; +extern asn_TYPE_operation_t asn_OP_UTF8String; + +#define UTF8String_free OCTET_STRING_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f UTF8String_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +#define UTF8String_compare OCTET_STRING_compare + +asn_constr_check_f UTF8String_constraint; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define UTF8String_decode_ber OCTET_STRING_decode_ber +#define UTF8String_encode_der OCTET_STRING_encode_der +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define UTF8String_decode_xer OCTET_STRING_decode_xer_utf8 +#define UTF8String_encode_xer OCTET_STRING_encode_xer_utf8 +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +#define UTF8String_encode_jer OCTET_STRING_encode_jer_utf8 +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +#define UTF8String_decode_uper OCTET_STRING_decode_uper +#define UTF8String_encode_uper OCTET_STRING_encode_uper +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#define UTF8String_decode_aper OCTET_STRING_decode_aper +#define UTF8String_encode_aper OCTET_STRING_encode_aper +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f UTF8String_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +/* + * Returns length of the given UTF-8 string in characters, + * or a negative error code: + * -1: UTF-8 sequence truncated + * -2: Illegal UTF-8 sequence start + * -3: Continuation expectation failed + * -4: Not minimal length encoding + * -5: Invalid arguments + */ +ssize_t UTF8String_length(const UTF8String_t *st); + +/* + * Convert the UTF-8 string into a sequence of wide characters. + * Returns the number of characters necessary. + * Returned value might be greater than dstlen. + * In case of conversion error, 0 is returned. + * + * If st points to a valid UTF-8 string, calling + * UTF8String_to_wcs(st, 0, 0); + * is equivalent to + * UTF8String_length(const UTF8String_t *st); + */ +size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen); + +#ifdef __cplusplus +} +#endif + +#endif /* _UTF8String_H_ */ diff --git a/certgen/asncodec/UTF8String_print.c b/certgen/asncodec/UTF8String_print.c new file mode 100644 index 0000000..fdf7925 --- /dev/null +++ b/certgen/asncodec/UTF8String_print.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +UTF8String_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + const UTF8String_t *st = (const UTF8String_t *)sptr; + + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(st && st->buf) { + return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0; + } else { + return (cb("", 8, app_key) < 0) ? -1 : 0; + } +} diff --git a/certgen/asncodec/Uint16.c b/certgen/asncodec/Uint16.c index 6fe907d..8ea2103 100644 --- a/certgen/asncodec/Uint16.c +++ b/certgen/asncodec/Uint16.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Uint16.h" @@ -36,9 +36,11 @@ Uint16_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Uint16_constr_1 CC_NOTUSED = { { 2, 1 } /* (0..65535) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Uint16_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_Uint16 = { asn_DEF_Uint16_tags_1, /* Same as above */ sizeof(asn_DEF_Uint16_tags_1) /sizeof(asn_DEF_Uint16_tags_1[0]), /* 1 */ - { &asn_OER_type_Uint16_constr_1, 0, Uint16_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Uint16_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Uint16_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Uint16.h b/certgen/asncodec/Uint16.h index 864785c..efcb5aa 100644 --- a/certgen/asncodec/Uint16.h +++ b/certgen/asncodec/Uint16.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Uint16_H_ #define _Uint16_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Uint16; asn_struct_free_f Uint16_free; asn_struct_print_f Uint16_print; asn_constr_check_f Uint16_constraint; -ber_type_decoder_f Uint16_decode_ber; -der_type_encoder_f Uint16_encode_der; xer_type_decoder_f Uint16_decode_xer; xer_type_encoder_f Uint16_encode_xer; oer_type_decoder_f Uint16_decode_oer; diff --git a/certgen/asncodec/Uint3.c b/certgen/asncodec/Uint3.c index fb8c323..83f65c8 100644 --- a/certgen/asncodec/Uint3.c +++ b/certgen/asncodec/Uint3.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Uint3.h" @@ -36,9 +36,11 @@ Uint3_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Uint3_constr_1 CC_NOTUSED = { { 1, 1 } /* (0..7) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Uint3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_Uint3 = { asn_DEF_Uint3_tags_1, /* Same as above */ sizeof(asn_DEF_Uint3_tags_1) /sizeof(asn_DEF_Uint3_tags_1[0]), /* 1 */ - { &asn_OER_type_Uint3_constr_1, 0, Uint3_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Uint3_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Uint3_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Uint3.h b/certgen/asncodec/Uint3.h index 2bc6ddb..9560877 100644 --- a/certgen/asncodec/Uint3.h +++ b/certgen/asncodec/Uint3.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Uint3_H_ #define _Uint3_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Uint3; asn_struct_free_f Uint3_free; asn_struct_print_f Uint3_print; asn_constr_check_f Uint3_constraint; -ber_type_decoder_f Uint3_decode_ber; -der_type_encoder_f Uint3_encode_der; xer_type_decoder_f Uint3_decode_xer; xer_type_encoder_f Uint3_encode_xer; oer_type_decoder_f Uint3_decode_oer; diff --git a/certgen/asncodec/Uint32.c b/certgen/asncodec/Uint32.c index 361d6b5..85b4bbf 100644 --- a/certgen/asncodec/Uint32.c +++ b/certgen/asncodec/Uint32.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Uint32.h" @@ -27,9 +27,11 @@ Uint32_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Uint32_constr_1 CC_NOTUSED = { { 4, 1 } /* (0..4294967295) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ const asn_INTEGER_specifics_t asn_SPC_Uint32_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ @@ -48,7 +50,15 @@ asn_TYPE_descriptor_t asn_DEF_Uint32 = { asn_DEF_Uint32_tags_1, /* Same as above */ sizeof(asn_DEF_Uint32_tags_1) /sizeof(asn_DEF_Uint32_tags_1[0]), /* 1 */ - { &asn_OER_type_Uint32_constr_1, 0, Uint32_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Uint32_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Uint32_constraint + }, 0, 0, /* No members */ &asn_SPC_Uint32_specs_1 /* Additional specs */ }; diff --git a/certgen/asncodec/Uint32.h b/certgen/asncodec/Uint32.h index 64b9e71..613c9da 100644 --- a/certgen/asncodec/Uint32.h +++ b/certgen/asncodec/Uint32.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Uint32_H_ #define _Uint32_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -27,8 +27,6 @@ extern const asn_INTEGER_specifics_t asn_SPC_Uint32_specs_1; asn_struct_free_f Uint32_free; asn_struct_print_f Uint32_print; asn_constr_check_f Uint32_constraint; -ber_type_decoder_f Uint32_decode_ber; -der_type_encoder_f Uint32_encode_der; xer_type_decoder_f Uint32_decode_xer; xer_type_encoder_f Uint32_encode_xer; oer_type_decoder_f Uint32_decode_oer; diff --git a/certgen/asncodec/Uint64.c b/certgen/asncodec/Uint64.c index 13ee0e2..9320fa7 100644 --- a/certgen/asncodec/Uint64.c +++ b/certgen/asncodec/Uint64.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Uint64.h" @@ -27,7 +27,7 @@ Uint64_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if((value >= 0 && value <= 18446744073709551615)) { + if((value >= 0 && value <= 18446744073709551615ULL)) { /* Constraint check succeeded */ return 0; } else { @@ -42,9 +42,11 @@ Uint64_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Uint64_constr_1 CC_NOTUSED = { - { 8, 1 } /* (0..18446744073709551615) */, + { 8, 1 } /* (0..18446744073709551615ULL) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Uint64_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -58,7 +60,15 @@ asn_TYPE_descriptor_t asn_DEF_Uint64 = { asn_DEF_Uint64_tags_1, /* Same as above */ sizeof(asn_DEF_Uint64_tags_1) /sizeof(asn_DEF_Uint64_tags_1[0]), /* 1 */ - { &asn_OER_type_Uint64_constr_1, 0, Uint64_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Uint64_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Uint64_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Uint64.h b/certgen/asncodec/Uint64.h index 3f7068a..82cee41 100644 --- a/certgen/asncodec/Uint64.h +++ b/certgen/asncodec/Uint64.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Uint64_H_ #define _Uint64_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Uint64; asn_struct_free_f Uint64_free; asn_struct_print_f Uint64_print; asn_constr_check_f Uint64_constraint; -ber_type_decoder_f Uint64_decode_ber; -der_type_encoder_f Uint64_encode_der; xer_type_decoder_f Uint64_decode_xer; xer_type_encoder_f Uint64_encode_xer; oer_type_decoder_f Uint64_decode_oer; diff --git a/certgen/asncodec/Uint8.c b/certgen/asncodec/Uint8.c index 546a6d3..ee841f0 100644 --- a/certgen/asncodec/Uint8.c +++ b/certgen/asncodec/Uint8.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Uint8.h" @@ -36,9 +36,11 @@ Uint8_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_Uint8_constr_1 CC_NOTUSED = { { 1, 1 } /* (0..255) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_Uint8_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_Uint8 = { asn_DEF_Uint8_tags_1, /* Same as above */ sizeof(asn_DEF_Uint8_tags_1) /sizeof(asn_DEF_Uint8_tags_1[0]), /* 1 */ - { &asn_OER_type_Uint8_constr_1, 0, Uint8_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_Uint8_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + Uint8_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Uint8.h b/certgen/asncodec/Uint8.h index 7114b19..508f476 100644 --- a/certgen/asncodec/Uint8.h +++ b/certgen/asncodec/Uint8.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Uint8_H_ #define _Uint8_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Uint8; asn_struct_free_f Uint8_free; asn_struct_print_f Uint8_print; asn_constr_check_f Uint8_constraint; -ber_type_decoder_f Uint8_decode_ber; -der_type_encoder_f Uint8_encode_der; xer_type_decoder_f Uint8_decode_xer; xer_type_encoder_f Uint8_encode_xer; oer_type_decoder_f Uint8_decode_oer; diff --git a/certgen/asncodec/UnCountryId.c b/certgen/asncodec/UnCountryId.c new file mode 100644 index 0000000..439c2b9 --- /dev/null +++ b/certgen/asncodec/UnCountryId.c @@ -0,0 +1,69 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "UnCountryId.h" + +int +UnCountryId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 65535)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using Uint16, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_UnCountryId_constr_1 CC_NOTUSED = { + { 2, 1 } /* (0..65535) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_UnCountryId_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_UnCountryId = { + "UnCountryId", + "UnCountryId", + &asn_OP_NativeInteger, + asn_DEF_UnCountryId_tags_1, + sizeof(asn_DEF_UnCountryId_tags_1) + /sizeof(asn_DEF_UnCountryId_tags_1[0]), /* 1 */ + asn_DEF_UnCountryId_tags_1, /* Same as above */ + sizeof(asn_DEF_UnCountryId_tags_1) + /sizeof(asn_DEF_UnCountryId_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_UnCountryId_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + UnCountryId_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/certgen/asncodec/UnCountryId.h b/certgen/asncodec/UnCountryId.h new file mode 100644 index 0000000..e7de1bb --- /dev/null +++ b/certgen/asncodec/UnCountryId.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Uint16.h" +#ifndef _UnCountryId_H_ +#define _UnCountryId_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* UnCountryId */ +typedef Uint16_t UnCountryId_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_UnCountryId; +asn_struct_free_f UnCountryId_free; +asn_struct_print_f UnCountryId_print; +asn_constr_check_f UnCountryId_constraint; +xer_type_decoder_f UnCountryId_decode_xer; +xer_type_encoder_f UnCountryId_encode_xer; +oer_type_decoder_f UnCountryId_decode_oer; +oer_type_encoder_f UnCountryId_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _UnCountryId_H_ */ +#include diff --git a/certgen/asncodec/UnknownLatitude.c b/certgen/asncodec/UnknownLatitude.c index 2fee900..2dfe841 100644 --- a/certgen/asncodec/UnknownLatitude.c +++ b/certgen/asncodec/UnknownLatitude.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "UnknownLatitude.h" @@ -36,9 +36,11 @@ UnknownLatitude_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using NinetyDegreeInt, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_UnknownLatitude_constr_1 CC_NOTUSED = { { 4, 1 } /* (900000001..900000001) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_UnknownLatitude_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_UnknownLatitude = { asn_DEF_UnknownLatitude_tags_1, /* Same as above */ sizeof(asn_DEF_UnknownLatitude_tags_1) /sizeof(asn_DEF_UnknownLatitude_tags_1[0]), /* 1 */ - { &asn_OER_type_UnknownLatitude_constr_1, 0, UnknownLatitude_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_UnknownLatitude_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + UnknownLatitude_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/UnknownLatitude.h b/certgen/asncodec/UnknownLatitude.h index 0289397..1312cdb 100644 --- a/certgen/asncodec/UnknownLatitude.h +++ b/certgen/asncodec/UnknownLatitude.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "NinetyDegreeInt.h" #ifndef _UnknownLatitude_H_ #define _UnknownLatitude_H_ #include -/* Including external dependencies */ -#include "NinetyDegreeInt.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_UnknownLatitude; asn_struct_free_f UnknownLatitude_free; asn_struct_print_f UnknownLatitude_print; asn_constr_check_f UnknownLatitude_constraint; -ber_type_decoder_f UnknownLatitude_decode_ber; -der_type_encoder_f UnknownLatitude_encode_der; xer_type_decoder_f UnknownLatitude_decode_xer; xer_type_encoder_f UnknownLatitude_encode_xer; oer_type_decoder_f UnknownLatitude_decode_oer; diff --git a/certgen/asncodec/UnknownLongitude.c b/certgen/asncodec/UnknownLongitude.c index d1f2b11..7b1dd60 100644 --- a/certgen/asncodec/UnknownLongitude.c +++ b/certgen/asncodec/UnknownLongitude.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "UnknownLongitude.h" @@ -36,9 +36,11 @@ UnknownLongitude_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, * This type is implemented using OneEightyDegreeInt, * so here we adjust the DEF accordingly. */ +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_UnknownLongitude_constr_1 CC_NOTUSED = { { 4, 1 } /* (1800000001..1800000001) */, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_UnknownLongitude_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; @@ -52,7 +54,15 @@ asn_TYPE_descriptor_t asn_DEF_UnknownLongitude = { asn_DEF_UnknownLongitude_tags_1, /* Same as above */ sizeof(asn_DEF_UnknownLongitude_tags_1) /sizeof(asn_DEF_UnknownLongitude_tags_1[0]), /* 1 */ - { &asn_OER_type_UnknownLongitude_constr_1, 0, UnknownLongitude_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_UnknownLongitude_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + UnknownLongitude_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/UnknownLongitude.h b/certgen/asncodec/UnknownLongitude.h index 3f122f4..e1fe921 100644 --- a/certgen/asncodec/UnknownLongitude.h +++ b/certgen/asncodec/UnknownLongitude.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "OneEightyDegreeInt.h" #ifndef _UnknownLongitude_H_ #define _UnknownLongitude_H_ #include -/* Including external dependencies */ -#include "OneEightyDegreeInt.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_UnknownLongitude; asn_struct_free_f UnknownLongitude_free; asn_struct_print_f UnknownLongitude_print; asn_constr_check_f UnknownLongitude_constraint; -ber_type_decoder_f UnknownLongitude_decode_ber; -der_type_encoder_f UnknownLongitude_encode_der; xer_type_decoder_f UnknownLongitude_decode_xer; xer_type_encoder_f UnknownLongitude_encode_xer; oer_type_decoder_f UnknownLongitude_decode_oer; diff --git a/certgen/asncodec/UnsecuredAprvBinaryTree.c b/certgen/asncodec/UnsecuredAprvBinaryTree.c new file mode 100644 index 0000000..0bf0c5e --- /dev/null +++ b/certgen/asncodec/UnsecuredAprvBinaryTree.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "UnsecuredAprvBinaryTree.h" + +int +UnsecuredAprvBinaryTree_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using Ieee1609Dot2Data_Unsecured_216P1, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_UnsecuredAprvBinaryTree_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_UnsecuredAprvBinaryTree_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_UnsecuredAprvBinaryTree = { + "UnsecuredAprvBinaryTree", + "UnsecuredAprvBinaryTree", + &asn_OP_SEQUENCE, + asn_DEF_UnsecuredAprvBinaryTree_tags_1, + sizeof(asn_DEF_UnsecuredAprvBinaryTree_tags_1) + /sizeof(asn_DEF_UnsecuredAprvBinaryTree_tags_1[0]), /* 1 */ + asn_DEF_UnsecuredAprvBinaryTree_tags_1, /* Same as above */ + sizeof(asn_DEF_UnsecuredAprvBinaryTree_tags_1) + /sizeof(asn_DEF_UnsecuredAprvBinaryTree_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_UnsecuredAprvBinaryTree_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + UnsecuredAprvBinaryTree_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/UnsecuredAprvBinaryTree.h b/certgen/asncodec/UnsecuredAprvBinaryTree.h new file mode 100644 index 0000000..aab1e67 --- /dev/null +++ b/certgen/asncodec/UnsecuredAprvBinaryTree.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Acpc" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "Ieee1609Dot2Data-Unsecured.h" +#ifndef _UnsecuredAprvBinaryTree_H_ +#define _UnsecuredAprvBinaryTree_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* UnsecuredAprvBinaryTree */ +typedef Ieee1609Dot2Data_Unsecured_216P1_t UnsecuredAprvBinaryTree_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_UnsecuredAprvBinaryTree; +asn_struct_free_f UnsecuredAprvBinaryTree_free; +asn_struct_print_f UnsecuredAprvBinaryTree_print; +asn_constr_check_f UnsecuredAprvBinaryTree_constraint; +xer_type_decoder_f UnsecuredAprvBinaryTree_decode_xer; +xer_type_encoder_f UnsecuredAprvBinaryTree_encode_xer; +oer_type_decoder_f UnsecuredAprvBinaryTree_decode_oer; +oer_type_encoder_f UnsecuredAprvBinaryTree_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _UnsecuredAprvBinaryTree_H_ */ +#include diff --git a/certgen/asncodec/Url.c b/certgen/asncodec/Url.c index 5233dfb..56e6b12 100644 --- a/certgen/asncodec/Url.c +++ b/certgen/asncodec/Url.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Url.h" @@ -24,7 +24,15 @@ asn_TYPE_descriptor_t asn_DEF_Url = { asn_DEF_Url_tags_1, /* Same as above */ sizeof(asn_DEF_Url_tags_1) /sizeof(asn_DEF_Url_tags_1[0]), /* 1 */ - { 0, 0, IA5String_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + IA5String_constraint + }, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Url.h b/certgen/asncodec/Url.h index b08257a..eb2c9bb 100644 --- a/certgen/asncodec/Url.h +++ b/certgen/asncodec/Url.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941TrustLists" - * found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941TrustLists.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Url_H_ #define _Url_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Url; asn_struct_free_f Url_free; asn_struct_print_f Url_print; asn_constr_check_f Url_constraint; -ber_type_decoder_f Url_decode_ber; -der_type_encoder_f Url_encode_der; xer_type_decoder_f Url_decode_xer; xer_type_encoder_f Url_encode_xer; oer_type_decoder_f Url_decode_oer; diff --git a/certgen/asncodec/ValidityPeriod.c b/certgen/asncodec/ValidityPeriod.c index f0b8ff6..0264832 100644 --- a/certgen/asncodec/ValidityPeriod.c +++ b/certgen/asncodec/ValidityPeriod.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "ValidityPeriod.h" @@ -13,7 +13,15 @@ asn_TYPE_member_t asn_MBR_ValidityPeriod_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_Time32, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "start" }, @@ -22,7 +30,15 @@ asn_TYPE_member_t asn_MBR_ValidityPeriod_1[] = { +1, /* EXPLICIT tag at current level */ &asn_DEF_Duration, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "duration" }, @@ -52,7 +68,15 @@ asn_TYPE_descriptor_t asn_DEF_ValidityPeriod = { asn_DEF_ValidityPeriod_tags_1, /* Same as above */ sizeof(asn_DEF_ValidityPeriod_tags_1) /sizeof(asn_DEF_ValidityPeriod_tags_1[0]), /* 1 */ - { 0, 0, SEQUENCE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, asn_MBR_ValidityPeriod_1, 2, /* Elements count */ &asn_SPC_ValidityPeriod_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/ValidityPeriod.h b/certgen/asncodec/ValidityPeriod.h index 3a7b53a..fec69b1 100644 --- a/certgen/asncodec/ValidityPeriod.h +++ b/certgen/asncodec/ValidityPeriod.h @@ -1,20 +1,20 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2BaseTypes" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2BaseTypes" + * found in "asn1/ieee1609.2/IEEE1609dot2BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ -#ifndef _ValidityPeriod_H_ -#define _ValidityPeriod_H_ - - -#include /* Including external dependencies */ #include "Time32.h" #include "Duration.h" #include +#ifndef _ValidityPeriod_H_ +#define _ValidityPeriod_H_ + + +#include #ifdef __cplusplus extern "C" { diff --git a/certgen/asncodec/VerificationKeyIndicator.c b/certgen/asncodec/VerificationKeyIndicator.c index c0ef813..00af797 100644 --- a/certgen/asncodec/VerificationKeyIndicator.c +++ b/certgen/asncodec/VerificationKeyIndicator.c @@ -1,31 +1,49 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "VerificationKeyIndicator.h" +#if !defined(ASN_DISABLE_OER_SUPPORT) static asn_oer_constraints_t asn_OER_type_VerificationKeyIndicator_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ asn_TYPE_member_t asn_MBR_VerificationKeyIndicator_1[] = { { ATF_NOFLAGS, 0, offsetof(struct VerificationKeyIndicator, choice.verificationKey), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), +1, /* EXPLICIT tag at current level */ &asn_DEF_PublicVerificationKey, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "verificationKey" }, { ATF_NOFLAGS, 0, offsetof(struct VerificationKeyIndicator, choice.reconstructionValue), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), +1, /* EXPLICIT tag at current level */ - &asn_DEF_EccP256CurvePoint, + &asn_DEF_ReconstructionValue, 0, - { 0, 0, 0 }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, 0, 0, /* No default value */ "reconstructionValue" }, @@ -52,7 +70,15 @@ asn_TYPE_descriptor_t asn_DEF_VerificationKeyIndicator = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - { &asn_OER_type_VerificationKeyIndicator_constr_1, 0, CHOICE_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_VerificationKeyIndicator_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, asn_MBR_VerificationKeyIndicator_1, 2, /* Elements count */ &asn_SPC_VerificationKeyIndicator_specs_1 /* Additional specs */ diff --git a/certgen/asncodec/VerificationKeyIndicator.h b/certgen/asncodec/VerificationKeyIndicator.h index 25b3a93..ee6dfc1 100644 --- a/certgen/asncodec/VerificationKeyIndicator.h +++ b/certgen/asncodec/VerificationKeyIndicator.h @@ -1,21 +1,21 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) - * From ASN.1 module "IEEE1609dot2" - * found in "../asn1/1609Dot2-ASN1/asn1c/IEEE1609dot2.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2" + * found in "asn1/ieee1609.2/IEEE1609dot2.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include "PublicVerificationKey.h" +#include "ReconstructionValue.h" +#include #ifndef _VerificationKeyIndicator_H_ #define _VerificationKeyIndicator_H_ #include -/* Including external dependencies */ -#include "PublicVerificationKey.h" -#include "EccP256CurvePoint.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -34,7 +34,7 @@ typedef struct VerificationKeyIndicator { VerificationKeyIndicator_PR present; union VerificationKeyIndicator_u { PublicVerificationKey_t verificationKey; - EccP256CurvePoint_t reconstructionValue; + ReconstructionValue_t reconstructionValue; /* * This type is extensible, * possible extensions are below. diff --git a/certgen/asncodec/Version.c b/certgen/asncodec/Version.c index 72d8441..fdd12ac 100644 --- a/certgen/asncodec/Version.c +++ b/certgen/asncodec/Version.c @@ -1,8 +1,8 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ #include "Version.h" @@ -24,7 +24,15 @@ asn_TYPE_descriptor_t asn_DEF_Version = { asn_DEF_Version_tags_1, /* Same as above */ sizeof(asn_DEF_Version_tags_1) /sizeof(asn_DEF_Version_tags_1[0]), /* 1 */ - { 0, 0, NativeInteger_constraint }, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + NativeInteger_constraint + }, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/certgen/asncodec/Version.h b/certgen/asncodec/Version.h index fe730e4..ac0857a 100644 --- a/certgen/asncodec/Version.h +++ b/certgen/asncodec/Version.h @@ -1,19 +1,19 @@ /* - * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) * From ASN.1 module "EtsiTs102941BaseTypes" - * found in "../asn1/EtsiTs102941/EtsiTs102941BaseTypes.asn" - * `asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage` + * found in "asn1/pki_ts102941/EtsiTs102941BaseTypes.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` */ + +/* Including external dependencies */ +#include #ifndef _Version_H_ #define _Version_H_ #include -/* Including external dependencies */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -31,8 +31,6 @@ extern asn_TYPE_descriptor_t asn_DEF_Version; asn_struct_free_f Version_free; asn_struct_print_f Version_print; asn_constr_check_f Version_constraint; -ber_type_decoder_f Version_decode_ber; -der_type_encoder_f Version_encode_der; xer_type_decoder_f Version_decode_xer; xer_type_encoder_f Version_encode_xer; oer_type_decoder_f Version_decode_oer; diff --git a/certgen/asncodec/X509Certificate.c b/certgen/asncodec/X509Certificate.c new file mode 100644 index 0000000..ca5847f --- /dev/null +++ b/certgen/asncodec/X509Certificate.c @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "X509Certificate.h" + +/* + * This type is implemented using OCTET_STRING, + * so here we adjust the DEF accordingly. + */ +static const ber_tlv_tag_t asn_DEF_X509Certificate_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_X509Certificate = { + "X509Certificate", + "X509Certificate", + &asn_OP_OCTET_STRING, + asn_DEF_X509Certificate_tags_1, + sizeof(asn_DEF_X509Certificate_tags_1) + /sizeof(asn_DEF_X509Certificate_tags_1[0]), /* 1 */ + asn_DEF_X509Certificate_tags_1, /* Same as above */ + sizeof(asn_DEF_X509Certificate_tags_1) + /sizeof(asn_DEF_X509Certificate_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + OCTET_STRING_constraint + }, + 0, 0, /* No members */ + &asn_SPC_OCTET_STRING_specs /* Additional specs */ +}; + diff --git a/certgen/asncodec/X509Certificate.h b/certgen/asncodec/X509Certificate.h new file mode 100644 index 0000000..df34d44 --- /dev/null +++ b/certgen/asncodec/X509Certificate.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#ifndef _X509Certificate_H_ +#define _X509Certificate_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* X509Certificate */ +typedef OCTET_STRING_t X509Certificate_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_X509Certificate; +asn_struct_free_f X509Certificate_free; +asn_struct_print_f X509Certificate_print; +asn_constr_check_f X509Certificate_constraint; +xer_type_decoder_f X509Certificate_decode_xer; +xer_type_encoder_f X509Certificate_encode_xer; +oer_type_decoder_f X509Certificate_decode_oer; +oer_type_encoder_f X509Certificate_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _X509Certificate_H_ */ +#include diff --git a/certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.c b/certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.c new file mode 100644 index 0000000..afd35e6 --- /dev/null +++ b/certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.c @@ -0,0 +1,64 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "X509SignedButterflyAuthorizationRequestMessage.h" + +int +X509SignedButterflyAuthorizationRequestMessage_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using EtsiTs103097Data_Encrypted_Unicast_107P0, + * so here we adjust the DEF accordingly. + */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_X509SignedButterflyAuthorizationRequestMessage_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static const ber_tlv_tag_t asn_DEF_X509SignedButterflyAuthorizationRequestMessage_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_X509SignedButterflyAuthorizationRequestMessage = { + "X509SignedButterflyAuthorizationRequestMessage", + "X509SignedButterflyAuthorizationRequestMessage", + &asn_OP_SEQUENCE, + asn_DEF_X509SignedButterflyAuthorizationRequestMessage_tags_1, + sizeof(asn_DEF_X509SignedButterflyAuthorizationRequestMessage_tags_1) + /sizeof(asn_DEF_X509SignedButterflyAuthorizationRequestMessage_tags_1[0]), /* 1 */ + asn_DEF_X509SignedButterflyAuthorizationRequestMessage_tags_1, /* Same as above */ + sizeof(asn_DEF_X509SignedButterflyAuthorizationRequestMessage_tags_1) + /sizeof(asn_DEF_X509SignedButterflyAuthorizationRequestMessage_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_X509SignedButterflyAuthorizationRequestMessage_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + X509SignedButterflyAuthorizationRequestMessage_constraint + }, + asn_MBR_Ieee1609Dot2Data_1, + 2, /* Elements count */ + &asn_SPC_Ieee1609Dot2Data_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.h b/certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.h new file mode 100644 index 0000000..059cb60 --- /dev/null +++ b/certgen/asncodec/X509SignedButterflyAuthorizationRequestMessage.h @@ -0,0 +1,39 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "EtsiTs102941MessagesCa" + * found in "asn1/pki_ts102941/EtsiTs102941MessagesCA.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "EtsiTs103097Data-Encrypted-Unicast.h" +#ifndef _X509SignedButterflyAuthorizationRequestMessage_H_ +#define _X509SignedButterflyAuthorizationRequestMessage_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* X509SignedButterflyAuthorizationRequestMessage */ +typedef EtsiTs103097Data_Encrypted_Unicast_107P0_t X509SignedButterflyAuthorizationRequestMessage_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_X509SignedButterflyAuthorizationRequestMessage; +asn_struct_free_f X509SignedButterflyAuthorizationRequestMessage_free; +asn_struct_print_f X509SignedButterflyAuthorizationRequestMessage_print; +asn_constr_check_f X509SignedButterflyAuthorizationRequestMessage_constraint; +xer_type_decoder_f X509SignedButterflyAuthorizationRequestMessage_decode_xer; +xer_type_encoder_f X509SignedButterflyAuthorizationRequestMessage_encode_xer; +oer_type_decoder_f X509SignedButterflyAuthorizationRequestMessage_decode_oer; +oer_type_encoder_f X509SignedButterflyAuthorizationRequestMessage_encode_oer; + +#ifdef __cplusplus +} +#endif + +#endif /* _X509SignedButterflyAuthorizationRequestMessage_H_ */ +#include diff --git a/certgen/asncodec/X509SignerIdentifier.c b/certgen/asncodec/X509SignerIdentifier.c new file mode 100644 index 0000000..cd7a207 --- /dev/null +++ b/certgen/asncodec/X509SignerIdentifier.c @@ -0,0 +1,68 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "X509SignerIdentifier.h" + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_X509SignerIdentifier_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_X509SignerIdentifier_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct X509SignerIdentifier, choice.certificate), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_SequenceOfX509Certificate, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "certificate" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_X509SignerIdentifier_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* certificate */ +}; +asn_CHOICE_specifics_t asn_SPC_X509SignerIdentifier_specs_1 = { + sizeof(struct X509SignerIdentifier), + offsetof(struct X509SignerIdentifier, _asn_ctx), + offsetof(struct X509SignerIdentifier, present), + sizeof(((struct X509SignerIdentifier *)0)->present), + asn_MAP_X509SignerIdentifier_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, + 1 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_X509SignerIdentifier = { + "X509SignerIdentifier", + "X509SignerIdentifier", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_X509SignerIdentifier_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_X509SignerIdentifier_1, + 1, /* Elements count */ + &asn_SPC_X509SignerIdentifier_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/X509SignerIdentifier.h b/certgen/asncodec/X509SignerIdentifier.h new file mode 100644 index 0000000..65e4c87 --- /dev/null +++ b/certgen/asncodec/X509SignerIdentifier.h @@ -0,0 +1,55 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "Ieee1609Dot2Dot1Protocol" + * found in "asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "SequenceOfX509Certificate.h" +#include +#ifndef _X509SignerIdentifier_H_ +#define _X509SignerIdentifier_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum X509SignerIdentifier_PR { + X509SignerIdentifier_PR_NOTHING, /* No components present */ + X509SignerIdentifier_PR_certificate + /* Extensions may appear below */ + +} X509SignerIdentifier_PR; + +/* X509SignerIdentifier */ +typedef struct X509SignerIdentifier { + X509SignerIdentifier_PR present; + union X509SignerIdentifier_u { + SequenceOfX509Certificate_t certificate; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} X509SignerIdentifier_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_X509SignerIdentifier; +extern asn_CHOICE_specifics_t asn_SPC_X509SignerIdentifier_specs_1; +extern asn_TYPE_member_t asn_MBR_X509SignerIdentifier_1[1]; + +#ifdef __cplusplus +} +#endif + +#endif /* _X509SignerIdentifier_H_ */ +#include diff --git a/certgen/asncodec/YEAR-ENCODING.c b/certgen/asncodec/YEAR-ENCODING.c new file mode 100644 index 0000000..3007fcd --- /dev/null +++ b/certgen/asncodec/YEAR-ENCODING.c @@ -0,0 +1,236 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "YEAR-ENCODING.h" + +static int +memb_immediate_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 2005 && value <= 2020)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_near_future_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 2021 && value <= 2276)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_near_past_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 1749 && value <= 2004)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_remainder_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + + if(1 /* No applicable constraints whatsoever */) { + /* Nothing is here. See below */ + } + + return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_immediate_constr_2 CC_NOTUSED = { + { 2, 1 } /* (2005..2020) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_near_future_constr_3 CC_NOTUSED = { + { 2, 1 } /* (2021..2276) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_near_past_constr_4 CC_NOTUSED = { + { 2, 1 } /* (1749..2004) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_remainder_constr_5 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_type_YEAR_ENCODING_constr_1 CC_NOTUSED = { + { 0, 0 }, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +asn_TYPE_member_t asn_MBR_YEAR_ENCODING_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct YEAR_ENCODING, choice.immediate), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_immediate_constr_2, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_immediate_constraint_1 + }, + 0, 0, /* No default value */ + "immediate" + }, + { ATF_NOFLAGS, 0, offsetof(struct YEAR_ENCODING, choice.near_future), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_near_future_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_near_future_constraint_1 + }, + 0, 0, /* No default value */ + "near-future" + }, + { ATF_NOFLAGS, 0, offsetof(struct YEAR_ENCODING, choice.near_past), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_near_past_constr_4, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_near_past_constraint_1 + }, + 0, 0, /* No default value */ + "near-past" + }, + { ATF_NOFLAGS, 0, offsetof(struct YEAR_ENCODING, choice.remainder), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + +1, /* EXPLICIT tag at current level */ + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_remainder_constr_5, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_remainder_constraint_1 + }, + 0, 0, /* No default value */ + "remainder" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_YEAR_ENCODING_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* immediate */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* near-future */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* near-past */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* remainder */ +}; +asn_CHOICE_specifics_t asn_SPC_YEAR_ENCODING_specs_1 = { + sizeof(struct YEAR_ENCODING), + offsetof(struct YEAR_ENCODING, _asn_ctx), + offsetof(struct YEAR_ENCODING, present), + sizeof(((struct YEAR_ENCODING *)0)->present), + asn_MAP_YEAR_ENCODING_tag2el_1, + 4, /* Count of tags in the map */ + 0, 0, + -1 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_YEAR_ENCODING = { + "YEAR-ENCODING", + "YEAR-ENCODING", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_type_YEAR_ENCODING_constr_1, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_YEAR_ENCODING_1, + 4, /* Elements count */ + &asn_SPC_YEAR_ENCODING_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/YEAR-ENCODING.h b/certgen/asncodec/YEAR-ENCODING.h new file mode 100644 index 0000000..8ef6afc --- /dev/null +++ b/certgen/asncodec/YEAR-ENCODING.h @@ -0,0 +1,55 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include +#include +#ifndef _YEAR_ENCODING_H_ +#define _YEAR_ENCODING_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum YEAR_ENCODING_PR { + YEAR_ENCODING_PR_NOTHING, /* No components present */ + YEAR_ENCODING_PR_immediate, + YEAR_ENCODING_PR_near_future, + YEAR_ENCODING_PR_near_past, + YEAR_ENCODING_PR_remainder +} YEAR_ENCODING_PR; + +/* YEAR-ENCODING */ +typedef struct YEAR_ENCODING { + YEAR_ENCODING_PR present; + union YEAR_ENCODING_u { + long immediate; + long near_future; + long near_past; + long remainder; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} YEAR_ENCODING_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_YEAR_ENCODING; +extern asn_CHOICE_specifics_t asn_SPC_YEAR_ENCODING_specs_1; +extern asn_TYPE_member_t asn_MBR_YEAR_ENCODING_1[4]; + +#ifdef __cplusplus +} +#endif + +#endif /* _YEAR_ENCODING_H_ */ +#include diff --git a/certgen/asncodec/YEAR-MONTH-ENCODING.c b/certgen/asncodec/YEAR-MONTH-ENCODING.c new file mode 100644 index 0000000..3c51798 --- /dev/null +++ b/certgen/asncodec/YEAR-MONTH-ENCODING.c @@ -0,0 +1,117 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + +#include "YEAR-MONTH-ENCODING.h" + +static int +memb_month_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 1 && value <= 12)) { + /* Constraint check succeeded */ + return 0; + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +#if !defined(ASN_DISABLE_OER_SUPPORT) +static asn_oer_constraints_t asn_OER_memb_month_constr_3 CC_NOTUSED = { + { 1, 1 } /* (1..12) */, + -1}; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +static asn_TYPE_member_t asn_MBR_YEAR_MONTH_ENCODING_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct YEAR_MONTH_ENCODING, year), + -1 /* Ambiguous tag (CHOICE?) */, + 0, + &asn_DEF_YEAR_ENCODING, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + 0 + }, + 0, 0, /* No default value */ + "year" + }, + { ATF_NOFLAGS, 0, offsetof(struct YEAR_MONTH_ENCODING, month), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NativeInteger, + 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + &asn_OER_memb_month_constr_3, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + memb_month_constraint_1 + }, + 0, 0, /* No default value */ + "month" + }, +}; +static const ber_tlv_tag_t asn_DEF_YEAR_MONTH_ENCODING_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_YEAR_MONTH_ENCODING_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* month */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* immediate */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* near-future */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* near-past */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* remainder */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_YEAR_MONTH_ENCODING_specs_1 = { + sizeof(struct YEAR_MONTH_ENCODING), + offsetof(struct YEAR_MONTH_ENCODING, _asn_ctx), + asn_MAP_YEAR_MONTH_ENCODING_tag2el_1, + 5, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_YEAR_MONTH_ENCODING = { + "YEAR-MONTH-ENCODING", + "YEAR-MONTH-ENCODING", + &asn_OP_SEQUENCE, + asn_DEF_YEAR_MONTH_ENCODING_tags_1, + sizeof(asn_DEF_YEAR_MONTH_ENCODING_tags_1) + /sizeof(asn_DEF_YEAR_MONTH_ENCODING_tags_1[0]), /* 1 */ + asn_DEF_YEAR_MONTH_ENCODING_tags_1, /* Same as above */ + sizeof(asn_DEF_YEAR_MONTH_ENCODING_tags_1) + /sizeof(asn_DEF_YEAR_MONTH_ENCODING_tags_1[0]), /* 1 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_YEAR_MONTH_ENCODING_1, + 2, /* Elements count */ + &asn_SPC_YEAR_MONTH_ENCODING_specs_1 /* Additional specs */ +}; + diff --git a/certgen/asncodec/YEAR-MONTH-ENCODING.h b/certgen/asncodec/YEAR-MONTH-ENCODING.h new file mode 100644 index 0000000..232ce47 --- /dev/null +++ b/certgen/asncodec/YEAR-MONTH-ENCODING.h @@ -0,0 +1,40 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + * From ASN.1 module "ASN1C-DATE" + * found in "../../../../asn1c-fillabs2/skeletons/standard-modules/date.asn1" + * `asn1c -S ../../../../asn1c-fillabs2/skeletons -fcompound-names -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage -pdu=EtsiTs103097Certificate` + */ + + +/* Including external dependencies */ +#include "YEAR-ENCODING.h" +#include +#include +#ifndef _YEAR_MONTH_ENCODING_H_ +#define _YEAR_MONTH_ENCODING_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* YEAR-MONTH-ENCODING */ +typedef struct YEAR_MONTH_ENCODING { + YEAR_ENCODING_t year; + long month; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} YEAR_MONTH_ENCODING_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_YEAR_MONTH_ENCODING; + +#ifdef __cplusplus +} +#endif + +#endif /* _YEAR_MONTH_ENCODING_H_ */ +#include diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn new file mode 100755 index 0000000..c83e0e3 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn @@ -0,0 +1,92 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: ACA - EE Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1AcaEeInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-ee(1) major-version-2(2) + minor-version-3(3)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + Certificate +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-5(5)} +WITH SUCCESSORS + + Time32, + Uint8 +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS +; + +/** + * @brief This is the parent structure for all structures exchanged between + * the ACA and the EE. The ACA - EE interface is a logical interface rather + * than a direct communications interface in that there is no direct message + * flow between the ACA and the EE: Messages from the ACA are stored + * by the RA and subsequently forwarded to the EE. The PDUs are identified as + * ACA-EE PDUs even though the RA acts as a forwarder for them because those + * PDUs are created by the ACA and encrypted for the EE, and not modified and + * frequently not read by the RA. An overview of this structure is as follows: + * + * @param acaEeCertResponse: contains the ACA's response to + * RaAcaCertRequestSPDU, which is meant for the EE and sent via the RA. + */ +AcaEeInterfacePdu ::= CHOICE { + acaEeCertResponse AcaEeCertResponse, + ... +} + +/** + * @brief This structure contains a certificate and associated data as + * generated by the ACA for the EE that will be the holder of that + * certificate. An overview of this structure is as follows: + * + * @note In the case where the butterfly expansion function is used + * to set certEncKey in RaAcaCertRequest, the value j is not communicated to + * the ACA. However, the EE that receives the certificate response can only + * decrypt the response if it knows j. The RA is therefore anticipated to + * store j so that it can be associated with the appropriate certificate + * response. The RA encodes j in the filename. + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of AcaEeCertResponse. + * + * @param certificate: contains an authorization certificate generated by the + * ACA. It is of the type indicated by the type field in the corresponding + * request (if the requester requested an incorrect type, the response would + * be an error not an instance of this structure). + * + * @param privateKeyInfo: shall be: + * - Present and contain the private key randomization value, if the field + * certificate.type is explicit and the butterfly key mechanism was used to + * generate the certificate. This is used by the EE in deriving the butterfly + * private key for explicit certificates as specified in 9.3. + * - Present and contain the private key reconstruction value, if the field + * certificate.type is implicit. This is used by the EE as specified in 5.3.2 + * of IEEE Std 1609.2a-2017 (also 9.3 if the butterfly key mechanism is used). + * - Absent otherwise. + */ +AcaEeCertResponse ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + certificate Certificate, + privateKeyInfo OCTET STRING (SIZE (32)) OPTIONAL, + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn new file mode 100755 index 0000000..26dee61 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn @@ -0,0 +1,26 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: ACA - LA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1AcaLaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-la(2) major-version-2(2) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +/** + * @brief This structure is not used by EEs, so it is defined as NULL for + * purposes of this document. + */ +AcaLaInterfacePdu ::= NULL + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn new file mode 100755 index 0000000..5a1c9fe --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn @@ -0,0 +1,26 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: ACA - MA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1AcaMaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-ma(3) major-version-2(2) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +/** + * @brief This structure is not used by EEs, so it is defined as NULL for + * purposes of this document. + */ +AcaMaInterfacePdu ::= NULL + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn new file mode 100755 index 0000000..1235651 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn @@ -0,0 +1,261 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: ACA - RA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1AcaRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-ra(4) major-version-3(3) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + CertificateType, + ToBeSignedCertificate +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-5(5)} +WITH SUCCESSORS + + HashAlgorithm, + HashedId8, + LaId, + PublicEncryptionKey, + Time32, + Uint8 +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS + + AcaEeCertResponsePlainSpdu, + AcaEeCertResponsePrivateSpdu, + AcaEeCertResponseCubkSpdu, + Ieee1609Dot2Data-SymmEncryptedSingleRecipient +FROM Ieee1609Dot2Dot1Protocol {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) protocol(17) + major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS +; + +/** + * @brief This is the parent structure for all structures exchanged between + * the ACA and the RA. An overview of this structure is as follows: + * + * @param raAcaCertRequest: contains the request for an authorization + * certificate from the RA to the ACA on behalf of the EE. + * + * @param acaRaCertResponse: contains the ACA's response to RaAcaCertRequest. + */ +AcaRaInterfacePdu ::= CHOICE { + raAcaCertRequest RaAcaCertRequest, + acaRaCertResponse AcaRaCertResponse, + ... +} + +/** + * @brief This structure contains parameters needed to request an individual + * authorization certificate. An overview of this structure is as follows: + * + * @note: + * - In the case where the butterfly key mechanism is used to set + * certEncKey, the value of j is not communicated to the ACA. However, the EE + * that receives the certificate response can only decrypt the response if it + * knows j. The RA is therefore anticipated to store j so that it can be + * associated with the appropriate certificate response. + * + * - The cracaId and crlSeries are set to the indicated values + * in the request. The ACA replaces these values with the appropriate values + * in the response. + * + * - The ACA is not bound by the contents of the request and can + * issue certificates that are different from those requested, if so directed + * by policy. + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of RaAcaCertRequest. + * + * @param type: indicates whether the request is for an explicit or implicit + * certificate (see 4.1.1, 4.1.3.3.1). + * + * @param flags: contains the flags related to the use of the butterfly key + * mechanism, and provides the following instructions to the ACA as to how + * to generate the response: + * - If the flag butterflyExplicit is set, the request is valid only if + * the type field is set to explicit. In this case, the ACA uses the + * butterfly key derivation for explicit certificates as specified in 9.3. + * The field tbsCert.verifyKeyIndicator.verificationKey is used by the ACA as + * the cocoon public key for signing. The field privateKeyInfo in the + * corresponding AcaEeCertResponse is used by the EE as the random integer to + * recover the butterfly private key for signing. + * - If the flag cubk is set, the request is valid only if the certEncKey + * field is absent. In this case, the ACA uses the compact unified variation + * of the butterfly key mechanism as specified in 9.3. This means that the + * ACA generates an AcaEeCertResponseCubkSpdu instead of an + * AcaEeCertResponsePrivateSpdu, and the response is valid only if the ACA + * certificate has the flag cubk set. + * + * @param linkageInfo: contains the encrypted prelinkage values needed to + * generate the linkage value for the certificate. If linkageInfo is present, + * the field tbsCert.id is of type LinkageData, where the iCert field is set + * to the actual i-period value and the linkage-value field is set to a dummy + * value to be replaced by the ACA with the actual linkage value. The + * encrypted prelinkage values are encrypted for the ACA by the LAs. + * + * @param certEncKey: is used in combination with flags.cubk to indicate + * the type of response that is expected from the ACA. It is as follows: + * - Absent and flags.cubk is not set if the ACA's response doesn't need + * to be encrypted. In this case, the ACA responds with + * AcaEeCertResponsePlainSpdu. + * - Absent and flags.cubk is set if the ACA's response is to be encrypted + * with the verification key from the request and not signed. In this case, + * the ACA responds with AcaEeCertResponseCubkSpdu. + * - Present and flags.cubk is not set if the ACA's response is to be + * encrypted with certEncKey and then signed by the ACA. In this case, the + * ACA responds with AcaEeCertResponsePrivateSpdu. + * + * @param tbsCert: contains parameters of the requested certificate. The + * certificate type depends on the field type, as follows: + * - If type is explicit, the request is valid only if + * tbsCert.verifyKeyIndicator is a verificationKey. + * - If type is implicit, the request is valid only if + * tbsCert.verifyKeyIndicator is a reconstructionValue. + */ +RaAcaCertRequest ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + type CertificateType, + flags RaAcaCertRequestFlags, + linkageInfo LinkageInfo OPTIONAL, + certEncKey PublicEncryptionKey OPTIONAL, + tbsCert ToBeSignedCertificate (WITH COMPONENTS { + ..., + cracaId ('000000'H), + crlSeries (0), + appPermissions PRESENT, + certIssuePermissions ABSENT, + certRequestPermissions ABSENT + }), + ... +} + +/** + * @brief This structure is used to convey information from the RA to the ACA + * about operations to be carried out when generating the certificate. For + * more details see the specification of RaAcaCertRequest. An overview of + * this structure is as follows: + */ +RaAcaCertRequestFlags ::= + BIT STRING {butterflyExplicit (0), cubk (1)} (SIZE (8)) + +/** + * @brief This structure contains parameters needed to generate a linkage + * value for a given (EE, i, j). An overview of this structure is as follows: + * + * @note See Annex D for further discussion of LAs. + * + * @param encPlv1: contains the EncryptedIndividualPLV from one of the LAs. + * + * @param encPlv2: contains the EncryptedIndividualPLV from the other LA. + */ +LinkageInfo ::= SEQUENCE { + encPlv1 EncryptedIndividualPLV, + encPlv2 EncryptedIndividualPLV, + ... +} + +/** + * @brief This structure contains an individual prelinkage value encrypted by + * the LA for the ACA using the shared secret key. An overview of this + * structure is as follows: + * + * @note How the ACA obtains the shared symmetric key and how the RA + * associates the encPlv1 and encPlv2 with the correct certificate request are + * outside the scope of this document. + * + * @param version: contains the current version of the structure. + * + * @param laId: contains the ID of the LA that created the prelinkage value. + * See Annex D for further discussion of LA IDs. + * + * @param encPlv: contains the encrypted individual prelinkage value, that is, + * the ciphertext field decrypts to a PreLinkageValue. It contains a pointer + * (hash of the shared symmetric key) to the used shared secret encryption key. + */ +EncryptedIndividualPLV ::= SEQUENCE { + version Uint8 (2), + laId LaId, + encPlv Ieee1609Dot2Data-SymmEncryptedSingleRecipient { + PreLinkageValue + } +} + +/** + * @brief This structure contains an individual prelinkage value. It is an + * octet string of length 9 octets. + */ +PreLinkageValue ::= OCTET STRING (SIZE(9)) + +/** + * @brief This structure contains a certificate response by the ACA, + * encapsulated for consumption by the EE, as well as associated data for + * consumption by the RA. The response is of form AcaEeCertResponsePlainSpdu, + * AcaEeCertResponsePrivateSpdu, or AcaEeCertResponseCubkSpdu, and is + * generated in response to a successful RaAcaCertRequestSpdu. In this + * structure: + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of AcaRaCertResponse. + * + * @param requestHash: contains the hash of the corresponding + * RaAcaCertRequestSPDU. + * + * @param acaResponse: contains the certificate for the EE in a suitable form + * as determined from the corresponding RaAcaCertRequestSPDU. + */ +AcaRaCertResponse ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + requestHash HashedId8, + acaResponse AcaResponse, + ... +} + +/** + * @brief This structure contains the certificate for the EE in a suitable + * form as determined from the corresponding RaAcaCertRequestSPDU. In this + * structure: + * + * @param plain: contains the certificate for the EE in plain, that is, without + * encryption or signature. This choice is used only when the field + * certEncKey is absent and flags.cubk is not set in the corresponding + * RaAcaCertRequest. + * + * @param private: contains the certificate for the EE in an encrypted then + * signed form to protect the EE's privacy from the RA. This choice is used + * only when the field certEncKey is present and flags.cubk is not set in the + * corresponding RaAcaCertRequest. + * + * @param cubk: contains the certificate for the EE in an encrypted form. This + * choice is used only when the field certEncKey is absent and flags.cubk is + * set in the corresponding RaAcaCertRequest. + */ +AcaResponse ::= CHOICE { + plain AcaEeCertResponsePlainSpdu, + private AcaEeCertResponsePrivateSpdu, + cubk AcaEeCertResponseCubkSpdu, + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn new file mode 100755 index 0000000..a658f22 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn @@ -0,0 +1,205 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: ACPC -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1Acpc {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) acpc(18) major-version-3(3) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + HashAlgorithm, + IValue, + Psid, + Time32, + Uint8 +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS + + Ieee1609Dot2Data-Unsecured, + Ieee1609Dot2Data-Signed +FROM Ieee1609Dot2Dot1Protocol {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) protocol(17) + major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS +; + +/** + * @brief This structure contains an APrV structure produced by the CAM. An + * overview of this structure is as follows: + * + * @param tree: contains an AprvBinaryTree. + * + * @param aprv: contains a single IndividualAprv. + */ +AcpcPdu ::= CHOICE { + tree AprvBinaryTree, + aprv IndividualAprv, + ... +} + +/** + * @brief This structure encodes a binary tree. An overview of this structure + * is as follows: + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of AprvBinaryTree. + * + * @param currentI: contains the i-value associated with the batch of + * certificates. + * + * @param acpcTreeId: contains an identifier for the CAM creating this binary + * tree. + * + * @param hashAlgorithmId: contains the identifier of the hash algorithm used + * inside the binary tree. + * + * @param tree: contains a bit string indicating which nodes of the tree are + * present. It is calculated as specified in 9.5.4.2, and can be used by the + * EE to determine which entry in nodeValueList to use to derive that EE's + * APrV as specified in 9.5.2. + * + * @param nodeValueList: contains the values of the nodes that are present in + * the order indicated by tree. + */ +AprvBinaryTree ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + currentI IValue, + acpcTreeId AcpcTreeId, + hashAlgorithmId HashAlgorithm, + tree BIT STRING, + nodeValueList SEQUENCE (SIZE (1..MAX)) OF AcpcNodeValue, + ... +} + +/** + * @brief This is the PSID used to indicate activities in ACPC as specified in + * this document. + */ +AcpcPsid ::= Psid(2113696) + +/** + * @brief This is used to wrap an AprvBinaryTree in an Ieee1609Dot2Data for + * transmission if the policy is that the AprvBinaryTree need not be signed. + * See 9.5.6 for discussion. + */ +UnsecuredAprvBinaryTree ::= Ieee1609Dot2Data-Unsecured { + AcpcPdu (WITH COMPONENTS { + tree + }) +} + +/** + * @brief This is used to wrap an AprvBinaryTree in an Ieee1609Dot2Data for + * transmission if the policy is that the AprvBinaryTree be signed. See 9.5.6 + * for discussion. + */ +SignedAprvBinaryTree ::= Ieee1609Dot2Data-Signed { + AcpcPdu (WITH COMPONENTS { + tree + }), + AcpcPsid +} + +/** + * @brief This structure contains an individual APrV. An overview of this + * structure is as follows: + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of IndividualAprv. + * + * @param currentI: contains the i-value associated with the batch of + * certificates. + * + * @param acpcTreeId: contains an identifier for the CAM creating this binary + * tree. + * + * @param nodeId: contains the identifier of the node. + * + * @param nodeValue: contains the value of the node. + */ +IndividualAprv ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + currentI IValue, + acpcTreeId AcpcTreeId, + nodeId BIT STRING, + nodeValue AcpcNodeValue, + ... +} + +/** + * @brief This is used to wrap an IndividualAprv in an Ieee1609Dot2Data for + * transmission if the policy is that the IndividualAprv be signed. See 9.5.6 + * for discussion. + */ +SignedIndividualAprv ::= Ieee1609Dot2Data-Signed { + AcpcPdu (WITH COMPONENTS { + aprv + }), + AcpcPsid +} + +/** + * @brief This is an 8 byte string that identifies an ACPC tree series. It is + * required to be globally unique within the system and is the same for all + * ACPC tree instances within the ACPC tree series. Registration of AcpcTreeId + * values is managed by the IEEE RA; see http://standards.ieee.org/regauth. A + * list of assigned AcpcTreeId values is provided in L.2. + */ +AcpcTreeId ::= OCTET STRING (SIZE(8)) + +/** + * @brief This is a 16 byte string that represents the value of a node in the + * ACPC tree. + */ +AcpcNodeValue ::= OCTET STRING (SIZE(16)) + +/** + * @brief This structure, C-OER encoded, is the input to the hash function to + * calculate child node values from a parent node. By including the ID fields + * it "firewalls" the hash function so that an attacker who inverts the hash + * has only found the hash preimage for a specific node, in a specific tree, + * for a specific time period. An overview of this structure is as follows: + * + * @param version: contains the current version of the structure. + * + * @param acpcTreeId: contains an identifier for this ACPC tree series. + * + * @param acpcPeriod: contains an identifier for the time period for this tree. + * If the certificates for which this set of APrVs are intended have an IValue + * field, acpcPeriod in this structure shall be the IValue field in the + * certificates. How the RA and the CAM synchronize on this value is outside + * the scope of this document. + * + * @param childNodeId: contains a bit string of length l encoding the node + * location within the l'th level. + * + * @param parentNodeValue: contains the value of the parent node. + */ +AprvHashCalculationInput ::= SEQUENCE { + version Uint8 (2), + acpcTreeId AcpcTreeId, + acpcPeriod IValue, + childNodeId BIT STRING, + parentNodeValue OCTET STRING (SIZE(16)), + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn new file mode 100755 index 0000000..f49c3bc --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn @@ -0,0 +1,90 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: CAM - RA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1CamRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) cam-ra(19) major-version-2(2) + minor-version-2(2)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + EccP256CurvePoint, + HashedId8, + IValue, + Uint8 +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS +; + +/** + * @brief This is the parent structure for all structures exchanged between + * the CAM and the RA during ACPC enrollment. An overview of this structure + * is as follows: + * + * @param raCamBatchRequest: contains the ACPC blinded key batch request sent + * by the RA to the CAM. + * + * @param camRaBatchResponse: contains the CAM's response to RaCamBatchRequest. + */ +CamRaInterfacePdu ::= CHOICE { + raCamBatchRequest RaCamBatchRequest, + camRaBatchResponse CamRaBatchResponse, + ... +} + +/** + * @brief This structure contains parameters needed to request a blinded batch + * of keys for the EE during ACPC enrollment. An overview of this structure + * is as follows: + * + * @param version: contains the current version of the structure. + * + * @param eeId: contains the EE's ID generated by the RA for the production of + * ACPC batch keys by the CAM. + * + * @param periodList: contains the list of i-periods covered by the batch. + */ +RaCamBatchRequest ::= SEQUENCE { + version Uint8 (2), + eeId OCTET STRING (SIZE(5)), + periodList SEQUENCE OF IValue, + ... +} + +/** + * @brief This structure contains a blinded batch of keys for the EE during + * ACPC enrollment. An overview of this structure is as follows: + * + * @param version: contains the current version of the structure. + * + * @param requestHash: contains the hash of the corresponding request + * RaCamBatchRequest. + * + * @param batch: contains a sequence of blinded keys, each mapped to one + * IValue from the periodList field of the request. + */ +CamRaBatchResponse ::= SEQUENCE { + version Uint8 (2), + requestHash HashedId8, + batch SEQUENCE OF BlindedKey, + ... +} + +/** + * @brief This is a blinded ACPC encryption key produced by the CAM. + */ +BlindedKey ::= EccP256CurvePoint + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn new file mode 100755 index 0000000..5115efe --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn @@ -0,0 +1,412 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: Certificate Management -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1CertManagement {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) cert-management(7) + major-version-3(3) minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + Certificate, + SequenceOfCertificate +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-5(5)} +WITH SUCCESSORS + + HashedId8, + HashedId32, + HashedId48, + Time32, + Uint8 +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS + + CrlSeries +FROM Ieee1609Dot2CrlBaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + crl(3) base-types(2) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + + SecuredCrl +FROM Ieee1609Dot2Crl {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + crl(3) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + + CtlSignatureSpdu, + MultiSignedCtlSpdu, + SequenceOfPsid +FROM Ieee1609Dot2Dot1Protocol {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) protocol(17) + major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS +; + +/** + * @brief This is the parent structure for all SCMS component certificate + * management structures. An overview of this structure is as follows: + * + * @param compositeCrl: contains zero or more SecuredCrl as defined in IEEE + * Std 1609.2, and the CTL. + * + * @param certificateChain: contains a collection of certificates and the CTL. + * + * @param multiSignedCtl: contains the CTL signed by multiple + * signers, the electors. + * + * @param tbsCtlSignature: contains the CTL-instance-specific information used + * to generate a signature on the CTL. + */ +CertManagementPdu ::= CHOICE { + compositeCrl CompositeCrl, + certificateChain CertificateChain, + multiSignedCtl MultiSignedCtl, + tbsCtlSignature ToBeSignedCtlSignature, + infoStatus CertificateManagementInfoStatus, + ... +} + +/** + * @brief This structure is used to encapsulate CRLs and a CTL. An overview + * of this structure is as follows: + * + * @param crl: contains a list of signed CRLs for different (CRACA ID, CRL + * series) pairs. The CRLs are signed individually, and this document does not + * specify the order in which they should appear. + * + * @param homeCtl: contains a CTL. If the composite CRL was requested via the + * mechanisms given in 6.3.5.8, the CtlSeriesId in this CTL is the same as + * the CtlSeriesId provided in the request. The intent is that this is the + * "home" CTL of the requester, but this field can in practice be used to + * provide any CTL with any CtlSeriesId value. + */ +CompositeCrl ::= SEQUENCE { + crl SEQUENCE SIZE(0..MAX) OF SecuredCrl, + homeCtl MultiSignedCtlSpdu, + ... +} + +/** + * @brief This structure is used to encapsulate certificates and a CTL. An + * overview of this structure is as follows: + * + * @param homeCtl: contains a CTL. If the certificate chain was requested via + * the mechanisms given in 6.3.5.7, the CtlSeriesId in this CTL is the + * same as the CtlSeriesId provided in the request. The intent is that + * this is the "home" CTL of the requester, but this field can in practice be + * used to provide any CTL. + * + * @param others: contains additional valid certificates of the CAs and the + * MAs chosen by means outside the scope of this document. + */ +CertificateChain ::= SEQUENCE { + homeCtl MultiSignedCtlSpdu, + others SEQUENCE SIZE(0..MAX) OF Certificate, + ... +} + +/** + * @brief This structure a certificate trust list (CTL) signed by multiple + * signers, the electors. An overview of this structure is as follows: + * + * @param type: contains the type of the multi-signed CTL. Only one type of + * multi-signed CTL is supported in this version of this document. + * + * @param tbsCtl: contains the CTL contents. + * + * @param unsigned: contains data that are associated with the CTL and that + * are not included directly in tbsCtl. For example, if the type is + * fullIeeeCtlType, the FullIeeeTbsCtl contains the hashes of the + * certificates, and the certificates themselves are contained in unsigned. + * + * @param signatures: contains the signatures. How the signatures are + * calculated is specified in the definition of ToBeSignedCtlSignature. The + * number of signatures shall be no more than the number of electors. Each + * signature shall have been generated by a distinct elector. + */ +MultiSignedCtl ::= SEQUENCE { + type IEEE-1609-2-1-MSCTL.&type({ + Ieee1609dot2dot1Ctls + }), + tbsCtl IEEE-1609-2-1-MSCTL.&TbsCtl({ + Ieee1609dot2dot1Ctls + }{@.type}), + unsigned IEEE-1609-2-1-MSCTL.&UnsignedCtlMaterial({ + Ieee1609dot2dot1Ctls + }{@.type}), + signatures SEQUENCE (SIZE(1..MAX)) OF CtlSignatureSpdu +} + +/** + * @brief This is the ASN.1 Information Object Class used to associate + * multisigned CTL type identifiers, CTL contents, and unsigned material. In + * this structure: + * + * @param type: contains the type, an Ieee1609dot2dot1MsctlType. + * + * @param TbsCtl: contains the CTL contents. + * + * @param UnsignedCtlMaterial: contains unsigned material associated with the + * CTL, as specified in 7.3.11. + */ +IEEE-1609-2-1-MSCTL ::= CLASS { + &type Ieee1609dot2dot1MsctlType, + &TbsCtl, + &UnsignedCtlMaterial +} WITH SYNTAX {&TbsCtl IDENTIFIED BY &type USING &UnsignedCtlMaterial} + +/** + * @brief This is the Information Object Set containing the instances of the + * IEEE-1609-2-1-MSCTL class that are specified for use. Only one instance is + * specified for use in this version of this document. + */ +Ieee1609dot2dot1Ctls IEEE-1609-2-1-MSCTL ::= { + {FullIeeeTbsCtl IDENTIFIED BY + fullIeeeCtl USING SequenceOfCertificate}, + ... +} + +/** + * @brief This is the integer used to identify the type of the CTL. + */ +Ieee1609dot2dot1MsctlType ::= INTEGER (0..255) + +fullIeeeCtl Ieee1609dot2dot1MsctlType ::= 1 + +/** + * @brief This structure specifies a CTL that contains information about the + * complete set of certificates trusted by the electors that sign the CTL. An + * overview of this structure is as follows: + * + * @note: + * - If in future CTL types are defined that contain the same + * information as, or a subset of the information in, the fullIeeeCtl, those + * types are anticipated to contain the same sequence number as the + * corresponding fullIeeeCtl. + * + * - Any root CA or elector certificate that is not on the CTL is + * not trusted. The electorRemove and rootCaRemove are intended to be used + * only if the SCMS manager wants to explicitly indicate that a previously + * trusted entity (elector or root CA) is now not trusted even though that + * entity's certificate is still within its validity period. In practice, it + * is anticipated that the remove fields (electorRemove and rootCaRemove) + * will almost always be sequences of length 0. + * + * @param type: contains the type of the CTL. It is identical to the type + * field that appears in the enclosing MultiSignedCtl. The field is included + * here as well to provide the simplest mechanism to help ensure that the + * type is included in the calculated CTL hash. + * + * @param CtlSeriesId: contains the group of electors that have signed the + * CTL. It plays a role similar to CrlSeries in a CRL. This field is intended + * to be globally unique in the universe of all systems that use the + * MultiSignedCtl. See the specification of CtlSeriesId for discussion of + * a convention that can be followed to enable uniqueness. + * + * @param sequenceNumber: contains the sequence number of the CTL. This is + * incremented by 1 every time a new FullIeeeTbsCtl is issued. + * + * @param effectiveDate: contains the time when the CTL is to take effect. + * This is to be greater than or equal to the effectiveDate field in the CTL + * with the same CtlSeriesId and the previous sequence number. + * + * @param electorApprove: contains the list of hashes of the elector + * certificates that are approved as of the effective date. The hash is + * calculated with the same hash algorithm that is used to hash the elector + * certificate for signing. + * + * @param electorRemove: contains the list of hashes of the elector + * certificates that are valid (that is, not expired) on the effective date and + * are not approved, as of the effective date, to sign a CTL. The hash is + * calculated with the same hash algorithm that is used to hash the elector + * certificate for signing. This field is to be considered informational as a + * certificate that is not included in electorApprove is not valid even if it + * does not appear in electorRemove. + * + * @param rootCaApprove: contains the list of root CA certificates that are + * approved as of the effective date. The hash is calculated with the same + * hash algorithm that is used to hash the root certificate for signing. If + * the root certificate is signed with a hash function with a 48 octet + * output, this is truncated to the low-order 32 bytes for inclusion in the + * CTL. + * + * @param rootCaRemove: contains the list of root CA certificates that are + * valid (that is, not expired) on the effective date and are not approved, as + * of the effective date, to issue certificates or carry out other + * activities. If the root certificate is signed with a hash function + * with a 48 octet output, this is truncated to the low-order 32 bytes for + * inclusion in the CTL. This field is to be considered informational as a + * certificate that is not included in rootCaApprove is not valid even if it + * does not appear in rootCaRemove. + * + * @param quorum: contains the quorum, that is, the number of the electors + * required to sign the next CTL with the same CtlSeriesId value for that + * CTL to be trusted. If this field is absent, the quorum for the next CTL + * shall be the quorum for the current CTL. + */ +FullIeeeTbsCtl ::= SEQUENCE { + type Ieee1609dot2dot1MsctlType(fullIeeeCtl), + ctlSeriesId CtlSeriesId, + sequenceNumber CtlSequenceNumber, + effectiveDate Time32, + electorApprove SEQUENCE OF CtlElectorEntry, + electorRemove SEQUENCE OF CtlElectorEntry, + rootCaApprove SEQUENCE OF CtlRootCaEntry, + rootCaRemove SEQUENCE OF CtlRootCaEntry, + ..., + quorum INTEGER +} + +/** + * @brief This structure identifies a group of electors that sign a series of + * CTLs for a specific purpose. Registration of CtlSeriesId values is + * managed by the IEEE RA; see http://standards.ieee.org/regauth. A list of + * assigned CtlSeriesId values is provided in K.1. + */ +CtlSeriesId ::= OCTET STRING (SIZE(8)) + +/** + * @brief This structure is used to encode the CTL sequence number. This + * document does not specify semantics of this type once it reaches its + * maximum value. + */ +CtlSequenceNumber ::= INTEGER(0..65535) + +/** + * @brief This structure contains the hash of an elector certificate. + */ +CtlElectorEntry ::= HashedId48 + +/** + * @brief This structure contains the hash of a root CA certificate. + */ +CtlRootCaEntry ::= HashedId32 + +/** + * @brief This structure contains the CTL-instance-specific information used + * to generate a signature on the CTL. An overview of this structure is as + * follows: + * + * @param ctlSeriesId: contains the CtlSeriesId that appears in the CTL. + * + * @param ctlType: identifies the type of the CTL. + * + * @param sequenceNumber: contains the sequence number of the CTL being signed. + * + * @param tbsCtlHash: contains the hash of the C-OER encoded tbsCtl field + * in the MultiSignedCtl. The hash is calculated using the same hash + * algorithm that is used to generate the signature on this structure when it + * is contained in a CtlSignatureSpdu. This algorithm can be determined from + * the headers of the CtlSignatureSpdu. + */ +ToBeSignedCtlSignature ::= SEQUENCE { + ctlSeriesId CtlSeriesId, + ctlType Ieee1609dot2dot1MsctlType, + sequenceNumber CtlSequenceNumber, + tbsCtlHash HashedId48 +} + +/** + * @brief This structure contains the status of different certificate + * management information, including CRLs, CTLs, and individual certificates + * of CAs, MAs, and the RA. + * + * @param crl: contains the status information for CRLs. + * + * @param ctl: contains the status information for CTLs. + * + * @param caCcf: contains the time of the last update of any of the CA + * certificates in the CCF. + * + * @param ma: contains the status information for MA certificates. + * + * @param ra: shall be present and contain the time of last update of the RA's + * certificate, if this structure is sent by an RA. + */ +CertificateManagementInfoStatus ::= SEQUENCE { + crl SequenceOfCrlInfoStatus, + ctl SequenceOfCtlInfoStatus, + caCcf Time32, + ma SequenceOfMaInfoStatus, + ra Time32 OPTIONAL, + ... +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfCtlInfoStatus ::= SEQUENCE OF CtlInfoStatus + +/** + * @brief This structure contains the status information for a CTL. + * + * @param ctlSeriesId: contains the elector group ID of the CTL. + * + * @param sequenceNumber: contains the sequence number of the CTL. + * + * @param lastUpdate: contains the time of the last update of the CTL. + */ +CtlInfoStatus ::= SEQUENCE { + ctlSeriesId CtlSeriesId, + sequenceNumber CtlSequenceNumber, + lastUpdate Time32, + ... +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfCrlInfoStatus ::= SEQUENCE OF CrlInfoStatus + +/** + * @brief This structure contains the status information for a CRL. + * + * @param cracaId: contains the CRACA ID of the CRL. + * + * @param series: contains the CRL series of the CRL. + * + * @param issueDate: contains the time of the last update of the CRL. + */ +CrlInfoStatus ::= SEQUENCE { + cracaId HashedId8, + series CrlSeries, + issueDate Time32, + ... +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfMaInfoStatus ::= SEQUENCE OF MaInfoStatus + +/** + * @brief This structure contains the status information for an MA's + * certificate. + * + * @param psids: contains the PSIDs associated with the misbehavior that is to + * be reported to that MA. + * + * @param updated: contains the time of the last update of the MA's certificate. + */ +MaInfoStatus ::= SEQUENCE { + psids SequenceOfPsid, + updated Time32, + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn new file mode 100755 index 0000000..c325a77 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn @@ -0,0 +1,172 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: ECA - EE Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1EcaEeInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) eca-ee(9) major-version-3(3) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + Certificate, + CertificateType, + SequenceOfCertificate +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-5(5)} +WITH SUCCESSORS + + EccP256CurvePoint, + HashedId8, + Time32, + Uint8 +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS + + PublicVerificationKey, + ToBeSignedCertificate +FROM Ieee1609Dot2Dot1Protocol {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) protocol(17) + major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS +; + +/** + * @brief This is the parent structure for all structures exchanged between + * the ECA and the EE. An overview of this structure is as follows: + * + * @param eeEcaCertRequest: contains the enrollment certificate request sent + * by the EE to the ECA. + * + * @param ecaEeCertResponse: contains the enrollment certificate response sent + * by the ECA to the EE. + */ +EcaEeInterfacePdu::= CHOICE { + eeEcaCertRequest EeEcaCertRequest, + ecaEeCertResponse EcaEeCertResponse, + ... +} + +/** + * @brief This structure contains parameters needed to request an enrollment + * certificate from the ECA. The ECA may, subject to policy, issue an + * enrollment certificate with different contents than the contents requested. + * An overview of this structure is as follows: + * + * @note: + * - The tbsCert.cracaId and tbsCert.crlSeries are set to the + * indicated values in the corresponding EeEcaCertRequest. In the issued + * enrollment certificate, they may have different values, set by the ECA. + * - The EE uses the type field to indicate whether it is + * requesting an explicit or an implicit enrollment certificate. A policy is + * anticipated that determines what type of certificate is appropriate for a + * given set of circumstances (such as PSIDs, other end entity information, + * and locality) and that if the EE has requested a kind of certificate that + * is not allowed by policy, the ECA returns an error to the EE. + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of EeEcaCertRequest. + * + * @param type: indicates whether the request is for an explicit or implicit + * certificate (see 4.1.1, 4.1.4.3.1). + * + * @param tbsCert: contains the parameters used by the ECA to generate the + * enrollment certificate. tbsCert.verifyKeyIndicator.verificationKey + * contains the public key information sent by the requester. The + * verifyKeyIndicator field indicates the choice verificationKey even if type + * is implicit, as this allows the requester to indicate which signature + * algorithm and curve they are requesting. The value in this field is used + * as the verification key in the certificate if the certificate issued in + * response to this request is explicit, and as the input public key value + * for implicit certificate generation if the certificate issued in response + * to this request is implicit. + * + * @param canonicalId: shall be present and contain the canonical identifier + * for the device per 4.1.4.2, if the enclosing EeEcaCertRequestSpdu was + * signed by the canonical private key. The receiver is intended to use the + * canonicalId to look up the canonical public key to verify the certificate + * request. + */ +EeEcaCertRequest ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + type CertificateType, + tbsCert ToBeSignedCertificate (WITH COMPONENTS { + ..., + id (WITH COMPONENTS { + ..., + linkageData ABSENT + }), + cracaId ('000000'H), + crlSeries (0), + appPermissions ABSENT, + certIssuePermissions ABSENT, + certRequestPermissions PRESENT, + verifyKeyIndicator (WITH COMPONENTS { + verificationKey + }) + }), + canonicalId IA5String OPTIONAL, + ... +} + +/** + * @brief This structure is used by the ECA to respond to an EE's enrollment + * certificate request. Additional bootstrapping information including the + * RA's certificate are provided by the DCM. The specification of the DCM is + * outside the scope of this document. An overview of this structure is as + * follows: + * + * The definition of validity for a certificate request, including + * constraints on the fields in this structure, is specified in 10.1. + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of EcaEeCertResponse. + * + * @param requestHash: contains the following hash: + * - EeEcaCertRequestSPDU, if the corresponding request was + * EeEcaCertRequestSPDU. This is calculated without "canonicalizing" the + * signature, i.e., it is calculated over the signature as given in the + * EeEcaCertRequestSpdu without re-encoding the signature's r component in + * x-coordinate-only form. See IEEE Std 1609.2 for further details on + * canonicalization. + * - EeRaSuccessorEnrollmentCertRequestSpd, if the corresponding request + * was EeRaSuccessorEnrollmentCertRequestSpd. + * + * @param ecaCertChain: contains the ECA's currently valid certificate and the + * certificate chain, up to and including the root CA. + * + * @param certificate: contains the enrollment certificate generated by the + * ECA, which shall be of the type indicated by the type field in the + * corresponding request. + * + * @param privateKeyInfo: shall be present and contain the private key + * reconstruction value, if certificate.type is implicit. This is used by the + * EE as specified in 9.3.5.1. + */ +EcaEeCertResponse ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + requestHash HashedId8, + ecaCertChain SequenceOfCertificate, + certificate Certificate, + privateKeyInfo OCTET STRING (SIZE(32)) OPTIONAL, + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn new file mode 100755 index 0000000..e0eebae --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn @@ -0,0 +1,26 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: EE - MA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1EeMaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) ee-ma(10) major-version-2(2) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +/** + * @brief This structure is currently being defined outside of this document, + * so it is defined as NULL for purposes of this document. + */ +EeMaInterfacePdu ::= NULL + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn new file mode 100755 index 0000000..6384ae6 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn @@ -0,0 +1,305 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: EE - RA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1EeRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) ee-ra(11) major-version-3(3) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + CertificateType +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-5(5)} +WITH SUCCESSORS + + HashedId8, + IValue, + PublicEncryptionKey, + Time32, + Uint8 +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS + + AcpcTreeId +FROM Ieee1609Dot2Dot1Acpc {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) acpc(18) major-version-3(3) + minor-version-1(1)} +WITH SUCCESSORS + + EeEcaCertRequestSpdu, + PublicVerificationKey, + ToBeSignedCertificate +FROM Ieee1609Dot2Dot1Protocol {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) protocol(17) + major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS +; + +/** + * @brief This is the parent structure for all structures exchanged between + * the EE and the RA. An overview of this structure is as follows: + * + * @note This CHOICE does not include a PDU type for encrypted + * misbehavior report upload; see 4.1.5. + * + * @param eeRaCertRequest: contains the certificate generation request sent by + * the EE to the RA. + * + * @param raEeCertAck: contains the RA's acknowledgement of the receipt of + * EeRaCertRequestSpdu. + * + * @param raEeCertInfo: contains the information about certificate download. + * + * @param eeRaDownloadRequest: contains the download request sent by the EE to + * the RA. + * + * @param eeRaSuccessorEnrollmentCertRequest: contains a self-signed request + * for an enrollment certificate, identical in format to the one submitted + * for an initial enrollment certificate. (This becomes a request for a + * successor enrollment certificate by virtue of being signed by the current + * enrollment certificate.) + */ +EeRaInterfacePdu ::= CHOICE { + eeRaCertRequest EeRaCertRequest, + raEeCertAck RaEeCertAck, + raEeCertInfo RaEeCertInfo, + eeRaDownloadRequest EeRaDownloadRequest, + eeRaSuccessorEnrollmentCertRequest EeEcaCertRequestSpdu, + ... +} + +/** + * @brief This structure contains parameters needed to request different types + * of authorization certificates. An overview of this structure is as follows: + * + * The definition of validity for a certificate request, including + * constraints on the fields in this structure, is specified in 10.1. + * + * @note: + * - In the case where the butterfly key mechanism is used to + * derive the certificate encryption key, the value j is not communicated to + * the ACA. However, the EE that receives the certificate response can only + * decrypt the response if it knows j. The RA is therefore anticipated to + * store j so that it can be associated with the appropriate certificate + * response. + * - If the type of id is LinkageData, the contents of the + * field in the request are replaced by random data by the RA when it sends + * the individual certificate requests to the ACA. The ACA then in turn + * replaces that data with the linkage values generated with the help of the + * LAs; see Annex D. + * - This document does not specify a method to include an + * encryptionKey in the requested certificates, if the butterfly key + * mechanism is used. The EE using such a certificate to sign a message + * cannot request that the response is encrypted to the certificate. Instead, + * it can request an encrypted response using the + * tbsData.headerInfo.encryptionKey field of the SignedData; see 6.3.9, + * 6.3.33, 6.3.34, and 6.3.36 of IEEE Std 1609.2 for more details. + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of EeRaCertRequest. + * + * @param type: indicates whether the request is for an explicit or implicit + * certificate (see 4.1.1 and 4.1.4.3.1). + * + * @param tbsCert: contains the parameters to be used by the ACA to generate + * authorization certificate(s). + * - id contains the identity information sent by the requester. If the + * type is LinkageData, the contents of the field are chosen by the EE using + * any appropriate means. RA replaces that in the certificates with the + * linkage values generated with the help of the LAs and the ACA; see Annex D. + * - validityPeriod contains the requested validity period of the first + * batch of certificates. + * - region, assuranceLevel, canRequestRollover, and encryptionKey, if + * present, contain the information sent by the requester for the requested + * certificates. + * - verifyKeyIndicator.verificationKey contains the public key + * information sent by the requester. The verifyKeyIndicator field indicates + * the choice verificationKey even if type is implicit, as this allows the + * requester to indicate which signature algorithm and curve they are + * requesting. + * - If the certificate issued in response to this request is explicit and + * butterfly expansion is not used, the value in this field is the + * verification key that appears in that certificate. + * - If the certificate issued in response to this request is implicit and + * butterfly expansion is not used, the value in this field is the input + * public key value for implicit certificate generation. + * - If butterfly expansion is used, that is, if one of (original, unified, + * compactUnified) options is present in the field additionalParams, the + * value in this field is combined with the values in the additionalParams + * field as specified in 9.3. + * + * @param additionalParams: shall be present and contain relevant parameters if + * the requested certificates are to be generated using the butterfly key + * mechanism as specified in 9.3, or if the requested certificates are to be + * encrypted without using the butterfly key mechanism. If present, the field + * tbsCert.verifyKeyIndicator shall be used as the caterpillar public key for + * signing in the butterfly key mechanism. + */ +EeRaCertRequest ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + type CertificateType, + tbsCert ToBeSignedCertificate (WITH COMPONENTS { + ..., + cracaId ('000000'H), + crlSeries (0), + appPermissions PRESENT, + certIssuePermissions ABSENT, + certRequestPermissions ABSENT, + verifyKeyIndicator (WITH COMPONENTS { + verificationKey + }) + }), + additionalParams AdditionalParams OPTIONAL, + ... +} + +/** + * @brief This structure contains parameters for the butterfly key mechanism. + * An overview of this structure is as follows: + * + * @param original: contains the parameters for the original variant. + * + * @param unified: contains the expansion function for signing to be used for + * the unified variant. The caterpillar public key and expansion function for + * encryption are the same as those for signing. + * + * @param compactUnified: contains the expansion function for signing to be + * used for the compact unified variant. The caterpillar public key and + * expansion function for encryption are the same as those for signing. + * + * @param encryptionKey: contains the public key for encrypting the + * certificate if the butterfly key mechanism is not used. + */ +AdditionalParams ::= CHOICE { + original ButterflyParamsOriginal, + unified ButterflyExpansion, + compactUnified ButterflyExpansion, + encryptionKey PublicEncryptionKey, + ... +} + +/** + * @brief This structure contains parameters for the original variation of the + * butterfly key mechanism. An overview of this structure is as follows: + * + * @param signingExpansion: contains the expansion function for signing. + * + * @param encryptionKey: contains the caterpillar public key for encryption. + * + * @param encryptionExpansion: contains the expansion function for encryption. + */ +ButterflyParamsOriginal ::= SEQUENCE { + signingExpansion ButterflyExpansion, + encryptionKey PublicEncryptionKey, + encryptionExpansion ButterflyExpansion +} + +/** + * @brief This structure contains material used in the butterfly key + * calculations as specified in 9.3.5.1 and 9.3.5.2. An overview of this + * structure is as follows: + * + * @param aes128: indicates that the symmetric algorithm used in the expansion + * function is AES-128 with the indicated 16 byte string used as the key. + */ +ButterflyExpansion ::= CHOICE { + aes128 OCTET STRING (SIZE(16)), + ... +} + +/** + * @brief This structure is used to create the acknowledgement for certificate + * requests. An overview of this structure is as follows: + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of RaEeCertAck. + * + * @param requestHash: contains the hash of the corresponding + * EeRaCertRequestSpdu. + * + * @param firstI: shall be present and contain the i-value that will be + * associated with the first certificate or the certificate batch that will be + * made available to the EE, if the corresponding EeRaCertRequest uses the + * butterfly key mechanism as indicated in the field additionalParams. The EE + * uses this to form the download filename for the download request as + * specified in 8.2.2. + * + * @param nextDlTime: contains the time after which the EE should connect to + * the RA to download the certificates. + */ +RaEeCertAck ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + requestHash HashedId8, + firstI IValue OPTIONAL, + nextDlTime Time32, + ... +} + +/** + * @brief This structure is used to create the info file that accompanies a + * batch of certificates for download as specified in 8.2.3. It is used when + * certificates were generated using the butterfly key expansion mechanism + * specified in 9.3. An overview of this structure is as follows: + * + * @param version: contains the current version of the structure. + * + * @param generationTime: contains the generation time of RaEeCertInfo. + * + * @param currentI: contains the i-value associated with the batch of + * certificates. + * + * @param requestHash: contains the hash of the corresponding + * EeRaCertRequestSpdu. + * + * @param nextDlTime: contains the time after which the EE should connect to + * the RA to download the certificates. + * + * @param acpcTreeId: shall be present and contain the ACPC Tree Id, if the + * certificates were generated using ACPC as specified in 9.5. + */ +RaEeCertInfo ::= SEQUENCE { + version Uint8 (2), + generationTime Time32, + currentI IValue, + requestHash HashedId8, + nextDlTime Time32, + acpcTreeId AcpcTreeId OPTIONAL, + ... +} + +/** + * @brief This structure contains parameters needed to request the download of + * certificates from the RA. An overview of this structure is as follows: + * + * @param generationTime: contains the generation time of EeRaDownloadRequest. + * + * @param filename: contains the name of the file requested for download, + * formed as specified in 8.2.2. + */ +EeRaDownloadRequest ::= SEQUENCE { + generationTime Time32, + filename UTF8String (SIZE (0..255)), + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn new file mode 100755 index 0000000..74959cb --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn @@ -0,0 +1,26 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: LA - MA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1LaMaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) la-ma(12) major-version-2(2) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +/** + * @brief This structure is not used by EEs, so it is defined as NULL for + * purposes of this document. + */ +LaMaInterfacePdu ::= NULL + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn new file mode 100755 index 0000000..c5f819a --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn @@ -0,0 +1,26 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: LA - RA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1LaRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) la-ra(13) major-version-2(2) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +/** + * @brief This structure is not used by EEs, so it is defined as NULL for + * purposes of this document. + */ +LaRaInterfacePdu ::= NULL + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn new file mode 100755 index 0000000..b74c248 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn @@ -0,0 +1,26 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1: MA - RA Interface -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1MaRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) ma-ra(14) major-version-2(2) + minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +/** + * @brief This structure is not used by EEs, so it is defined as NULL for + * purposes of this document. + */ +MaRaInterfacePdu ::= NULL + +END diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn new file mode 100755 index 0000000..b518c63 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn @@ -0,0 +1,1277 @@ +--***************************************************************************-- +-- IEEE Std 1609.2.1 -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2.1 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Dot1Protocol {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) protocol(17) + major-version-3(3) minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + Certificate, + CertificateId, + Ieee1609Dot2Data, + SequenceOfCertificate, + SequenceOfPsidGroupPermissions, + SignerIdentifier, + ToBeSignedCertificate, + VerificationKeyIndicator +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-5(5)} +WITH SUCCESSORS + + CrlSeries, + EccP256CurvePoint, + EccP384CurvePoint, + EcdsaP256Signature, + EcdsaP384Signature, + GeographicRegion, + HashAlgorithm, + HashedId3, + Psid, + PublicEncryptionKey, + PublicVerificationKey, + SequenceOfPsid, + SequenceOfPsidSsp, + Signature, + SubjectAssurance, + Uint8, + Uint16, + ValidityPeriod +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-3(3)} +WITH SUCCESSORS + + AcaEeInterfacePdu +FROM Ieee1609Dot2Dot1AcaEeInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-ee(1) major-version-2(2) + minor-version-3(3)} +WITH SUCCESSORS + + AcaLaInterfacePdu +FROM Ieee1609Dot2Dot1AcaLaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-la(2) major-version-2(2) + minor-version-1(1)} +WITH SUCCESSORS + + AcaMaInterfacePdu +FROM Ieee1609Dot2Dot1AcaMaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-ma(3) major-version-2(2) + minor-version-1(1)} +WITH SUCCESSORS + + AcaRaInterfacePdu +FROM Ieee1609Dot2Dot1AcaRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) aca-ra(4) major-version-3(3) + minor-version-1(1)} +WITH SUCCESSORS + + AcpcTreeId +FROM Ieee1609Dot2Dot1Acpc {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) acpc(18) major-version-3(3) + minor-version-1(1)} +WITH SUCCESSORS + + CertManagementPdu +FROM Ieee1609Dot2Dot1CertManagement {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) cert-management(7) + major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + + EcaEeInterfacePdu +FROM Ieee1609Dot2Dot1EcaEeInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) eca-ee(9) major-version-3(3) + minor-version-1(1)} +WITH SUCCESSORS + + EeMaInterfacePdu +FROM Ieee1609Dot2Dot1EeMaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) ee-ma(10) major-version-2(2) + minor-version-1(1)} +WITH SUCCESSORS + + EeRaInterfacePdu +FROM Ieee1609Dot2Dot1EeRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) ee-ra(11) major-version-3(3) + minor-version-1(1)} +WITH SUCCESSORS + + LaMaInterfacePdu +FROM Ieee1609Dot2Dot1LaMaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) la-ma(12) major-version-2(2) + minor-version-1(1)} +WITH SUCCESSORS + + LaRaInterfacePdu +FROM Ieee1609Dot2Dot1LaRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) la-ra(13) major-version-2(2) + minor-version-1(1)} +WITH SUCCESSORS + + MaRaInterfacePdu +FROM Ieee1609Dot2Dot1MaRaInterface {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + extension-standards(255) dot1(1) interfaces(1) ma-ra(14) major-version-2(2) + minor-version-1(1)} +WITH SUCCESSORS +; + +/** + * @brief This PSID, 0x23, identifies security management activities as + * defined in this document. + */ +SecurityMgmtPsid ::= Psid (35) + +/** + * @brief This is the parent structure that encompasses all parent structures + * of interfaces defined in the SCMS. An overview of this structure is as + * follows: + * - aca-ee contains the interface structures defined for interaction + * between the ACA and the EE. + * - aca-la contains the interface structures defined for interaction + * between the ACA and the LA. + * - aca-ma contains the interface structures defined for interaction + * between the ACA and the MA. + * - aca-ra contains the interface structures defined for interaction + * between the ACA and the RA. + * - cert contains the interface structures defined for certificate + * management. + * - eca-ee contains the interface structures defined for interaction + * between the ECA and the EE. + * - ee-ma contains the interface structures defined for interaction + * between the EE and the MA. + * - ee-ra contains the interface structures defined for interaction + * between the EE and the RA. + * - la-ma contains the interface structures defined for interaction + * between the LA and the MA. + * - la-ra contains the interface structures defined for interaction + * between the LA and the RA. + * - ma-ra contains the interface structures defined for interactions + * between the MA and the RA. + * + * @param version: contains the current version of the structure. + */ +ScmsPdu ::= SEQUENCE { + version Uint8 (2), + content CHOICE { + aca-ee AcaEeInterfacePdu, + aca-la AcaLaInterfacePdu, + aca-ma AcaMaInterfacePdu, + aca-ra AcaRaInterfacePdu, + cert CertManagementPdu, + eca-ee EcaEeInterfacePdu, + ee-ma EeMaInterfacePdu, + ee-ra EeRaInterfacePdu, + la-ma LaMaInterfacePdu, + la-ra LaRaInterfacePdu, + ma-ra MaRaInterfacePdu, + ... + } +} + + +--***************************************************************************-- +-- Parameterized Types -- +--***************************************************************************-- + +/** + * @brief This structure defines a parameterized type for creating a scoped + * data as a subtype of ScmsPdu. + */ +ScmsPdu-Scoped {Pdu} ::= ScmsPdu (WITH COMPONENTS { + ..., + content (CONSTRAINED BY { + Pdu + }) +}) + +/** + * @brief This structure defines a parameterized type for creating an + * unsecured data as a subtype of Ieee1609Dot2Data. + */ +Ieee1609Dot2Data-Unsecured {Tbu} ::= + Ieee1609Dot2Data (WITH COMPONENTS { + content (WITH COMPONENTS { + ..., + unsecuredData (CONTAINING Tbu) + }) +}) + +/** + * @brief This structure defines a parameterized type for creating a signed + * data as a subtype of Ieee1609Dot2Data. + */ +Ieee1609Dot2Data-Signed {Tbs, Psid} ::= + Ieee1609Dot2Data (WITH COMPONENTS { + ..., + content (WITH COMPONENTS { + ..., + signedData (WITH COMPONENTS { + ..., + tbsData (WITH COMPONENTS { + ..., + payload (WITH COMPONENTS { + ..., + data (WITH COMPONENTS { + ..., + content (WITH COMPONENTS { + unsecuredData (CONTAINING Tbs) + }) + }) + }), + headerInfo (WITH COMPONENTS { + ..., + psid (Psid), + generationTime ABSENT, + expiryTime ABSENT, + generationLocation ABSENT, + p2pcdLearningRequest ABSENT, + missingCrlIdentifier ABSENT, + encryptionKey ABSENT + }) + }), + signer (SignerSingleCert) + }) + }) +}) + +/** + * @brief This structure defines a parameterized type for creating an + * encrypted data as a subtype of Ieee1609Dot2Data. An overview of this + * structure is as follows: + * + * @param Tbe: is first encrypted per IEEE 1609.2. Per IEEE 1609.2, this + * includes encapsulating Tbe in an Ieee1609Dot2Data of type unsecured if + * Tbe is not already an Ieee1609Dot2Data. The ciphertext output from the + * encryption of Tbe is used to set the encryptedData.ciphertext field. The + * encryptedData.recipients field is set to reflect the recipients. This + * parameterized type does not provide parameters to set the recipients; that + * information is set directly by the entity that creates an instance of this + * type. + */ +Ieee1609Dot2Data-Encrypted {Tbe} ::= + Ieee1609Dot2Data (WITH COMPONENTS { + ..., + content (WITH COMPONENTS { + encryptedData (CONSTRAINED BY { + --encryption of-- Tbe + }) + }) +}) + +/** + * @brief This structure defines a parameterized type for creating a signed + * certificate request as a subtype of Ieee1609Dot2Data. + */ +Ieee1609Dot2Data-SignedCertRequest {Tbscr, Signer} ::= + Ieee1609Dot2Data (WITH COMPONENTS { + ..., + content (WITH COMPONENTS { + ..., + signedCertificateRequest (CONTAINING + SignedCertificateRequest (WITH COMPONENTS { + ..., + tbsRequest (Tbscr), + signer (Signer) + })) + }) +}) + +/** + * @brief This structure is a wrapper for an ITU-T X.509 certificate. + * + * @note ITU-T X.509 certificates are encoded with the ASN.1 DER + * rather than the OER used in this document and so cannot be "directly" + * imported into these structures. + */ +X509Certificate ::= OCTET STRING + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfX509Certificate ::= + SEQUENCE (SIZE(1..MAX)) OF X509Certificate + +/** + * @brief This structure identifies an ITU-T X.509 certificate used to sign a + * signed data structure. The only data structure currently defined that can + * be signed by an ITU-T X.509 certificate is SignedX509CertificateRequest. + */ +X509SignerIdentifier ::= CHOICE { + certificate SequenceOfX509Certificate, + ... +} + +/** + * @brief This structure defines a parameterized type for creating a + * certificate request, signed with an ITU-T X.509 certificate, as a subtype of + * Ieee1609Dot2Data. It makes use of the extension of Ieee1609Dot2Content + * defined in 11.2.3. + */ +Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest {Tbscr, Signer} ::= + Ieee1609Dot2Data (WITH COMPONENTS { + ..., + content (WITH COMPONENTS { + ..., + signedX509CertificateRequest (CONTAINING + SignedX509CertificateRequest (WITH COMPONENTS { + ..., + tbsRequest (Tbscr), + signer (Signer) + })) + }) +}) + +/** + * @brief This structure defines a parameterized type for creating a signed + * then encrypted data as a subtype of Ieee1609Dot2Data. + */ +Ieee1609Dot2Data-SignedEncrypted {Tbse, Psid} ::= + Ieee1609Dot2Data-Encrypted { + Ieee1609Dot2Data-Signed { + Tbse, + Psid + } +} + +/** + * @brief This structure defines a parameterized type for creating an + * encrypted then signed data as a subtype of Ieee1609Dot2Data. + * + * @note This parameterized type inadvertently adds some overhead. + * The Ieee1609Dot2Data-EncryptedSigned {Tbes, Psid} structure, because it + * puts Ieee1609Dot2Data-Encrypted inside Ieee1609Dot2Data-Signed {Tbs, Psid}, + * and because Ieee1609Dot2Data-Signed {Tbs, Psid} puts Tbs inside + * unsecuredData, Tbes is "Signed (Unsecured (Encrypted))" instead of + * "Signed (Encrypted))", which was the intent and also in the original CAMP + * design. Other documents that use this document may be better off defining + * this structure on their own, if they want avoid this overhead. + */ +Ieee1609Dot2Data-EncryptedSigned {Tbes, Psid} ::= + Ieee1609Dot2Data-Signed { + Ieee1609Dot2Data-Encrypted { + Tbes + }, + Psid +} + +/** + * @brief This structure defines a parameterized type for creating a signed + * then encrypted certificate request as a subtype of Ieee1609Dot2Data. + */ +Ieee1609Dot2Data-SignedEncryptedCertRequest {Tbstecr, Signer} ::= + Ieee1609Dot2Data-Encrypted { + Ieee1609Dot2Data-SignedCertRequest { + Tbstecr, + Signer + } +} + +/** + * @brief This structure defines a parameterized type for creating an + * encrypted data as a subtype of Ieee1609Dot2Data. An overview of this + * structure is as follows: + * + * @param Tbe: is first encrypted and the resulting ciphertext is used as + * input to the encryptedData field. + */ +Ieee1609Dot2Data-SymmEncryptedSingleRecipient {Tbe} ::= + Ieee1609Dot2Data (WITH COMPONENTS { + ..., + content (WITH COMPONENTS { + encryptedData (CONSTRAINED BY { + --contains only one RecipientInfo, of form symmRecipinfo + --symmetric encryption of-- Tbe + }) + }) +}) + +--***************************************************************************-- +-- Signer Types -- +--***************************************************************************-- + +/** + * @brief This structure is used to indicate a SignerIdentifier with a + * certificate chain of size 1. + */ +SignerSingleCert ::= SignerIdentifier (WITH COMPONENTS { + certificate (SequenceOfCertificate (SIZE (1))) +}) + +/** + * @brief This structure is used to indicate an X509SignerIdentifier with a + * certificate chain of size 1. + */ +SignerSingleX509Cert ::= X509SignerIdentifier (WITH COMPONENTS { + certificate (SequenceOfX509Certificate (SIZE (1))) +}) + +/** + * @brief This structure is used to indicate a SignerIdentifier of type self. + */ +SignerSelf ::= SignerIdentifier (WITH COMPONENTS { + self +}) + +--***************************************************************************-- +-- Certificate Requests -- +--***************************************************************************-- + + ScmsPdu-RaAcaCertRequest ::= ScmsPdu-Scoped { + AcaRaInterfacePdu (WITH COMPONENTS { + raAcaCertRequest + }) + } + ScmsPdu-EeEcaCertRequest ::= ScmsPdu-Scoped { + EcaEeInterfacePdu (WITH COMPONENTS { + eeEcaCertRequest + }) + } + ScmsPdu-EeRaCertRequest ::= ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaCertRequest + }) + } + ScmsPdu-EeRaSuccessorEnrollmentCertRequest ::= ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaSuccessorEnrollmentCertRequest + }) + } + + +/** + * @brief This structure defines the all certificate request structures as a + * scoped version of the ScmsPdu. + */ +ScopedCertificateRequest ::= ScmsPdu ( + ScmsPdu-RaAcaCertRequest | ScmsPdu-EeEcaCertRequest | + ScmsPdu-EeRaCertRequest | ScmsPdu-EeRaSuccessorEnrollmentCertRequest +) + +/** + * @brief This structure defines the format of a signed certificate request. + * An overview of this structure is as follows: + * + * The signature is generated on the hash of this structure, obtained + * per the rules specified for hashing data objects in 5.3.1 of IEEE Std + * 1609.2a-2017, where the parameter Data Input shall be the C-OER + * encoding of tbsRequest, and the parameter Signer Identifier Input + * depending on whether the request is self-signed or signed using an + * enrollment certificate: + * - If the request is self-signed, the parameter Signer Identifier + * Input shall be the empty string, i.e., a string of length 0. + * - If the request is signed using an enrollment certificate, the + * parameter Signer Identifier Input shall be the signer's enrollment + * certificate. + * + * @param hashAlgorithmId: contains the identifier of the hash algorithm used + * to calculate the hash of tbsRequest. + * + * @param tbsRequest: contains the certificate request information that is + * signed by the recipient. + * + * @param signer: denotes the signing entity's identifier. + * + * @param signature: contains the request sender's signature. + */ +SignedCertificateRequest ::= SEQUENCE { + hashAlgorithmId HashAlgorithm, + tbsRequest ScopedCertificateRequest, + signer SignerIdentifier, + signature Signature +} + +/** + * @brief This structure contains a certificate request signed with an ITU-T + * X.509 certificate. The only type of certificate request signed with an + * ITU-T X.509 certificate supported in this document is an authorization + * certificate request. An overview of this structure is as follows: + * + * The signature is generated on the hash of this structure, obtained + * per the rules specified for hashing data objects in 5.3.1 of IEEE Std + * 1609.2a-2017, where the parameter Data Input shall be the C-OER + * encoding of tbsRequest, and the parameter Signer Identifier Input + * shall be the signer's certificate, that is, the ITU-T X.509 certificate + * contained in the OCTET STRING indicated by the first X509Certificate in + * signer. For example, if the signer is as below, the first 6 bytes are the + * ASN.1 encoding overhead, where 80 01 01 is the overhead for signer, and + * then 82 01 AC is the overhead introduced by the OCTET STRING encoding for + * the first (in this case, the only) X509Certificate; and the first + * X509Certificate is contained in the next 428 bytes (30 82 01 ... 00 00 00), + * so the parameter Signer Identifier Input shall be '30 82 01 ... 00 00 00'. + * + * An example X509SignerIdentifier with one X509Certificate: + * + * 80 01 01 82 01 AC 30 82 01 A8 30 82 01 4D A0 03 02 01 02 02 04 90 + * C5 9D 21 30 0A 06 08 2A 86 48 CE 3D 04 03 02 30 24 31 0A 30 08 06 03 55 04 + * 06 13 01 00 31 0A 30 08 06 03 55 04 0A 13 01 00 31 0A 30 08 06 03 55 04 03 + * 13 01 00 30 1E 17 0D 30 30 30 31 30 31 30 30 30 30 30 30 5A 17 0D 30 30 30 + * 31 30 31 30 30 30 30 30 30 5A 30 24 31 0A 30 08 06 03 55 04 06 13 01 00 31 + * 0A 30 08 06 03 55 04 0A 13 01 00 31 0A 30 08 06 03 55 04 03 13 01 00 30 59 + * 30 13 06 07 2A 86 48 CE 3D 02 01 06 08 2A 86 48 CE 3D 03 01 07 03 42 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A3 6D 30 6B 30 0A 06 03 55 1D 0E + * 04 03 04 01 00 30 0A 06 03 55 1D 23 04 03 04 01 00 30 0C 06 03 55 1D 13 01 + * 01 FF 04 02 30 00 30 0E 06 03 55 1D 0F 01 01 FF 04 04 03 02 03 C8 30 0A 06 + * 03 55 1D 25 04 03 04 01 00 30 0A 06 03 55 1D 1F 04 03 04 01 00 30 0F 06 08 + * 2B 06 01 05 05 07 01 01 04 03 04 01 00 30 0A 06 03 55 1D 20 04 03 04 01 00 + * 30 0A 06 08 2A 86 48 CE 3D 04 03 02 03 49 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 + * + * @param hashAlgorithmId: contains the identifier of the hash algorithm used + * inside the binary tree. + * + * @param tbsRequest: contains the certificate request information that is + * signed by the recipient. + * + * @param signer: denotes the signing entity's identifier. + * + * @param signature: contains the request sender's signature. + */ +SignedX509CertificateRequest ::= SEQUENCE { + hashAlgorithmId HashAlgorithm, + tbsRequest ScopedCertificateRequest, + signer X509SignerIdentifier, + signature Signature +} + +--***************************************************************************-- +-- ACA - EE Interface -- +--***************************************************************************-- + +/** + * @brief This structure contains a certificate response for consumption by + * the EE. In the architecture of this document, although it is created by the + * ACA, it is made available to the EE via the RA as described in 8.2. + * + * The ACA creates this response when 1) the compact unified + * butterfly key mechanism is not being used (that is, some other flavor of + * butterfly key is being used, or butterfly keys are not being used) and 2) + * it is not necessary to protect the EE's privacy from the RA, for example, + * when the certificate being returned is not a pseudonym certificate. + */ +AcaEeCertResponsePlainSpdu ::= Ieee1609Dot2Data-Unsecured { + ScmsPdu-Scoped { + AcaEeInterfacePdu (WITH COMPONENTS { + acaEeCertResponse + }) + } +} + +/** + * @brief This structure contains a certificate response for consumption by + * the EE. In the architecture of this document, although it is created by the + * ACA, it is made available to the EE via the RA as described in 8.2. + * + * The ACA creates this response when 1) the compact unified + * butterfly key mechanism is not being used (that is, some other flavor of + * butterfly key is being used, or butterfly keys are not being used) and 2) + * it is necessary to protect the EE's privacy from the RA, for example when + * the certificate being returned is a pseudonym certificate. + * + * The structure consists of a signed SPDU containing an encrypted + * SPDU. + * + * The encrypted SPDU is encrypted with the response + * encryption key that was provided to the ACA for that purpose. This key is + * determined as follows: + * - If the original EeRaCertRequest from the end entity indicated a single + * response encryption key, that is, if the additionalParams.encryptionKey + * field was present in the request, then the response is encrypted with that + * key. + * - If the original EeRaCertRequest from the end entity indicated a + * response encryption key generated with the "original" butterfly key + * mechanism, that is, the additionalParams.original field was provided in the + * request, then the response is encrypted with the cocoon encryption key + * derived from additionalParams.original.encryptionKey and + * additionalParams.original.encryptionExpansion as specified in 9.3.4.2 + * and the corresponding decryption private key is derived as specified in + * 9.3.4.1. + * - If the original EeRaCertRequest from the end entity indicated a + * response encryption key generated with the "unified" butterfly key + * mechanism, that is, the additionalParams.unified field was provided in the + * request, then the response is encrypted with the cocoon encryption key + * derived from tbsCert.verifyKeyIndicator and additionalParams.unified as + * specified in 9.3.4.2 and the corresponding decryption private key is + * derived as specified in 9.3.4.1. + * + * See 9.3 for more material about butterfly keys. + * + * The resulting Ieee1609Dot2Data of content type encryptedData is + * signed by the same ACA certificate that was used to issue the certificate + * field in the AcaEeCertResponse. If this structure is signed by a different + * ACA certificate, it is invalid. The ACA certificate shall follow the ACA + * certificate profile given in 7.7.3.2. + * + * @note: + * - Other potential responses to an authorization certificate + * request: If the original request indicated the use of "compact unified" + * butterfly key mechanism by including the additionalParams.compactUnified + * field, the response shall be a AcaEeCertResponseCubkSpdu, not a + * AcaEeCertResponsePrivateSpdu. + * + * - How the ACA obtains the response encryption key: This + * document provides the RaAcaCertRequest structure to allow the RA to + * indicate whether the original or unified butterfly key mechanism is to be + * used via the flags field. The encryption key for encrypting + * AcaEeCertResponse is calculated by the indicated method even if the RA + * does not use an RaAcaCertRequest as defined in this document to + * communicate the certificate request to the ACA. + * + * - Consistency between inner and outer signers, and the IEEE + * Std 1609.2 model. This SPDU introduces a new type of validity condition + * by requiring that the ACA that signs the outer signed SPDU is also the ACA + * that issued the certificate inside the encrypted SPDU. This requires that + * to verify the inner "SPDU", that is, the certificate, the verifier + * needs to store the information from the outer SPDU. This is not a violation + * of the IEEE 1609.2 model: Subclause 4.2.2.3 of IEEE Std 1609.2 considers all + * operations carried out on received data to be atomic and does not put any + * restrictions on the information that is stored between operations. However, + * it should be noted that because the IEEE 1609.2 approach enables SPDUs to + * be nested within one another as Ieee1609Dot2Data, in principle an + * implementation could be built that iterated through the layers of a nested + * SPDU within a single call from the invoking application instance. (And it + * should also be noted that IEEE Std 1609.2 was consciously designed to + * enable this approach: Although the primitives provided in IEEE Std 1609.2 + * only support the series-of-single-operations approach, an implementation + * could layer this "one-invocation processing" on top of the IEEE 1609.2 + * interface as an optimization.) A "one-invocation processing" implementation + * of that type would have to anticipate situations of coupling between inner + * and outer SPDUs like the one created by this AcaEeCertResponsePrivateSpdu, + * and allow the invoking certificate management service to check consistency + * at the application layer, perhaps by (for example) returning the signing + * certificates for all nested signed SPDUs. How this is to be implemented is + * implementation specific; this note is intended as a notification of this + * potential issue to implementers planning to implement one-invocation + * processing. + */ +AcaEeCertResponsePrivateSpdu ::= Ieee1609Dot2Data-EncryptedSigned { + ScmsPdu-Scoped { + AcaEeInterfacePdu (WITH COMPONENTS { + acaEeCertResponse + }) + }, + SecurityMgmtPsid +} + +/** + * @brief This structure contains a certificate response for consumption by + * the EE. In the architecture of this document, although it is created by + * the ACA, it is made available to the EE via the RA as described in 8.2. + * + * The ACA creates a certificate response in this form when the + * compact unified butterfly key mechanism is being used. If the + * RaAcaCertRequest structure was used to communicate between the RA and the + * ACA, the RA indicated use of compact unified butterfly keys by setting the + * cubk (1) bit in the bkType field in the corresponding RaAcaCertRequest. + * + * The AcaEeCertResponse is encrypted by the ACA using the cocoon + * public key for encryption. See 9.3.4.2 for how the ACA derives the cocoon + * public key for encryption, using the tbsCert.verifyKeyIndicator field in the + * corresponding RaAcaCertRequest as the input cocoon public key for signing + * Bt. See 9.3.4.1 for how the EE derives the corresponding cocoon private + * key for encryption. + */ +AcaEeCertResponseCubkSpdu ::= Ieee1609Dot2Data-Encrypted { + ScmsPdu-Scoped { + AcaEeInterfacePdu (WITH COMPONENTS { + acaEeCertResponse + }) + } +} + +--***************************************************************************-- +-- ACA - LA Interface -- +--***************************************************************************-- + +--***************************************************************************-- +-- ACA - MA Interface -- +--***************************************************************************-- + +--***************************************************************************-- +-- ACA - RA Interface -- +--***************************************************************************-- + +/** + * @brief This structure is the SPDU used to send a signed RaAcaCertRequest. + * For the signature to be valid the signing certificate shall conform to the + * RA certificate profile given in 7.7.3.9, contain a PSID equal to + * SecurityMgmtPsid and a corresponding SSP containing the C-OER encoding of a + * SecurityMgmtSsp indicating RaSsp. The toBeSigned.certRequestPermissions + * field of the RA certificate shall permit the requested permissions in the + * raAcaCertRequest.tbsCert.appPermissions field. + */ +RaAcaCertRequestSpdu ::= Ieee1609Dot2Data-SignedCertRequest { + ScmsPdu-Scoped { + AcaRaInterfacePdu (WITH COMPONENTS { + raAcaCertRequest + }) + }, + SignerSingleCert +} + +/** + * @brief This structure is the SPDU used to send a signed AcaRaCertResponse. + * For the signature to be valid the signing certificate shall contain a PSID + * equal to SecurityMgmtPsid and a corresponding SSP containing the C-OER + * encoding of a SecurityMgmtSsp indicating AcaSsp. + */ +AcaRaCertResponseSpdu ::= Ieee1609Dot2Data-Signed { + ScmsPdu-Scoped { + AcaRaInterfacePdu (WITH COMPONENTS { + acaRaCertResponse + }) + }, + SecurityMgmtPsid +} + +--***************************************************************************-- +-- Certificate Management -- +--***************************************************************************-- + +/** + * @brief This structure is the SPDU used to send an unsecured CompositeCrl. + * It is used to create composite CRL files as specified in 8.5. + */ +CompositeCrlSpdu ::= Ieee1609Dot2Data-Unsecured { + ScmsPdu-Scoped { + CertManagementPdu (WITH COMPONENTS { + compositeCrl + }) + } +} + +/** + * @brief This structure is the SPDU used to send an unsecured + * CertificateChain. It is used to create certificate chain files as + * specified in 8.4. + */ +CertificateChainSpdu ::= Ieee1609Dot2Data-Unsecured { + ScmsPdu-Scoped { + CertManagementPdu (WITH COMPONENTS { + certificateChain + }) + } +} + +/** + * @brief This structure is the SPDU used to send an unsecured MultiSignedCtl. + */ +MultiSignedCtlSpdu ::= Ieee1609Dot2Data-Unsecured { + ScmsPdu-Scoped { + CertManagementPdu (WITH COMPONENTS { + multiSignedCtl + }) + } +} + +/** + * @brief This structure is the SPDU used to send a signed + * ToBeSignedCtlSignature. For the signature to be valid, the signing + * certificate shall match the elector certificate profile in 7.7.3.7. This + * means that the signature is calculated as specified in IEEE Std 1609.2, + * with the data input to the hash process consisting of the C-OER encoding + * of the tbsData that includes the ToBeSignedCtlSignature. + */ +CtlSignatureSpdu ::= Ieee1609Dot2Data-Signed { + ScmsPdu-Scoped { + CertManagementPdu (WITH COMPONENTS { + tbsCtlSignature + }) + }, + SecurityMgmtPsid +} + +/** + * @brief This structure is the SPDU used to send a signed + * CertManagementInfoStatus. For the signature to be valid the signing + * certificate shall conform to the RA certificate profile given in 7.7.3.9 or + * the DC certificate profile given in 7.7.3.10. + */ +CertificateManagementInformationStatusSpdu ::= + Ieee1609Dot2Data-Signed { + ScmsPdu-Scoped { + CertManagementPdu (WITH COMPONENTS { + infoStatus + }) + }, + SecurityMgmtPsid +} + + +--***************************************************************************-- +-- ECA - EE Interface -- +--***************************************************************************-- + +/** + * @brief This structure is the SPDU used to send a signed EeEcaCertRequest, + * as follows: + * - If eeEcaCertRequest.canonicalId is not present, the EE signs this + * structure using the private key corresponding to the + * tbsCert.verifyKeyIndicator field of the EeEcaCertRequest. + * - If eeEcaCertRequest.canonicalId is present, the EE signs this + * structure using the canonical private key as specified in 4.1.4.2. + */ +EeEcaCertRequestSpdu ::= Ieee1609Dot2Data-SignedCertRequest { + ScmsPdu-Scoped { + EcaEeInterfacePdu (WITH COMPONENTS { + eeEcaCertRequest + }) + }, + SignerSelf +} + +/** + * @brief This structure is the SPDU used to send a signed EcaEeCertResponse. + * For the signature to be valid, the signing certificate shall contain a PSID + * equal to SecurityMgmtPsid and a corresponding SSP containing the C-OER + * encoding of a SecurityMgmtSsp indicating EcaSsp. + */ +EcaEeCertResponseSpdu ::= Ieee1609Dot2Data-Signed { + ScmsPdu-Scoped { + EcaEeInterfacePdu (WITH COMPONENTS { + ecaEeCertResponse + }) + }, + SecurityMgmtPsid +} + +--***************************************************************************-- +-- EE - MA Interface -- +--***************************************************************************-- + +--***************************************************************************-- +-- EE - RA Interface -- +--***************************************************************************-- + +/** + * @brief This structure is the SPDU used to send a signed then encrypted + * EeRaCertRequest. It is a choice of the IEEE 1609.2 authenticated + * certificate request, which may be any kind of EE-RA certificate request, + * and the ITU-T X.509 certificate request, which is required to be an + * authorization certificate request. + */ +EeRaCertRequestSpdu ::= Ieee1609Dot2Data ( + EeRa1609Dot2AuthenticatedCertRequestSpdu | + EeRaX509AuthenticatedCertRequestSpdu +) + +/** + * @brief This structure is the SPDU used to send a signed then encrypted IEEE + * 1609.2 authenticated certificate request. The EE signs this structure + * using its enrollment certificate. The enrollment certificate shall conform + * to the enrollment certificate profile given in 7.7.3.5. The EE encrypts + * the signed structure using the encryptionKey from the RA's certificate. + */ +EeRa1609Dot2AuthenticatedCertRequestSpdu ::= + Ieee1609Dot2Data-SignedEncryptedCertRequest { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaCertRequest + }) + }, + SignerSingleCert +} + +/** + * @brief This structure is the SPDU used to send a signed then encrypted ITU-T + * X.509authenticated certificate request. The EE signs this structure + * using its enrollment certificate. The enrollment certificate shall conform + * to the enrollment certificate profile given in 7.7.3.6. The EE encrypts + * the signed structure using the encryptionKey from the RA's certificate. + */ +EeRaX509AuthenticatedCertRequestSpdu ::= Ieee1609Dot2Data-Encrypted { + Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaCertRequest + }) + }, + SignerSingleX509Cert + } +} + +/** + * @brief This structure is the SPDU used to send a signed RaEeCertAck to + * acknowledge the receipt of an EeRaCertRequestSpdu. For the signature to be + * valid the signing certificate shall conform to the RA certificate profile + * given in 7.7.3.9. + */ +RaEeCertAckSpdu ::= Ieee1609Dot2Data-Signed { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + raEeCertAck + }) + }, + SecurityMgmtPsid +} + +/** + * @brief This structure is the SPDU used to create an unsigned .info file + * to be included in a certificate batch zip file as specified in 8.2. This + * SPDU is used if the RaEeCertInfo does not contain an acpcTreeId field. + */ +RaEeCertInfoSpdu ::= Ieee1609Dot2Data-Unsecured { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + raEeCertInfo (WITH COMPONENTS { + acpcTreeId ABSENT + }) + }) + } +} + +/** + * @brief This structure is the SPDU used to create a signed .info file to + * be included in a certificate batch zip file as specified in 8.2. This + * SPDU is used if the RaEeCertInfo contains an acpcTreeId field. For the + * signature to be valid the signing certificate shall conform to the RA + * certificate profile given in 7.7.3.9. + */ +RaEeCertAndAcpcInfoSpdu ::= Ieee1609Dot2Data-Signed { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + raEeCertInfo (WITH COMPONENTS { + acpcTreeId PRESENT + }) + }) + }, + SecurityMgmtPsid +} + +/** + * @brief This structure is the SPDU used to send an unsecured + * EeRaDownloadRequest. + */ +EeRaDownloadRequestPlainSpdu ::= Ieee1609Dot2Data-Unsecured { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaDownloadRequest + }) + } +} + +/** + * @brief This structure is the SPDU used to send a signed then encrypted + * EeRaDownloadRequest. The EE signs this structure using its enrollment + * certificate. The enrollment certificate shall conform to the enrollment + * certificate profile given in 7.7.3.5. The EE encrypts the signed + * structure using the encryptionKey from the RA's certificate. + */ +EeRaDownloadRequestSpdu ::= Ieee1609Dot2Data-SignedEncrypted { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaDownloadRequest + }) + }, + SecurityMgmtPsid +} + +/** + * @brief This structure is the SPDU used to send a signed then encrypted + * EeEcaCertRequestSpdu. The EE signs this structure using its enrollment + * certificate. The enrollment certificate shall conform to the enrollment + * certificate profile given in 7.7.3.5. The EE encrypts the signed + * structure using the encryptionKey from the RA's certificate. + */ +EeRaSuccessorEnrollmentCertRequestSpdu ::= + Ieee1609Dot2Data-SignedEncryptedCertRequest { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaSuccessorEnrollmentCertRequest + }) + }, + SignerSingleCert +} + +/** + * @brief This structure is the SPDU used to send a signed RaEeCertInfo. For + * the signature to be valid the signing certificate shall conform to the RA + * certificate profile given in 7.7.3.9. + */ +RaEeEnrollmentCertAckSpdu ::= Ieee1609Dot2Data-Signed { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + raEeCertInfo (WITH COMPONENTS { + acpcTreeId ABSENT + }) + }) + }, + SecurityMgmtPsid +} + +--***************************************************************************-- +-- LA - MA Interface -- +--***************************************************************************-- + +--***************************************************************************-- +-- LA - RA Interface -- +--***************************************************************************-- + +--***************************************************************************-- +-- MA - RA Interface -- +--***************************************************************************-- + +--***************************************************************************-- +-- Service Specific Permissions -- +--***************************************************************************-- + +/** + * @brief This parent structure defines the SSP for SecurityMgmtPsid and + * encompasses all SSP structures defined in this document. An overview of + * this structure is as follows: + * + * @note The LOP is in the SSP for backward compatibility reasons, + * and in practice, in this design the LOP does not have a certificate. + * + * @param elector: contains the SSP defined for an elector. + * + * @param root: contains the SSP defined for a root CA. + * + * @param pg: contains the SSP defined for a policy generator. + * + * @param ica: contains the SSP defined for an intermediate CA. + * + * @param eca: contains the SSP defined for an enrollment CA. + * + * @param aca: contains the SSP defined for an authorization CA. + * + * @param crl: contains the SSP defined for a CRL signer. + * + * @param dcm: contains the SSP defined for a device configuration manager. + * + * @param la: contains the SSP defined for a linkage authority. + * + * @param lop: contains the SSP defined for a location obscurer proxy. + * + * @param ma: contains the SSP defined for a misbehavior authority. + * + * @param ra: contains the SSP defined for a registration authority. + * + * @param ee: contains the SSP defined for an end entity. + * + * @param dc: contains the SSP defined for a distribution center. + */ +SecurityMgmtSsp ::= CHOICE { + elector ElectorSsp, + root RootCaSsp, + pg PgSsp, + ica IcaSsp, + eca EcaSsp, + aca AcaSsp, + crl CrlSignerSsp, + dcm DcmSsp, + la LaSsp, + lop LopSsp, + ma MaSsp, + ra RaSsp, + ee EeSsp, + ..., + dc DcSsp + } + +TestSecurityMgmtSsp ::= SecurityMgmtSsp + +/** + * @brief This structure defines the SSP for an elector when it is authorizing + * SecurityMgmtPsid messages. It has no parameters other than the version + * number. + */ +ElectorSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for a root CA when it is authorizing + * SecurityMgmtPsid messages. It has no parameters other than the version + * number. + */ +RootCaSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for a policy generator when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + */ +PgSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for an intermediate CA when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + */ +IcaSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for an enrollment CA when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + */ +EcaSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for an authorization CA when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + */ +AcaSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for a CRL signer when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + * + * @note The SSP for a CRL signer when signing CRLs is associated with + * PSID 0x0100 and is defined in IEEE Std 1609.2. + */ +CrlSignerSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for a device configuration manager + * when it is authorizing SecurityMgmtPsid messages. It has no parameters + * other than the version number. + */ +DcmSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for a linkage authority when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + */ +LaSsp ::= SEQUENCE { + version Uint8 (2), + laId Uint16, + ... +} + +/** + * @brief This structure defines the SSP for a location obscurer proxy (LOP) + * when it is authorizing SecurityMgmtPsid messages. It has no parameters + * other than the version number. + * + * @note The LOP is in the SSP for backward compatibility reasons, and + * in practice, in this design the LOP does not have a certificate. + */ +LopSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for a misbehavior authority when it + * is authorizing SecurityMgmtPsid messages. Its parameters + * indicate the PSIDs associated with the misbehavior that is to be reported + * to that MA (see 4.1.5 for further details). The certificate containing + * this SSP is the MA Certificate to which an end entity should encrypt + * misbehavior reports related to the indicated PSIDs. + */ +MaSsp ::= SEQUENCE { + version Uint8 (2), + relevantPsids SequenceOfPsid, + ... +} + +/** + * @brief This structure defines the SSP for an RA when it is authorizing + * SecurityMgmtPsid messages. It has no parameters other than the version + * number. + */ +RaSsp ::= SEQUENCE { + version Uint8 (2), + ... +} + +/** + * @brief This structure defines the SSP for an end entity when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + */ +EeSsp ::= SEQUENCE { + version Uint8(2), + ... +} + +/** + * @brief This is a container for ACPC-related SSPs, specifying one SSP for + * each role. The only SSP defined in this document is the CamSsp, used in + * the CAM certificate that signs a SignedAprvBinaryTree or a + * SignedIndividualAprv. The SSP shall be C-OER encoded for inclusion in the + * CAM certificate. New versions of the CAM SSP should be handled by + * extending this structure rather than by use of a version number in the + * CamSsp structure. + * + * The AcpcSsp is associated with the AcpcPsid in the CAM certificate's + * appPermissions field. + */ +AcpcSsp ::= CHOICE { + cam CamSsp, + ... +} + +/** + * @brief This is a list of the ACPC Tree IDs for which the containing CAM + * certificate is entitled to sign a SignedAprvBinaryTree or a + * SignedIndividualAprv. The SSP entitles the certificate holder to sign + * either of these structures. + */ +CamSsp ::= SEQUENCE (SIZE(1..MAX)) OF AcpcTreeId + +/** + * @brief This structure defines the SSP for a distribution center when it is + * authorizing SecurityMgmtPsid messages. It has no parameters other than the + * version number. + */ +DcSsp ::= SEQUENCE { + version Uint8(2), + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2.asn b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2.asn new file mode 100644 index 0000000..d12cd95 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2.asn @@ -0,0 +1,1471 @@ +--***************************************************************************-- +-- IEEE Std 1609.2 -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-6(6)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + CERT-EXT-TYPE, + CrlSeries, + EccP256CurvePoint, + EcencP256EncryptedKey, + EciesP256EncryptedKey, + EncryptionKey, + EXT-TYPE, + Extension, + ExtId, + GeographicRegion, + GroupLinkageValue, + HashAlgorithm, + HashedId3, + HashedId8, + HashedId32, + HashedId48, + Hostname, + IValue, + LinkageValue, + Opaque, + Psid, + PsidSsp, + PsidSspRange, + PublicEncryptionKey, + PublicVerificationKey, + SequenceOfHashedId3, + SequenceOfPsidSsp, + SequenceOfPsidSspRange, + ServiceSpecificPermissions, + Signature, + SubjectAssurance, + SymmetricEncryptionKey, + ThreeDLocation, + Time64, + Uint3, + Uint8, + Uint16, + Uint32, + ValidityPeriod +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-4(4)} +WITH SUCCESSORS + + EtsiOriginatingHeaderInfoExtension +FROM EtsiTs103097ExtensionModule {itu-t(0) identified-organization(4) etsi(0) + itsDomain(5) wg5(5) secHeaders(103097) extension(2) major-version-1(1) + minor-version-0(0)} +WITH SUCCESSORS +; + +--***************************************************************************-- +-- Secured Data -- +--***************************************************************************-- + +/** + * @brief This data type is used to contain the other data types in this + * clause. The fields in the Ieee1609Dot2Data have the following meanings: + * + * @param protocolVersion: contains the current version of the protocol. The + * version specified in this standard is version 3, represented by the + * integer 3. There are no major or minor version numbers. + * + * @param content: contains the content in the form of an Ieee1609Dot2Content. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the Ieee1609Dot2Content. + */ +Ieee1609Dot2Data ::= SEQUENCE { + protocolVersion Uint8(3), + content Ieee1609Dot2Content +} + +/** + * @brief In this structure: + * + * @param unsecuredData: indicates that the content is an OCTET STRING to be + * consumed outside the SDS. + * + * @param signedData: indicates that the content has been signed according to + * this standard. + * + * @param encryptedData: indicates that the content has been encrypted + * according to this standard. + * + * @param signedCertificateRequest: indicates that the content is a + * certificate request signed by an IEEE 1609.2 certificate or self-signed. + * + * @param signedX509CertificateRequest: indicates that the content is a + * certificate request signed by an ITU-T X.509 certificate. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2 if it is of type signedData. + * The canonicalization applies to the SignedData. + */ +Ieee1609Dot2Content ::= CHOICE { + unsecuredData Opaque, + signedData SignedData, + encryptedData EncryptedData, + signedCertificateRequest Opaque, + ..., + signedX509CertificateRequest Opaque +} + +/** + * @brief In this structure: + * + * @param hashId: indicates the hash algorithm to be used to generate the hash + * of the message for signing and verification. + * + * @param tbsData: contains the data that is hashed as input to the signature. + * + * @param signer: determines the keying material and hash algorithm used to + * sign the data. + * + * @param signature: contains the digital signature itself, calculated as + * specified in 5.3.1. + * - If signer indicates the choice self, then the signature calculation + * is parameterized as follows: + * - Data input is equal to the COER encoding of the tbsData field + * canonicalized according to the encoding considerations given in 6.3.6. + * - Verification type is equal to self. + * - Signer identifier input is equal to the empty string. + * - If signer indicates certificate or digest, then the signature + * calculation is parameterized as follows: + * - Data input is equal to the COER encoding of the tbsData field + * canonicalized according to the encoding considerations given in 6.3.6. + * - Verification type is equal to certificate. + * - Signer identifier input equal to the COER-encoding of the + * Certificate that is to be used to verify the SPDU, canonicalized according + * to the encoding considerations given in 6.4.3. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the ToBeSignedData and the Signature. + */ +SignedData ::= SEQUENCE { + hashId HashAlgorithm, + tbsData ToBeSignedData, + signer SignerIdentifier, + signature Signature +} + +/** + * @brief This structure contains the data to be hashed when generating or + * verifying a signature. See 6.3.4 for the specification of the input to the + * hash. + * + * @param payload: contains data that is provided by the entity that invokes + * the SDS. + * + * @param headerInfo: contains additional data that is inserted by the SDS. + * This structure is used as follows to determine the "data input" to the + * hash operation for signing or verification as specified in 5.3.1.2.2 or + * 5.3.1.3. + * - If payload does not contain the field omitted, the data input to the + * hash operation is the COER encoding of the ToBeSignedData. + * - If payload field in this ToBeSignedData instance contains the field + * omitted, the data input to the hash operation is the COER encoding of the + * ToBeSignedData, concatenated with the hash of the omitted payload. The hash + * of the omitted payload is calculated with the same hash algorithm that is + * used to calculate the hash of the data input for signing or verification. + * The data input to the hash operation is simply the COER enocding of the + * ToBeSignedData, concatenated with the hash of the omitted payload: there is + * no additional wrapping or length indication. As noted in 5.2.4.3.4, the + * means by which the signer and verifier establish the contents of the + * omitted payload are out of scope for this standard. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the SignedDataPayload if it is of type data, and to the + * HeaderInfo. + */ +ToBeSignedData ::= SEQUENCE { + payload SignedDataPayload, + headerInfo HeaderInfo +} + +/** + * @brief This structure contains the data payload of a ToBeSignedData. This + * structure contains at least one of the optional elements, and may contain + * more than one. See 5.2.4.3.4 for more details. + * The security profile in Annex C allows an implementation of this standard + * to state which forms of Signed¬Data¬Payload are supported by that + * implementation, and also how the signer and verifier are intended to obtain + * the external data for hashing. The specification of an SDEE that uses + * external data is expected to be explicit and unambiguous about how this + * data is obtained and how it is formatted prior to processing by the hash + * function. + * + * @param data: contains data that is explicitly transported within the + * structure. + * + * @param extDataHash: contains the hash of data that is not explicitly + * transported within the structure, and which the creator of the structure + * wishes to cryptographically bind to the signature. + * + * @param omitted: indicates that there is external data to be included in the + * hash calculation for the signature.The mechanism for including the external + * data in the hash calculation is specified in 6.3.6. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the Ieee1609Dot2Data. + */ +SignedDataPayload ::= SEQUENCE { + data Ieee1609Dot2Data OPTIONAL, + extDataHash HashedData OPTIONAL, + ..., + omitted NULL OPTIONAL +} (WITH COMPONENTS {..., data PRESENT} | + WITH COMPONENTS {..., extDataHash PRESENT} | + WITH COMPONENTS {..., omitted PRESENT}) + + +/** + * @brief This structure contains the hash of some data with a specified hash + * algorithm. See 5.3.3 for specification of the permitted hash algorithms. + * + * @param sha256HashedData: indicates data hashed with SHA-256. + * + * @param sha384HashedData: indicates data hashed with SHA-384. + * + * @param sm3HashedData: indicates data hashed with SM3. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.6. An implementation that does not + * recognize the indicated CHOICE for this type when verifying a signed SPDU + * shall indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, + * that is, it is invalid in the sense that its validity cannot be established. + */ +HashedData::= CHOICE { + sha256HashedData HashedId32, + ..., + sha384HashedData HashedId48, + sm3HashedData HashedId32 +} + +/** + * @brief This structure contains information that is used to establish + * validity by the criteria of 5.2. + * + * @param psid: indicates the application area with which the sender is + * claiming the payload is to be associated. + * + * @param generationTime: indicates the time at which the structure was + * generated. See 5.2.5.2.2 and 5.2.5.2.3 for discussion of the use of this + * field. + * + * @param expiryTime: if present, contains the time after which the data + * is no longer considered relevant. If both generationTime and + * expiryTime are present, the signed SPDU is invalid if generationTime is + * not strictly earlier than expiryTime. + * + * @param generationLocation: if present, contains the location at which the + * signature was generated. + * + * @param p2pcdLearningRequest: if present, is used by the SDS to request + * certificates for which it has seen identifiers and does not know the + * entire certificate. A specification of this peer-to-peer certificate + * distribution (P2PCD) mechanism is given in Clause 8. This field is used + * for the separate-certificate-pdu flavor of P2PCD and shall only be present + * if inlineP2pcdRequest is not present. The HashedId3 is calculated with the + * whole-certificate hash algorithm, determined as described in 6.4.3, + * applied to the COER-encoded certificate, canonicalized as defined in the + * definition of Certificate. + * + * @param missingCrlIdentifier: if present, is used by the SDS to request + * CRLs which it knows to have been issued and have not received. This is + * provided for future use and the associated mechanism is not defined in + * this version of this standard. + * + * @param encryptionKey: if present, is used to provide a key that is to + * be used to encrypt at least one response to this SPDU. The SDEE + * specification is expected to specify which response SPDUs are to be + * encrypted with this key. One possible use of this key to encrypt a + * response is specified in 6.3.35, 6.3.37, and 6.3.34. An encryptionKey + * field of type symmetric should only be used if the SignedData containing + * this field is securely encrypted by some means. + * + * @param inlineP2pcdRequest: if present, is used by the SDS to request + * unknown certificates per the inline peer-to-peer certificate distribution + * mechanism is given in Clause 8. This field shall only be present if + * p2pcdLearningRequest is not present. The HashedId3 is calculated with the + * whole-certificate hash algorithm, determined as described in 6.4.3, applied + * to the COER-encoded certificate, canonicalized as defined in the definition + * of Certificate. + * + * @param requestedCertificate: if present, is used by the SDS to provide + * certificates per the "inline" version of the peer-to-peer certificate + * distribution mechanism given in Clause 8. + * + * @param pduFunctionalType: if present, is used to indicate that the SPDU is + * to be consumed by a process other than an application process as defined + * in ISO 21177 [B14a]. See 6.3.23b for more details. + * + * @param contributedExtensions: if present, is used to contain additional + * extensions defined using the ContributedExtensionBlocks structure. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the EncryptionKey. If encryptionKey is present, and indicates + * the choice public, and contains a BasePublicEncryptionKey that is an + * elliptic curve point (i.e., of type EccP256CurvePoint or + * EccP384CurvePoint), then the elliptic curve point is encoded in compressed + * form, i.e., such that the choice indicated within the Ecc*CurvePoint is + * compressed-y-0 or compressed-y-1. + * The canonicalization does not apply to any fields after the extension + * marker, including any fields in contributedExtensions. + */ +HeaderInfo ::= SEQUENCE { + psid Psid, + generationTime Time64 OPTIONAL, + expiryTime Time64 OPTIONAL, + generationLocation ThreeDLocation OPTIONAL, + p2pcdLearningRequest HashedId3 OPTIONAL, + missingCrlIdentifier MissingCrlIdentifier OPTIONAL, + encryptionKey EncryptionKey OPTIONAL, + ..., + inlineP2pcdRequest SequenceOfHashedId3 OPTIONAL, + requestedCertificate Certificate OPTIONAL, + pduFunctionalType PduFunctionalType OPTIONAL, + contributedExtensions ContributedExtensionBlocks OPTIONAL +} + +/** + * @brief This structure may be used to request a CRL that the SSME knows to + * have been issued and has not yet received. It is provided for future use + * and its use is not defined in this version of this standard. + * + * @param cracaId: is the HashedId3 of the CRACA, as defined in 5.1.3. The + * HashedId3 is calculated with the whole-certificate hash algorithm, + * determined as described in 6.4.3, applied to the COER-encoded certificate, + * canonicalized as defined in the definition of Certificate. + * + * @param crlSeries: is the requested CRL Series value. See 5.1.3 for more + * information. + */ +MissingCrlIdentifier ::= SEQUENCE { + cracaId HashedId3, + crlSeries CrlSeries, + ... +} + +/** + * @brief This data structure identifies the functional entity that is + * intended to consume an SPDU, for the case where that functional entity is + * not an application process, and are instead security support services for an + * application process. Further details and the intended use of this field are + * defined in ISO 21177 [B20]. + * + * @param tlsHandshake: indicates that the Signed SPDU is not to be directly + * consumed as an application PDU and is to be used to provide information + * about the holder’s permissions to a Transport Layer Security (TLS) + * (IETF 5246 [B15], IETF 8446 [B16]) handshake process operating to secure + * communications to an application process. See IETF [B15] and ISO 21177 + * [B20] for further information. + * + * @param iso21177ExtendedAuth: indicates that the Signed SPDU is not to be + * directly consumed as an application PDU and is to be used to provide + * additional information about the holder’s permissions to the ISO 21177 + * Security Subsystem for an application process. See ISO 21177 [B20] for + * further information. + * + * @param iso21177SessionExtension: indicates that the Signed SPDU is not to + * be directly consumed as an application PDU and is to be used to extend an + * existing ISO 21177 secure session. This enables a secure session to + * persist beyond the lifetime of the certificates used to establish that + * session. + */ +PduFunctionalType ::= INTEGER (0..255) + +tlsHandshake PduFunctionalType ::= 1 +iso21177ExtendedAuth PduFunctionalType ::= 2 +iso21177SessionExtension PduFunctionalType ::= 3 + + +/** + * @brief This type is used for clarity of definitions. + */ +ContributedExtensionBlocks ::= SEQUENCE (SIZE(1..MAX)) OF + ContributedExtensionBlock + +/** + * @brief This data structure defines the format of an extension block + * provided by an identified contributor by using the temnplate provided + * in the class IEEE1609DOT2-HEADERINFO-CONTRIBUTED-EXTENSION constraint + * to the objects in the set Ieee1609Dot2HeaderInfoContributedExtensions. + * + * @param contributorId: uniquely identifies the contributor. + * + * @param extns: contains a list of extensions from that contributor. + * Extensions are expected and not required to follow the format specified + * in 6.5. + */ +ContributedExtensionBlock ::= SEQUENCE { + contributorId IEEE1609DOT2-HEADERINFO-CONTRIBUTED-EXTENSION.&id({ + Ieee1609Dot2HeaderInfoContributedExtensions + }), + extns SEQUENCE (SIZE(1..MAX)) OF + IEEE1609DOT2-HEADERINFO-CONTRIBUTED-EXTENSION.&Extn({ + Ieee1609Dot2HeaderInfoContributedExtensions + }{@.contributorId}) +} + +/** + * @brief This Information Object Class defines the class that provides a + * template for defining extension blocks. + */ +IEEE1609DOT2-HEADERINFO-CONTRIBUTED-EXTENSION ::= CLASS { + &id HeaderInfoContributorId UNIQUE, + &Extn +} WITH SYNTAX {&Extn IDENTIFIED BY &id} + +/** + * @brief This structure is an ASN.1 Information Object Set listing the + * defined contributed extension types and the associated + * HeaderInfoContributorId values. In this version of this standard two + * extension types are defined: Ieee1609ContributedHeaderInfoExtension and + * EtsiOriginatingHeaderInfoExtension. + */ +Ieee1609Dot2HeaderInfoContributedExtensions + IEEE1609DOT2-HEADERINFO-CONTRIBUTED-EXTENSION ::= { + {Ieee1609ContributedHeaderInfoExtension IDENTIFIED BY + ieee1609HeaderInfoContributorId} | + {EtsiOriginatingHeaderInfoExtension IDENTIFIED BY + etsiHeaderInfoContributorId}, + ... +} + +/** + * @brief This is an integer used to identify a HeaderInfo extension + * contributing organization. In this version of this standard two values are + * defined: + * - ieee1609OriginatingExtensionId indicating extensions originating with + * IEEE 1609. + * - etsiOriginatingExtensionId indicating extensions originating with + * ETSI TC ITS. + */ +HeaderInfoContributorId ::= INTEGER (0..255) + +ieee1609HeaderInfoContributorId HeaderInfoContributorId ::= 1 +etsiHeaderInfoContributorId HeaderInfoContributorId ::= 2 + + +/** + * @brief This structure allows the recipient of data to determine which + * keying material to use to authenticate the data. It also indicates the + * verification type to be used to generate the hash for verification, as + * specified in 5.3.1. + * + * @param digest: If the choice indicated is digest: + * - The structure contains the HashedId8 of the relevant certificate. The + * HashedId8 is calculated with the whole-certificate hash algorithm, + * determined as described in 6.4.3. + * - The verification type is certificate and the certificate data + * passed to the hash function as specified in 5.3.1 is the authorization + * certificate. + * + * @param certificate: If the choice indicated is certificate: + * - The structure contains one or more Certificate structures, in order + * such that the first certificate is the authorization certificate and each + * subsequent certificate is the issuer of the one before it. + * - The verification type is certificate and the certificate data + * passed to the hash function as specified in 5.3.1 is the authorization + * certificate. + * + * @param self: If the choice indicated is self: + * - The structure does not contain any data beyond the indication that + * the choice value is self. + * - The verification type is self-signed. + * + * @note Critical information fields: + * - If present, this is a critical information field as defined in 5.2.6. + * An implementation that does not recognize the CHOICE value for this type + * when verifying a signed SPDU shall indicate that the signed SPDU is invalid. + * - If present, certificate is a critical information field as defined in + * 5.2.6. An implementation that does not support the number of certificates + * in certificate when verifying a signed SPDU shall indicate that the signed + * SPDU is invalid. A compliant implementation shall support certificate + * fields containing at least one certificate. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to every Certificate in the certificate field. + */ +SignerIdentifier ::= CHOICE { + digest HashedId8, + certificate SequenceOfCertificate, + self NULL, + ... +} + +/** + * @brief This data structure is used to perform a countersignature over an + * already-signed SPDU. This is the profile of an Ieee1609Dot2Data containing + * a signedData. The tbsData within content is composed of a payload + * containing the hash (extDataHash) of the externally generated, pre-signed + * SPDU over which the countersignature is performed. + */ +Countersignature ::= Ieee1609Dot2Data (WITH COMPONENTS {..., + content (WITH COMPONENTS {..., + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS {..., + payload (WITH COMPONENTS {..., + data ABSENT, + extDataHash PRESENT + }), + headerInfo(WITH COMPONENTS {..., + generationTime PRESENT, + expiryTime ABSENT, + generationLocation ABSENT, + p2pcdLearningRequest ABSENT, + missingCrlIdentifier ABSENT, + encryptionKey ABSENT + }) + }) + }) + }) +}) + + +--***************************************************************************-- +-- Encrypted Data -- +--***************************************************************************-- + +/** + * @brief This data structure encodes data that has been encrypted to one or + * more recipients using the recipients’ public or symmetric keys as + * specified in 5.3.4. + * + * @param recipients: contains one or more RecipientInfos. These entries may + * be more than one RecipientInfo, and more than one type of RecipientInfo, + * as long as all entries are indicating or containing the same data encryption + * key. + * + * @param ciphertext: contains the encrypted data. This is the encryption of + * an encoded Ieee1609Dot2Data structure as specified in 5.3.4.2. + * + * @note Critical information fields: + * - If present, recipients is a critical information field as defined in + * 5.2.6. An implementation that does not support the number of RecipientInfo + * in recipients when decrypted shall indicate that the encrypted SPDU could + * not be decrypted due to unsupported critical information fields. A + * compliant implementation shall support recipients fields containing at + * least eight entries. + * + * @note If the plaintext is raw data, i.e., it has not been output from a + * previous operation of the SDS, then it is trivial to encapsulate it in an + * Ieee1609Dot2Data of type unsecuredData as noted in 4.2.2.2.2. For example, + * '03 80 08 01 23 45 67 89 AB CD EF' is the C-OER encoding of '01 23 45 67 + * 89 AB CD EF' encapsulated in an Ieee1609Dot2Data of type unsecuredData. + * The first byte of the encoding 03 is the protocolVersion, the second byte + * 80 indicates the choice unsecuredData, and the third byte 08 is the length + * of the raw data '01 23 45 67 89 AB CD EF'. + */ +EncryptedData ::= SEQUENCE { + recipients SequenceOfRecipientInfo, + ciphertext SymmetricCiphertext +} + +/** + * @brief This data structure is used to transfer the data encryption key to + * an individual recipient of an EncryptedData. The option pskRecipInfo is + * selected if the EncryptedData was encrypted using the static encryption + * key approach specified in 5.3.4. The other options are selected if the + * EncryptedData was encrypted using the ephemeral encryption key approach + * specified in 5.3.4. The meanings of the choices are: + * + * See Annex C.7 for guidance on when it may be appropriate to use + * each of these approaches. + * + * @param pskRecipInfo: The data was encrypted directly using a pre-shared + * symmetric key. + * + * @param symmRecipInfo: The data was encrypted with a data encryption key, + * and the data encryption key was encrypted using a symmetric key. + * + * @param certRecipInfo: The data was encrypted with a data encryption key, + * the data encryption key was encrypted using a public key encryption scheme, + * where the public encryption key was obtained from a certificate. In this + * case, the parameter P1 to ECIES as defined in 5.3.5 is the hash of the + * certificate, calculated with the whole-certificate hash algorithm, + * determined as described in 6.4.3, applied to the COER-encoded certificate, + * canonicalized as defined in the definition of Certificate. + * + * @note If the encryption algorithm is SM2, there is no equivalent of the + * parameter P1 and so no input to the encryption process that uses the hash + * of the certificate. + * + * @param signedDataRecipInfo: The data was encrypted with a data encryption + * key, the data encryption key was encrypted using a public key encryption + * scheme, where the public encryption key was obtained as the public response + * encryption key from a SignedData. In this case, if ECIES is the encryption + * algorithm, then the parameter P1 to ECIES as defined in 5.3.5 is the + * SHA-256 hash of the Ieee1609Dot2Data of type signedData containing the + * response encryption key, canonicalized as defined in the definition of + * Ieee1609Dot2Data. + * + * @note If the encryption algorithm is SM2, there is no equivalent of the + * parameter P1 and so no input to the encryption process that uses the hash + * of the Ieee1609Dot2Data. + * + * @param rekRecipInfo: The data was encrypted with a data encryption key, + * the data encryption key was encrypted using a public key encryption scheme, + * where the public encryption key was not obtained from a Signed-Data or a + * certificate. In this case, the SDEE specification is expected to specify + * how the public key is obtained, and if ECIES is the encryption algorithm, + * then the parameter P1 to ECIES as defined in 5.3.5 is the hash of the + * empty string. + * + * @note If the encryption algorithm is SM2, there is no equivalent of the + * parameter P1 and so no input to the encryption process that uses the hash + * of the empty string. + * + * @note The material input to encryption is the bytes of the encryption key + * with no headers, encapsulation, or length indication. Contrast this to + * encryption of data, where the data is encapsulated in an Ieee1609Dot2Data. + */ +RecipientInfo ::= CHOICE { + pskRecipInfo PreSharedKeyRecipientInfo, + symmRecipInfo SymmRecipientInfo, + certRecipInfo PKRecipientInfo, + signedDataRecipInfo PKRecipientInfo, + rekRecipInfo PKRecipientInfo +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfRecipientInfo ::= SEQUENCE OF RecipientInfo + +/** + * @brief This data structure is used to indicate a symmetric key that may + * be used directly to decrypt a SymmetricCiphertext. It consists of the + * low-order 8 bytes of the hash of the COER encoding of a + * SymmetricEncryptionKey structure containing the symmetric key in question. + * The HashedId8 is calculated with the hash algorithm determined as + * specified in 5.3.9.3. The symmetric key may be established by any + * appropriate means agreed by the two parties to the exchange. + */ +PreSharedKeyRecipientInfo ::= HashedId8 + +/** + * @brief This data structure contains the following fields: + * + * @param recipientId: contains the hash of the symmetric key encryption key + * that may be used to decrypt the data encryption key. It consists of the + * low-order 8 bytes of the hash of the COER encoding of a + * SymmetricEncryptionKey structure containing the symmetric key in question. + * The HashedId8 is calculated with the hash algorithm determined as + * specified in 5.3.9.4. The symmetric key may be established by any + * appropriate means agreed by the two parties to the exchange. + * + * @param encKey: contains the encrypted data encryption key within a + * SymmetricCiphertext, where the data encryption key is input to the data + * encryption key encryption process with no headers, encapsulation, or + * length indication. + */ +SymmRecipientInfo ::= SEQUENCE { + recipientId HashedId8, + encKey SymmetricCiphertext +} + +/** + * @brief This data structure contains the following fields: + * + * @param recipientId: contains the hash of the container for the encryption + * public key as specified in the definition of RecipientInfo. Specifically, + * depending on the choice indicated by the containing RecipientInfo structure: + * - If the containing RecipientInfo structure indicates certRecipInfo, + * this field contains the HashedId8 of the certificate. The HashedId8 is + * calculated with the whole-certificate hash algorithm, determined as + * described in 6.4.3, applied to the COER-encoded certificate, canonicalized + * as defined in the definition of Certificate. + * - If the containing RecipientInfo structure indicates + * signedDataRecipInfo, this field contains the HashedId8 of the + * Ieee1609Dot2Data of type signedData that contained the encryption key, + * with that Ieee¬¬1609¬Dot2¬¬Data canonicalized per 6.3.4. The HashedId8 is + * calculated with the hash algorithm determined as specified in 5.3.9.5. + * - If the containing RecipientInfo structure indicates rekRecipInfo, this + * field contains the HashedId8 of the COER encoding of a PublicEncryptionKey + * structure containing the response encryption key. The HashedId8 is + * calculated with the hash algorithm determined as specified in 5.3.9.5. + * + * @param encKey: contains the encrypted data encryption key, where the data + * encryption key is input to the data encryption key encryption process with + * no headers, encapsulation, or length indication. + */ +PKRecipientInfo ::= SEQUENCE { + recipientId HashedId8, + encKey EncryptedDataEncryptionKey +} + +/** + * @brief This data structure contains an encrypted data encryption key, + * where the data encryption key is input to the data encryption key + * encryption process with no headers, encapsulation, or length indication. + * + * Critical information fields: If present and applicable to + * the receiving SDEE, this is a critical information field as defined in + * 5.2.6. If an implementation receives an encrypted SPDU and determines that + * one or more RecipientInfo fields are relevant to it, and if all of those + * RecipientInfos contain an EncryptedDataEncryptionKey such that the + * implementation does not recognize the indicated CHOICE, the implementation + * shall indicate that the encrypted SPDU is not decryptable. + */ +EncryptedDataEncryptionKey ::= CHOICE { + eciesNistP256 EciesP256EncryptedKey, + eciesBrainpoolP256r1 EciesP256EncryptedKey, + ..., + ecencSm2256 EcencP256EncryptedKey +} + +/** + * @brief This data structure encapsulates a ciphertext generated with an + * approved symmetric algorithm. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.6. An implementation that does not + * recognize the indicated CHOICE value for this type in an encrypted SPDU + * shall indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, + * that is, it is invalid in the sense that its validity cannot be established. + */ +SymmetricCiphertext ::= CHOICE { + aes128ccm One28BitCcmCiphertext, + ..., + sm4Ccm One28BitCcmCiphertext +} + +/** + * @brief This data structure encapsulates an encrypted ciphertext for any + * symmetric algorithm with 128-bit blocks in CCM mode. The ciphertext is + * 16 bytes longer than the corresponding plaintext due to the inclusion of + * the message authentication code (MAC). The plaintext resulting from a + * correct decryption of the ciphertext is either a COER-encoded + * Ieee1609Dot2Data structure (see 6.3.41), or a 16-byte symmetric key + * (see 6.3.44). + * + * The ciphertext is 16 bytes longer than the corresponding plaintext. + * + * The plaintext resulting from a correct decryption of the + * ciphertext is a COER-encoded Ieee1609Dot2Data structure. + * + * @param nonce: contains the nonce N as specified in 5.3.8. + * + * @param ccmCiphertext: contains the ciphertext C as specified in 5.3.8. + * + * @note In the name of this structure, "One28" indicates that the + * symmetric cipher block size is 128 bits. It happens to also be the case + * that the keys used for both AES-128-CCM and SM4-CCM are also 128 bits long. + * This is, however, not what “One28” refers to. Since the cipher is used in + * counter mode, i.e., as a stream cipher, the fact that that block size is 128 + * bits affects only the size of the MAC and does not affect the size of the + * raw ciphertext. + */ +One28BitCcmCiphertext ::= SEQUENCE { + nonce OCTET STRING (SIZE (12)), + ccmCiphertext Opaque +} + +/** + * @brief This type is defined only for backwards compatibility. + */ +Aes128CcmCiphertext ::= One28BitCcmCiphertext + +--***************************************************************************-- +-- Certificates and other Security Management -- +--***************************************************************************-- + +/** + * @brief This structure is a profile of the structure CertificateBase which + * specifies the valid combinations of fields to transmit implicit and + * explicit certificates. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the CertificateBase. + */ +Certificate ::= + CertificateBase (ImplicitCertificate | ExplicitCertificate) + +TestCertificate ::= Certificate + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfCertificate ::= SEQUENCE OF Certificate + +/** + * @brief The fields in this structure have the following meaning: + * + * @param version: contains the version of the certificate format. In this + * version of the data structures, this field is set to 3. + * + * @param type: states whether the certificate is implicit or explicit. This + * field is set to explicit for explicit certificates and to implicit for + * implicit certificates. See ExplicitCertificate and ImplicitCertificate for + * more details. + * + * @param issuer: identifies the issuer of the certificate. + * + * @param toBeSigned: is the certificate contents. This field is an input to + * the hash when generating or verifying signatures for an explicit + * certificate, or generating or verifying the public key from the + * reconstruction value for an implicit certificate. The details of how this + * field are encoded are given in the description of the + * ToBeSignedCertificate type. + * + * @param signature: is included in an ExplicitCertificate. It is the + * signature, calculated by the signer identified in the issuer field, over + * the hash of toBeSigned. The hash is calculated as specified in 5.3.1, where: + * - Data input is the encoding of toBeSigned following the COER. + * - Signer identifier input depends on the verification type, which in + * turn depends on the choice indicated by issuer. If the choice indicated by + * issuer is self, the verification type is self-signed and the signer + * identifier input is the empty string. If the choice indicated by issuer is + * not self, the verification type is certificate and the signer identifier + * input is the canonicalized COER encoding of the certificate indicated by + * issuer. The canonicalization is carried out as specified in the + * Canonicalization section of this subclause. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the ToBeSignedCertificate and to the Signature. + * + * @note Whole-certificate hash: If the entirety of a certificate is hashed + * to calculate a HashedId3, HashedId8, or HashedId10, the algorithm used for + * this purpose is known as the whole-certificate hash. The method used to + * determine the whole-certificate hash algorithm is specified in 5.3.9.2. + */ +CertificateBase ::= SEQUENCE { + version Uint8(3), + type CertificateType, + issuer IssuerIdentifier, + toBeSigned ToBeSignedCertificate, + signature Signature OPTIONAL +} + +/** + * @brief This enumerated type indicates whether a certificate is explicit or + * implicit. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.5. An implementation that does not + * recognize the indicated CHOICE for this type when verifying a signed SPDU + * shall indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, + * that is, it is invalid in the sense that its validity cannot be + * established. + */ +CertificateType ::= ENUMERATED { + explicit, + implicit, + ... +} + +/** + * @brief This is a profile of the CertificateBase structure providing all + * the fields necessary for an implicit certificate, and no others. + */ +ImplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., + type(implicit), + toBeSigned(WITH COMPONENTS {..., + verifyKeyIndicator(WITH COMPONENTS {reconstructionValue}) + }), + signature ABSENT +}) + +/** + * @brief This is a profile of the CertificateBase structure providing all + * the fields necessary for an explicit certificate, and no others. + */ +ExplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., + type(explicit), + toBeSigned (WITH COMPONENTS {..., + verifyKeyIndicator(WITH COMPONENTS {verificationKey}) + }), + signature PRESENT +}) + +/** + * @brief This structure allows the recipient of a certificate to determine + * which keying material to use to authenticate the certificate. + * + * If the choice indicated is sha256AndDigest, sha384AndDigest, or + * sm3AndDigest: + * - The structure contains the HashedId8 of the issuing certificate. The + * HashedId8 is calculated with the whole-certificate hash algorithm, + * determined as described in 6.4.3, applied to the COER-encoded certificate, + * canonicalized as defined in the definition of Certificate. + * - The hash algorithm to be used to generate the hash of the certificate + * for verification is SHA-256 (in the case of sha256AndDigest), SM3 (in the + * case of sm3AndDigest) or SHA-384 (in the case of sha384AndDigest). + * - The certificate is to be verified with the public key of the + * indicated issuing certificate. + * + * If the choice indicated is self: + * - The structure indicates what hash algorithm is to be used to generate + * the hash of the certificate for verification. + * - The certificate is to be verified with the public key indicated by + * the verifyKeyIndicator field in theToBeSignedCertificate. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.5. An implementation that does not + * recognize the indicated CHOICE for this type when verifying a signed SPDU + * shall indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, + * that is, it is invalid in the sense that its validity cannot be + * established. + */ +IssuerIdentifier ::= CHOICE { + sha256AndDigest HashedId8, + self HashAlgorithm, + ..., + sha384AndDigest HashedId8, + sm3AndDigest HashedId8 +} + +/** + * @brief The fields in the ToBeSignedCertificate structure have the + * following meaning: + * + * For both implicit and explicit certificates, when the certificate + * is hashed to create or recover the public key (in the case of an implicit + * certificate) or to generate or verify the signature (in the case of an + * explicit certificate), the hash is Hash (Data input) || Hash ( + * Signer identifier input), where: + * - Data input is the COER encoding of toBeSigned, canonicalized + * as described above. + * - Signer identifier input depends on the verification type, + * which in turn depends on the choice indicated by issuer. If the choice + * indicated by issuer is self, the verification type is self-signed and the + * signer identifier input is the empty string. If the choice indicated by + * issuer is not self, the verification type is certificate and the signer + * identifier input is the COER encoding of the canonicalization per 6.4.3 of + * the certificate indicated by issuer. + * + * In other words, for implicit certificates, the value H (CertU) in SEC 4, + * section 3, is for purposes of this standard taken to be H [H + * (canonicalized ToBeSignedCertificate from the subordinate certificate) || + * H (entirety of issuer Certificate)]. See 5.3.2 for further discussion, + * including material differences between this standard and SEC 4 regarding + * how the hash function output is converted from a bit string to an integer. + * + * @param id: contains information that is used to identify the certificate + * holder if necessary. + * + * @param cracaId: identifies the Certificate Revocation Authorization CA + * (CRACA) responsible for certificate revocation lists (CRLs) on which this + * certificate might appear. Use of the cracaId is specified in 5.1.3. The + * HashedId3 is calculated with the whole-certificate hash algorithm, + * determined as described in 6.4.3, applied to the COER-encoded certificate, + * canonicalized as defined in the definition of Certificate. + * + * @param crlSeries: represents the CRL series relevant to a particular + * Certificate Revocation Authorization CA (CRACA) on which the certificate + * might appear. Use of this field is specified in 5.1.3. + * + * @param validityPeriod: contains the validity period of the certificate. + * + * @param region: if present, indicates the validity region of the + * certificate. If it is omitted the validity region is indicated as follows: + * - If enclosing certificate is self-signed, i.e., the choice indicated + * by the issuer field in the enclosing certificate structure is self, the + * certificate is valid worldwide. + * - Otherwise, the certificate has the same validity region as the + * certificate that issued it. + * + * @param assuranceLevel: indicates the assurance level of the certificate + * holder. + * + * @param appPermissions: indicates the permissions that the certificate + * holder has to sign application data with this certificate. A valid + * instance of appPermissions contains any particular Psid value in at most + * one entry. + * + * @param certIssuePermissions: indicates the permissions that the certificate + * holder has to sign certificates with this certificate. A valid instance of + * this array contains no more than one entry whose psidSspRange field + * indicates all. If the array has multiple entries and one entry has its + * psidSspRange field indicate all, then the entry indicating all specifies + * the permissions for all PSIDs other than the ones explicitly specified in + * the other entries. See the description of PsidGroupPermissions for further + * discussion. + * + * @param certRequestPermissions: indicates the permissions that the + * certificate holder can request in its certificate. A valid instance of this + * array contains no more than one entry whose psidSspRange field indicates + * all. If the array has multiple entries and one entry has its psidSspRange + * field indicate all, then the entry indicating all specifies the permissions + * for all PSIDs other than the ones explicitly specified in the other entries. + * See the description of PsidGroupPermissions for further discussion. + * + * @param canRequestRollover: indicates that the certificate may be used to + * sign a request for another certificate with the same permissions. This + * field is provided for future use and its use is not defined in this + * version of this standard. + * + * @param encryptionKey: contains a public key for encryption for which the + * certificate holder holds the corresponding private key. + * + * @param verifyKeyIndicator: contains material that may be used to recover + * the public key that may be used to verify data signed by this certificate. + * + * @param flags: indicates additional yes/no properties of the certificate + * holder. The only bit with defined semantics in this string in this version + * of this standard is usesCubk. If set, the usesCubk bit indicates that the + * certificate holder supports the compact unified butterfly key response. + * Further material about the compact unified butterfly key response can be + * found in IEEE Std 1609.2.1. + * + * @note usesCubk is only relevant for CA certificates, and the only + * functionality defined associated with this field is associated with + * consistency checks on received certificate responses. No functionality + * associated with communications between peer SDEEs is defined associated + * with this field. + * + * @param appExtensions: indicates additional permissions that may be applied + * to application activities that the certificate holder is carrying out. + * + * @param certIssueExtensions: indicates additional permissions to issue + * certificates containing endEntityExtensions. + * + * @param certRequestExtensions: indicates additional permissions to request + * certificates containing endEntityExtensions. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the PublicEncryptionKey and to the VerificationKeyIndicator. + * + * If the PublicEncryptionKey contains a BasePublicEncryptionKey that is an + * elliptic curve point (i.e., of type EccP256CurvePoint or EccP384CurvePoint), + * then the elliptic curve point is encoded in compressed form, i.e., such + * that the choice indicated within the Ecc*CurvePoint is compressed-y-0 or + * compressed-y-1. + * + * @note Critical information fields: + * - If present, appPermissions is a critical information field as defined + * in 5.2.6. If an implementation of verification does not support the number + * of PsidSsp in the appPermissions field of a certificate that signed a + * signed SPDU, that implementation shall indicate that the signed SPDU is + * invalid in the sense of 4.2.2.3.2, that is, it is invalid in the sense + * that its validity cannot be established.. A conformant implementation + * shall support appPermissions fields containing at least eight entries. + * It may be the case that an implementation of verification does not support + * the number of entries in the appPermissions field and the appPermissions + * field is not relevant to the verification: this will occur, for example, + * if the certificate in question is a CA certificate and so the + * certIssuePermissions field is relevant to the verification and the + * appPermissions field is not. In this case, whether the implementation + * indicates that the signed SPDU is valid (because it could validate all + * relevant fields) or invalid (because it could not parse the entire + * certificate) is implementation-specific. + * - If present, certIssuePermissions is a critical information field as + * defined in 5.2.6. If an implementation of verification does not support + * the number of PsidGroupPermissions in the certIssuePermissions field of a + * CA certificate in the chain of a signed SPDU, the implementation shall + * indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, that + * is, it is invalid in the sense that its validity cannot be established. + * A conformant implementation shall support certIssuePermissions fields + * containing at least eight entries. + * It may be the case that an implementation of verification does not support + * the number of entries in the certIssuePermissions field and the + * certIssuePermissions field is not relevant to the verification: this will + * occur, for example, if the certificate in question is the signing + * certificate for the SPDU and so the appPermissions field is relevant to + * the verification and the certIssuePermissions field is not. In this case, + * whether the implementation indicates that the signed SPDU is valid + * (because it could validate all relevant fields) or invalid (because it + * could not parse the entire certificate) is implementation-specific. + * - If present, certRequestPermissions is a critical information field as + * defined in 5.2.6. If an implementaiton of verification of a certificate + * request does not support the number of PsidGroupPermissions in + * certRequestPermissions, the implementation shall indicate that the signed + * SPDU is invalid in the sense of 4.2.2.3.2, that is, it is invalid in the + * sense that its validity cannot be established. A conformant implementation + * shall support certRequestPermissions fields containing at least eight + * entries. + * It may be the case that an implementation of verification does not support + * the number of entries in the certRequestPermissions field and the + * certRequestPermissions field is not relevant to the verification: this will + * occur, for example, if the certificate in question is the signing + * certificate for the SPDU and so the appPermissions field is relevant to + * the verification and the certRequestPermissions field is not. In this + * case, whether the implementation indicates that the signed SPDU is valid + * (because it could validate all relevant fields) or invalid (because it + * could not parse the entire certificate) is implementation-specific. + */ +ToBeSignedCertificate ::= SEQUENCE { + id CertificateId, + cracaId HashedId3, + crlSeries CrlSeries, + validityPeriod ValidityPeriod, + region GeographicRegion OPTIONAL, + assuranceLevel SubjectAssurance OPTIONAL, + appPermissions SequenceOfPsidSsp OPTIONAL, + certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, + certRequestPermissions SequenceOfPsidGroupPermissions OPTIONAL, + canRequestRollover NULL OPTIONAL, + encryptionKey PublicEncryptionKey OPTIONAL, + verifyKeyIndicator VerificationKeyIndicator, + ..., + flags BIT STRING {usesCubk (0)} (SIZE (8)) OPTIONAL, + appExtensions SequenceOfAppExtensions, + certIssueExtensions SequenceOfCertIssueExtensions, + certRequestExtension SequenceOfCertRequestExtensions +} +(WITH COMPONENTS { ..., appPermissions PRESENT} | + WITH COMPONENTS { ..., certIssuePermissions PRESENT} | + WITH COMPONENTS { ..., certRequestPermissions PRESENT}) + +/** + * @brief This structure contains information that is used to identify the + * certificate holder if necessary. + * + * @param linkageData: is used to identify the certificate for revocation + * purposes in the case of certificates that appear on linked certificate + * CRLs. See 5.1.3 and 7.3 for further discussion. + * + * @param name: is used to identify the certificate holder in the case of + * non-anonymous certificates. The contents of this field are a matter of + * policy and are expected to be human-readable. + * + * @param binaryId: supports identifiers that are not human-readable. + * + * @param none: indicates that the certificate does not include an identifier. + * + * @note Critical information fields: + * - If present, this is a critical information field as defined in 5.2.6. + * An implementation that does not recognize the choice indicated in this + * field shall reject a signed SPDU as invalid. + */ +CertificateId ::= CHOICE { + linkageData LinkageData, + name Hostname, + binaryId OCTET STRING(SIZE(1..64)), + none NULL, + ... +} + +/** + * @brief This structure contains information that is matched against + * information obtained from a linkage ID-based CRL to determine whether the + * containing certificate has been revoked. See 5.1.3.4 and 7.3 for details + * of use. + */ +LinkageData ::= SEQUENCE { + iCert IValue, + linkage-value LinkageValue, + group-linkage-value GroupLinkageValue OPTIONAL +} + +/** + * @brief This type indicates which type of permissions may appear in + * end-entity certificates the chain of whose permissions passes through the + * PsidGroupPermissions field containing this value. If app is indicated, the + * end-entity certificate may contain an appPermissions field. If enroll is + * indicated, the end-entity certificate may contain a certRequestPermissions + * field. + */ +EndEntityType ::= + BIT STRING {app (0), enrol (1) } (SIZE (8)) (ALL EXCEPT {}) + +/** + * @brief This structure states the permissions that a certificate holder has + * with respect to issuing and requesting certificates for a particular set + * of PSIDs. For examples, see D.5.3 and D.5.4. + * + * @param subjectPermissions: indicates PSIDs and SSP Ranges covered by this + * field. + * + * @param minChainLength: and chainLengthRange indicate how long the + * certificate chain from this certificate to the end-entity certificate is + * permitted to be. As specified in 5.1.2.1, the length of the certificate + * chain is the number of certificates "below" this certificate in the chain, + * down to and including the end-entity certificate. The length is permitted + * to be (a) greater than or equal to minChainLength certificates and (b) + * less than or equal to minChainLength + chainLengthRange certificates. A + * value of 0 for minChainLength is not permitted when this type appears in + * the certIssuePermissions field of a ToBeSignedCertificate; a certificate + * that has a value of 0 for this field is invalid. The value -1 for + * chainLengthRange is a special case: if the value of chainLengthRange is -1 + * it indicates that the certificate chain may be any length equal to or + * greater than minChainLength. See the examples below for further discussion. + * + * @param eeType: takes one or more of the values app and enroll and indicates + * the type of certificates or requests that this instance of + * PsidGroupPermissions in the certificate is entitled to authorize. + * Different instances of PsidGroupPermissions within a ToBeSignedCertificate + * may have different values for eeType. + * - If this field indicates app, the chain is allowed to end in an + * authorization certificate, i.e., a certficate in which these permissions + * appear in an appPermissions field (in other words, if the field does not + * indicate app and the chain ends in an authorization certificate, the + * chain shall be considered invalid). + * - If this field indicates enroll, the chain is allowed to end in an + * enrollment certificate, i.e., a certificate in which these permissions + * appear in a certReqPermissions permissions field (in other words, if the + * field does not indicate enroll and the chain ends in an enrollment + * certificate, the chain shall be considered invalid). + */ +PsidGroupPermissions ::= SEQUENCE { + subjectPermissions SubjectPermissions, + minChainLength INTEGER DEFAULT 1, + chainLengthRange INTEGER DEFAULT 0, + eeType EndEntityType DEFAULT {app} +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfPsidGroupPermissions ::= SEQUENCE OF PsidGroupPermissions + +/** + * @brief This indicates the PSIDs and associated SSPs for which certificate + * issuance or request permissions are granted by a PsidGroupPermissions + * structure. If this takes the value explicit, the enclosing + * PsidGroupPermissions structure grants certificate issuance or request + * permissions for the indicated PSIDs and SSP Ranges. If this takes the + * value all, the enclosing PsidGroupPermissions structure grants certificate + * issuance or request permissions for all PSIDs not indicated by other + * PsidGroupPermissions in the same certIssuePermissions or + * certRequestPermissions field. + * + * @note Critical information fields: + * - If present, this is a critical information field as defined in 5.2.6. + * An implementation that does not recognize the indicated CHOICE when + * verifying a signed SPDU shall indicate that the signed SPDU is + * invalidin the sense of 4.2.2.3.2, that is, it is invalid in the sense that + * its validity cannot be established. + * - If present, explicit is a critical information field as defined in + * 5.2.6. An implementation that does not support the number of PsidSspRange + * in explicit when verifying a signed SPDU shall indicate that the signed + * SPDU is invalid in the sense of 4.2.2.3.2, that is, it is invalid in the + * sense that its validity cannot be established. A conformant implementation + * shall support explicit fields containing at least eight entries. + */ +SubjectPermissions ::= CHOICE { + explicit SequenceOfPsidSspRange, + all NULL, + ... +} + +/** + * @brief The contents of this field depend on whether the certificate is an + * implicit or an explicit certificate. + * + * @param verificationKey: is included in explicit certificates. It contains + * the public key to be used to verify signatures generated by the holder of + * the Certificate. + * + * @param reconstructionValue: is included in implicit certificates. It + * contains the reconstruction value, which is used to recover the public key + * as specified in SEC 4 and 5.3.2. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.5. An implementation that does not + * recognize the indicated CHOICE for this type when verifying a signed SPDU + * shall indicate that the signed SPDU is invalid indicate that the signed + * SPDU is invalid in the sense of 4.2.2.3.2, that is, it is invalid in the + * sense that its validity cannot be established. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the PublicVerificationKey and to the EccP256CurvePoint. The + * EccP256CurvePoint is encoded in compressed form, i.e., such that the + * choice indicated within the EccP256CurvePoint is compressed-y-0 or + * compressed-y-1. + */ +VerificationKeyIndicator ::= CHOICE { + verificationKey PublicVerificationKey, + reconstructionValue ReconstructionValue, + ... +} + +ReconstructionValue ::= EccP256CurvePoint + +/** + * @brief This structure uses the parameterized type Extension to define an + * Ieee1609ContributedHeaderInfoExtension as an open Extension Content field + * identified by an extension identifier. The extension identifier value is + * unique to extensions defined by ETSI and need not be unique among all + * extension identifier values defined by all contributing organizations. + */ +Ieee1609ContributedHeaderInfoExtension ::= + Extension{{Ieee1609HeaderInfoExtensions}} + +/** + * @brief This is an integer used to identify an + * Ieee1609ContributedHeaderInfoExtension. + */ +Ieee1609HeaderInfoExtensionId ::= ExtId + +p2pcd8ByteLearningRequestId Ieee1609HeaderInfoExtensionId ::= 1 + +/** + * @brief This is the ASN.1 Information Object Class that associates IEEE + * 1609 HeaderInfo contributed extensions with the appropriate + * Ieee1609HeaderInfoExtensionId value. + */ +Ieee1609HeaderInfoExtensions EXT-TYPE ::= { + {HashedId8 IDENTIFIED BY p2pcd8ByteLearningRequestId}, + ... +} + +/** + * @brief This structure contains any AppExtensions that apply to the + * certificate holder. As specified in 5.2.4.2.3, each individual + * AppExtension type is associated with consistency conditions, specific to + * that extension, that govern its consistency with SPDUs signed by the + * certificate holder and with the CertIssueExtensions in the CA certificates + * in that certificate holder’s chain. Those consistency conditions are + * specified for each individual AppExtension below. + */ +SequenceOfAppExtensions ::= SEQUENCE (SIZE(1..MAX)) OF AppExtension + +/** + * @brief This structure contains an individual AppExtension. AppExtensions + * specified in this standard are drawn from the ASN.1 Information Object Set + * SetCertExtensions. This set, and its use in the AppExtension type, is + * structured so that each AppExtension is associated with a + * CertIssueExtension and a CertRequestExtension and all are identified by + * the same id value. In this structure: + * + * @param id: identifies the extension type. + * + * @param content: provides the content of the extension. + */ +AppExtension ::= SEQUENCE { + id CERT-EXT-TYPE.&id({SetCertExtensions}), + content CERT-EXT-TYPE.&App({SetCertExtensions}{@.id}) +} + +/** + * @brief This field contains any CertIssueExtensions that apply to the + * certificate holder. As specified in 5.2.4.2.3, each individual + * CertIssueExtension type is associated with consistency conditions, + * specific to that extension, that govern its consistency with + * AppExtensions in certificates issued by the certificate holder and with + * the CertIssueExtensions in the CA certificates in that certificate + * holder’s chain. Those consistency conditions are specified for each + * individual CertIssueExtension below. + */ +SequenceOfCertIssueExtensions ::= + SEQUENCE (SIZE(1..MAX)) OF CertIssueExtension + +/** + * @brief This field contains an individual CertIssueExtension. + * CertIssueExtensions specified in this standard are drawn from the ASN.1 + * Information Object Set SetCertExtensions. This set, and its use in the + * CertIssueExtension type, is structured so that each CertIssueExtension + * is associated with a AppExtension and a CertRequestExtension and all are + * identified by the same id value. In this structure: + * + * @param id: identifies the extension type. + * + * @param permissions: indicates the permissions. Within this field. + * - all indicates that the certificate is entitled to issue all values of + * the extension. + * - specific is used to specify which values of the extension may be + * issued in the case where all does not apply. + */ +CertIssueExtension ::= SEQUENCE { + id CERT-EXT-TYPE.&id({SetCertExtensions}), + permissions CHOICE { + specific CERT-EXT-TYPE.&Issue({SetCertExtensions}{@.id}), + all NULL + } +} + +/** + * @brief This field contains any CertRequestExtensions that apply to the + * certificate holder. As specified in 5.2.4.2.3, each individual + * CertRequestExtension type is associated with consistency conditions, + * specific to that extension, that govern its consistency with + * AppExtensions in certificates issued by the certificate holder and with + * the CertRequestExtensions in the CA certificates in that certificate + * holder’s chain. Those consistency conditions are specified for each + * individual CertRequestExtension below. + */ +SequenceOfCertRequestExtensions ::= SEQUENCE (SIZE(1..MAX)) OF CertRequestExtension + +/** + * @brief This field contains an individual CertRequestExtension. + * CertRequestExtensions specified in this standard are drawn from the + * ASN.1 Information Object Set SetCertExtensions. This set, and its use in + * the CertRequestExtension type, is structured so that each + * CertRequestExtension is associated with a AppExtension and a + * CertRequestExtension and all are identified by the same id value. In this + * structure: + * + * @param id: identifies the extension type. + * + * @param permissions: indicates the permissions. Within this field. + * - all indicates that the certificate is entitled to issue all values of + * the extension. + * - specific is used to specify which values of the extension may be + * issued in the case where all does not apply. + */ +CertRequestExtension ::= SEQUENCE { + id CERT-EXT-TYPE.&id({SetCertExtensions}), + permissions CHOICE { + content CERT-EXT-TYPE.&Req({SetCertExtensions}{@.id}), + all NULL + } +} + +/** + * @brief This type is the AppExtension used to identify an operating + * organization. The associated CertIssueExtension and CertRequestExtension + * are both of type OperatingOrganizationId. + * To determine consistency between this type and an SPDU, the SDEE + * specification for that SPDU is required to specify how the SPDU can be + * used to determine an OBJECT IDENTIFIER (for example, by including the + * full OBJECT IDENTIFIER in the SPDU, or by including a RELATIVE-OID with + * clear instructions about how a full OBJECT IDENTIFIER can be obtained from + * the RELATIVE-OID). The SPDU is then consistent with this type if the + * OBJECT IDENTIFIER determined from the SPDU is identical to the OBJECT + * IDENTIFIER contained in this field. + * This AppExtension does not have consistency conditions with a + * corresponding CertIssueExtension. It can appear in a certificate issued + * by any CA. + */ +OperatingOrganizationId ::= OBJECT IDENTIFIER + +certExtId-OperatingOrganization ExtId ::= 1 + +/** + * @brief This Information Object is an instance of the Information Object + * Class CERT-EXT-TYPE. It is defined to bind together the AppExtension, + * CertIssueExtension, and CertRequestExtension types associated with the + * use of an operating organization identifier, and to assocaute them all + * with the extension identifier value certExtId-OperatingOrganization. + */ +instanceOperatingOrganizationCertExtensions CERT-EXT-TYPE ::= { + ID certExtId-OperatingOrganization + APP OperatingOrganizationId + ISSUE NULL + REQUEST NULL +} + +/** + * @brief This Information Object Set is a collection of Information Objects + * used to contain the AppExtension, CertIssueExtension, and + * CertRequestExtension types associated with a specific use of certificate + * extensions. In this version of this standard it only has a single entry + * instanceOperatingOrganizationCertExtensions. + */ +SetCertExtensions CERT-EXT-TYPE ::= { + instanceOperatingOrganizationCertExtensions, + ... +} + +END diff --git a/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2BaseTypes.asn b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2BaseTypes.asn new file mode 100644 index 0000000..4fac05e --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2BaseTypes.asn @@ -0,0 +1,1413 @@ +--***************************************************************************-- +-- IEEE Std 1609.2: Base Data Types -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-4(4)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +--***************************************************************************-- +-- Integer Types -- +--***************************************************************************-- + +/** + * @brief This atomic type is used in the definition of other data structures. + * It is for non-negative integers up to 7, i.e., (hex)07. + */ +Uint3 ::= INTEGER (0..7) + +/** + * @brief This atomic type is used in the definition of other data structures. + * It is for non-negative integers up to 255, i.e., (hex)ff. + */ +Uint8 ::= INTEGER (0..255) + +/** + * @brief This atomic type is used in the definition of other data structures. + * It is for non-negative integers up to 65,535, i.e., (hex)ff ff. + */ +Uint16 ::= INTEGER (0..65535) + +/** + * @brief This atomic type is used in the definition of other data structures. + * It is for non-negative integers up to 4,294,967,295, i.e., + * (hex)ff ff ff ff. + */ +Uint32 ::= INTEGER (0..4294967295) + +/** + * @brief This atomic type is used in the definition of other data structures. + * It is for non-negative integers up to 18,446,744,073,709,551,615, i.e., + * (hex)ff ff ff ff ff ff ff ff. + */ +Uint64 ::= INTEGER (0..18446744073709551615) + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfUint8 ::= SEQUENCE OF Uint8 + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfUint16 ::= SEQUENCE OF Uint16 + + +--***************************************************************************-- +-- OCTET STRING Types -- +--***************************************************************************-- + +/** + * @brief This is a synonym for ASN.1 OCTET STRING, and is used in the + * definition of other data structures. + */ +Opaque ::= OCTET STRING + +/** + * @brief This type contains the truncated hash of another data structure. + * The HashedId3 for a given data structure is calculated by calculating the + * hash of the encoded data structure and taking the low-order three bytes of + * the hash output. The low-order three bytes are the last three bytes of the + * 32-byte hash when represented in network byte order. If the data structure + * is subject to canonicalization it is canonicalized before hashing. See + * Example below. + * + * The hash algorithm to be used to calculate a HashedId3 within a + * structure depends on the context. In this standard, for each structure + * that includes a HashedId3 field, the corresponding text indicates how the + * hash algorithm is determined. See also the discussion in 5.3.9. + * + * Example: Consider the SHA-256 hash of the empty string: + * + * SHA-256("") = + * e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + * + * The HashedId3 derived from this hash corresponds to the following: + * + * HashedId3 = 52b855. + */ +HashedId3 ::= OCTET STRING (SIZE(3)) + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfHashedId3 ::= SEQUENCE OF HashedId3 + +/** + * @brief This type contains the truncated hash of another data structure. + * The HashedId8 for a given data structure is calculated by calculating the + * hash of the encoded data structure and taking the low-order eight bytes of + * the hash output. The low-order eight bytes are the last eight bytes of the + * hash when represented in network byte order. If the data structure + * is subject to canonicalization it is canonicalized before hashing. See + * Example below. + * + * The hash algorithm to be used to calculate a HashedId8 within a + * structure depends on the context. In this standard, for each structure + * that includes a HashedId8 field, the corresponding text indicates how the + * hash algorithm is determined. See also the discussion in 5.3.9. + * + * Example: Consider the SHA-256 hash of the empty string: + * + * SHA-256("") = + * e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + * + * The HashedId8 derived from this hash corresponds to the following: + * + * HashedId8 = a495991b7852b855. + */ +HashedId8 ::= OCTET STRING (SIZE(8)) + +/** + * @brief This type contains the truncated hash of another data structure. + * The HashedId10 for a given data structure is calculated by calculating the + * hash of the encoded data structure and taking the low-order ten bytes of + * the hash output. The low-order ten bytes are the last ten bytes of the + * hash when represented in network byte order. If the data structure + * is subject to canonicalization it is canonicalized before hashing. See + * Example below. + * + * The hash algorithm to be used to calculate a HashedId10 within a + * structure depends on the context. In this standard, for each structure + * that includes a HashedId10 field, the corresponding text indicates how the + * hash algorithm is determined. See also the discussion in 5.3.9. + * + * Example: Consider the SHA-256 hash of the empty string: + * + * SHA-256("") = + * e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + * + * The HashedId10 derived from this hash corresponds to the following: + * + * HashedId10 = 934ca495991b7852b855. + */ +HashedId10 ::= OCTET STRING (SIZE(10)) + +/** + * @brief This data structure contains the truncated hash of another data + * structure. The HashedId32 for a given data structure is calculated by + * calculating the hash of the encoded data structure and taking the + * low-order 32 bytes of the hash output. The low-order 32 bytes are the last + * 32 bytes of the hash when represented in network byte order. If the data + * structure is subject to canonicalization it is canonicalized before + * hashing. See Example below. + * + * The hash algorithm to be used to calculate a HashedId32 within a + * structure depends on the context. In this standard, for each structure + * that includes a HashedId32 field, the corresponding text indicates how the + * hash algorithm is determined. See also the discussion in 5.3.9. + * + * Example: Consider the SHA-256 hash of the empty string: + * + * SHA-256("") = + * e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + * + * The HashedId32 derived from this hash corresponds to the following: + * + * HashedId32 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b8 + * 55. + */ +HashedId32 ::= OCTET STRING (SIZE(32)) + +/** + * @brief This data structure contains the truncated hash of another data + * structure. The HashedId48 for a given data structure is calculated by + * calculating the hash of the encoded data structure and taking the + * low-order 48 bytes of the hash output. The low-order 48 bytes are the last + * 48 bytes of the hash when represented in network byte order. If the data + * structure is subject to canonicalization it is canonicalized before + * hashing. See Example below. + * + * The hash algorithm to be used to calculate a HashedId48 within a + * structure depends on the context. In this standard, for each structure + * that includes a HashedId48 field, the corresponding text indicates how the + * hash algorithm is determined. See also the discussion in 5.3.9. + * + * Example: Consider the SHA-384 hash of the empty string: + * + * SHA-384("") = 38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6 + * e1da274edebfe76f65fbd51ad2f14898b95b + * + * The HashedId48 derived from this hash corresponds to the following: + * + * HashedId48 = 38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e + * 1da274edebfe76f65fbd51ad2f14898b95b. + */ +HashedId48 ::= OCTET STRING(SIZE(48)) + + +--***************************************************************************-- +-- Time Structures -- +--***************************************************************************-- + +/** + * @brief This type gives the number of (TAI) seconds since 00:00:00 UTC, 1 + * January, 2004. + */ +Time32 ::= Uint32 + +/** + * @brief This data structure is a 64-bit integer giving an estimate of the + * number of (TAI) microseconds since 00:00:00 UTC, 1 January, 2004. + */ +Time64 ::= Uint64 + +/** + * @brief This type gives the validity period of a certificate. The start of + * the validity period is given by start and the end is given by + * start + duration. + */ +ValidityPeriod ::= SEQUENCE { + start Time32, + duration Duration +} + +/** + * @brief This structure represents the duration of validity of a + * certificate. The Uint16 value is the duration, given in the units denoted + * by the indicated choice. A year is considered to be 31556952 seconds, + * which is the average number of seconds in a year. + * + * @note Years can be mapped more closely to wall-clock days using the hours + * choice for up to 7 years and the sixtyHours choice for up to 448 years. + */ +Duration ::= CHOICE { + microseconds Uint16, + milliseconds Uint16, + seconds Uint16, + minutes Uint16, + hours Uint16, + sixtyHours Uint16, + years Uint16 +} + + +--***************************************************************************-- +-- Location Structures -- +--***************************************************************************-- + +/** + * @brief This structure represents a geographic region of a specified form. + * A certificate is not valid if any part of the region indicated in its + * scope field lies outside the region indicated in the scope of its issuer. + * + * @param circularRegion: contains a single instance of the CircularRegion + * structure. + * + * @param rectangularRegion: is an array of RectangularRegion structures + * containing at least one entry. This field is interpreted as a series of + * rectangles, which may overlap or be disjoint. The permitted region is any + * point within any of the rectangles. + * + * @param polygonalRegion: contains a single instance of the PolygonalRegion + * structure. + * + * @param identifiedRegion: is an array of IdentifiedRegion structures + * containing at least one entry. The permitted region is any point within + * any of the identified regions. + * + * @note Critical information fields: + * - If present, this is a critical information field as defined in 5.2.6. + * An implementation that does not recognize the indicated CHOICE when + * verifying a signed SPDU shall indicate that the signed SPDU is invalid in + * the sense of 4.2.2.3.2, that is, it is invalid in the sense that its + * validity cannot be established. + * - If selected, rectangularRegion is a critical information field as + * defined in 5.2.6. An implementation that does not support the number of + * RectangularRegion in rectangularRegions when verifying a signed SPDU shall + * indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, that + * is, it is invalid in the sense that its validity cannot be established. + * A conformant implementation shall support rectangularRegions fields + * containing at least eight entries. + * - If selected, identifiedRegion is a critical information field as + * defined in 5.2.6. An implementation that does not support the number of + * IdentifiedRegion in identifiedRegion shall reject the signed SPDU as + * invalid in the sense of 4.2.2.3.2, that is, it is invalid in the sense + * that its validity cannot be established. A conformant implementation shall + * support identifiedRegion fields containing at least eight entries. + */ +GeographicRegion ::= CHOICE { + circularRegion CircularRegion, + rectangularRegion SequenceOfRectangularRegion, + polygonalRegion PolygonalRegion, + identifiedRegion SequenceOfIdentifiedRegion, + ... +} + +/** + * @brief This structure specifies a circle with its center at center, its + * radius given in meters, and located tangential to the reference ellipsoid. + * The indicated region is all the points on the surface of the reference + * ellipsoid whose distance to the center point over the reference ellipsoid + * is less than or equal to the radius. A point which contains an elevation + * component is considered to be within the circular region if its horizontal + * projection onto the reference ellipsoid lies within the region. + */ +CircularRegion ::= SEQUENCE { + center TwoDLocation, + radius Uint16 +} + +/** + * @brief This structure specifies a “rectangle” on the surface of the WGS84 ellipsoid where the + * sides are given by lines of constant latitude or longitude. + * A point which contains an elevation component is considered to be within the rectangular region + * if its horizontal projection onto the reference ellipsoid lies within the region. + * A RectangularRegion is invalid if the northWest value is south of the southEast value, or if the + * latitude values in the two points are equal, or if the longitude values in the two points are + * equal; otherwise it is valid. A certificate that contains an invalid RectangularRegion is invalid. + * + * @param northWest: is the north-west corner of the rectangle. + * + * @param southEast is the south-east corner of the rectangle. + */ +RectangularRegion ::= SEQUENCE { + northWest TwoDLocation, + southEast TwoDLocation +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfRectangularRegion ::= SEQUENCE OF RectangularRegion + +/** + * @brief This structure defines a region using a series of distinct + * geographic points, defined on the surface of the reference ellipsoid. The + * region is specified by connecting the points in the order they appear, + * with each pair of points connected by the geodesic on the reference + * ellipsoid. The polygon is completed by connecting the final point to the + * first point. The allowed region is the interior of the polygon and its + * boundary. + * + * A point which contains an elevation component is considered to be + * within the polygonal region if its horizontal projection onto the + * reference ellipsoid lies within the region. + * + * A valid PolygonalRegion contains at least three points. In a valid + * PolygonalRegion, the implied lines that make up the sides of the polygon + * do not intersect. + * + * @note This type does not support enclaves / exclaves. This might be + * addressed in a future version of this standard. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.6. An implementation that does not + * support the number of TwoDLocation in the PolygonalRegion when verifying a + * signed SPDU shall indicate that the signed SPDU is invalid. A compliant + * implementation shall support PolygonalRegions containing at least eight + * TwoDLocation entries. + */ +PolygonalRegion ::= SEQUENCE SIZE (3..MAX) OF TwoDLocation + +/** + * @brief This structure is used to define validity regions for use in + * certificates. The latitude and longitude fields contain the latitude and + * longitude as defined above. + * + * @note This data structure is consistent with the location encoding + * used in SAE J2735, except that values 900 000 001 for latitude (used to + * indicate that the latitude was not available) and 1 800 000 001 for + * longitude (used to indicate that the longitude was not available) are not + * valid. + */ +TwoDLocation ::= SEQUENCE { + latitude Latitude, + longitude Longitude +} + +/** + * @brief This structure indicates the region of validity of a certificate + * using region identifiers. + * A conformant implementation that supports this type shall support at least + * one of the possible CHOICE values. The Protocol Implementation Conformance + * Statement (PICS) provided in Annex A allows an implementation to state + * which CountryOnly values it recognizes. + * + * @param countryOnly: indicates that only a country (or a geographic entity + * included in a country list) is given. + * + * @param countryAndRegions: indicates that one or more top-level regions + * within a country (as defined by the region listing associated with that + * country) is given. + * + * @param countryAndSubregions: indicates that one or more regions smaller + * than the top-level regions within a country (as defined by the region + * listing associated with that country) is given. + * + * Critical information fields: If present, this is a critical + * information field as defined in 5.2.6. An implementation that does not + * recognize the indicated CHOICE when verifying a signed SPDU shall indicate + * that the signed SPDU is invalid in the sense of 4.2.2.3.2, that is, it is + * invalid in the sense that its validity cannot be established. + */ +IdentifiedRegion ::= CHOICE { + countryOnly UnCountryId, + countryAndRegions CountryAndRegions, + countryAndSubregions CountryAndSubregions, + ... +} + + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfIdentifiedRegion ::= SEQUENCE OF IdentifiedRegion + +/** + * @brief This type contains the integer representation of the country or + * area identifier as defined by the United Nations Statistics Division in + * October 2013 (see normative references in Clause 0). + * A conformant implementation that implements IdentifiedRegion shall + * recognize (in the sense of “be able to determine whether a two dimensional + * location lies inside or outside the borders identified by”) at least one + * value of UnCountryId. The Protocol Implementation Conformance Statement + * (PICS) provided in Annex A allows an implementation to state which + * UnCountryId values it recognizes. + * Since 2013 and before the publication of this version of this standard, + * three changes have been made to the country code list, to define the + * region "sub-Saharan Africa" and remove the "developed regions", and + * "developing regions". A conformant implementation may recognize these + * region identifiers in the sense defined in the previous paragraph. + * If a verifying implementation is required to check that relevant + * geographic information in a signed SPDU is consistent with a certificate + * containing one or more instances of this type, then the SDS is permitted + * to indicate that the signed SPDU is valid even if some instances of this + * type are unrecognized in the sense defined above, so long as the + * recognized instances of this type completely contain the relevant + * geographic information. Informally, if the recognized values in the + * certificate allow the SDS to determine that the SPDU is valid, then it + * can make that determination even if there are also unrecognized values in + * the certificate. This field is therefore not a "critical information + * field" as defined in 5.2.6, because unrecognized values are permitted so + * long as the validity of the SPDU can be established with the recognized + * values. However, as discussed in 5.2.6, the presence of an unrecognized + * value in a certificate can make it impossible to determine whether the + * certificate and the SPDU are valid. + */ +UnCountryId ::= Uint16 + +/** + * @brief This type is defined only for backwards compatibility. + */ +CountryOnly ::= UnCountryId + +/** + * @brief A conformant implementation that supports CountryAndRegions shall + * support a regions field containing at least eight entries. + * A conformant implementation that implements this type shall recognize + * (in the sense of "be able to determine whether a two dimensional location + * lies inside or outside the borders identified by") at least one value of + * UnCountryId and at least one value for a region within the country + * indicated by that recognized UnCountryId value. In this version of this + * standard, the only means to satisfy this is for a conformant + * implementation to recognize the value of UnCountryId indicating USA and + * at least one of the FIPS state codes for US states. The Protocol + * Implementation Conformance Statement (PICS) provided in Annex A allows + * an implementation to state which UnCountryId values it recognizes and + * which region values are recognized within that country. + * If a verifying implementation is required to check that an relevant + * geographic information in a signed SPDU is consistent with a certificate + * containing one or more instances of this type, then the SDS is permitted + * to indicate that the signed SPDU is valid even if some values of country + * or within regions are unrecognized in the sense defined above, so long + * as the recognized instances of this type completely contain the relevant + * geographic information. Informally, if the recognized values in the + * certificate allow the SDS to determine that the SPDU is valid, then it + * can make that determination even if there are also unrecognized values + * in the certificate. This field is therefore not a "critical information + * field" as defined in 5.2.6, because unrecognized values are permitted so + * long as the validity of the SPDU can be established with the recognized + * values. However, as discussed in 5.2.6, the presence of an unrecognized + * value in a certificate can make it impossible to determine whether the + * certificate is valid and so whether the SPDU is valid. + * In this type: + * + * @param countryOnly: is a UnCountryId as defined above. + * + * @param regions: identifies one or more regions within the country. If + * country indicates the United States of America, the values in this field + * identify the state or statistically equivalent entity using the integer + * version of the 2010 FIPS codes as provided by the U.S. Census Bureau + * (see normative references in Clause 0). For other values of country, the + * meaning of region is not defined in this version of this standard. + */ +CountryAndRegions ::= SEQUENCE { + countryOnly UnCountryId, + regions SequenceOfUint8 +} + +/** + * @brief A conformant implementation that supports CountryAndSubregions + * shall support a regionAndSubregions field containing at least eight + * entries. + * A conformant implementation that implements this type shall recognize + * (in the sense of “be able to determine whether a two dimensional location + * lies inside or outside the borders identified by”) at least one value of + * country and at least one value for a region within the country indicated + * by that recognized country value. In this version of this standard, the + * only means to satisfy this is for a conformant implementation to recognize + * the value of UnCountryId indicating USA and at least one of the FIPS state + * codes for US states. The Protocol Implementation Conformance Statement + * (PICS) provided in Annex A allows an implementation to state which + * UnCountryId values it recognizes and which region values are recognized + * within that country. + * If a verifying implementation is required to check that an relevant + * geographic information in a signed SPDU is consistent with a certificate + * containing one or more instances of this type, then the SDS is permitted + * to indicate that the signed SPDU is valid even if some values of country + * or within regionAndSubregions are unrecognized in the sense defined above, + * so long as the recognized instances of this type completely contain the + * relevant geographic information. Informally, if the recognized values in + * the certificate allow the SDS to determine that the SPDU is valid, then + * it can make that determination even if there are also unrecognized values + * in the certificate. This field is therefore not a "critical information + * field" as defined in 5.2.6, because unrecognized values are permitted so + * long as the validity of the SPDU can be established with the recognized + * values. However, as discussed in 5.2.6, the presence of an unrecognized + * value in a certificate can make it impossible to determine whether the + * certificate is valid and so whether the SPDU is valid. + * In this structure: + * + * @param countryOnly: is a UnCountryId as defined above. + * + * @param regionAndSubregions: identifies one or more subregions within + * country. + */ +CountryAndSubregions ::= SEQUENCE { + countryOnly UnCountryId, + regionAndSubregions SequenceOfRegionAndSubregions +} + +/** + * @brief The meanings of the fields in this structure are to be interpreted + * in the context of a country within which the region is located, referred + * to as the "enclosing country". If this structure is used in a + * CountryAndSubregions structure, the enclosing country is the one indicated + * by the country field in the CountryAndSubregions structure. If other uses + * are defined for this structure in future, it is expected that that + * definition will include a specification of how the enclosing country can + * be determined. + * If the enclosing country is the United States of America: + * - The region field identifies the state or statistically equivalent + * entity using the integer version of the 2010 FIPS codes as provided by the + * U.S. Census Bureau (see normative references in Clause 0). + * - The values in the subregions field identify the county or county + * equivalent entity using the integer version of the 2010 FIPS codes as + * provided by the U.S. Census Bureau. + * If the enclosing country is a different country from the USA, the meaning + * of regionAndSubregions is not defined in this version of this standard. + * A conformant implementation that implements this type shall recognize (in + * the sense of "be able to determine whether a two-dimensional location lies + * inside or outside the borders identified by"), for at least one enclosing + * country, at least one value for a region within that country and at least + * one subregion for the indicated region. In this version of this standard, + * the only means to satisfy this is for a conformant implementation to + * recognize, for the USA, at least one of the FIPS state codes for US + * states, and at least one of the county codes in at least one of the + * recognized states. The Protocol Implementation Conformance Statement + * (PICS) provided in Annex A allows an implementation to state which + * UnCountryId values it recognizes and which region values are recognized + * within that country. + * If a verifying implementation is required to check that an relevant + * geographic information in a signed SPDU is consistent with a certificate + * containing one or more instances of this type, then the SDS is permitted + * to indicate that the signed SPDU is valid even if some values within + * subregions are unrecognized in the sense defined above, so long as the + * recognized instances of this type completely contain the relevant + * geographic information. Informally, if the recognized values in the + * certificate allow the SDS to determine that the SPDU is valid, then it + * can make that determination even if there are also unrecognized values + * in the certificate. This field is therefore not not a "critical + * information field" as defined in 5.2.6, because unrecognized values are + * permitted so long as the validity of the SPDU can be established with the + * recognized values. However, as discussed in 5.2.6, the presence of an + * unrecognized value in a certificate can make it impossible to determine + * whether the certificate is valid and so whether the SPDU is valid. + * In this structure: + * + * @param region: identifies a region within a country. + * + * @param subregions: identifies one or more subregions within region. A + * conformant implementation that supports RegionAndSubregions shall support + * a subregions field containing at least eight entries. + */ +RegionAndSubregions ::= SEQUENCE { + region Uint8, + subregions SequenceOfUint16 +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfRegionAndSubregions ::= SEQUENCE OF RegionAndSubregions + +/** + * @brief This structure contains an estimate of 3D location. The details of + * the structure are given in the definitions of the individual fields below. + * + * @note The units used in this data structure are consistent with the + * location data structures used in SAE J2735 [B26], though the encoding is + * incompatible. + */ +ThreeDLocation ::= SEQUENCE { + latitude Latitude, + longitude Longitude, + elevation Elevation +} + +/** + * @brief This type contains an INTEGER encoding an estimate of the latitude + * with precision 1/10th microdegree relative to the World Geodetic System + * (WGS)-84 datum as defined in NIMA Technical Report TR8350.2. + * The integer in the latitude field is no more than 900 000 000 and no less + * than ?900 000 000, except that the value 900 000 001 is used to indicate + * the latitude was not available to the sender. + */ +Latitude ::= NinetyDegreeInt + +/** + * @brief This type contains an INTEGER encoding an estimate of the longitude + * with precision 1/10th microdegree relative to the World Geodetic System + * (WGS)-84 datum as defined in NIMA Technical Report TR8350.2. + * The integer in the longitude field is no more than 1 800 000 000 and no + * less than ?1 799 999 999, except that the value 1 800 000 001 is used to + * indicate that the longitude was not available to the sender. + */ +Longitude ::= OneEightyDegreeInt + +/** + * @brief This structure contains an estimate of the geodetic altitude above + * or below the WGS84 ellipsoid. The 16-bit value is interpreted as an + * integer number of decimeters representing the height above a minimum + * height of -409.5 m, with the maximum height being 6143.9 m. + */ +Elevation ::= Uint16 + +/** + * @brief The integer in the latitude field is no more than 900,000,000 and + * no less than -900,000,000, except that the value 900,000,001 is used to + * indicate the latitude was not available to the sender. + */ +NinetyDegreeInt ::= INTEGER { + min (-900000000), + max (900000000), + unknown (900000001) +} (-900000000..900000001) + +/** + * @brief The known latitudes are from -900,000,000 to +900,000,000 in 0.1 + * microdegree intervals. + */ +KnownLatitude ::= NinetyDegreeInt (min..max) + +/** + * @brief The value 900,000,001 indicates that the latitude was not + * available to the sender. + */ +UnknownLatitude ::= NinetyDegreeInt (unknown) + +/** + * @brief The integer in the longitude field is no more than 1,800,000,000 + * and no less than -1,799,999,999, except that the value 1,800,000,001 is + * used to indicate that the longitude was not available to the sender. + */ +OneEightyDegreeInt ::= INTEGER { + min (-1799999999), + max (1800000000), + unknown (1800000001) +} (-1799999999..1800000001) + +/** + * @brief The known longitudes are from -1,799,999,999 to +1,800,000,000 in + * 0.1 microdegree intervals. + */ +KnownLongitude ::= OneEightyDegreeInt (min..max) + +/** + * @brief The value 1,800,000,001 indicates that the longitude was not + * available to the sender. + */ +UnknownLongitude ::= OneEightyDegreeInt (unknown) + + +--***************************************************************************-- +-- Crypto Structures -- +--***************************************************************************-- + +/** + * @brief This structure represents a signature for a supported public key + * algorithm. It may be contained within SignedData or Certificate. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.5. An implementation that does not + * recognize the indicated CHOICE for this type when verifying a signed SPDU + * shall indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, + * that is, it is invalid in the sense that its validity cannot be + * established. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to instances of this data structure of form EcdsaP256Signature + * and EcdsaP384Signature. + */ +Signature ::= CHOICE { + ecdsaNistP256Signature EcdsaP256Signature, + ecdsaBrainpoolP256r1Signature EcdsaP256Signature, + ..., + ecdsaBrainpoolP384r1Signature EcdsaP384Signature, + ecdsaNistP384Signature EcdsaP384Signature, + sm2Signature EcsigP256Signature +} + +/** + * @brief This structure represents an ECDSA signature. The signature is + * generated as specified in 5.3.1. + * + * If the signature process followed the specification of FIPS 186-4 + * and output the integer r, r is represented as an EccP256CurvePoint + * indicating the selection x-only. + * + * If the signature process followed the specification of SEC 1 and + * output the elliptic curve point R to allow for fast verification, R is + * represented as an EccP256CurvePoint indicating the choice compressed-y-0, + * compressed-y-1, or uncompressed at the sender's discretion. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. When this data structure + * is canonicalized, the EccP256CurvePoint in rSig is represented in the + * form x-only. + * + * @note When the signature is of form x-only, the x-value in rSig is + * an integer mod n, the order of the group; when the signature is of form + * compressed-y-\*, the x-value in rSig is an integer mod p, the underlying + * prime defining the finite field. In principle this means that to convert a + * signature from form compressed-y-\* to form x-only, the converter checks + * the x-value to see if it lies between n and p and reduces it mod n if so. + * In practice this check is unnecessary: Haase's Theorem states that + * difference between n and p is always less than 2*square-root(p), and so the + * chance that an integer lies between n and p, for a 256-bit curve, is + * bounded above by approximately square-root(p)/p or 2^(-128). For the + * 256-bit curves in this standard, the exact values of n and p in hexadecimal + * are: + * + * NISTp256: + * - p = FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF + * - n = FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 + * + * Brainpoolp256: + * - p = A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377 + * - n = A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7 + */ +EcdsaP256Signature ::= SEQUENCE { + rSig EccP256CurvePoint, + sSig OCTET STRING (SIZE (32)) +} + +/** + * @brief This structure represents an ECDSA signature. The signature is + * generated as specified in 5.3.1. + * + * If the signature process followed the specification of FIPS 186-4 + * and output the integer r, r is represented as an EccP384CurvePoint + * indicating the selection x-only. + * + * If the signature process followed the specification of SEC 1 and + * output the elliptic curve point R to allow for fast verification, R is + * represented as an EccP384CurvePoint indicating the choice compressed-y-0, + * compressed-y-1, or uncompressed at the sender's discretion. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. When this data structure + * is canonicalized, the EccP384CurvePoint in rSig is represented in the + * form x-only. + * + * @note When the signature is of form x-only, the x-value in rSig is + * an integer mod n, the order of the group; when the signature is of form + * compressed-y-\*, the x-value in rSig is an integer mod p, the underlying + * prime defining the finite field. In principle this means that to convert a + * signature from form compressed-y-* to form x-only, the converter checks the + * x-value to see if it lies between n and p and reduces it mod n if so. In + * practice this check is unnecessary: Haase's Theorem states that difference + * between n and p is always less than 2*square-root(p), and so the chance + * that an integer lies between n and p, for a 384-bit curve, is bounded + * above by approximately square-root(p)/p or 2^(-192). For the 384-bit curve + * in this standard, the exact values of n and p in hexadecimal are: + * - p = 8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123 + * ACD3A729901D1A71874700133107EC53 + * - n = 8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7 + * CF3AB6AF6B7FC3103B883202E9046565 + */ +EcdsaP384Signature ::= SEQUENCE { + rSig EccP384CurvePoint, + sSig OCTET STRING (SIZE (48)) +} + +/** + * @brief This structure represents a elliptic curve signature where the + * component r is constrained to be an integer. This structure supports SM2 + * signatures as specified in 5.3.1.3. + */ +EcsigP256Signature ::= SEQUENCE { + rSig OCTET STRING (SIZE (32)), + sSig OCTET STRING (SIZE (32)) +} + +/** + * @brief This structure specifies a point on an elliptic curve in Weierstrass + * form defined over a 256-bit prime number. The curves supported in this + * standard are NIST p256 as defined in FIPS 186-4, Brainpool p256r1 as + * defined in RFC 5639, and the SM2 curve as defined in GB/T 32918.5-2017. + * The fields in this structure are OCTET STRINGS produced with the elliptic + * curve point encoding and decoding methods defined in subclause 5.5.6 of + * IEEE Std 1363-2000. The x-coordinate is encoded as an unsigned integer of + * length 32 octets in network byte order for all values of the CHOICE; the + * encoding of the y-coordinate y depends on whether the point is x-only, + * compressed, or uncompressed. If the point is x-only, y is omitted. If the + * point is compressed, the value of type depends on the least significant + * bit of y: if the least significant bit of y is 0, type takes the value + * compressed-y-0, and if the least significant bit of y is 1, type takes the + * value compressed-y-1. If the point is uncompressed, y is encoded explicitly + * as an unsigned integer of length 32 octets in network byte order. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2 if it appears in a + * HeaderInfo or in a ToBeSignedCertificate. See the definitions of HeaderInfo + * and ToBeSignedCertificate for a specification of the canonicalization + * operations. + */ +EccP256CurvePoint::= CHOICE { + x-only OCTET STRING (SIZE (32)), + fill NULL, + compressed-y-0 OCTET STRING (SIZE (32)), + compressed-y-1 OCTET STRING (SIZE (32)), + uncompressedP256 SEQUENCE { + x OCTET STRING (SIZE (32)), + y OCTET STRING (SIZE (32)) + } +} + +/** + * @brief This structure specifies a point on an elliptic curve in + * Weierstrass form defined over a 384-bit prime number. The only supported + * such curve in this standard is Brainpool p384r1 as defined in RFC 5639. + * The fields in this structure are octet strings produced with the elliptic + * curve point encoding and decoding methods defined in subclause 5.5.6 of + * IEEE Std 1363-2000. The x-coordinate is encoded as an unsigned integer of + * length 48 octets in network byte order for all values of the CHOICE; the + * encoding of the y-coordinate y depends on whether the point is x-only, + * compressed, or uncompressed. If the point is x-only, y is omitted. If the + * point is compressed, the value of type depends on the least significant + * bit of y: if the least significant bit of y is 0, type takes the value + * compressed-y-0, and if the least significant bit of y is 1, type takes the + * value compressed-y-1. If the point is uncompressed, y is encoded + * explicitly as an unsigned integer of length 48 octets in network byte order. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2 if it appears in a + * HeaderInfo or in a ToBeSignedCertificate. See the definitions of HeaderInfo + * and ToBeSignedCertificate for a specification of the canonicalization + * operations. + */ +EccP384CurvePoint::= CHOICE { + x-only OCTET STRING (SIZE (48)), + fill NULL, + compressed-y-0 OCTET STRING (SIZE (48)), + compressed-y-1 OCTET STRING (SIZE (48)), + uncompressedP384 SEQUENCE { + x OCTET STRING (SIZE (48)), + y OCTET STRING (SIZE (48)) + } +} + +/** + * @brief This enumerated value indicates supported symmetric algorithms. The + * algorithm identifier identifies both the algorithm itself and a specific + * mode of operation. The symmetric algorithms supported in this version of + * this standard are AES-128 and SM4. The only mode of operation supported is + * Counter Mode Encryption With Cipher Block Chaining Message Authentication + * Code (CCM). Full details are given in 5.3.8. + */ +SymmAlgorithm ::= ENUMERATED { + aes128Ccm, + ..., + sm4Ccm +} + +/** + * @brief This structure identifies a hash algorithm. The value sha256, + * indicates SHA-256. The value sha384 indicates SHA-384. The value sm3 + * indicates SM3. See 5.3.3 for more details. + * + * @note Critical information fields: This is a critical information field as + * defined in 5.2.6. An implementation that does not recognize the enumerated + * value of this type in a signed SPDU when verifying a signed SPDU shall + * indicate that the signed SPDU is invalid in the sense of 4.2.2.3.2, that + * is, it is invalid in the sense that its validity cannot be established. + */ +HashAlgorithm ::= ENUMERATED { + sha256, + ..., + sha384, + sm3 +} + +/** + * @brief This data structure is used to transfer a 16-byte symmetric key + * encrypted using ECIES as specified in IEEE Std 1363a-2004. The symmetric + * key is input to the key encryption process with no headers, encapsulation, + * or length indication. Encryption and decryption are carried out as + * specified in 5.3.5.1. + * + * @param v: is the sender's ephemeral public key, which is the output V from + * encryption as specified in 5.3.5.1. + * + * @param c: is the encrypted symmetric key, which is the output C from + * encryption as specified in 5.3.5.1. The algorithm for the symmetric key + * is identified by the CHOICE indicated in the following SymmetricCiphertext. + * For ECIES this shall be AES-128. + * + * @param t: is the authentication tag, which is the output tag from + * encryption as specified in 5.3.5.1. + */ +EciesP256EncryptedKey ::= SEQUENCE { + v EccP256CurvePoint, + c OCTET STRING (SIZE (16)), + t OCTET STRING (SIZE (16)) +} + +/** + * @brief This data structure is used to transfer a 16-byte symmetric key + * encrypted using SM2 encryption as specified in 5.3.3. The symmetric key is + * input to the key encryption process with no headers, encapsulation, or + * length indication. Encryption and decryption are carried out as specified + * in 5.3.5.2. + * + * @param v: is the sender's ephemeral public key, which is the output V from + * encryption as specified in 5.3.5.2. + * + * @param c: is the encrypted symmetric key, which is the output C from + * encryption as specified in 5.3.5.2. The algorithm for the symmetric key + * is identified by the CHOICE indicated in the following SymmetricCiphertext. + * For SM2 this algorithm shall be SM4. + * + * @param t: is the authentication tag, which is the output tag from + * encryption as specified in 5.3.5.2. + */ +EcencP256EncryptedKey ::= SEQUENCE { + v EccP256CurvePoint, + c OCTET STRING (SIZE (16)), + t OCTET STRING (SIZE (32)) +} + + +/** + * @brief This structure contains an encryption key, which may be a public or + * a symmetric key. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2 if it appears in a + * HeaderInfo or in a ToBeSignedCertificate. The canonicalization applies to + * the PublicEncryptionKey. See the definitions of HeaderInfo and + * ToBeSignedCertificate for a specification of the canonicalization + * operations. + */ +EncryptionKey ::= CHOICE { + public PublicEncryptionKey, + symmetric SymmetricEncryptionKey +} + +/** + * @brief This structure specifies a public encryption key and the associated + * symmetric algorithm which is used for bulk data encryption when encrypting + * for that public key. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2 if it appears in a + * HeaderInfo or in a ToBeSignedCertificate. The canonicalization applies to + * the BasePublicEncryptionKey. See the definitions of HeaderInfo and + * ToBeSignedCertificate for a specification of the canonicalization + * operations. + */ +PublicEncryptionKey ::= SEQUENCE { + supportedSymmAlg SymmAlgorithm, + publicKey BasePublicEncryptionKey +} + +/** + * @brief This structure specifies the bytes of a public encryption key for + * a particular algorithm. Supported public key encryption algorithms are + * defined in 5.3.5. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2 if it appears in a + * HeaderInfo or in a ToBeSignedCertificate. See the definitions of HeaderInfo + * and ToBeSignedCertificate for a specification of the canonicalization + * operations. + */ +BasePublicEncryptionKey ::= CHOICE { + eciesNistP256 EccP256CurvePoint, + eciesBrainpoolP256r1 EccP256CurvePoint, + ..., + ecencSm2 EccP256CurvePoint +} + +/** + * @brief This structure represents a public key and states with what + * algorithm the public key is to be used. Cryptographic mechanisms are + * defined in 5.3. + * An EccP256CurvePoint or EccP384CurvePoint within a PublicVerificationKey + * structure is invalid if it indicates the choice x-only. + * + * @note Critical information fields: If present, this is a critical + * information field as defined in 5.2.6. An implementation that does not + * recognize the indicated CHOICE when verifying a signed SPDU shall indicate + * that the signed SPDU is invalid indicate that the signed SPDU is invalid + * in the sense of 4.2.2.3.2, that is, it is invalid in the sense that its + * validity cannot be established. + * + * @note Canonicalization: This data structure is subject to canonicalization + * for the relevant operations specified in 6.1.2. The canonicalization + * applies to the EccP256CurvePoint and the Ecc384CurvePoint. Both forms of + * point are encoded in compressed form, i.e., such that the choice indicated + * within the Ecc*CurvePoint is compressed-y-0 or compressed-y-1. + */ +PublicVerificationKey ::= CHOICE { + ecdsaNistP256 EccP256CurvePoint, + ecdsaBrainpoolP256r1 EccP256CurvePoint, + ... , + ecdsaBrainpoolP384r1 EccP384CurvePoint, + ecdsaNistP384 EccP384CurvePoint, + ecsigSm2 EccP256CurvePoint +} + +/** + * @brief This structure provides the key bytes for use with an identified + * symmetric algorithm. The supported symmetric algorithms are AES-128 and + * SM4 in CCM mode as specified in 5.3.8. + */ +SymmetricEncryptionKey ::= CHOICE { + aes128Ccm OCTET STRING(SIZE(16)), + ..., + sm4Ccm OCTET STRING(SIZE(16)) +} + + +--***************************************************************************-- +-- PSID / ITS-AID -- +--***************************************************************************-- + +/** + * @brief This structure represents the permissions that the certificate + * holder has with respect to activities for a single application area, + * identified by a Psid. + * + * @note The determination as to whether the activities are consistent with + * the permissions indicated by the PSID and ServiceSpecificPermissions is + * made by the SDEE and not by the SDS; the SDS provides the PSID and SSP + * information to the SDEE to enable the SDEE to make that determination. + * See 5.2.4.3.3 for more information. + * + * @note The SDEE specification is expected to specify what application + * activities are permitted by particular ServiceSpecificPermissions values. + * The SDEE specification is also expected EITHER to specify application + * activities that are permitted if the ServiceSpecificPermissions is + * omitted, OR to state that the ServiceSpecificPermissions need to always be + * present. + * + * @note Consistency with signed SPDU: As noted in 5.1.1, + * consistency between the SSP and the signed SPDU is defined by rules + * specific to the given PSID and is out of scope for this standard. + * + * @note Consistency with issuing certificate: If a certificate has an + * appPermissions entry A for which the ssp field is omitted, A is consistent + * with the issuing certificate if the issuing certificate contains a + * PsidSspRange P for which the following holds: + * - The psid field in P is equal to the psid field in A and one of the + * following is true: + * - The sspRange field in P indicates all. + * - The sspRange field in P indicates opaque and one of the entries in + * opaque is an OCTET STRING of length 0. + * + * For consistency rules for other forms of the ssp field, see the + * following subclauses. + */ +PsidSsp ::= SEQUENCE { + psid Psid, + ssp ServiceSpecificPermissions OPTIONAL +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfPsidSsp ::= SEQUENCE OF PsidSsp + +/** + * @brief This type represents the PSID defined in IEEE Std 1609.12. + */ +Psid ::= INTEGER (0..MAX) + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfPsid ::= SEQUENCE OF Psid + +/** + * @brief This structure represents the Service Specific Permissions (SSP) + * relevant to a given entry in a PsidSsp. The meaning of the SSP is specific + * to the associated Psid. SSPs may be PSID-specific octet strings or + * bitmap-based. See Annex C for further discussion of how application + * specifiers may choose which SSP form to use. + * + * @note Consistency with issuing certificate: If a certificate has an + * appPermissions entry A for which the ssp field is opaque, A is consistent + * with the issuing certificate if the issuing certificate contains one of + * the following: + * - (OPTION 1) A SubjectPermissions field indicating the choice all and + * no PsidSspRange field containing the psid field in A; + * - (OPTION 2) A PsidSspRange P for which the following holds: + * - The psid field in P is equal to the psid field in A and one of the + * following is true: + * - The sspRange field in P indicates all. + * - The sspRange field in P indicates opaque and one of the entries in + * the opaque field in P is an OCTET STRING identical to the opaque field in + * A. + * + * For consistency rules for other types of ServiceSpecificPermissions, + * see the following subclauses. + */ +ServiceSpecificPermissions ::= CHOICE { + opaque OCTET STRING (SIZE(0..MAX)), + ..., + bitmapSsp BitmapSsp +} + +/** + * @brief This structure represents a bitmap representation of a SSP. The + * mapping of the bits of the bitmap to constraints on the signed SPDU is + * PSID-specific. + * + * @note Consistency with issuing certificate: If a certificate has an + * appPermissions entry A for which the ssp field is bitmapSsp, A is + * consistent with the issuing certificate if the certificate contains one + * of the following: + * - (OPTION 1) A SubjectPermissions field indicating the choice all and + * no PsidSspRange field containing the psid field in A; + * - (OPTION 2) A PsidSspRange P for which the following holds: + * - The psid field in P is equal to the psid field in A and one of the + * following is true: + * - EITHER The sspRange field in P indicates all + * - OR The sspRange field in P indicates bitmapSspRange and for every + * bit set to 1 in the sspBitmask in P, the bit in the identical position in + * the sspValue in A is set equal to the bit in that position in the + * sspValue in P. + * + * @note A BitmapSsp B is consistent with a BitmapSspRange R if for every + * bit set to 1 in the sspBitmask in R, the bit in the identical position in + * B is set equal to the bit in that position in the sspValue in R. For each + * bit set to 0 in the sspBitmask in R, the corresponding bit in the + * identical position in B may be freely set to 0 or 1, i.e., if a bit is + * set to 0 in the sspBitmask in R, the value of corresponding bit in the + * identical position in B has no bearing on whether B and R are consistent. + */ +BitmapSsp ::= OCTET STRING (SIZE(0..31)) + +/** + * @brief This structure represents the certificate issuing or requesting + * permissions of the certificate holder with respect to one particular set + * of application permissions. + * + * @param psid: identifies the application area. + * + * @param sspRange: identifies the SSPs associated with that PSID for which + * the holder may issue or request certificates. If sspRange is omitted, the + * holder may issue or request certificates for any SSP for that PSID. + */ +PsidSspRange ::= SEQUENCE { + psid Psid, + sspRange SspRange OPTIONAL +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfPsidSspRange ::= SEQUENCE OF PsidSspRange + +/** + * @brief This structure identifies the SSPs associated with a PSID for + * which the holder may issue or request certificates. + * + * @note Consistency with issuing certificate: If a certificate has a + * PsidSspRange A for which the ssp field is opaque, A is consistent with + * the issuing certificate if the issuing certificate contains one of the + * following: + * - (OPTION 1) A SubjectPermissions field indicating the choice all and + * no PsidSspRange field containing the psid field in A; + * - (OPTION 2) A PsidSspRange P for which the following holds: + * - The psid field in P is equal to the psid field in A and one of the + * following is true: + * - The sspRange field in P indicates all. + * - The sspRange field in P indicates opaque, and the sspRange field in + * A indicates opaque, and every OCTET STRING within the opaque in A is a + * duplicate of an OCTET STRING within the opaque in P. + * + * If a certificate has a PsidSspRange A for which the ssp field is all, + * A is consistent with the issuing certificate if the issuing certificate + * contains a PsidSspRange P for which the following holds: + * - (OPTION 1) A SubjectPermissions field indicating the choice all and + * no PsidSspRange field containing the psid field in A; + * - (OPTION 2) A PsidSspRange P for which the psid field in P is equal to + * the psid field in A and the sspRange field in P indicates all. + * + * For consistency rules for other types of SspRange, see the following + * subclauses. + * + * @note The choice "all" may also be indicated by omitting the + * SspRange in the enclosing PsidSspRange structure. Omitting the SspRange is + * preferred to explicitly indicating "all". + */ +SspRange ::= CHOICE { + opaque SequenceOfOctetString, + all NULL, + ..., + bitmapSspRange BitmapSspRange +} + +/** + * @brief This structure represents a bitmap representation of a SSP. The + * sspValue indicates permissions. The sspBitmask contains an octet string + * used to permit or constrain sspValue fields in issued certificates. The + * sspValue and sspBitmask fields shall be of the same length. + * + * @note Consistency with issuing certificate: If a certificate has an + * PsidSspRange value P for which the sspRange field is bitmapSspRange, + * P is consistent with the issuing certificate if the issuing certificate + * contains one of the following: + * - (OPTION 1) A SubjectPermissions field indicating the choice all and + * no PsidSspRange field containing the psid field in P; + * - (OPTION 2) A PsidSspRange R for which the following holds: + * - The psid field in R is equal to the psid field in P and one of the + * following is true: + * - EITHER The sspRange field in R indicates all + * - OR The sspRange field in R indicates bitmapSspRange and for every + * bit set to 1 in the sspBitmask in R: + * - The bit in the identical position in the sspBitmask in P is set + * equal to 1, AND + * - The bit in the identical position in the sspValue in P is set equal + * to the bit in that position in the sspValue in R. + * + * Reference ETSI TS 103 097 for more information on bitmask SSPs. + */ +BitmapSspRange ::= SEQUENCE { + sspValue OCTET STRING (SIZE(1..32)), + sspBitmask OCTET STRING (SIZE(1..32)) +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfOctetString ::= + SEQUENCE (SIZE (0..MAX)) OF OCTET STRING (SIZE(0..MAX)) + + +--***************************************************************************-- +-- Certificate Components -- +--***************************************************************************-- + +/** + * @brief This field contains the certificate holder's assurance level, which + * indicates the security of both the platform and storage of secret keys as + * well as the confidence in this assessment. + * + * This field is encoded as defined in Table 1, where "A" denotes bit + * fields specifying an assurance level, "R" reserved bit fields, and "C" bit + * fields specifying the confidence. + * + * Table 1: Bitwise encoding of subject assurance + * + * | Bit number | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + * | -------------- | --- | --- | --- | --- | --- | --- | --- | --- | + * | Interpretation | A | A | A | R | R | R | C | C | + * + * In Table 1, bit number 0 denotes the least significant bit. Bit 7 + * to bit 5 denote the device's assurance levels, bit 4 to bit 2 are reserved + * for future use, and bit 1 and bit 0 denote the confidence. + * + * The specification of these assurance levels as well as the + * encoding of the confidence levels is outside the scope of the present + * standard. It can be assumed that a higher assurance value indicates that + * the holder is more trusted than the holder of a certificate with lower + * assurance value and the same confidence value. + * + * @note This field was originally specified in ETSI TS 103 097 and + * future uses of this field are anticipated to be consistent with future + * versions of that standard. + */ +SubjectAssurance ::= OCTET STRING (SIZE(1)) + +/** + * @brief This integer identifies a series of CRLs issued under the authority + * of a particular CRACA. + */ +CrlSeries ::= Uint16 + + +--***************************************************************************-- +-- Pseudonym Linkage -- +--***************************************************************************-- + +/** + * @brief This atomic type is used in the definition of other data structures. + */ +IValue ::= Uint16 + +/** + * @brief This is a UTF-8 string as defined in IETF RFC 3629. The contents + * are determined by policy. + */ +Hostname ::= UTF8String (SIZE(0..255)) + +/** + * @brief This is the individual linkage value. See 5.1.3 and 7.3 for details + * of use. + */ +LinkageValue ::= OCTET STRING (SIZE(9)) + +/** + * @brief This is the group linkage value. See 5.1.3 and 7.3 for details of + * use. + */ +GroupLinkageValue ::= SEQUENCE { + jValue OCTET STRING (SIZE(4)), + value OCTET STRING (SIZE(9)) +} + +/** + * @brief This structure contains a LA Identifier for use in the algorithms + * specified in 5.1.3.4. + */ +LaId ::= OCTET STRING (SIZE(2)) + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfLinkageSeed ::= SEQUENCE OF LinkageSeed + +/** + * @brief This structure contains a linkage seed value for use in the + * algorithms specified in 5.1.3.4. + */ +LinkageSeed ::= OCTET STRING (SIZE(16)) + +--***************************************************************************-- +-- Information Object Classes and Sets -- +--***************************************************************************-- + +/** + * @brief This structure is the Information Object Class used to contain + * information about a set of certificate extensions that are associated with + * each other: an AppExtension, a CertIssueExtension, and a + * CertRequestExtension. + */ +CERT-EXT-TYPE ::= CLASS { + &id ExtId, + &App, + &Issue, + &Req +} WITH SYNTAX {ID &id APP &App ISSUE &Issue REQUEST &Req} + +/** + * @brief This parameterized type represents a (id, content) pair drawn from + * the set ExtensionTypes, which is constrained to contain objects defined by + * the class EXT-TYPE. + */ +Extension {EXT-TYPE : ExtensionTypes} ::= SEQUENCE { + id EXT-TYPE.&extId({ExtensionTypes}), + content EXT-TYPE.&ExtContent({ExtensionTypes}{@.id}) +} + +/** + * @brief This class defines objects in a form suitable for import into the + * definition of HeaderInfo. + */ +EXT-TYPE ::= CLASS { + &extId ExtId, + &ExtContent +} WITH SYNTAX {&ExtContent IDENTIFIED BY &extId} + +/** + * @brief This type is used as an identifier for instances of ExtContent + * within an EXT-TYPE. + */ +ExtId ::= INTEGER(0..255) + + +END diff --git a/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn new file mode 100755 index 0000000..92e9738 --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn @@ -0,0 +1,72 @@ +--***************************************************************************-- +-- IEEE Std 1609.2: CRL Data Types -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2Crl {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + crl(3) major-version-3(3) minor-version-2(2)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + Ieee1609Dot2Data +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-6(6)} +WITH SUCCESSORS + + Opaque, + Psid +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-4(4)} +WITH SUCCESSORS + + CrlContents +FROM Ieee1609Dot2CrlBaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + crl(3) base-types(2) major-version-3(3) minor-version-2(2)} +WITH SUCCESSORS +; + +/** + * @brief This is the PSID for the CRL application. + */ +CrlPsid ::= Psid(256) + +/** + * @brief This structure is the SPDU used to contain a signed CRL. A valid + * signed CRL meets the validity criteria of 7.4. + */ +SecuredCrl ::= Ieee1609Dot2Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS { + payload (WITH COMPONENTS {..., + data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + unsecuredData (CONTAINING CrlContents) + }) + }) + }), + headerInfo (WITH COMPONENTS {..., + psid (CrlPsid), + generationTime ABSENT, + expiryTime ABSENT, + generationLocation ABSENT, + p2pcdLearningRequest ABSENT, + missingCrlIdentifier ABSENT, + encryptionKey ABSENT + }) + }) + }) + }) +}) + +END diff --git a/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn new file mode 100755 index 0000000..a45aeec --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn @@ -0,0 +1,468 @@ +--***************************************************************************-- +-- IEEE Std 1609.2: CRL Base Data Types -- +--***************************************************************************-- + +/** + * @note Section references in this file are to clauses in IEEE Std + * 1609.2 unless indicated otherwise. Full forms of acronyms and + * abbreviations used in this file are specified in 3.2. + */ + +Ieee1609Dot2CrlBaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + crl(3) base-types(2) major-version-3(3) minor-version-2(2)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + CrlSeries, + Duration, + GeographicRegion, + HashedId8, + HashedId10, + IValue, + LaId, + LinkageSeed, + Opaque, + Psid, + SequenceOfLinkageSeed, + Signature, + Time32, + Uint3, + Uint8, + Uint16, + Uint32, + ValidityPeriod +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) + base(1) base-types(2) major-version-2(2) minor-version-4(4)} +WITH SUCCESSORS +; + +/** + * @brief The fields in this structure have the following meaning: + * + * @param version: is the version number of the CRL. For this version of this + * standard it is 1. + * + * @param crlSeries: represents the CRL series to which this CRL belongs. This + * is used to determine whether the revocation information in a CRL is relevant + * to a particular certificate as specified in 5.1.3.2. + * + * @param crlCraca: contains the low-order eight octets of the hash of the + * certificate of the Certificate Revocation Authorization CA (CRACA) that + * ultimately authorized the issuance of this CRL. This is used to determine + * whether the revocation information in a CRL is relevant to a particular + * certificate as specified in 5.1.3.2. In a valid signed CRL as specified in + * 7.4 the crlCraca is consistent with the associatedCraca field in the + * Service Specific Permissions as defined in 7.4.3.3. The HashedId8 is + * calculated with the whole-certificate hash algorithm, determined as + * described in 6.4.3, applied to the COER-encoded certificate, canonicalized + * as defined in the definition of Certificate. + * + * @param issueDate: specifies the time when the CRL was issued. + * + * @param nextCrl: contains the time when the next CRL with the same crlSeries + * and cracaId is expected to be issued. The CRL is invalid unless nextCrl is + * strictly after issueDate. This field is used to set the expected update time + * for revocation information associated with the (crlCraca, crlSeries) pair as + * specified in 5.1.3.6. + * + * @param priorityInfo: contains information that assists devices with limited + * storage space in determining which revocation information to retain and + * which to discard. + * + * @param typeSpecific: contains the CRL body. + */ +CrlContents ::= SEQUENCE { + version Uint8 (1), + crlSeries CrlSeries, + crlCraca HashedId8, + issueDate Time32, + nextCrl Time32, + priorityInfo CrlPriorityInfo, + typeSpecific TypeSpecificCrlContents +} + +/** + * @brief This data structure contains information that assists devices with + * limited storage space in determining which revocation information to retain + * and which to discard. + * + * @param priority: indicates the priority of the revocation information + * relative to other CRLs issued for certificates with the same cracaId and + * crlSeries values. A higher value for this field indicates higher importance + * of this revocation information. + * + * @note This mechanism is for future use; details are not specified in this + * version of the standard. + */ +CrlPriorityInfo ::= SEQUENCE { + priority Uint8 OPTIONAL, + ... +} + +/** + * @brief This structure contains type-specific CRL contents. + * + * @param fullHashCrl: contains a full hash-based CRL, i.e., a listing of the + * hashes of all certificates that: + * - contain the indicated cracaId and crlSeries values, and + * - are revoked by hash, and + * - have been revoked, and + * - have not expired. + * + * @param deltaHashCrl: contains a delta hash-based CRL, i.e., a listing of + * the hashes of all certificates that: + * - contain the indicated cracaId and crlSeries values, and + * - are revoked by hash, and + * - have been revoked since the previous CRL that contained the indicated + * cracaId and crlSeries values. + * + * @param fullLinkedCrl and fullLinkedCrlWithAlg: contain a full linkage + * ID-based CRL, i.e., a listing of the individual and/or group linkage data + * for all certificates that: + * - contain the indicated cracaId and crlSeries values, and + * - are revoked by linkage value, and + * - have been revoked, and + * - have not expired. + * The difference between fullLinkedCrl and fullLinkedCrlWithAlg is in how + * the cryptographic algorithms to be used in the seed evolution function and + * linkage value generation function of 5.1.3.4 are communicated to the + * receiver of the CRL. See below in this subclause for details. + * + * @param deltaLinkedCrl and deltaLinkedCrlWithAlg: contain a delta linkage + * ID-based CRL, i.e., a listing of the individual and/or group linkage data + * for all certificates that: + * - contain the specified cracaId and crlSeries values, and + * - are revoked by linkage data, and + * - have been revoked since the previous CRL that contained the indicated + * cracaId and crlSeries values. + * The difference between deltaLinkedCrl and deltaLinkedCrlWithAlg is in how + * the cryptographic algorithms to be used in the seed evolution function + * and linkage value generation function of 5.1.3.4 are communicated to the + * receiver of the CRL. See below in this subclause for details. + * + * @note It is the intent of this standard that once a certificate is revoked, + * it remains revoked for the rest of its lifetime. CRL signers are expected + * to include a revoked certificate on all CRLs issued between the + * certificate's revocation and its expiry. + * + * @note Seed evolution function and linkage value generation function + * identification. In order to derive linkage values per the mechanisms given + * in 5.1.3.4, a receiver needs to know the seed evolution function and the + * linkage value generation function. + * + * If the contents of this structure is a + * ToBeSignedLinkageValueCrlWithAlgIdentifier, then the seed evolution function + * and linkage value generation function are given explicitly as specified in + * the specification of ToBeSignedLinkageValueCrlWithAlgIdentifier. + * + * If the contents of this structure is a ToBeSignedLinkageValueCrl, then the + * seed evolution function and linkage value generation function are obtained + * based on the crlCraca field in the CrlContents: + * - If crlCraca was obtained with SHA-256 or SHA-384, then + * seedEvolutionFunctionIdentifier is seedEvoFn1-sha256 and + * linkageValueGenerationFunctionIdentifier is lvGenFn1-aes128. + * - If crlCraca was obtained with SM3, then seedEvolutionFunctionIdentifier + * is seedEvoFn1-sm3 and linkageValueGenerationFunctionIdentifier is + * lvGenFn1-sm4. + */ +TypeSpecificCrlContents ::= CHOICE { + fullHashCrl ToBeSignedHashIdCrl, + deltaHashCrl ToBeSignedHashIdCrl, + fullLinkedCrl ToBeSignedLinkageValueCrl, + deltaLinkedCrl ToBeSignedLinkageValueCrl, + ..., + fullLinkedCrlWithAlg ToBeSignedLinkageValueCrlWithAlgIdentifier, + deltaLinkedCrlWithAlg ToBeSignedLinkageValueCrlWithAlgIdentifier +} + +/** + * @brief This data structure represents information about a revoked + * certificate. + * + * @param crlSerial: is a counter that increments by 1 every time a new full + * or delta CRL is issued for the indicated crlCraca and crlSeries values. + * + * @param entries: contains the individual revocation information items. + * + * @note To indicate that a hash-based CRL contains no individual revocation + * information items, the recommended approach is for the SEQUENCE OF in the + * SequenceOfHashBasedRevocationInfo in this field to indicate zero entries. + */ +ToBeSignedHashIdCrl ::= SEQUENCE { + crlSerial Uint32, + entries SequenceOfHashBasedRevocationInfo, + ... +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfHashBasedRevocationInfo ::= + SEQUENCE OF HashBasedRevocationInfo + +/** + * @brief In this structure: + * + * @param id: is the HashedId10 identifying the revoked certificate. The + * HashedId10 is calculated with the whole-certificate hash algorithm, + * determined as described in 6.4.3, applied to the COER-encoded certificate, + * canonicalized as defined in the definition of Certificate. + * + * @param expiry: is the value computed from the validity period's start and + * duration values in that certificate. + */ +HashBasedRevocationInfo ::= SEQUENCE { + id HashedId10, + expiry Time32, + ... +} + +/** + * @brief In this structure: + * + * @param iRev: is the value iRev used in the algorithm given in 5.1.3.4. This + * value applies to all linkage-based revocation information included within + * either indvidual or groups. + * + * @param indexWithinI: is a counter that is set to 0 for the first CRL issued + * for the indicated combination of crlCraca, crlSeries, and iRev, and + * increments by 1 every time a new full or delta CRL is issued for the + * indicated crlCraca and crlSeries values without changing iRev. + * + * @param individual: contains individual linkage data. + * + * @note To indicate that a linkage ID-based CRL contains no individual + * linkage data, the recommended approach is for the SEQUENCE OF in the + * SequenceOfJMaxGroup in this field to indicate zero entries. + * + * @param groups: contains group linkage data. + * + * @note To indicate that a linkage ID-based CRL contains no group linkage + * data, the recommended approach is for the SEQUENCE OF in the + * SequenceOfGroupCrlEntry in this field to indicate zero entries. + * + * @param groupsSingleSeed: contains group linkage data generated with a single + * seed. + */ +ToBeSignedLinkageValueCrl ::= SEQUENCE { + iRev IValue, + indexWithinI Uint8, + individual SequenceOfJMaxGroup OPTIONAL, + groups SequenceOfGroupCrlEntry OPTIONAL, + ..., + groupsSingleSeed SequenceOfGroupSingleSeedCrlEntry OPTIONAL +} (WITH COMPONENTS {..., individual PRESENT} | + WITH COMPONENTS {..., groups PRESENT} | + WITH COMPONENTS {..., groupsSingleSeed PRESENT}) + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfJMaxGroup ::= SEQUENCE OF JMaxGroup + +/** + * @brief In this structure: + * + * @param jMax: is the value jMax used in the algorithm given in 5.1.3.4. This + * value applies to all linkage-based revocation information included within + * contents. + * + * @param contents: contains individual linkage data. + */ +JMaxGroup ::= SEQUENCE { + jmax Uint8, + contents SequenceOfLAGroup, + ... +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfLAGroup ::= SEQUENCE OF LAGroup + +/** + * @brief In this structure: + * + * @param la1Id: is the value LinkageAuthorityIdentifier1 used in the + * algorithm given in 5.1.3.4. This value applies to all linkage-based + * revocation information included within contents. + * + * @param la2Id: is the value LinkageAuthorityIdentifier2 used in the + * algorithm given in 5.1.3.4. This value applies to all linkage-based + * revocation information included within contents. + * + * @param contents: contains individual linkage data. + */ +LAGroup ::= SEQUENCE { + la1Id LaId, + la2Id LaId, + contents SequenceOfIMaxGroup, + ... +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfIMaxGroup ::= SEQUENCE OF IMaxGroup + +/** + * @brief In this structure: + * + * @param iMax indicates that for the entries in contents, revocation + * information need no longer be calculated once iCert > iMax as the holder + * is known to have no more valid certs at that point. iMax is not directly + * used in the calculation of the linkage values, it is used to determine + * when revocation information can safely be deleted. + * + * @param contents contains individual linkage data for certificates that are + * revoked using two seeds, per the algorithm given in per the mechanisms + * given in 5.1.3.4 and with seedEvolutionFunctionIdentifier and + * linkageValueGenerationFunctionIdentifier obtained as specified in 7.3.3. + * + * @param singleSeed contains individual linkage data for certificates that + * are revoked using a single seed, per the algorithm given in per the + * mechanisms given in 5.1.3.4 and with seedEvolutionFunctionIdentifier and + * linkageValueGenerationFunctionIdentifier obtained as specified in 7.3.3. + */ +IMaxGroup ::= SEQUENCE { + iMax Uint16, + contents SequenceOfIndividualRevocation, + ..., + singleSeed SequenceOfLinkageSeed OPTIONAL +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfIndividualRevocation ::= + SEQUENCE (SIZE(0..MAX)) OF IndividualRevocation + +/** + * @brief In this structure: + * + * @param linkageSeed1 is the value LinkageSeed1 used in the algorithm given + * in 5.1.3.4. + * + * @param linkageSeed2 is the value LinkageSeed2 used in the algorithm given + * in 5.1.3.4. + */ +IndividualRevocation ::= SEQUENCE { + linkageSeed1 LinkageSeed, + linkageSeed2 LinkageSeed, + ... +} + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfGroupCrlEntry ::= SEQUENCE OF GroupCrlEntry + +/** + * @brief In this structure: + * + * @param iMax: indicates that for these certificates, revocation information + * need no longer be calculated once iCert > iMax as the holders are known + * to have no more valid certs for that (crlCraca, crlSeries) at that point. + * + * @param la1Id: is the value LinkageAuthorityIdentifier1 used in the + * algorithm given in 5.1.3.4. This value applies to all linkage-based + * revocation information included within contents. + * + * @param linkageSeed1: is the value LinkageSeed1 used in the algorithm given + * in 5.1.3.4. + * + * @param la2Id: is the value LinkageAuthorityIdentifier2 used in the + * algorithm given in 5.1.3.4. This value applies to all linkage-based + * revocation information included within contents. + * + * @param linkageSeed2: is the value LinkageSeed2 used in the algorithm given + * in 5.1.3.4. + */ +GroupCrlEntry ::= SEQUENCE { + iMax Uint16, + la1Id LaId, + linkageSeed1 LinkageSeed, + la2Id LaId, + linkageSeed2 LinkageSeed, + ... +} + +/** + * @brief In this structure: + * + * @param iRev is the value iRev used in the algorithm given in 5.1.3.4. This + * value applies to all linkage-based revocation information included within + * either indvidual or groups. + * + * @param indexWithinI is a counter that is set to 0 for the first CRL issued + * for the indicated combination of crlCraca, crlSeries, and iRev, and increments by 1 every time a new full or delta CRL is issued for the indicated crlCraca and crlSeries values without changing iRev. + * + * @param seedEvolution contains an identifier for the seed evolution + * function, used as specified in 5.1.3.4. + * + * @param lvGeneration contains an identifier for the linkage value + * generation function, used as specified in 5.1.3.4. + * + * @param individual contains individual linkage data. + * + * @param groups contains group linkage data for linkage value generation + * with two seeds. + * + * @param groupsSingleSeed contains group linkage data for linkage value + * generation with one seed. + */ +ToBeSignedLinkageValueCrlWithAlgIdentifier ::= SEQUENCE { + iRev IValue, + indexWithinI Uint8, + seedEvolution SeedEvolutionFunctionIdentifier, + lvGeneration LvGenerationFunctionIdentifier, + individual SequenceOfJMaxGroup OPTIONAL, + groups SequenceOfGroupCrlEntry OPTIONAL, + groupsSingleSeed SequenceOfGroupSingleSeedCrlEntry OPTIONAL, + ... +} (WITH COMPONENTS {..., individual PRESENT} | + WITH COMPONENTS {..., groups PRESENT} | + WITH COMPONENTS {..., groupsSingleSeed PRESENT}) + +/** + * @brief This type is used for clarity of definitions. + */ +SequenceOfGroupSingleSeedCrlEntry ::= + SEQUENCE OF GroupSingleSeedCrlEntry + +/** + * @brief This structure contains the linkage seed for group revocation with + * a single seed. The seed is used as specified in the algorithms in 5.1.3.4. + */ +GroupSingleSeedCrlEntry ::= SEQUENCE { + iMax Uint16, + laId LaId, + linkageSeed LinkageSeed +} + +/** + * @brief This structure contains an identifier for the algorithms specified + * in 5.1.3.4. + */ +ExpansionAlgorithmIdentifier ::= ENUMERATED { + sha256ForI-aesForJ, + sm3ForI-sm4ForJ, + ... +} + +/** + * @brief This is the identifier for the seed evolution function. See 5.1.3 + * for details of use. + */ +SeedEvolutionFunctionIdentifier ::= NULL + +/** + * @brief This is the identifier for the linkage value generation function. + * See 5.1.3 for details of use. + */ +LvGenerationFunctionIdentifier ::= NULL + +END diff --git a/certgen/asncodec/asn1/ieee1609.2/README.md b/certgen/asncodec/asn1/ieee1609.2/README.md new file mode 100644 index 0000000..48292fa --- /dev/null +++ b/certgen/asncodec/asn1/ieee1609.2/README.md @@ -0,0 +1,5 @@ +# ASN.1 module for IEEE 1609.2 + +The module was published as a part of delivery **[ETSI TS 103 097 v2.1.1](http://www.etsi.org/deliver/etsi_ts/103000_103099/103097/02.01.01_60/ts_103097v020101p.pdf)** + +The module contains extensions published with IEEE 1609.2.1 diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941BaseTypes.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941BaseTypes.asn new file mode 100644 index 0000000..d043119 --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941BaseTypes.asn @@ -0,0 +1,58 @@ +EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey, Signature +FROM + Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) base-types(2) major-version-2(2) minor-version-3(3)} + WITH SUCCESSORS + + CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, + ValidityPeriod, GeographicRegion, HashedData +FROM + Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base (1) schema (1) major-version-2(2) minor-version-4(4)} + WITH SUCCESSORS + + EtsiTs103097Data, EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, + EtsiTs103097Data-SignedExternalPayload, + EtsiTs103097Data-Unsecured, EtsiTs103097Data-Encrypted-Unicast, EtsiTs103097Data-SignedAndEncrypted-Unicast +FROM + EtsiTs103097Module {itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1)} + WITH SUCCESSORS +; + +CertificateFormat::= INTEGER { + ts103097v131 (1) + }(1..255) + +CertificateSubjectAttributes ::= SEQUENCE { + id CertificateId OPTIONAL, + validityPeriod ValidityPeriod OPTIONAL, + region GeographicRegion OPTIONAL, + assuranceLevel SubjectAssurance OPTIONAL, + appPermissions SequenceOfPsidSsp OPTIONAL, + certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, + ... + }(WITH COMPONENTS { ..., appPermissions PRESENT} | + WITH COMPONENTS { ..., certIssuePermissions PRESENT}) + +EcSignature::= CHOICE { + encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, + ecSignature EtsiTs103097Data-SignedExternalPayload + } + +PublicKeys ::= SEQUENCE { + verificationKey PublicVerificationKey, + encryptionKey PublicEncryptionKey OPTIONAL + } + +Version ::= INTEGER {v1(1)} + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesCa.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesCa.asn new file mode 100644 index 0000000..6491719 --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesCa.asn @@ -0,0 +1,127 @@ +/************************************************************************************* + This file contains the EtsiTs102941Messages module containing all possible PKI messages. + It should be used when all PKI messages needs to be implemented (for example, for CA development) +**************************************************************************************/ +EtsiTs102941MessagesCa + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) major-version-3(3) minor-version-3(3)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed, +EtsiTs103097Data-SignedExternalPayload, +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast +FROM EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +EtsiTs102941ButterflyAuthorizationRequest-X509Signed, InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) major-version-3(3) minor-version-2(2) } +WITH SUCCESSORS + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +AuthorizationValidationRequest, AuthorizationValidationResponse +FROM EtsiTs102941TypesAuthorizationValidation +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +CaCertificateRequest +FROM EtsiTs102941TypesCaManagement +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +ToBeSignedLinkCertificate, ToBeSignedLinkCertificateTlm, ToBeSignedLinkCertificateRca +FROM EtsiTs102941TypesLinkCertificate +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) linkCertificate(9) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +EeRaCertRequest, RaEeCertInfo, EeRaDownloadRequest +FROM Ieee1609Dot2Dot1EeRaInterface +{iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) extension-standards(255) dot1(1) interfaces(1) ee-ra(11) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + +RaAcaCertRequest, AcaRaCertResponse +FROM Ieee1609Dot2Dot1AcaRaInterface +{iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) extension-standards(255) dot1(1) interfaces(1) aca-ra(4) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS +; + +/************ +-- Messages +************/ +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} +AuthorizationValidationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} +AuthorizationValidationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} +CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} +CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})}} +TlmLinkCertificateMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{linkCertificateTlm PRESENT})})} +RcaSingleSignedLinkCertificateMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{singleSignedLinkCertificateRca PRESENT})})} +RcaDoubleSignedLinkCertificateMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{doubleSignedlinkCertificateRca PRESENT})})} +ButterflyAuthorizationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAuthorizationRequest PRESENT})})} +X509SignedButterflyAuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{x509SignedbutterflyAuthorizationRequest PRESENT})})} +ButterflyAuthorizationResponseMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAuthorizationResponse PRESENT})})} +ButterflyAtDownloadRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAtDownloadRequest PRESENT})})} +ButterflyCertRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyCertificateRequest PRESENT})})} +ButterflyCertResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyCertificateResponse PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + authorizationValidationRequest AuthorizationValidationRequest, + authorizationValidationResponse AuthorizationValidationResponse, + caCertificateRequest CaCertificateRequest, + ..., + linkCertificateTlm ToBeSignedLinkCertificateTlm, + singleSignedLinkCertificateRca ToBeSignedLinkCertificateRca, + doubleSignedlinkCertificateRca RcaSingleSignedLinkCertificateMessage, + /* Extension for butterfly key provisioning */ + [[butterflyAuthorizationRequest EeRaCertRequest, + x509SignedbutterflyAuthorizationRequest EtsiTs102941ButterflyAuthorizationRequest-X509Signed, + butterflyAuthorizationResponse RaEeCertInfo, + butterflyCertificateRequest RaAcaCertRequest, + butterflyCertificateResponse AcaRaCertResponse, + butterflyAtDownloadRequest EeRaDownloadRequest]] + } + + + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss-OptionalPrivacy.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss-OptionalPrivacy.asn new file mode 100644 index 0000000..418e4b3 --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss-OptionalPrivacy.asn @@ -0,0 +1,106 @@ +/************************************************************************************* + This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the + same subset of messages as the EtsiTs102941MessagesItss module. + It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss + + This module allows the usage of unencrypted EC signature for AA requests. +**************************************************************************************/ +EtsiTs102941MessagesItss-OptionalPrivacy + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) major-version-3(3) minor-version-3(3)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed, +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +EtsiTs102941ButterflyAuthorizationRequest-X509Signed, InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) major-version-3(3) minor-version-2(2) } +WITH SUCCESSORS + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +ToBeSignedLinkCertificate, ToBeSignedLinkCertificateTlm +FROM EtsiTs102941TypesLinkCertificate +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) linkCertificate(9) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + +EeRaCertRequest, RaEeCertInfo, EeRaDownloadRequest +FROM Ieee1609Dot2Dot1EeRaInterface +{ iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) extension-standards(255) dot1(1) interfaces(1) ee-ra(11) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} +TlmLinkCertificateMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{linkCertificateTlm PRESENT})})} +ButterflyAuthorizationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAuthorizationRequest PRESENT})})} +X509SignedButterflyAuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{x509SignedbutterflyAuthorizationRequest PRESENT})})} +ButterflyAuthorizationResponseMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAuthorizationResponse PRESENT})})} +ButterflyAtDownloadRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAtDownloadRequest PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + authorizationValidationRequest NULL, + authorizationValidationResponse NULL, + caCertificateRequest NULL, + ..., + linkCertificateTlm ToBeSignedLinkCertificateTlm, + singleSignedLinkCertificateRca NULL, + doubleSignedlinkCertificateRca NULL, + /* Extension for butterfly key provisioning */ + [[butterflyAuthorizationRequest EeRaCertRequest, + x509SignedbutterflyAuthorizationRequest EtsiTs102941ButterflyAuthorizationRequest-X509Signed, + butterflyAuthorizationResponse RaEeCertInfo, + butterflyCertificateRequest NULL, + butterflyCertificateResponse NULL, + butterflyAtDownloadRequest EeRaDownloadRequest]] + } + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss.asn new file mode 100644 index 0000000..23a3e5f --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941MessagesItss.asn @@ -0,0 +1,112 @@ +/************************************************************************************* + This file contains the EtsiTs102941MessagesItss module providing the ITS-S subset + of messages defined in the module EtsiTs102941MessagesCA + It should never be imported together with the module EtsiTs102941MessagesCA. + Use the EtsiTs102941MessagesCA if all possible PKI message types are needed. + + This module blocks the usage of unencrypted EC signature for AA requests. +**************************************************************************************/ +EtsiTs102941MessagesItss + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) major-version-3(3) minor-version-3(3)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed, +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +EtsiTs102941ButterflyAuthorizationRequest-X509Signed, InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) major-version-3(3) minor-version-2(2) } +WITH SUCCESSORS + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +ToBeSignedLinkCertificate, ToBeSignedLinkCertificateTlm +FROM EtsiTs102941TypesLinkCertificate +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) linkCertificate(9) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +EeRaCertRequest, RaEeCertInfo, EeRaDownloadRequest +FROM Ieee1609Dot2Dot1EeRaInterface +{ iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) extension-standards(255) dot1(1) interfaces(1) ee-ra(11) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} +TlmLinkCertificateMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{linkCertificateTlm PRESENT})})} +ButterflyAuthorizationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAuthorizationRequest PRESENT})})} +X509SignedButterflyAuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{x509SignedbutterflyAuthorizationRequest PRESENT})})} +ButterflyAuthorizationResponseMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAuthorizationResponse PRESENT})})} +ButterflyAtDownloadRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{butterflyAtDownloadRequest PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + authorizationValidationRequest NULL, + authorizationValidationResponse NULL, + caCertificateRequest NULL, + ..., + linkCertificateTlm ToBeSignedLinkCertificateTlm, + singleSignedLinkCertificateRca NULL, + doubleSignedlinkCertificateRca NULL, + /* Extension for butterfly key provisioning */ + [[butterflyAuthorizationRequest EeRaCertRequest, + x509SignedbutterflyAuthorizationRequest EtsiTs102941ButterflyAuthorizationRequest-X509Signed, + butterflyAuthorizationResponse RaEeCertInfo, + butterflyCertificateRequest NULL, + butterflyCertificateResponse NULL, + butterflyAtDownloadRequest EeRaDownloadRequest]] + } (WITH COMPONENTS{..., + authorizationRequest (WITH COMPONENTS{..., + ecSignature (WITH COMPONENTS{..., + encryptedEcSignature PRESENT + }) + }) + }) + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TrustLists.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TrustLists.asn new file mode 100644 index 0000000..4ff6896 --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TrustLists.asn @@ -0,0 +1,143 @@ +EtsiTs102941TrustLists + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) major-version-3(3) minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +HashedId8, Time32, Version --, CertificateAuthorityConstraints +FROM EtsiTs102941BaseTypes +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS +; + +/************ +-- CRL +************/ +ToBeSignedCrl ::= SEQUENCE { + version Version, + thisUpdate Time32, + nextUpdate Time32, + entries SEQUENCE OF CrlEntry, + ... +} + +CrlEntry ::= HashedId8 + +/************ +-- TLM CTL +************/ + +ToBeSignedTlmCtl ::= CtlFormat (FullCtl | DeltaCtl) (WITH COMPONENTS {..., + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + add ( WITH COMPONENTS {..., + ea ABSENT, + aa ABSENT + }) + }) + )) +}) + +/************ +-- RCA CTL +************/ + +ToBeSignedRcaCtl ::= CtlFormat (FullCtl | DeltaCtl) ( WITH COMPONENTS {..., + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + add ( WITH COMPONENTS {..., + rca ABSENT, + tlm ABSENT + }) + }) + )) +}) + +/************ +-- CTL +************/ + +FullCtl::= CtlFormat ( WITH COMPONENTS {..., + isFullCtl ( TRUE ), + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + delete ABSENT + }) + )) +}) + +DeltaCtl::= CtlFormat (WITH COMPONENTS {..., + isFullCtl(FALSE) +}) + + +CtlFormat ::= SEQUENCE { + version Version, + nextUpdate Time32, + isFullCtl BOOLEAN, + ctlSequence INTEGER (0..255), + ctlCommands SEQUENCE OF CtlCommand, + ... +} + +CtlCommand ::= CHOICE { + add CtlEntry, + delete CtlDelete, + ... +} + +CtlEntry ::= CHOICE { + rca RootCaEntry, + ea EaEntry, + aa AaEntry, + dc DcEntry, + tlm TlmEntry, + ... +} + +CtlDelete ::= CHOICE { + cert HashedId8, + dc DcDelete, + ... +} + +TlmEntry::= SEQUENCE { + selfSignedTLMCertificate EtsiTs103097Certificate, + successorTo EtsiTs103097Certificate OPTIONAL, + accessPoint Url +} + +RootCaEntry ::= SEQUENCE { + selfsignedRootCa EtsiTs103097Certificate, + successorTo EtsiTs103097Certificate OPTIONAL +} + +EaEntry ::= SEQUENCE { + eaCertificate EtsiTs103097Certificate, + aaAccessPoint Url, + itsAccessPoint Url OPTIONAL +} + +AaEntry ::= SEQUENCE { + aaCertificate EtsiTs103097Certificate, + accessPoint Url +} + +DcEntry ::= SEQUENCE { + url Url, + cert SEQUENCE OF HashedId8 +} + +DcDelete ::= Url + +Url::= IA5String + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn new file mode 100644 index 0000000..0b37d42 --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorization.asn @@ -0,0 +1,105 @@ +EtsiTs102941TypesAuthorization + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) major-version-3(3) minor-version-3(3)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, +EtsiTs103097Data-Signed +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +EeRaInterfacePdu +FROM Ieee1609Dot2Dot1EeRaInterface +{ iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) extension-standards(255) dot1(1) interfaces(1) ee-ra(11) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + +Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest, ScmsPdu-Scoped, SignerSingleX509Cert +FROM Ieee1609Dot2Dot1Protocol +{ iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) extension-standards(255) dot1(1) interfaces(1) protocol(17) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + +; + +/************ +-- AuthorizationRequest/Response +************/ + +AuthorizationResponseCode ::= ENUMERATED { + ok(0), + -- ITS->AA + its-aa-cantparse, -- valid for any structure + its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + its-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me + its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + its-aa-keysdontmatch, -- HMAC keyTag verification fails + its-aa-incompleterequest, -- some elements are missing + its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad + its-aa-outofsyncrequest, -- signingTime is outside acceptable limits + its-aa-unknownea, -- the EA identified by eaId is unknown to me + its-aa-invalidea, -- the EA certificate is revoked + its-aa-deniedpermissions, -- I, the AA, deny the requested permissions + -- AA->EA + aa-ea-cantreachea, -- the EA is unreachable (network error?) + -- EA->AA + ea-aa-cantparse, -- valid for any structure + ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + ea-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me + ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + -- TODO: to be continued... + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can't validate the request signature + wrongea, -- the encrypted signature doesn't designate me as the EA + unknownits, -- can't retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the key is bad + deniedpermissions, -- permissions not granted + deniedtoomanycerts, -- parallel limit + ... } + + +InnerAtRequest ::= SEQUENCE { + publicKeys PublicKeys, + hmacKey OCTET STRING (SIZE(32)), + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +SharedAtRequest ::= SEQUENCE { + eaId HashedId8, + keyTag OCTET STRING (SIZE(16)), + certificateFormat CertificateFormat, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}), + ... + } + +InnerAtResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +EtsiTs102941ButterflyAuthorizationRequest-X509Signed ::= Ieee1609Dot2Data-SignedX509AuthenticatedCertRequest { + ScmsPdu-Scoped { + EeRaInterfacePdu (WITH COMPONENTS { + eeRaCertRequest}) + }, + SignerSingleX509Cert +} + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn new file mode 100644 index 0000000..10411e4 --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesAuthorizationValidation.asn @@ -0,0 +1,63 @@ +EtsiTs102941TypesAuthorizationValidation + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) major-version-3(3) minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +CertificateFormat, CertificateSubjectAttributes,EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +SharedAtRequest +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) major-version-3(3) minor-version-2(2) } +WITH SUCCESSORS +; + +/************ +-- AuthorizationValidationRequest/Response +************/ + +AuthorizationValidationResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest + imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can't validate the request signature + wrongea, -- the encrypted signature doesn't designate me as the EA + unknownits, -- can't retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + deniedpermissions, -- requested permissions not granted + deniedtoomanycerts, -- parallel limit + deniedrequest, -- any other reason? + ... } + +AuthorizationValidationRequest ::= SEQUENCE { + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +AuthorizationValidationResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationValidationResponseCode, + confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}) OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), confirmedSubjectAttributes PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), confirmedSubjectAttributes ABSENT } + ) + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesCaManagement.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesCaManagement.asn new file mode 100644 index 0000000..e0371c1 --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesCaManagement.asn @@ -0,0 +1,31 @@ +EtsiTs102941TypesCaManagement + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) major-version-3(3) minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +PublicKeys, CertificateSubjectAttributes +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS +; + +/************ +-- CA certificate request +************/ + +CaCertificateRequest ::= SEQUENCE { + publicKeys PublicKeys, + requestedSubjectAttributes CertificateSubjectAttributes, + ... +} + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn new file mode 100644 index 0000000..cc76f6d --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesEnrolment.asn @@ -0,0 +1,62 @@ +EtsiTs102941TypesEnrolment + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) major-version-3(3) minor-version-1(1) } + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, +EtsiTs103097Data-Signed +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS + +CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1) } +WITH SUCCESSORS +; + +/************ +-- EnrolmentRequest/Response +************/ + +EnrolmentResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not enrolmentrequest + imnottherecipient, -- the "recipients" doesn't include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + unknownits, -- can't retrieve the ITS from the itsId + invalidsignature, -- signature verification of the request fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + baditsstatus, -- revoked, not yet active + incompleterequest, -- some elements are missing + deniedpermissions, -- requested permissions are not granted + invalidkeys, -- either the verification_key of the encryption_key is bad + deniedrequest, -- any other reason? + ... } + +InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} + +InnerEcRequest ::= SEQUENCE { + itsId OCTET STRING, + certificateFormat CertificateFormat, + publicKeys PublicKeys, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}), + ... + } + +InnerEcResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode EnrolmentResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +END diff --git a/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn new file mode 100644 index 0000000..e5429bf --- /dev/null +++ b/certgen/asncodec/asn1/pki_ts102941/EtsiTs102941TypesLinkCertificate.asn @@ -0,0 +1,30 @@ +EtsiTs102941TypesLinkCertificate +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) linkCertificate(9) major-version-3(3) minor-version-1(1) } + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +Time32, HashedData +FROM EtsiTs102941BaseTypes +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) major-version-3(3) minor-version-1(1)} +WITH SUCCESSORS + +; + +/************ +-- Link certificate messages +************/ + +ToBeSignedLinkCertificate ::= SEQUENCE { + expiryTime Time32, + certificateHash HashedData, + ... +} + +ToBeSignedLinkCertificateTlm ::= ToBeSignedLinkCertificate +ToBeSignedLinkCertificateRca ::= ToBeSignedLinkCertificate + +END + diff --git a/certgen/asncodec/asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn b/certgen/asncodec/asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn new file mode 100644 index 0000000..9876814 --- /dev/null +++ b/certgen/asncodec/asn1/sec_ts103097/EtsiTs103097ExtensionModule.asn @@ -0,0 +1,43 @@ +EtsiTs103097ExtensionModule +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) extension(2) major-version-1(1) minor-version-1(1)} +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + HashedId8, + Time32, + Extension, + EXT-TYPE, + ExtId +FROM Ieee1609Dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) base-types(2) major-version-2 (2) minor-version-4 (4)} +WITH SUCCESSORS +; + +ExtensionModuleVersion::= INTEGER(1) + +EtsiOriginatingHeaderInfoExtension ::= Extension{{EtsiTs103097HeaderInfoExtensions}} + +EtsiTs103097HeaderInfoExtensionId ::= ExtId + etsiTs102941CrlRequestId EtsiTs103097HeaderInfoExtensionId ::= 1 --'01'H + etsiTs102941DeltaCtlRequestId EtsiTs103097HeaderInfoExtensionId ::= 2 --'02'H + +EtsiTs103097HeaderInfoExtensions EXT-TYPE ::= { + { EtsiTs102941CrlRequest IDENTIFIED BY etsiTs102941CrlRequestId } | + { EtsiTs102941DeltaCtlRequest IDENTIFIED BY etsiTs102941DeltaCtlRequestId }, + ... +} + +EtsiTs102941CrlRequest::= SEQUENCE { + issuerId HashedId8, + lastKnownUpdate Time32 OPTIONAL +} + +EtsiTs102941CtlRequest::= SEQUENCE { + issuerId HashedId8, + lastKnownCtlSequence INTEGER (0..255) OPTIONAL +} + +EtsiTs102941DeltaCtlRequest::= EtsiTs102941CtlRequest + +END diff --git a/certgen/asncodec/asn1/sec_ts103097/EtsiTs103097Module.asn b/certgen/asncodec/asn1/sec_ts103097/EtsiTs103097Module.asn new file mode 100644 index 0000000..83c9410 --- /dev/null +++ b/certgen/asncodec/asn1/sec_ts103097/EtsiTs103097Module.asn @@ -0,0 +1,123 @@ +EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) secHeaders(103097) core(1) major-version-3(3) minor-version-1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + +Ieee1609Dot2Data, Certificate +FROM Ieee1609Dot2 {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) schema(1) major-version-2(2) minor-version-4(4)} +WITH SUCCESSORS + +ExtensionModuleVersion +FROM EtsiTs103097ExtensionModule {itu-t(0) identified-organization(4) + etsi(0) itsDomain(5) wg5(5) secHeaders(103097) extension(2) major-version-1(1) minor-version-1(1)} +; + +EtsiTs103097Certificate::= Certificate (WITH COMPONENTS{..., + toBeSigned (WITH COMPONENTS{..., + id (WITH COMPONENTS{..., + linkageData ABSENT, + binaryId ABSENT + }), + certRequestPermissions ABSENT, + canRequestRollover ABSENT + }) +}) + +EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., + content (WITH COMPONENTS {..., + signedData (WITH COMPONENTS {..., -- constraints on signed data headers + tbsData (WITH COMPONENTS { + headerInfo (WITH COMPONENTS {..., + generationTime PRESENT, + p2pcdLearningRequest ABSENT, + missingCrlIdentifier ABSENT + }) + }), + signer (WITH COMPONENTS {..., --constraints on the certificate + certificate ((WITH COMPONENT (EtsiTs103097Certificate))^(SIZE(1))) + }) + }), + encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers + recipients (WITH COMPONENT ( + (WITH COMPONENTS {..., + pskRecipInfo ABSENT, + symmRecipInfo ABSENT, + rekRecipInfo ABSENT + }) + )) + }), + signedCertificateRequest ABSENT + }) +}) + +EtsiTs103097Data-Unsecured {ToBeSentDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + unsecuredData (CONTAINING ToBeSentDataContent) + }) +}) + +EtsiTs103097Data-Signed {ToBeSignedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS { + payload (WITH COMPONENTS { + data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + unsecuredData (CONTAINING ToBeSignedDataContent) + }) + }) PRESENT + }) + }) + }) + }) +}) + +EtsiTs103097Data-SignedExternalPayload ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS { + payload (WITH COMPONENTS { + extDataHash (WITH COMPONENTS { + sha256HashedData PRESENT + }) PRESENT + }) + }) + }) + }) +}) + +EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + ciphertext (WITH COMPONENTS {..., + aes128ccm (WITH COMPONENTS {..., + ccmCiphertext (CONSTRAINED BY {-- ccm encryption of -- ToBeEncryptedDataContent}) + }) + }) + }) + }) +}) + +EtsiTs103097Data-SignedAndEncrypted {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} + +EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted { EtsiTs103097Data-Unsecured{ToBeEncryptedDataContent}} (WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + recipients (SIZE(1)) + }) + }) +}) + +EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} (WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + recipients (SIZE(1)) + }) + }) +}) + +END diff --git a/certgen/asncodec/asn1/sec_ts103097/LICENSE b/certgen/asncodec/asn1/sec_ts103097/LICENSE new file mode 100644 index 0000000..28bd922 --- /dev/null +++ b/certgen/asncodec/asn1/sec_ts103097/LICENSE @@ -0,0 +1,23 @@ +Copyright 2020 ETSI + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/certgen/asncodec/asn1/sec_ts103097/README.md b/certgen/asncodec/asn1/sec_ts103097/README.md new file mode 100644 index 0000000..13edddb --- /dev/null +++ b/certgen/asncodec/asn1/sec_ts103097/README.md @@ -0,0 +1,17 @@ +# ASN.1 module for ETSI TS 103 097 v2.1.1 + +The module was published as a part of delivery **[ETSI TS 103 097 v2.1.1](http://www.etsi.org/deliver/etsi_ts/103000_103099/103097/02.01.01_60/ts_103097v020101p.pdf)** + +## License + +The content of this repository and the files contained are released under the BSD-3-Clause license. + +See the attached LICENSE file or visit https://forge.etsi.org/legal-matters. + +## Dependencies + +The module dependens of the following external modules and repositories: + +* The **[IEEE1609dot2](https://forge.etsi.org/rep/ITS/asn1/ieee1609.2/)** module from the **IEEE Std 1609.2** - WAVE - Security Services for Applications and Management Messages + +*NOTE: Please use `--recurse-submodules` option in order to clone the module with all necessary dependencies.* diff --git a/certgen/asncodec/asn_SEQUENCE_OF.c b/certgen/asncodec/asn_SEQUENCE_OF.c index 730c227..ec952fc 100644 --- a/certgen/asncodec/asn_SEQUENCE_OF.c +++ b/certgen/asncodec/asn_SEQUENCE_OF.c @@ -1,41 +1,41 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -typedef A_SEQUENCE_OF(void) asn_sequence; - -void -asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) { - asn_sequence *as = (asn_sequence *)asn_sequence_of_x; - - if(as) { - void *ptr; - int n; - - if(number < 0 || number >= as->count) - return; /* Nothing to delete */ - - if(_do_free && as->free) { - ptr = as->array[number]; - } else { - ptr = 0; - } - - /* - * Shift all elements to the left to hide the gap. - */ - --as->count; - for(n = number; n < as->count; n++) - as->array[n] = as->array[n+1]; - - /* - * Invoke the third-party function only when the state - * of the parent structure is consistent. - */ - if(ptr) as->free(ptr); - } -} - +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +typedef A_SEQUENCE_OF(void) asn_sequence; + +void +asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) { + asn_sequence *as = (asn_sequence *)asn_sequence_of_x; + + if(as) { + void *ptr; + int n; + + if(number < 0 || number >= as->count) + return; /* Nothing to delete */ + + if(_do_free && as->free) { + ptr = as->array[number]; + } else { + ptr = 0; + } + + /* + * Shift all elements to the left to hide the gap. + */ + --as->count; + for(n = number; n < as->count; n++) + as->array[n] = as->array[n+1]; + + /* + * Invoke the third-party function only when the state + * of the parent structure is consistent. + */ + if(ptr) as->free(ptr); + } +} + diff --git a/certgen/asncodec/asn_SEQUENCE_OF.h b/certgen/asncodec/asn_SEQUENCE_OF.h index e1ef2b1..e35bc44 100644 --- a/certgen/asncodec/asn_SEQUENCE_OF.h +++ b/certgen/asncodec/asn_SEQUENCE_OF.h @@ -1,52 +1,52 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_SEQUENCE_OF_H -#define ASN_SEQUENCE_OF_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * SEQUENCE OF is the same as SET OF with a tiny difference: - * the delete operation preserves the initial order of elements - * and thus MAY operate in non-constant time. - */ -#define A_SEQUENCE_OF(type) A_SET_OF(type) - -#define ASN_SEQUENCE_ADD(headptr, ptr) \ - asn_sequence_add((headptr), (ptr)) - -/*********************************************** - * Implementation of the SEQUENCE OF structure. - */ - -#define asn_sequence_add asn_set_add -#define asn_sequence_empty asn_set_empty - -/* - * Delete the element from the set by its number (base 0). - * This is NOT a constant-time operation. - * The order of elements is preserved. - * If _do_free is given AND the (*free) is initialized, the element - * will be freed using the custom (*free) function as well. - */ -void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); - -/* - * Cope with different conversions requirements to/from void in C and C++. - * This is mostly useful for support library. - */ -typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; -#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) -#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_SEQUENCE_OF_H */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_SEQUENCE_OF_H +#define ASN_SEQUENCE_OF_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * SEQUENCE OF is the same as SET OF with a tiny difference: + * the delete operation preserves the initial order of elements + * and thus MAY operate in non-constant time. + */ +#define A_SEQUENCE_OF(type) A_SET_OF(type) + +#define ASN_SEQUENCE_ADD(headptr, ptr) \ + asn_sequence_add((headptr), (ptr)) + +/*********************************************** + * Implementation of the SEQUENCE OF structure. + */ + +#define asn_sequence_add asn_set_add +#define asn_sequence_empty asn_set_empty + +/* + * Delete the element from the set by its number (base 0). + * This is NOT a constant-time operation. + * The order of elements is preserved. + * If _do_free is given AND the (*free) is initialized, the element + * will be freed using the custom (*free) function as well. + */ +void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); + +/* + * Cope with different conversions requirements to/from void in C and C++. + * This is mostly useful for support library. + */ +typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; +#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) +#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_SEQUENCE_OF_H */ diff --git a/certgen/asncodec/asn_SET_OF.c b/certgen/asncodec/asn_SET_OF.c index 49650e2..944f2cb 100644 --- a/certgen/asncodec/asn_SET_OF.c +++ b/certgen/asncodec/asn_SET_OF.c @@ -1,88 +1,88 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Add another element into the set. - */ -int -asn_set_add(void *asn_set_of_x, void *ptr) { - asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); - - if(as == 0 || ptr == 0) { - errno = EINVAL; /* Invalid arguments */ - return -1; - } - - /* - * Make sure there's enough space to insert an element. - */ - if(as->count == as->size) { - int _newsize = as->size ? (as->size << 1) : 4; - void *_new_arr; - _new_arr = REALLOC(as->array, _newsize * sizeof(as->array[0])); - if(_new_arr) { - as->array = (void **)_new_arr; - as->size = _newsize; - } else { - /* ENOMEM */ - return -1; - } - } - - as->array[as->count++] = ptr; - - return 0; -} - -void -asn_set_del(void *asn_set_of_x, int number, int _do_free) { - asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); - - if(as) { - void *ptr; - if(number < 0 || number >= as->count) - return; - - if(_do_free && as->free) { - ptr = as->array[number]; - } else { - ptr = 0; - } - - as->array[number] = as->array[--as->count]; - - /* - * Invoke the third-party function only when the state - * of the parent structure is consistent. - */ - if(ptr) as->free(ptr); - } -} - -/* - * Free the contents of the set, do not free the set itself. - */ -void -asn_set_empty(void *asn_set_of_x) { - asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); - - if(as) { - if(as->array) { - if(as->free) { - while(as->count--) - as->free(as->array[as->count]); - } - FREEMEM(as->array); - as->array = 0; - } - as->count = 0; - as->size = 0; - } - -} - +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * Add another element into the set. + */ +int +asn_set_add(void *asn_set_of_x, void *ptr) { + asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); + + if(as == 0 || ptr == 0) { + errno = EINVAL; /* Invalid arguments */ + return -1; + } + + /* + * Make sure there's enough space to insert an element. + */ + if(as->count == as->size) { + int _newsize = as->size ? (as->size << 1) : 4; + void *_new_arr; + _new_arr = REALLOC(as->array, _newsize * sizeof(as->array[0])); + if(_new_arr) { + as->array = (void **)_new_arr; + as->size = _newsize; + } else { + /* ENOMEM */ + return -1; + } + } + + as->array[as->count++] = ptr; + + return 0; +} + +void +asn_set_del(void *asn_set_of_x, int number, int _do_free) { + asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); + + if(as) { + void *ptr; + if(number < 0 || number >= as->count) + return; + + if(_do_free && as->free) { + ptr = as->array[number]; + } else { + ptr = 0; + } + + as->array[number] = as->array[--as->count]; + + /* + * Invoke the third-party function only when the state + * of the parent structure is consistent. + */ + if(ptr) as->free(ptr); + } +} + +/* + * Free the contents of the set, do not free the set itself. + */ +void +asn_set_empty(void *asn_set_of_x) { + asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); + + if(as) { + if(as->array) { + if(as->free) { + while(as->count--) + as->free(as->array[as->count]); + } + FREEMEM(as->array); + as->array = 0; + } + as->count = 0; + as->size = 0; + } + +} + diff --git a/certgen/asncodec/asn_SET_OF.h b/certgen/asncodec/asn_SET_OF.h index 4a21409..882e1a4 100644 --- a/certgen/asncodec/asn_SET_OF.h +++ b/certgen/asncodec/asn_SET_OF.h @@ -1,72 +1,72 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_SET_OF_H -#define ASN_SET_OF_H - -#ifdef __cplusplus -#define A_SET_OF(type) \ - struct { \ - type **array; \ - int count; /* Meaningful size */ \ - int size; /* Allocated size */ \ - void (*free)(decltype(*array)); \ - } -#else /* C */ -#define A_SET_OF(type) \ - struct { \ - type **array; \ - int count; /* Meaningful size */ \ - int size; /* Allocated size */ \ - void (*free)(type *); \ - } -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define ASN_SET_ADD(headptr, ptr) \ - asn_set_add((headptr), (ptr)) - -/******************************************* - * Implementation of the SET OF structure. - */ - -/* - * Add another structure into the set by its pointer. - * RETURN VALUES: - * 0 for success and -1/errno for failure. - */ -int asn_set_add(void *asn_set_of_x, void *ptr); - -/* - * Delete the element from the set by its number (base 0). - * This is a constant-time operation. The order of elements before the - * deleted ones is guaranteed, the order of elements after the deleted - * one is NOT guaranteed. - * If _do_free is given AND the (*free) is initialized, the element - * will be freed using the custom (*free) function as well. - */ -void asn_set_del(void *asn_set_of_x, int number, int _do_free); - -/* - * Empty the contents of the set. Will free the elements, if (*free) is given. - * Will NOT free the set itself. - */ -void asn_set_empty(void *asn_set_of_x); - -/* - * Cope with different conversions requirements to/from void in C and C++. - * This is mostly useful for support library. - */ -typedef A_SET_OF(void) asn_anonymous_set_; -#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) -#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_SET_OF_H */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_SET_OF_H +#define ASN_SET_OF_H + +#ifdef __cplusplus +#define A_SET_OF(type) \ + struct { \ + type **array; \ + int count; /* Meaningful size */ \ + int size; /* Allocated size */ \ + void (*free)(decltype(*array)); \ + } +#else /* C */ +#define A_SET_OF(type) \ + struct { \ + type **array; \ + int count; /* Meaningful size */ \ + int size; /* Allocated size */ \ + void (*free)(type *); \ + } +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define ASN_SET_ADD(headptr, ptr) \ + asn_set_add((headptr), (ptr)) + +/******************************************* + * Implementation of the SET OF structure. + */ + +/* + * Add another structure into the set by its pointer. + * RETURN VALUES: + * 0 for success and -1/errno for failure. + */ +int asn_set_add(void *asn_set_of_x, void *ptr); + +/* + * Delete the element from the set by its number (base 0). + * This is a constant-time operation. The order of elements before the + * deleted ones is guaranteed, the order of elements after the deleted + * one is NOT guaranteed. + * If _do_free is given AND the (*free) is initialized, the element + * will be freed using the custom (*free) function as well. + */ +void asn_set_del(void *asn_set_of_x, int number, int _do_free); + +/* + * Empty the contents of the set. Will free the elements, if (*free) is given. + * Will NOT free the set itself. + */ +void asn_set_empty(void *asn_set_of_x); + +/* + * Cope with different conversions requirements to/from void in C and C++. + * This is mostly useful for support library. + */ +typedef A_SET_OF(void) asn_anonymous_set_; +#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) +#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_SET_OF_H */ diff --git a/certgen/asncodec/asn_application.c b/certgen/asncodec/asn_application.c index 6ab30df..7992185 100644 --- a/certgen/asncodec/asn_application.c +++ b/certgen/asncodec/asn_application.c @@ -1,440 +1,538 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -static asn_enc_rval_t asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx, - enum asn_transfer_syntax syntax, - const asn_TYPE_descriptor_t *td, - const void *sptr, - asn_app_consume_bytes_f *callback, - void *callback_key); - - -struct callback_count_bytes_key { - asn_app_consume_bytes_f *callback; - void *callback_key; - size_t computed_size; -}; - -/* - * Encoder which just counts bytes that come through it. - */ -static int -callback_count_bytes_cb(const void *data, size_t size, void *keyp) { - struct callback_count_bytes_key *key = keyp; - int ret; - - ret = key->callback(data, size, key->callback_key); - if(ret >= 0) { - key->computed_size += size; - } - - return ret; -} - -struct overrun_encoder_key { - void *buffer; - size_t buffer_size; - size_t computed_size; -}; - -struct dynamic_encoder_key { - void *buffer; - size_t buffer_size; - size_t computed_size; -}; - -struct callback_failure_catch_key { - asn_app_consume_bytes_f *callback; - void *callback_key; - int callback_failed; -}; - -/* - * Encoder which doesn't stop counting bytes - * even if it reaches the end of the buffer. - */ -static int -overrun_encoder_cb(const void *data, size_t size, void *keyp) { - struct overrun_encoder_key *key = keyp; - - if(key->computed_size + size > key->buffer_size) { - /* - * Avoid accident on the next call: - * stop adding bytes to the buffer. - */ - key->buffer_size = 0; - } else { - memcpy((char *)key->buffer + key->computed_size, data, size); - } - key->computed_size += size; - - return 0; -} - -/* - * Encoder which dynamically allocates output, and continues - * to count even if allocation failed. - */ -static int -dynamic_encoder_cb(const void *data, size_t size, void *keyp) { - struct dynamic_encoder_key *key = keyp; - - if(key->buffer) { - if(key->computed_size + size >= key->buffer_size) { - void *p; - size_t new_size = key->buffer_size; - - do { - new_size *= 2; - } while(new_size <= key->computed_size + size); - - p = REALLOC(key->buffer, new_size); - if(p) { - key->buffer = p; - key->buffer_size = new_size; - } else { - FREEMEM(key->buffer); - key->buffer = 0; - key->buffer_size = 0; - key->computed_size += size; - return 0; - } - } - memcpy((char *)key->buffer + key->computed_size, data, size); - } - - key->computed_size += size; - - return 0; -} - -/* - * Encoder which help convert the application level encoder failure into EIO. - */ -static int -callback_failure_catch_cb(const void *data, size_t size, void *keyp) { - struct callback_failure_catch_key *key = keyp; - int ret; - - ret = key->callback(data, size, key->callback_key); - if(ret < 0) { - key->callback_failed = 1; - } - - return ret; -} - -asn_enc_rval_t -asn_encode(const asn_codec_ctx_t *opt_codec_ctx, - enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, - const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) { - struct callback_failure_catch_key cb_key; - asn_enc_rval_t er; - - if(!callback) { - errno = EINVAL; - ASN__ENCODE_FAILED; - } - - cb_key.callback = callback; - cb_key.callback_key = callback_key; - cb_key.callback_failed = 0; - - er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr, - callback_failure_catch_cb, &cb_key); - if(cb_key.callback_failed) { - assert(er.encoded == -1); - assert(errno == EBADF); - errno = EIO; - } - - return er; -} - -asn_enc_rval_t -asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx, - enum asn_transfer_syntax syntax, - const asn_TYPE_descriptor_t *td, const void *sptr, - void *buffer, size_t buffer_size) { - struct overrun_encoder_key buf_key; - asn_enc_rval_t er; - - if(buffer_size > 0 && !buffer) { - errno = EINVAL; - ASN__ENCODE_FAILED; - } - - buf_key.buffer = buffer; - buf_key.buffer_size = buffer_size; - buf_key.computed_size = 0; - - er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr, - overrun_encoder_cb, &buf_key); - - if(er.encoded >= 0 && (size_t)er.encoded != buf_key.computed_size) { - ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE - " yet produced %" ASN_PRI_SIZE " bytes", - er.encoded, buf_key.computed_size); - assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size); - } - - return er; -} - -asn_encode_to_new_buffer_result_t -asn_encode_to_new_buffer(const asn_codec_ctx_t *opt_codec_ctx, - enum asn_transfer_syntax syntax, - const asn_TYPE_descriptor_t *td, const void *sptr) { - struct dynamic_encoder_key buf_key; - asn_encode_to_new_buffer_result_t res; - - buf_key.buffer_size = 16; - buf_key.buffer = MALLOC(buf_key.buffer_size); - buf_key.computed_size = 0; - - res.result = asn_encode_internal(opt_codec_ctx, syntax, td, sptr, - dynamic_encoder_cb, &buf_key); - - if(res.result.encoded >= 0 - && (size_t)res.result.encoded != buf_key.computed_size) { - ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE - " yet produced %" ASN_PRI_SIZE " bytes", - res.result.encoded, buf_key.computed_size); - assert(res.result.encoded < 0 - || (size_t)res.result.encoded == buf_key.computed_size); - } - - res.buffer = buf_key.buffer; - - /* 0-terminate just in case. */ - if(res.buffer) { - assert(buf_key.computed_size < buf_key.buffer_size); - ((char *)res.buffer)[buf_key.computed_size] = '\0'; - } - - return res; -} - -static asn_enc_rval_t -asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx, - enum asn_transfer_syntax syntax, - const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_consume_bytes_f *callback, void *callback_key) { - asn_enc_rval_t er; - enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL; - - (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */ - - if(!td || !sptr) { - errno = EINVAL; - ASN__ENCODE_FAILED; - } - - switch(syntax) { - case ATS_NONSTANDARD_PLAINTEXT: - if(td->op->print_struct) { - struct callback_count_bytes_key cb_key; - cb_key.callback = callback; - cb_key.callback_key = callback_key; - cb_key.computed_size = 0; - if(td->op->print_struct(td, sptr, 1, callback_count_bytes_cb, - &cb_key) - < 0 - || callback_count_bytes_cb("\n", 1, &cb_key) < 0) { - errno = EBADF; /* Structure has incorrect form. */ - er.encoded = -1; - er.failed_type = td; - er.structure_ptr = sptr; - } else { - er.encoded = cb_key.computed_size; - er.failed_type = 0; - er.structure_ptr = 0; - } - } else { - errno = ENOENT; /* Transfer syntax is not defined for this type. */ - ASN__ENCODE_FAILED; - } - break; - - case ATS_RANDOM: - errno = ENOENT; /* Randomization doesn't make sense on output. */ - ASN__ENCODE_FAILED; - - case ATS_BER: - /* BER is a superset of DER. */ - /* Fall through. */ - case ATS_DER: - if(td->op->der_encoder) { - er = der_encode(td, sptr, callback, callback_key); - if(er.encoded == -1) { - if(er.failed_type && er.failed_type->op->der_encoder) { - errno = EBADF; /* Structure has incorrect form. */ - } else { - errno = ENOENT; /* DER is not defined for this type. */ - } - } - } else { - errno = ENOENT; /* Transfer syntax is not defined for this type. */ - ASN__ENCODE_FAILED; - } - break; - case ATS_CER: - errno = ENOENT; /* Transfer syntax is not defined for any type. */ - ASN__ENCODE_FAILED; - -#ifdef ASN_DISABLE_OER_SUPPORT - case ATS_BASIC_OER: - case ATS_CANONICAL_OER: - errno = ENOENT; /* PER is not defined. */ - ASN__ENCODE_FAILED; - break; -#else /* ASN_DISABLE_OER_SUPPORT */ - case ATS_BASIC_OER: - /* CANONICAL-OER is a superset of BASIC-OER. */ - /* Fall through. */ - case ATS_CANONICAL_OER: - if(td->op->oer_encoder) { - er = oer_encode(td, sptr, callback, callback_key); - if(er.encoded == -1) { - if(er.failed_type && er.failed_type->op->oer_encoder) { - errno = EBADF; /* Structure has incorrect form. */ - } else { - errno = ENOENT; /* OER is not defined for this type. */ - } - } - } else { - errno = ENOENT; /* Transfer syntax is not defined for this type. */ - ASN__ENCODE_FAILED; - } - break; -#endif /* ASN_DISABLE_OER_SUPPORT */ - -#ifdef ASN_DISABLE_PER_SUPPORT - case ATS_UNALIGNED_BASIC_PER: - case ATS_UNALIGNED_CANONICAL_PER: - errno = ENOENT; /* PER is not defined. */ - ASN__ENCODE_FAILED; - break; -#else /* ASN_DISABLE_PER_SUPPORT */ - case ATS_UNALIGNED_BASIC_PER: - /* CANONICAL-UPER is a superset of BASIC-UPER. */ - /* Fall through. */ - case ATS_UNALIGNED_CANONICAL_PER: - if(td->op->uper_encoder) { - er = uper_encode(td, 0, sptr, callback, callback_key); - if(er.encoded == -1) { - if(er.failed_type && er.failed_type->op->uper_encoder) { - errno = EBADF; /* Structure has incorrect form. */ - } else { - errno = ENOENT; /* UPER is not defined for this type. */ - } - } else { - ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded); - if(er.encoded == 0) { - /* Enforce "Complete Encoding" of X.691 #11.1 */ - if(callback("\0", 1, callback_key) < 0) { - errno = EBADF; - ASN__ENCODE_FAILED; - } - er.encoded = 8; /* Exactly 8 zero bits is added. */ - } - /* Convert bits into bytes */ - er.encoded = (er.encoded + 7) >> 3; - } - } else { - errno = ENOENT; /* Transfer syntax is not defined for this type. */ - ASN__ENCODE_FAILED; - } - break; -#endif /* ASN_DISABLE_PER_SUPPORT */ - - case ATS_BASIC_XER: - /* CANONICAL-XER is a superset of BASIC-XER. */ - xer_flags &= ~XER_F_CANONICAL; - xer_flags |= XER_F_BASIC; - /* Fall through. */ - case ATS_CANONICAL_XER: - if(td->op->xer_encoder) { - er = xer_encode(td, sptr, xer_flags, callback, callback_key); - if(er.encoded == -1) { - if(er.failed_type && er.failed_type->op->xer_encoder) { - errno = EBADF; /* Structure has incorrect form. */ - } else { - errno = ENOENT; /* XER is not defined for this type. */ - } - } - } else { - errno = ENOENT; /* Transfer syntax is not defined for this type. */ - ASN__ENCODE_FAILED; - } - break; - - default: - errno = ENOENT; - ASN__ENCODE_FAILED; - } - - return er; -} - -asn_dec_rval_t -asn_decode(const asn_codec_ctx_t *opt_codec_ctx, - enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, - void **sptr, const void *buffer, size_t size) { - if(!td || !td->op || !sptr || (size && !buffer)) { - ASN__DECODE_FAILED; - } - - switch(syntax) { - case ATS_CER: - case ATS_NONSTANDARD_PLAINTEXT: - default: - errno = ENOENT; - ASN__DECODE_FAILED; - - case ATS_RANDOM: - if(!td->op->random_fill) { - ASN__DECODE_FAILED; - } else { - if(asn_random_fill(td, sptr, 16000) == 0) { - asn_dec_rval_t ret = {RC_OK, 0}; - return ret; - } else { - ASN__DECODE_FAILED; - } - } - break; - - case ATS_DER: - case ATS_BER: - return ber_decode(opt_codec_ctx, td, sptr, buffer, size); - - case ATS_BASIC_OER: - case ATS_CANONICAL_OER: -#ifdef ASN_DISABLE_OER_SUPPORT - errno = ENOENT; - ASN__DECODE_FAILED; -#else - return oer_decode(opt_codec_ctx, td, sptr, buffer, size); -#endif - - case ATS_UNALIGNED_BASIC_PER: - case ATS_UNALIGNED_CANONICAL_PER: -#ifdef ASN_DISABLE_PER_SUPPORT - errno = ENOENT; - ASN__DECODE_FAILED; -#else - return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size); -#endif - - case ATS_BASIC_XER: - case ATS_CANONICAL_XER: - return xer_decode(opt_codec_ctx, td, sptr, buffer, size); - } -} - +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +static asn_enc_rval_t asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx, + enum asn_transfer_syntax syntax, + const asn_TYPE_descriptor_t *td, + const void *sptr, + asn_app_consume_bytes_f *callback, + void *callback_key); + + +struct callback_count_bytes_key { + asn_app_consume_bytes_f *callback; + void *callback_key; + size_t computed_size; +}; + +/* + * Encoder which just counts bytes that come through it. + */ +static int +callback_count_bytes_cb(const void *data, size_t size, void *keyp) { + struct callback_count_bytes_key *key = keyp; + int ret; + + ret = key->callback(data, size, key->callback_key); + if(ret >= 0) { + key->computed_size += size; + } + + return ret; +} + +struct overrun_encoder_key { + void *buffer; + size_t buffer_size; + size_t computed_size; +}; + +struct dynamic_encoder_key { + void *buffer; + size_t buffer_size; + size_t computed_size; +}; + +struct callback_failure_catch_key { + asn_app_consume_bytes_f *callback; + void *callback_key; + int callback_failed; +}; + +/* + * Encoder which doesn't stop counting bytes + * even if it reaches the end of the buffer. + */ +static int +overrun_encoder_cb(const void *data, size_t size, void *keyp) { + struct overrun_encoder_key *key = keyp; + + if(key->computed_size + size > key->buffer_size) { + /* + * Avoid accident on the next call: + * stop adding bytes to the buffer. + */ + key->buffer_size = 0; + } else { + memcpy((char *)key->buffer + key->computed_size, data, size); + } + key->computed_size += size; + + return 0; +} + +/* + * Encoder which dynamically allocates output, and continues + * to count even if allocation failed. + */ +static int +dynamic_encoder_cb(const void *data, size_t size, void *keyp) { + struct dynamic_encoder_key *key = keyp; + + if(key->buffer) { + if(key->computed_size + size >= key->buffer_size) { + void *p; + size_t new_size = key->buffer_size; + + do { + new_size *= 2; + } while(new_size <= key->computed_size + size); + + p = REALLOC(key->buffer, new_size); + if(p) { + key->buffer = p; + key->buffer_size = new_size; + } else { + FREEMEM(key->buffer); + key->buffer = 0; + key->buffer_size = 0; + key->computed_size += size; + return 0; + } + } + memcpy((char *)key->buffer + key->computed_size, data, size); + } + + key->computed_size += size; + + return 0; +} + +/* + * Encoder which help convert the application level encoder failure into EIO. + */ +static int +callback_failure_catch_cb(const void *data, size_t size, void *keyp) { + struct callback_failure_catch_key *key = keyp; + int ret; + + ret = key->callback(data, size, key->callback_key); + if(ret < 0) { + key->callback_failed = 1; + } + + return ret; +} + +asn_enc_rval_t +asn_encode(const asn_codec_ctx_t *opt_codec_ctx, + enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, + const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) { + struct callback_failure_catch_key cb_key; + asn_enc_rval_t er = {0,0,0}; + + if(!callback) { + errno = EINVAL; + ASN__ENCODE_FAILED; + } + + cb_key.callback = callback; + cb_key.callback_key = callback_key; + cb_key.callback_failed = 0; + + er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr, + callback_failure_catch_cb, &cb_key); + if(cb_key.callback_failed) { + assert(er.encoded == -1); + assert(errno == EBADF); + errno = EIO; + } + + return er; +} + +asn_enc_rval_t +asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx, + enum asn_transfer_syntax syntax, + const asn_TYPE_descriptor_t *td, const void *sptr, + void *buffer, size_t buffer_size) { + struct overrun_encoder_key buf_key; + asn_enc_rval_t er = {0,0,0}; + + if(buffer_size > 0 && !buffer) { + errno = EINVAL; + ASN__ENCODE_FAILED; + } + + buf_key.buffer = buffer; + buf_key.buffer_size = buffer_size; + buf_key.computed_size = 0; + + er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr, + overrun_encoder_cb, &buf_key); + + if(er.encoded >= 0 && (size_t)er.encoded != buf_key.computed_size) { + ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE + " yet produced %" ASN_PRI_SIZE " bytes", + er.encoded, buf_key.computed_size); + assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size); + } + + return er; +} + +asn_encode_to_new_buffer_result_t +asn_encode_to_new_buffer(const asn_codec_ctx_t *opt_codec_ctx, + enum asn_transfer_syntax syntax, + const asn_TYPE_descriptor_t *td, const void *sptr) { + struct dynamic_encoder_key buf_key; + asn_encode_to_new_buffer_result_t res; + + buf_key.buffer_size = 16; + buf_key.buffer = MALLOC(buf_key.buffer_size); + buf_key.computed_size = 0; + + res.result = asn_encode_internal(opt_codec_ctx, syntax, td, sptr, + dynamic_encoder_cb, &buf_key); + + if(res.result.encoded >= 0 + && (size_t)res.result.encoded != buf_key.computed_size) { + ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE + " yet produced %" ASN_PRI_SIZE " bytes", + res.result.encoded, buf_key.computed_size); + assert(res.result.encoded < 0 + || (size_t)res.result.encoded == buf_key.computed_size); + } + + res.buffer = buf_key.buffer; + + /* 0-terminate just in case. */ + if(res.buffer) { + assert(buf_key.computed_size < buf_key.buffer_size); + ((char *)res.buffer)[buf_key.computed_size] = '\0'; + } + + return res; +} + +static asn_enc_rval_t +asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx, + enum asn_transfer_syntax syntax, + const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *callback, void *callback_key) { + asn_enc_rval_t er = {0,0,0}; +#if !defined(ASN_DISABLE_XER_SUPPORT) + enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + + (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */ + + if(!td || !sptr) { + errno = EINVAL; + ASN__ENCODE_FAILED; + } + + switch(syntax) { + case ATS_NONSTANDARD_PLAINTEXT: + if(td->op->print_struct) { + struct callback_count_bytes_key cb_key; + cb_key.callback = callback; + cb_key.callback_key = callback_key; + cb_key.computed_size = 0; + if(td->op->print_struct(td, sptr, 1, callback_count_bytes_cb, + &cb_key) + < 0 + || callback_count_bytes_cb("\n", 1, &cb_key) < 0) { + errno = EBADF; /* Structure has incorrect form. */ + er.encoded = -1; + er.failed_type = td; + er.structure_ptr = sptr; + } else { + er.encoded = cb_key.computed_size; + er.failed_type = 0; + er.structure_ptr = 0; + } + } else { + errno = ENOENT; /* Transfer syntax is not defined for this type. */ + ASN__ENCODE_FAILED; + } + break; + + case ATS_RANDOM: + errno = ENOENT; /* Randomization doesn't make sense on output. */ + ASN__ENCODE_FAILED; + +#if !defined(ASN_DISABLE_BER_SUPPORT) + case ATS_BER: + /* BER is a superset of DER. */ + /* Fall through. */ + case ATS_DER: + if(td->op->der_encoder) { + er = der_encode(td, sptr, callback, callback_key); + if(er.encoded == -1) { + if(er.failed_type && er.failed_type->op->der_encoder) { + errno = EBADF; /* Structure has incorrect form. */ + } else { + errno = ENOENT; /* DER is not defined for this type. */ + } + } + } else { + errno = ENOENT; /* Transfer syntax is not defined for this type. */ + ASN__ENCODE_FAILED; + } + break; + case ATS_CER: + errno = ENOENT; /* Transfer syntax is not defined for any type. */ + ASN__ENCODE_FAILED; +#else + case ATS_BER: + case ATS_DER: + case ATS_CER: + errno = ENOENT; /* BER is not defined. */ + ASN__ENCODE_FAILED; + +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) + case ATS_BASIC_OER: + /* CANONICAL-OER is a superset of BASIC-OER. */ + /* Fall through. */ + case ATS_CANONICAL_OER: + if(td->op->oer_encoder) { + er = oer_encode(td, sptr, callback, callback_key); + if(er.encoded == -1) { + if(er.failed_type && er.failed_type->op->oer_encoder) { + errno = EBADF; /* Structure has incorrect form. */ + } else { + errno = ENOENT; /* OER is not defined for this type. */ + } + } + } else { + errno = ENOENT; /* Transfer syntax is not defined for this type. */ + ASN__ENCODE_FAILED; + } + break; +#else + case ATS_BASIC_OER: + case ATS_CANONICAL_OER: + errno = ENOENT; /* OER is not defined. */ + ASN__ENCODE_FAILED; + break; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) + case ATS_UNALIGNED_BASIC_PER: + /* CANONICAL-UPER is a superset of BASIC-UPER. */ + /* Fall through. */ + case ATS_UNALIGNED_CANONICAL_PER: + if(td->op->uper_encoder) { + er = uper_encode(td, 0, sptr, callback, callback_key); + if(er.encoded == -1) { + if(er.failed_type && er.failed_type->op->uper_encoder) { + errno = EBADF; /* Structure has incorrect form. */ + } else { + errno = ENOENT; /* UPER is not defined for this type. */ + } + } else { + ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded); + if(er.encoded == 0) { + /* Enforce "Complete Encoding" of X.691 #11.1 */ + if(callback("\0", 1, callback_key) < 0) { + errno = EBADF; + ASN__ENCODE_FAILED; + } + er.encoded = 8; /* Exactly 8 zero bits is added. */ + } + /* Convert bits into bytes */ + er.encoded = (er.encoded + 7) >> 3; + } + } else { + errno = ENOENT; /* Transfer syntax is not defined for this type. */ + ASN__ENCODE_FAILED; + } + break; +#else + case ATS_UNALIGNED_BASIC_PER: + case ATS_UNALIGNED_CANONICAL_PER: + errno = ENOENT; /* UPER is not defined. */ + ASN__ENCODE_FAILED; + break; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + case ATS_ALIGNED_BASIC_PER: + /* CANONICAL-APER is a superset of BASIC-APER. */ + /* Fall through. */ + case ATS_ALIGNED_CANONICAL_PER: + if(td->op->aper_encoder) { + er = aper_encode(td, 0, sptr, callback, callback_key); + if(er.encoded == -1) { + if(er.failed_type && er.failed_type->op->aper_encoder) { + errno = EBADF; /* Structure has incorrect form. */ + } else { + errno = ENOENT; /* APER is not defined for this type. */ + } + } else { + ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded); + if(er.encoded == 0) { + /* Enforce "Complete Encoding" of X.691 #11.1 */ + if(callback("\0", 1, callback_key) < 0) { + errno = EBADF; + ASN__ENCODE_FAILED; + } + er.encoded = 8; /* Exactly 8 zero bits is added. */ + } + /* Convert bits into bytes */ + er.encoded = (er.encoded + 7) >> 3; + } + } else { + errno = ENOENT; /* Transfer syntax is not defined for this type. */ + ASN__ENCODE_FAILED; + } + break; +#else + case ATS_ALIGNED_BASIC_PER: + case ATS_ALIGNED_CANONICAL_PER: + errno = ENOENT; /* APER is not defined. */ + ASN__ENCODE_FAILED; + break; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) + case ATS_BASIC_XER: + /* CANONICAL-XER is a superset of BASIC-XER. */ + xer_flags &= ~XER_F_CANONICAL; + xer_flags |= XER_F_BASIC; + /* Fall through. */ + case ATS_CANONICAL_XER: + if(td->op->xer_encoder) { + er = xer_encode(td, sptr, xer_flags, callback, callback_key); + if(er.encoded == -1) { + if(er.failed_type && er.failed_type->op->xer_encoder) { + errno = EBADF; /* Structure has incorrect form. */ + } else { + errno = ENOENT; /* XER is not defined for this type. */ + } + } + } else { + errno = ENOENT; /* Transfer syntax is not defined for this type. */ + ASN__ENCODE_FAILED; + } + break; +#else + case ATS_BASIC_XER: + case ATS_CANONICAL_XER: + errno = ENOENT; /* XER is not defined. */ + ASN__ENCODE_FAILED; + break; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) + case ATS_JER: + if(td->op->jer_encoder) { + er = jer_encode(td, sptr, callback, callback_key); + if(er.encoded == -1) { + if(er.failed_type && er.failed_type->op->jer_encoder) { + errno = EBADF; /* Structure has incorrect form. */ + } else { + errno = ENOENT; /* JER is not defined for this type. */ + } + } + } else { + errno = ENOENT; /* Transfer syntax is not defined for this type. */ + ASN__ENCODE_FAILED; + } + break; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + default: + errno = ENOENT; + ASN__ENCODE_FAILED; + } + + return er; +} + +asn_dec_rval_t +asn_decode(const asn_codec_ctx_t *opt_codec_ctx, + enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, + void **sptr, const void *buffer, size_t size) { + if(!td || !td->op || !sptr || (size && !buffer)) { + ASN__DECODE_FAILED; + } + + switch(syntax) { + case ATS_CER: + case ATS_NONSTANDARD_PLAINTEXT: + default: + errno = ENOENT; + ASN__DECODE_FAILED; + + case ATS_RANDOM: +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + if(!td->op->random_fill) { + ASN__DECODE_FAILED; + } else { + if(asn_random_fill(td, sptr, 16000) == 0) { + asn_dec_rval_t ret = {RC_OK, 0}; + return ret; + } else { + ASN__DECODE_FAILED; + } + } + break; +#else + errno = ENOENT; + ASN__DECODE_FAILED; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + + case ATS_DER: + case ATS_BER: +#if !defined(ASN_DISABLE_BER_SUPPORT) + return ber_decode(opt_codec_ctx, td, sptr, buffer, size); +#else + errno = ENOENT; + ASN__DECODE_FAILED; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + + case ATS_BASIC_OER: + case ATS_CANONICAL_OER: +#if !defined(ASN_DISABLE_OER_SUPPORT) + return oer_decode(opt_codec_ctx, td, sptr, buffer, size); +#else + errno = ENOENT; + ASN__DECODE_FAILED; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + + case ATS_UNALIGNED_BASIC_PER: + case ATS_UNALIGNED_CANONICAL_PER: +#if !defined(ASN_DISABLE_UPER_SUPPORT) + return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size); +#else + errno = ENOENT; + ASN__DECODE_FAILED; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ + + case ATS_ALIGNED_BASIC_PER: + case ATS_ALIGNED_CANONICAL_PER: +#if !defined(ASN_DISABLE_APER_SUPPORT) + return aper_decode_complete(opt_codec_ctx, td, sptr, buffer, size); +#else + errno = ENOENT; + ASN__DECODE_FAILED; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + + case ATS_BASIC_XER: + case ATS_CANONICAL_XER: +#if !defined(ASN_DISABLE_XER_SUPPORT) + return xer_decode(opt_codec_ctx, td, sptr, buffer, size); +#else + errno = ENOENT; + ASN__DECODE_FAILED; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + } +} + diff --git a/certgen/asncodec/asn_application.h b/certgen/asncodec/asn_application.h index 0ec4e16..bf10cd3 100644 --- a/certgen/asncodec/asn_application.h +++ b/certgen/asncodec/asn_application.h @@ -1,169 +1,173 @@ -/*- - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Application-level ASN.1 callbacks. - */ -#ifndef ASN_APPLICATION_H -#define ASN_APPLICATION_H - -#include "asn_system.h" /* for platform-dependent types */ -#include "asn_codecs.h" /* for ASN.1 codecs specifics */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * A selection of ASN.1 Transfer Syntaxes to use with generalized - * encoders and decoders declared further in this .h file. - */ -enum asn_transfer_syntax { - /* Avoid appearance of a default transfer syntax. */ - ATS_INVALID = 0, - /* Plaintext output (not conforming to any standard), for debugging. */ - ATS_NONSTANDARD_PLAINTEXT, - /* Returns a randomly generatede structure. */ - ATS_RANDOM, - /* - * X.690: - * BER: Basic Encoding Rules. - * DER: Distinguished Encoding Rules. - * CER: Canonical Encoding Rules. - * DER and CER are more strict variants of BER. - */ - ATS_BER, - ATS_DER, - ATS_CER, /* Only decoding is supported */ - /* - * X.696: - * OER: Octet Encoding Rules. - * CANONICAL-OER is a more strict variant of BASIC-OER. - */ - ATS_BASIC_OER, - ATS_CANONICAL_OER, - /* - * X.691: - * PER: Packed Encoding Rules. - * CANONICAL-PER is a more strict variant of BASIC-PER. - * NOTE: Produces or consumes a complete encoding (X.691 (08/2015) #11.1). - */ - ATS_UNALIGNED_BASIC_PER, - ATS_UNALIGNED_CANONICAL_PER, - /* - * X.693: - * XER: XML Encoding Rules. - * CANONICAL-XER is a more strict variant of BASIC-XER. - */ - ATS_BASIC_XER, - ATS_CANONICAL_XER -}; - -/* - * A generic encoder for any supported transfer syntax. - * RETURN VALUES: - * The (.encoded) field of the return value is REDEFINED to mean the following: - * >=0: The computed size of the encoded data. Can exceed the (buffer_size). - * -1: Error encoding the structure. See the error code in (errno): - * EINVAL: Incorrect parameters to the function, such as NULLs. - * ENOENT: Encoding transfer syntax is not defined (for this type). - * EBADF: The structure has invalid form or content constraint failed. - * The (.failed_type) and (.structure_ptr) MIGHT be set to the appropriate - * values at the place of failure, if at all possible. - * WARNING: The (.encoded) field of the return value can exceed the buffer_size. - * This is similar to snprintf(3) contract which might return values - * greater than the buffer size. - */ -asn_enc_rval_t asn_encode_to_buffer( - const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */ - enum asn_transfer_syntax, - const struct asn_TYPE_descriptor_s *type_to_encode, - const void *structure_to_encode, void *buffer, size_t buffer_size); - -/* - * A variant of asn_encode_to_buffer() with automatically allocated buffer. - * RETURN VALUES: - * On success, returns a newly allocated (.buffer) containing the whole message. - * The message size is returned in (.result.encoded). - * On failure: - * (.buffer) is NULL, - * (.result.encoded) as in asn_encode_to_buffer(), - * The errno codes as in asn_encode_to_buffer(), plus the following: - * ENOMEM: Memory allocation failed due to system or internal limits. - * The user is responsible for freeing the (.buffer). - */ -typedef struct asn_encode_to_new_buffer_result_s { - void *buffer; /* NULL if failed to encode. */ - asn_enc_rval_t result; -} asn_encode_to_new_buffer_result_t; -asn_encode_to_new_buffer_result_t asn_encode_to_new_buffer( - const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */ - enum asn_transfer_syntax, - const struct asn_TYPE_descriptor_s *type_to_encode, - const void *structure_to_encode); - - -/* - * Generic type of an application-defined callback to return various - * types of data to the application. - * EXPECTED RETURN VALUES: - * -1: Failed to consume bytes. Abort the mission. - * Non-negative return values indicate success, and ignored. - */ -typedef int(asn_app_consume_bytes_f)(const void *buffer, size_t size, - void *application_specific_key); - - -/* - * A generic encoder for any supported transfer syntax. - * Returns the comprehensive encoding result descriptor (see asn_codecs.h). - * RETURN VALUES: - * The negative (.encoded) field of the return values is accompanied with the - * following error codes (errno): - * EINVAL: Incorrect parameters to the function, such as NULLs. - * ENOENT: Encoding transfer syntax is not defined (for this type). - * EBADF: The structure has invalid form or content constraint failed. - * EIO: The (callback) has returned negative value during encoding. - */ -asn_enc_rval_t asn_encode( - const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */ - enum asn_transfer_syntax, - const struct asn_TYPE_descriptor_s *type_to_encode, - const void *structure_to_encode, - asn_app_consume_bytes_f *callback, void *callback_key); - - -/* - * A generic decoder for any supported transfer syntax. - */ -asn_dec_rval_t asn_decode( - const asn_codec_ctx_t *opt_codec_parameters, enum asn_transfer_syntax, - const struct asn_TYPE_descriptor_s *type_to_decode, - void **structure_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of that buffer */ -); - - -/* - * A callback of this type is called whenever constraint validation fails - * on some ASN.1 type. See "constraints.h" for more details on constraint - * validation. - * This callback specifies a descriptor of the ASN.1 type which failed - * the constraint check, as well as human readable message on what - * particular constraint has failed. - */ -typedef void (asn_app_constraint_failed_f)(void *application_specific_key, - const struct asn_TYPE_descriptor_s *type_descriptor_which_failed, - const void *structure_which_failed_ptr, - const char *error_message_format, ...) CC_PRINTFLIKE(4, 5); - - -#ifdef __cplusplus -} -#endif - -#include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ - -#endif /* ASN_APPLICATION_H */ +/*- + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Application-level ASN.1 callbacks. + */ +#ifndef ASN_APPLICATION_H +#define ASN_APPLICATION_H + +#include "asn_system.h" /* for platform-dependent types */ +#include "asn_codecs.h" /* for ASN.1 codecs specifics */ +#include "asn_config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * A selection of ASN.1 Transfer Syntaxes to use with generalized + * encoders and decoders declared further in this .h file. + */ +enum asn_transfer_syntax { + /* Avoid appearance of a default transfer syntax. */ + ATS_INVALID = 0, + /* Plaintext output (not conforming to any standard), for debugging. */ + ATS_NONSTANDARD_PLAINTEXT, + /* Returns a randomly generated structure. */ + ATS_RANDOM, + /* + * X.690: + * BER: Basic Encoding Rules. + * DER: Distinguished Encoding Rules. + * CER: Canonical Encoding Rules. + * DER and CER are more strict variants of BER. + */ + ATS_BER, + ATS_DER, + ATS_CER, /* Only decoding is supported */ + /* + * X.696: + * OER: Octet Encoding Rules. + * CANONICAL-OER is a more strict variant of BASIC-OER. + */ + ATS_BASIC_OER, + ATS_CANONICAL_OER, + /* + * X.691: + * PER: Packed Encoding Rules. + * CANONICAL-PER is a more strict variant of BASIC-PER. + * NOTE: Produces or consumes a complete encoding (X.691 (08/2015) #11.1). + */ + ATS_UNALIGNED_BASIC_PER, + ATS_UNALIGNED_CANONICAL_PER, + ATS_ALIGNED_BASIC_PER, + ATS_ALIGNED_CANONICAL_PER, + /* + * X.693: + * XER: XML Encoding Rules. + * CANONICAL-XER is a more strict variant of BASIC-XER. + */ + ATS_BASIC_XER, + ATS_CANONICAL_XER, + ATS_JER, +}; + +/* + * A generic encoder for any supported transfer syntax. + * RETURN VALUES: + * The (.encoded) field of the return value is REDEFINED to mean the following: + * >=0: The computed size of the encoded data. Can exceed the (buffer_size). + * -1: Error encoding the structure. See the error code in (errno): + * EINVAL: Incorrect parameters to the function, such as NULLs. + * ENOENT: Encoding transfer syntax is not defined (for this type). + * EBADF: The structure has invalid form or content constraint failed. + * The (.failed_type) and (.structure_ptr) MIGHT be set to the appropriate + * values at the place of failure, if at all possible. + * WARNING: The (.encoded) field of the return value can exceed the buffer_size. + * This is similar to snprintf(3) contract which might return values + * greater than the buffer size. + */ +asn_enc_rval_t asn_encode_to_buffer( + const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */ + enum asn_transfer_syntax, + const struct asn_TYPE_descriptor_s *type_to_encode, + const void *structure_to_encode, void *buffer, size_t buffer_size); + +/* + * A variant of asn_encode_to_buffer() with automatically allocated buffer. + * RETURN VALUES: + * On success, returns a newly allocated (.buffer) containing the whole message. + * The message size is returned in (.result.encoded). + * On failure: + * (.buffer) is NULL, + * (.result.encoded) as in asn_encode_to_buffer(), + * The errno codes as in asn_encode_to_buffer(), plus the following: + * ENOMEM: Memory allocation failed due to system or internal limits. + * The user is responsible for freeing the (.buffer). + */ +typedef struct asn_encode_to_new_buffer_result_s { + void *buffer; /* NULL if failed to encode. */ + asn_enc_rval_t result; +} asn_encode_to_new_buffer_result_t; +asn_encode_to_new_buffer_result_t asn_encode_to_new_buffer( + const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */ + enum asn_transfer_syntax, + const struct asn_TYPE_descriptor_s *type_to_encode, + const void *structure_to_encode); + + +/* + * Generic type of an application-defined callback to return various + * types of data to the application. + * EXPECTED RETURN VALUES: + * -1: Failed to consume bytes. Abort the mission. + * Non-negative return values indicate success, and ignored. + */ +typedef int(asn_app_consume_bytes_f)(const void *buffer, size_t size, + void *application_specific_key); + + +/* + * A generic encoder for any supported transfer syntax. + * Returns the comprehensive encoding result descriptor (see asn_codecs.h). + * RETURN VALUES: + * The negative (.encoded) field of the return values is accompanied with the + * following error codes (errno): + * EINVAL: Incorrect parameters to the function, such as NULLs. + * ENOENT: Encoding transfer syntax is not defined (for this type). + * EBADF: The structure has invalid form or content constraint failed. + * EIO: The (callback) has returned negative value during encoding. + */ +asn_enc_rval_t asn_encode( + const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */ + enum asn_transfer_syntax, + const struct asn_TYPE_descriptor_s *type_to_encode, + const void *structure_to_encode, + asn_app_consume_bytes_f *callback, void *callback_key); + + +/* + * A generic decoder for any supported transfer syntax. + */ +asn_dec_rval_t asn_decode( + const asn_codec_ctx_t *opt_codec_parameters, enum asn_transfer_syntax, + const struct asn_TYPE_descriptor_s *type_to_decode, + void **structure_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of that buffer */ +); + + +/* + * A callback of this type is called whenever constraint validation fails + * on some ASN.1 type. See "constraints.h" for more details on constraint + * validation. + * This callback specifies a descriptor of the ASN.1 type which failed + * the constraint check, as well as human readable message on what + * particular constraint has failed. + */ +typedef void (asn_app_constraint_failed_f)(void *application_specific_key, + const struct asn_TYPE_descriptor_s *type_descriptor_which_failed, + const void *structure_which_failed_ptr, + const char *error_message_format, ...) CC_PRINTFLIKE(4, 5); + + +#ifdef __cplusplus +} +#endif + +#include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ + +#endif /* ASN_APPLICATION_H */ diff --git a/certgen/asncodec/asn_bit_data.c b/certgen/asncodec/asn_bit_data.c index 29a91ac..fe4b89b 100644 --- a/certgen/asncodec/asn_bit_data.c +++ b/certgen/asncodec/asn_bit_data.c @@ -1,333 +1,333 @@ -/* - * Copyright (c) 2005-2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Create a contiguous non-refillable bit data structure. - * Can be freed by FREEMEM(). - */ -asn_bit_data_t * -asn_bit_data_new_contiguous(const void *data, size_t size_bits) { - size_t size_bytes = (size_bits + 7) / 8; - asn_bit_data_t *pd; - uint8_t *bytes; - - /* Get the extensions map */ - pd = CALLOC(1, sizeof(*pd) + size_bytes + 1); - if(!pd) { - return NULL; - } - bytes = (void *)(((char *)pd) + sizeof(*pd)); - memcpy(bytes, data, size_bytes); - bytes[size_bytes] = 0; - pd->buffer = bytes; - pd->nboff = 0; - pd->nbits = size_bits; - - return pd; -} - - -char * -asn_bit_data_string(asn_bit_data_t *pd) { - static char buf[2][32]; - static int n; - n = (n+1) % 2; - snprintf(buf[n], sizeof(buf[n]), - "{m=%" ASN_PRI_SIZE " span %" ASN_PRI_SIZE "[%" ASN_PRI_SIZE - "..%" ASN_PRI_SIZE "] (%" ASN_PRI_SIZE ")}", - pd->moved, ((uintptr_t)(pd->buffer) & 0xf), pd->nboff, pd->nbits, - pd->nbits - pd->nboff); - return buf[n]; -} - -void -asn_get_undo(asn_bit_data_t *pd, int nbits) { - if((ssize_t)pd->nboff < nbits) { - assert((ssize_t)pd->nboff < nbits); - } else { - pd->nboff -= nbits; - pd->moved -= nbits; - } -} - -/* - * Extract a small number of bits (<= 31) from the specified PER data pointer. - */ -int32_t -asn_get_few_bits(asn_bit_data_t *pd, int nbits) { - size_t off; /* Next after last bit offset */ - ssize_t nleft; /* Number of bits left in this stream */ - uint32_t accum; - const uint8_t *buf; - - if(nbits < 0) - return -1; - - nleft = pd->nbits - pd->nboff; - if(nbits > nleft) { - int32_t tailv, vhead; - if(!pd->refill || nbits > 31) return -1; - /* Accumulate unused bytes before refill */ - ASN_DEBUG("Obtain the rest %d bits (want %d)", - (int)nleft, (int)nbits); - tailv = asn_get_few_bits(pd, nleft); - if(tailv < 0) return -1; - /* Refill (replace pd contents with new data) */ - if(pd->refill(pd)) - return -1; - nbits -= nleft; - vhead = asn_get_few_bits(pd, nbits); - /* Combine the rest of previous pd with the head of new one */ - tailv = (tailv << nbits) | vhead; /* Could == -1 */ - return tailv; - } - - /* - * Normalize position indicator. - */ - if(pd->nboff >= 8) { - pd->buffer += (pd->nboff >> 3); - pd->nbits -= (pd->nboff & ~0x07); - pd->nboff &= 0x07; - } - pd->moved += nbits; - pd->nboff += nbits; - off = pd->nboff; - buf = pd->buffer; - - /* - * Extract specified number of bits. - */ - if(off <= 8) - accum = nbits ? (buf[0]) >> (8 - off) : 0; - else if(off <= 16) - accum = ((buf[0] << 8) + buf[1]) >> (16 - off); - else if(off <= 24) - accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off); - else if(off <= 31) - accum = (((uint32_t)buf[0] << 24) + (buf[1] << 16) - + (buf[2] << 8) + (buf[3])) >> (32 - off); - else if(nbits <= 31) { - asn_bit_data_t tpd = *pd; - /* Here are we with our 31-bits limit plus 1..7 bits offset. */ - asn_get_undo(&tpd, nbits); - /* The number of available bits in the stream allow - * for the following operations to take place without - * invoking the ->refill() function */ - accum = asn_get_few_bits(&tpd, nbits - 24) << 24; - accum |= asn_get_few_bits(&tpd, 24); - } else { - asn_get_undo(pd, nbits); - return -1; - } - - accum &= (((uint32_t)1 << nbits) - 1); - - ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]", - (int)nbits, (int)nleft, - (int)pd->moved, - (((long)pd->buffer) & 0xf), - (int)pd->nboff, (int)pd->nbits, - ((pd->buffer != NULL)?pd->buffer[0]:0), - (int)(pd->nbits - pd->nboff), - (int)accum); - - return accum; -} - -/* - * Extract a large number of bits from the specified PER data pointer. - */ -int -asn_get_many_bits(asn_bit_data_t *pd, uint8_t *dst, int alright, int nbits) { - int32_t value; - - if(alright && (nbits & 7)) { - /* Perform right alignment of a first few bits */ - value = asn_get_few_bits(pd, nbits & 0x07); - if(value < 0) return -1; - *dst++ = value; /* value is already right-aligned */ - nbits &= ~7; - } - - while(nbits) { - if(nbits >= 24) { - value = asn_get_few_bits(pd, 24); - if(value < 0) return -1; - *(dst++) = value >> 16; - *(dst++) = value >> 8; - *(dst++) = value; - nbits -= 24; - } else { - value = asn_get_few_bits(pd, nbits); - if(value < 0) return -1; - if(nbits & 7) { /* implies left alignment */ - value <<= 8 - (nbits & 7), - nbits += 8 - (nbits & 7); - if(nbits > 24) - *dst++ = value >> 24; - } - if(nbits > 16) - *dst++ = value >> 16; - if(nbits > 8) - *dst++ = value >> 8; - *dst++ = value; - break; - } - } - - return 0; -} - -/* - * Put a small number of bits (<= 31). - */ -int -asn_put_few_bits(asn_bit_outp_t *po, uint32_t bits, int obits) { - size_t off; /* Next after last bit offset */ - size_t omsk; /* Existing last byte meaningful bits mask */ - uint8_t *buf; - - if(obits <= 0 || obits >= 32) return obits ? -1 : 0; - - ASN_DEBUG("[PER put %d bits %x to %p+%d bits]", - obits, (int)bits, (void *)po->buffer, (int)po->nboff); - - /* - * Normalize position indicator. - */ - if(po->nboff >= 8) { - po->buffer += (po->nboff >> 3); - po->nbits -= (po->nboff & ~0x07); - po->nboff &= 0x07; - } - - /* - * Flush whole-bytes output, if necessary. - */ - if(po->nboff + obits > po->nbits) { - size_t complete_bytes; - if(!po->buffer) po->buffer = po->tmpspace; - complete_bytes = (po->buffer - po->tmpspace); - ASN_DEBUG("[PER output %ld complete + %ld]", - (long)complete_bytes, (long)po->flushed_bytes); - if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0) - return -1; - if(po->nboff) - po->tmpspace[0] = po->buffer[0]; - po->buffer = po->tmpspace; - po->nbits = 8 * sizeof(po->tmpspace); - po->flushed_bytes += complete_bytes; - } - - /* - * Now, due to sizeof(tmpspace), we are guaranteed large enough space. - */ - buf = po->buffer; - omsk = ~((1 << (8 - po->nboff)) - 1); - off = (po->nboff + obits); - - /* Clear data of debris before meaningful bits */ - bits &= (((uint32_t)1 << obits) - 1); - - ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits, - (int)bits, (int)bits, - (int)po->nboff, (int)off, - buf[0], (int)(omsk&0xff), - (int)(buf[0] & omsk)); - - if(off <= 8) /* Completely within 1 byte */ - po->nboff = off, - bits <<= (8 - off), - buf[0] = (buf[0] & omsk) | bits; - else if(off <= 16) - po->nboff = off, - bits <<= (16 - off), - buf[0] = (buf[0] & omsk) | (bits >> 8), - buf[1] = bits; - else if(off <= 24) - po->nboff = off, - bits <<= (24 - off), - buf[0] = (buf[0] & omsk) | (bits >> 16), - buf[1] = bits >> 8, - buf[2] = bits; - else if(off <= 31) - po->nboff = off, - bits <<= (32 - off), - buf[0] = (buf[0] & omsk) | (bits >> 24), - buf[1] = bits >> 16, - buf[2] = bits >> 8, - buf[3] = bits; - else { - if(asn_put_few_bits(po, bits >> (obits - 24), 24)) return -1; - if(asn_put_few_bits(po, bits, obits - 24)) return -1; - } - - ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]", - (int)bits, (int)bits, buf[0], - (long)(po->buffer - po->tmpspace)); - - return 0; -} - - -/* - * Output a large number of bits. - */ -int -asn_put_many_bits(asn_bit_outp_t *po, const uint8_t *src, int nbits) { - - while(nbits) { - uint32_t value; - - if(nbits >= 24) { - value = (src[0] << 16) | (src[1] << 8) | src[2]; - src += 3; - nbits -= 24; - if(asn_put_few_bits(po, value, 24)) - return -1; - } else { - value = src[0]; - if(nbits > 8) - value = (value << 8) | src[1]; - if(nbits > 16) - value = (value << 8) | src[2]; - if(nbits & 0x07) - value >>= (8 - (nbits & 0x07)); - if(asn_put_few_bits(po, value, nbits)) - return -1; - break; - } - } - - return 0; -} - - -int -asn_put_aligned_flush(asn_bit_outp_t *po) { - uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07))); - size_t complete_bytes = - (po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3); - - if(unused_bits) { - po->buffer[po->nboff >> 3] &= ~0u << unused_bits; - } - - if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0) { - return -1; - } else { - po->buffer = po->tmpspace; - po->nboff = 0; - po->nbits = 8 * sizeof(po->tmpspace); - po->flushed_bytes += complete_bytes; - return 0; - } -} - +/* + * Copyright (c) 2005-2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * Create a contiguous non-refillable bit data structure. + * Can be freed by FREEMEM(). + */ +asn_bit_data_t * +asn_bit_data_new_contiguous(const void *data, size_t size_bits) { + size_t size_bytes = (size_bits + 7) / 8; + asn_bit_data_t *pd; + uint8_t *bytes; + + /* Get the extensions map */ + pd = CALLOC(1, sizeof(*pd) + size_bytes + 1); + if(!pd) { + return NULL; + } + bytes = (void *)(((char *)pd) + sizeof(*pd)); + memcpy(bytes, data, size_bytes); + bytes[size_bytes] = 0; + pd->buffer = bytes; + pd->nboff = 0; + pd->nbits = size_bits; + + return pd; +} + + +char * +asn_bit_data_string(asn_bit_data_t *pd) { + static char buf[2][32]; + static int n; + n = (n+1) % 2; + snprintf(buf[n], sizeof(buf[n]), + "{m=%" ASN_PRI_SIZE " span %" ASN_PRI_SIZE "[%" ASN_PRI_SIZE + "..%" ASN_PRI_SIZE "] (%" ASN_PRI_SIZE ")}", + pd->moved, ((uintptr_t)(pd->buffer) & 0xf), pd->nboff, pd->nbits, + pd->nbits - pd->nboff); + return buf[n]; +} + +void +asn_get_undo(asn_bit_data_t *pd, int nbits) { + if((ssize_t)pd->nboff < nbits) { + assert((ssize_t)pd->nboff < nbits); + } else { + pd->nboff -= nbits; + pd->moved -= nbits; + } +} + +/* + * Extract a small number of bits (<= 31) from the specified PER data pointer. + */ +int32_t +asn_get_few_bits(asn_bit_data_t *pd, int nbits) { + size_t off; /* Next after last bit offset */ + ssize_t nleft; /* Number of bits left in this stream */ + uint32_t accum; + const uint8_t *buf; + + if(nbits < 0) + return -1; + + nleft = pd->nbits - pd->nboff; + if(nbits > nleft) { + int32_t tailv, vhead; + if(!pd->refill || nbits > 31) return -1; + /* Accumulate unused bytes before refill */ + ASN_DEBUG("Obtain the rest %d bits (want %d)", + (int)nleft, (int)nbits); + tailv = asn_get_few_bits(pd, nleft); + if(tailv < 0) return -1; + /* Refill (replace pd contents with new data) */ + if(pd->refill(pd)) + return -1; + nbits -= nleft; + vhead = asn_get_few_bits(pd, nbits); + /* Combine the rest of previous pd with the head of new one */ + tailv = (tailv << nbits) | vhead; /* Could == -1 */ + return tailv; + } + + /* + * Normalize position indicator. + */ + if(pd->nboff >= 8) { + pd->buffer += (pd->nboff >> 3); + pd->nbits -= (pd->nboff & ~0x07); + pd->nboff &= 0x07; + } + pd->moved += nbits; + pd->nboff += nbits; + off = pd->nboff; + buf = pd->buffer; + + /* + * Extract specified number of bits. + */ + if(off <= 8) + accum = nbits ? (buf[0]) >> (8 - off) : 0; + else if(off <= 16) + accum = ((buf[0] << 8) + buf[1]) >> (16 - off); + else if(off <= 24) + accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off); + else if(off <= 31) + accum = (((uint32_t)buf[0] << 24) + (buf[1] << 16) + + (buf[2] << 8) + (buf[3])) >> (32 - off); + else if(nbits <= 31) { + asn_bit_data_t tpd = *pd; + /* Here are we with our 31-bits limit plus 1..7 bits offset. */ + asn_get_undo(&tpd, nbits); + /* The number of available bits in the stream allow + * for the following operations to take place without + * invoking the ->refill() function */ + accum = asn_get_few_bits(&tpd, nbits - 24) << 24; + accum |= asn_get_few_bits(&tpd, 24); + } else { + asn_get_undo(pd, nbits); + return -1; + } + + accum &= (((uint32_t)1 << nbits) - 1); + + ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]", + (int)nbits, (int)nleft, + (int)pd->moved, + (((long)pd->buffer) & 0xf), + (int)pd->nboff, (int)pd->nbits, + ((pd->buffer != NULL)?pd->buffer[0]:0), + (int)(pd->nbits - pd->nboff), + (int)accum); + + return accum; +} + +/* + * Extract a large number of bits from the specified PER data pointer. + */ +int +asn_get_many_bits(asn_bit_data_t *pd, uint8_t *dst, int alright, int nbits) { + int32_t value; + + if(alright && (nbits & 7)) { + /* Perform right alignment of a first few bits */ + value = asn_get_few_bits(pd, nbits & 0x07); + if(value < 0) return -1; + *dst++ = value; /* value is already right-aligned */ + nbits &= ~7; + } + + while(nbits) { + if(nbits >= 24) { + value = asn_get_few_bits(pd, 24); + if(value < 0) return -1; + *(dst++) = value >> 16; + *(dst++) = value >> 8; + *(dst++) = value; + nbits -= 24; + } else { + value = asn_get_few_bits(pd, nbits); + if(value < 0) return -1; + if(nbits & 7) { /* implies left alignment */ + value <<= 8 - (nbits & 7), + nbits += 8 - (nbits & 7); + if(nbits > 24) + *dst++ = value >> 24; + } + if(nbits > 16) + *dst++ = value >> 16; + if(nbits > 8) + *dst++ = value >> 8; + *dst++ = value; + break; + } + } + + return 0; +} + +/* + * Put a small number of bits (<= 31). + */ +int +asn_put_few_bits(asn_bit_outp_t *po, uint32_t bits, int obits) { + size_t off; /* Next after last bit offset */ + size_t omsk; /* Existing last byte meaningful bits mask */ + uint8_t *buf; + + if(obits <= 0 || obits >= 32) return obits ? -1 : 0; + + ASN_DEBUG("[PER put %d bits %x to %p+%d bits]", + obits, (int)bits, (void *)po->buffer, (int)po->nboff); + + /* + * Normalize position indicator. + */ + if(po->nboff >= 8) { + po->buffer += (po->nboff >> 3); + po->nbits -= (po->nboff & ~0x07); + po->nboff &= 0x07; + } + + /* + * Flush whole-bytes output, if necessary. + */ + if(po->nboff + obits > po->nbits) { + size_t complete_bytes; + if(!po->buffer) po->buffer = po->tmpspace; + complete_bytes = (po->buffer - po->tmpspace); + ASN_DEBUG("[PER output %ld complete + %ld]", + (long)complete_bytes, (long)po->flushed_bytes); + if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0) + return -1; + if(po->nboff) + po->tmpspace[0] = po->buffer[0]; + po->buffer = po->tmpspace; + po->nbits = 8 * sizeof(po->tmpspace); + po->flushed_bytes += complete_bytes; + } + + /* + * Now, due to sizeof(tmpspace), we are guaranteed large enough space. + */ + buf = po->buffer; + omsk = ~((1 << (8 - po->nboff)) - 1); + off = (po->nboff + obits); + + /* Clear data of debris before meaningful bits */ + bits &= (((uint32_t)1 << obits) - 1); + + ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits, + (int)bits, (int)bits, + (int)po->nboff, (int)off, + buf[0], (int)(omsk&0xff), + (int)(buf[0] & omsk)); + + if(off <= 8) /* Completely within 1 byte */ + po->nboff = off, + bits <<= (8 - off), + buf[0] = (buf[0] & omsk) | bits; + else if(off <= 16) + po->nboff = off, + bits <<= (16 - off), + buf[0] = (buf[0] & omsk) | (bits >> 8), + buf[1] = bits; + else if(off <= 24) + po->nboff = off, + bits <<= (24 - off), + buf[0] = (buf[0] & omsk) | (bits >> 16), + buf[1] = bits >> 8, + buf[2] = bits; + else if(off <= 31) + po->nboff = off, + bits <<= (32 - off), + buf[0] = (buf[0] & omsk) | (bits >> 24), + buf[1] = bits >> 16, + buf[2] = bits >> 8, + buf[3] = bits; + else { + if(asn_put_few_bits(po, bits >> (obits - 24), 24)) return -1; + if(asn_put_few_bits(po, bits, obits - 24)) return -1; + } + + ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]", + (int)bits, (int)bits, buf[0], + (long)(po->buffer - po->tmpspace)); + + return 0; +} + + +/* + * Output a large number of bits. + */ +int +asn_put_many_bits(asn_bit_outp_t *po, const uint8_t *src, int nbits) { + + while(nbits) { + uint32_t value; + + if(nbits >= 24) { + value = (src[0] << 16) | (src[1] << 8) | src[2]; + src += 3; + nbits -= 24; + if(asn_put_few_bits(po, value, 24)) + return -1; + } else { + value = src[0]; + if(nbits > 8) + value = (value << 8) | src[1]; + if(nbits > 16) + value = (value << 8) | src[2]; + if(nbits & 0x07) + value >>= (8 - (nbits & 0x07)); + if(asn_put_few_bits(po, value, nbits)) + return -1; + break; + } + } + + return 0; +} + + +int +asn_put_aligned_flush(asn_bit_outp_t *po) { + uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07))); + size_t complete_bytes = + (po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3); + + if(unused_bits) { + po->buffer[po->nboff >> 3] &= ~0u << unused_bits; + } + + if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0) { + return -1; + } else { + po->buffer = po->tmpspace; + po->nboff = 0; + po->nbits = 8 * sizeof(po->tmpspace); + po->flushed_bytes += complete_bytes; + return 0; + } +} + diff --git a/certgen/asncodec/asn_bit_data.h b/certgen/asncodec/asn_bit_data.h index 8447df6..f14714b 100644 --- a/certgen/asncodec/asn_bit_data.h +++ b/certgen/asncodec/asn_bit_data.h @@ -1,83 +1,83 @@ -/* - * Copyright (c) 2005-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_BIT_DATA -#define ASN_BIT_DATA - -#include /* Platform-specific types */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This structure describes a position inside an incoming PER bit stream. - */ -typedef struct asn_bit_data_s { - const uint8_t *buffer; /* Pointer to the octet stream */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits in the stream */ - size_t moved; /* Number of bits moved through this bit stream */ - int (*refill)(struct asn_bit_data_s *); - void *refill_key; -} asn_bit_data_t; - -/* - * Create a contiguous non-refillable bit data structure. - * Can be freed by FREEMEM(). - */ -asn_bit_data_t *asn_bit_data_new_contiguous(const void *data, size_t size_bits); - -/* - * Extract a small number of bits (<= 31) from the specified PER data pointer. - * This function returns -1 if the specified number of bits could not be - * extracted due to EOD or other conditions. - */ -int32_t asn_get_few_bits(asn_bit_data_t *, int get_nbits); - -/* Undo the immediately preceeding "get_few_bits" operation */ -void asn_get_undo(asn_bit_data_t *, int get_nbits); - -/* - * Extract a large number of bits from the specified PER data pointer. - * This function returns -1 if the specified number of bits could not be - * extracted due to EOD or other conditions. - */ -int asn_get_many_bits(asn_bit_data_t *, uint8_t *dst, int right_align, - int get_nbits); - -/* Non-thread-safe debugging function, don't use it */ -char *asn_bit_data_string(asn_bit_data_t *); - -/* - * This structure supports forming bit output. - */ -typedef struct asn_bit_outp_s { - uint8_t *buffer; /* Pointer into the (tmpspace) */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits left in (tmpspace) */ - uint8_t tmpspace[32]; /* Preliminary storage to hold data */ - int (*output)(const void *data, size_t size, void *op_key); - void *op_key; /* Key for (output) data callback */ - size_t flushed_bytes; /* Bytes already flushed through (output) */ -} asn_bit_outp_t; - -/* Output a small number of bits (<= 31) */ -int asn_put_few_bits(asn_bit_outp_t *, uint32_t bits, int obits); - -/* Output a large number of bits */ -int asn_put_many_bits(asn_bit_outp_t *, const uint8_t *src, int put_nbits); - -/* - * Flush whole bytes (0 or more) through (outper) member. - * The least significant bits which are not used are guaranteed to be set to 0. - * Returns -1 if callback returns -1. Otherwise, 0. - */ -int asn_put_aligned_flush(asn_bit_outp_t *); - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_BIT_DATA */ +/* + * Copyright (c) 2005-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_BIT_DATA +#define ASN_BIT_DATA + +#include /* Platform-specific types */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This structure describes a position inside an incoming PER bit stream. + */ +typedef struct asn_bit_data_s { + const uint8_t *buffer; /* Pointer to the octet stream */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits in the stream */ + size_t moved; /* Number of bits moved through this bit stream */ + int (*refill)(struct asn_bit_data_s *); + void *refill_key; +} asn_bit_data_t; + +/* + * Create a contiguous non-refillable bit data structure. + * Can be freed by FREEMEM(). + */ +asn_bit_data_t *asn_bit_data_new_contiguous(const void *data, size_t size_bits); + +/* + * Extract a small number of bits (<= 31) from the specified PER data pointer. + * This function returns -1 if the specified number of bits could not be + * extracted due to EOD or other conditions. + */ +int32_t asn_get_few_bits(asn_bit_data_t *, int get_nbits); + +/* Undo the immediately preceding "get_few_bits" operation */ +void asn_get_undo(asn_bit_data_t *, int get_nbits); + +/* + * Extract a large number of bits from the specified PER data pointer. + * This function returns -1 if the specified number of bits could not be + * extracted due to EOD or other conditions. + */ +int asn_get_many_bits(asn_bit_data_t *, uint8_t *dst, int right_align, + int get_nbits); + +/* Non-thread-safe debugging function, don't use it */ +char *asn_bit_data_string(asn_bit_data_t *); + +/* + * This structure supports forming bit output. + */ +typedef struct asn_bit_outp_s { + uint8_t *buffer; /* Pointer into the (tmpspace) */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits left in (tmpspace) */ + uint8_t tmpspace[32]; /* Preliminary storage to hold data */ + int (*output)(const void *data, size_t size, void *op_key); + void *op_key; /* Key for (output) data callback */ + size_t flushed_bytes; /* Bytes already flushed through (output) */ +} asn_bit_outp_t; + +/* Output a small number of bits (<= 31) */ +int asn_put_few_bits(asn_bit_outp_t *, uint32_t bits, int obits); + +/* Output a large number of bits */ +int asn_put_many_bits(asn_bit_outp_t *, const uint8_t *src, int put_nbits); + +/* + * Flush whole bytes (0 or more) through (outper) member. + * The least significant bits which are not used are guaranteed to be set to 0. + * Returns -1 if callback returns -1. Otherwise, 0. + */ +int asn_put_aligned_flush(asn_bit_outp_t *); + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_BIT_DATA */ diff --git a/certgen/asncodec/asn_codecs.h b/certgen/asncodec/asn_codecs.h index 5a6d9f7..e75c270 100644 --- a/certgen/asncodec/asn_codecs.h +++ b/certgen/asncodec/asn_codecs.h @@ -1,108 +1,108 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_CODECS_H -#define ASN_CODECS_H - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * This structure defines a set of parameters that may be passed - * to every ASN.1 encoder or decoder function. - * WARNING: if max_stack_size member is set, and you are calling the - * function pointers of the asn_TYPE_descriptor_t directly, - * this structure must be ALLOCATED ON THE STACK! - * If you can't always satisfy this requirement, use ber_decode(), - * xer_decode() and uper_decode() functions instead. - */ -typedef struct asn_codec_ctx_s { - /* - * Limit the decoder routines to use no (much) more stack than a given - * number of bytes. Most of decoders are stack-based, and this - * would protect against stack overflows if the number of nested - * encodings is high. - * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based, - * and are safe from this kind of overflow. - * A value from getrlimit(RLIMIT_STACK) may be used to initialize - * this variable. Be careful in multithreaded environments, as the - * stack size is rather limited. - */ - size_t max_stack_size; /* 0 disables stack bounds checking */ -} asn_codec_ctx_t; - -/* - * Type of the return value of the encoding functions (der_encode, xer_encode). - */ -typedef struct asn_enc_rval_s { - /* - * Number of bytes encoded. - * -1 indicates failure to encode the structure. - * In this case, the members below this one are meaningful. - */ - ssize_t encoded; - - /* - * Members meaningful when (encoded == -1), for post mortem analysis. - */ - - /* Type which cannot be encoded */ - const struct asn_TYPE_descriptor_s *failed_type; - - /* Pointer to the structure of that type */ - const void *structure_ptr; -} asn_enc_rval_t; -#define ASN__ENCODE_FAILED do { \ - asn_enc_rval_t tmp_error; \ - tmp_error.encoded = -1; \ - tmp_error.failed_type = td; \ - tmp_error.structure_ptr = sptr; \ - ASN_DEBUG("Failed to encode element %s", td ? td->name : ""); \ - return tmp_error; \ -} while(0) -#define ASN__ENCODED_OK(rval) do { \ - rval.structure_ptr = 0; \ - rval.failed_type = 0; \ - return rval; \ -} while(0) - -/* - * Type of the return value of the decoding functions (ber_decode, xer_decode) - * - * Please note that the number of consumed bytes is ALWAYS meaningful, - * even if code==RC_FAIL. This is to indicate the number of successfully - * decoded bytes, hence providing a possibility to fail with more diagnostics - * (i.e., print the offending remainder of the buffer). - */ -enum asn_dec_rval_code_e { - RC_OK, /* Decoded successfully */ - RC_WMORE, /* More data expected, call again */ - RC_FAIL /* Failure to decode data */ -}; -typedef struct asn_dec_rval_s { - enum asn_dec_rval_code_e code; /* Result code */ - size_t consumed; /* Number of bytes consumed */ -} asn_dec_rval_t; -#define ASN__DECODE_FAILED do { \ - asn_dec_rval_t tmp_error; \ - tmp_error.code = RC_FAIL; \ - tmp_error.consumed = 0; \ - ASN_DEBUG("Failed to decode element %s", td ? td->name : ""); \ - return tmp_error; \ -} while(0) -#define ASN__DECODE_STARVED do { \ - asn_dec_rval_t tmp_error; \ - tmp_error.code = RC_WMORE; \ - tmp_error.consumed = 0; \ - return tmp_error; \ -} while(0) - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_CODECS_H */ +/* + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_CODECS_H +#define ASN_CODECS_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ + +/* + * This structure defines a set of parameters that may be passed + * to every ASN.1 encoder or decoder function. + * WARNING: if max_stack_size member is set, and you are calling the + * function pointers of the asn_TYPE_descriptor_t directly, + * this structure must be ALLOCATED ON THE STACK! + * If you can't always satisfy this requirement, use ber_decode(), + * xer_decode() and uper_decode() functions instead. + */ +typedef struct asn_codec_ctx_s { + /* + * Limit the decoder routines to use no (much) more stack than a given + * number of bytes. Most of decoders are stack-based, and this + * would protect against stack overflows if the number of nested + * encodings is high. + * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based, + * and are safe from this kind of overflow. + * A value from getrlimit(RLIMIT_STACK) may be used to initialize + * this variable. Be careful in multithreaded environments, as the + * stack size is rather limited. + */ + size_t max_stack_size; /* 0 disables stack bounds checking */ +} asn_codec_ctx_t; + +/* + * Type of the return value of the encoding functions (der_encode, xer_encode). + */ +typedef struct asn_enc_rval_s { + /* + * Number of bytes encoded. + * -1 indicates failure to encode the structure. + * In this case, the members below this one are meaningful. + */ + ssize_t encoded; + + /* + * Members meaningful when (encoded == -1), for post mortem analysis. + */ + + /* Type which cannot be encoded */ + const struct asn_TYPE_descriptor_s *failed_type; + + /* Pointer to the structure of that type */ + const void *structure_ptr; +} asn_enc_rval_t; +#define ASN__ENCODE_FAILED do { \ + asn_enc_rval_t tmp_error; \ + tmp_error.encoded = -1; \ + tmp_error.failed_type = td; \ + tmp_error.structure_ptr = sptr; \ + ASN_DEBUG("Failed to encode element %s", td ? td->name : ""); \ + return tmp_error; \ +} while(0) +#define ASN__ENCODED_OK(rval) do { \ + rval.structure_ptr = 0; \ + rval.failed_type = 0; \ + return rval; \ +} while(0) + +/* + * Type of the return value of the decoding functions (ber_decode, xer_decode) + * + * Please note that the number of consumed bytes is ALWAYS meaningful, + * even if code==RC_FAIL. This is to indicate the number of successfully + * decoded bytes, hence providing a possibility to fail with more diagnostics + * (i.e., print the offending remainder of the buffer). + */ +enum asn_dec_rval_code_e { + RC_OK, /* Decoded successfully */ + RC_WMORE, /* More data expected, call again */ + RC_FAIL /* Failure to decode data */ +}; +typedef struct asn_dec_rval_s { + enum asn_dec_rval_code_e code; /* Result code */ + size_t consumed; /* Number of bytes consumed */ +} asn_dec_rval_t; +#define ASN__DECODE_FAILED do { \ + asn_dec_rval_t tmp_error; \ + tmp_error.code = RC_FAIL; \ + tmp_error.consumed = 0; \ + ASN_DEBUG("Failed to decode element %s", td ? td->name : ""); \ + return tmp_error; \ +} while(0) +#define ASN__DECODE_STARVED do { \ + asn_dec_rval_t tmp_error; \ + tmp_error.code = RC_WMORE; \ + tmp_error.consumed = 0; \ + return tmp_error; \ +} while(0) + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_CODECS_H */ diff --git a/certgen/asncodec/asn_codecs_prim.c b/certgen/asncodec/asn_codecs_prim.c index 0209cc9..f3fdbfd 100644 --- a/certgen/asncodec/asn_codecs_prim.c +++ b/certgen/asncodec/asn_codecs_prim.c @@ -1,317 +1,31 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Decode an always-primitive type. - */ -asn_dec_rval_t -ber_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const void *buf_ptr, size_t size, int tag_mode) { - ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr; - asn_dec_rval_t rval; - ber_tlv_len_t length = 0; /* =0 to avoid [incorrect] warning. */ - - /* - * If the structure is not there, allocate it. - */ - if(st == NULL) { - st = (ASN__PRIMITIVE_TYPE_t *)CALLOC(1, sizeof(*st)); - if(st == NULL) ASN__DECODE_FAILED; - *sptr = (void *)st; - } - - ASN_DEBUG("Decoding %s as plain primitive (tm=%d)", - td->name, tag_mode); - - /* - * Check tags and extract value length. - */ - rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); - if(rval.code != RC_OK) - return rval; - - ASN_DEBUG("%s length is %d bytes", td->name, (int)length); - - /* - * Make sure we have this length. - */ - buf_ptr = ((const char *)buf_ptr) + rval.consumed; - size -= rval.consumed; - if(length > (ber_tlv_len_t)size) { - rval.code = RC_WMORE; - rval.consumed = 0; - return rval; - } - - st->size = (int)length; - /* The following better be optimized away. */ - if(sizeof(st->size) != sizeof(length) - && (ber_tlv_len_t)st->size != length) { - st->size = 0; - ASN__DECODE_FAILED; - } - - st->buf = (uint8_t *)MALLOC(length + 1); - if(!st->buf) { - st->size = 0; - ASN__DECODE_FAILED; - } - - memcpy(st->buf, buf_ptr, length); - st->buf[length] = '\0'; /* Just in case */ - - rval.code = RC_OK; - rval.consumed += length; - - ASN_DEBUG("Took %ld/%ld bytes to encode %s", - (long)rval.consumed, - (long)length, td->name); - - return rval; -} - -/* - * Encode an always-primitive type using DER. - */ -asn_enc_rval_t -der_encode_primitive(const asn_TYPE_descriptor_t *td, const void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t erval; - const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr; - - ASN_DEBUG("%s %s as a primitive type (tm=%d)", - cb?"Encoding":"Estimating", td->name, tag_mode); - - erval.encoded = der_write_tags(td, st->size, tag_mode, 0, tag, - cb, app_key); - ASN_DEBUG("%s wrote tags %d", td->name, (int)erval.encoded); - if(erval.encoded == -1) { - erval.failed_type = td; - erval.structure_ptr = sptr; - return erval; - } - - if(cb && st->buf) { - if(cb(st->buf, st->size, app_key) < 0) { - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = sptr; - return erval; - } - } else { - assert(st->buf || st->size == 0); - } - - erval.encoded += st->size; - ASN__ENCODED_OK(erval); -} - -void -ASN__PRIMITIVE_TYPE_free(const asn_TYPE_descriptor_t *td, void *sptr, - enum asn_struct_free_method method) { - ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr; - - if(!td || !sptr) - return; - - ASN_DEBUG("Freeing %s as a primitive type", td->name); - - if(st->buf) - FREEMEM(st->buf); - - switch(method) { - case ASFM_FREE_EVERYTHING: - FREEMEM(sptr); - break; - case ASFM_FREE_UNDERLYING: - break; - case ASFM_FREE_UNDERLYING_AND_RESET: - memset(sptr, 0, sizeof(ASN__PRIMITIVE_TYPE_t)); - break; - } -} - - -/* - * Local internal type passed around as an argument. - */ -struct xdp_arg_s { - const asn_TYPE_descriptor_t *type_descriptor; - void *struct_key; - xer_primitive_body_decoder_f *prim_body_decoder; - int decoded_something; - int want_more; -}; - -/* - * Since some kinds of primitive values can be encoded using value-specific - * tags (, , etc), the primitive decoder must - * be supplied with such tags to parse them as needed. - */ -static int -xer_decode__unexpected_tag(void *key, const void *chunk_buf, size_t chunk_size) { - struct xdp_arg_s *arg = (struct xdp_arg_s *)key; - enum xer_pbd_rval bret; - - /* - * The chunk_buf is guaranteed to start at '<'. - */ - assert(chunk_size && ((const char *)chunk_buf)[0] == 0x3c); - - /* - * Decoding was performed once already. Prohibit doing it again. - */ - if(arg->decoded_something) - return -1; - - bret = arg->prim_body_decoder(arg->type_descriptor, - arg->struct_key, chunk_buf, chunk_size); - switch(bret) { - case XPBD_SYSTEM_FAILURE: - case XPBD_DECODER_LIMIT: - case XPBD_BROKEN_ENCODING: - break; - case XPBD_BODY_CONSUMED: - /* Tag decoded successfully */ - arg->decoded_something = 1; - /* Fall through */ - case XPBD_NOT_BODY_IGNORE: /* Safe to proceed further */ - return 0; - } - - return -1; -} - -static ssize_t -xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, int have_more) { - struct xdp_arg_s *arg = (struct xdp_arg_s *)key; - enum xer_pbd_rval bret; - size_t lead_wsp_size; - - if(arg->decoded_something) { - if(xer_whitespace_span(chunk_buf, chunk_size) == chunk_size) { - /* - * Example: - * "123 " - * ^- chunk_buf position. - */ - return chunk_size; - } - /* - * Decoding was done once already. Prohibit doing it again. - */ - return -1; - } - - if(!have_more) { - /* - * If we've received something like "1", we can't really - * tell whether it is really `1` or `123`, until we know - * that there is no more data coming. - * The have_more argument will be set to 1 once something - * like this is available to the caller of this callback: - * "1want_more = 1; - return -1; - } - - lead_wsp_size = xer_whitespace_span(chunk_buf, chunk_size); - chunk_buf = (const char *)chunk_buf + lead_wsp_size; - chunk_size -= lead_wsp_size; - - bret = arg->prim_body_decoder(arg->type_descriptor, - arg->struct_key, chunk_buf, chunk_size); - switch(bret) { - case XPBD_SYSTEM_FAILURE: - case XPBD_DECODER_LIMIT: - case XPBD_BROKEN_ENCODING: - break; - case XPBD_BODY_CONSUMED: - /* Tag decoded successfully */ - arg->decoded_something = 1; - /* Fall through */ - case XPBD_NOT_BODY_IGNORE: /* Safe to proceed further */ - return lead_wsp_size + chunk_size; - } - - return -1; -} - - -asn_dec_rval_t -xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - size_t struct_size, const char *opt_mname, - const void *buf_ptr, size_t size, - xer_primitive_body_decoder_f *prim_body_decoder) { - const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; - asn_struct_ctx_t s_ctx; - struct xdp_arg_s s_arg; - asn_dec_rval_t rc; - - /* - * Create the structure if does not exist. - */ - if(!*sptr) { - *sptr = CALLOC(1, struct_size); - if(!*sptr) ASN__DECODE_FAILED; - } - - memset(&s_ctx, 0, sizeof(s_ctx)); - s_arg.type_descriptor = td; - s_arg.struct_key = *sptr; - s_arg.prim_body_decoder = prim_body_decoder; - s_arg.decoded_something = 0; - s_arg.want_more = 0; - - rc = xer_decode_general(opt_codec_ctx, &s_ctx, &s_arg, - xml_tag, buf_ptr, size, - xer_decode__unexpected_tag, xer_decode__primitive_body); - switch(rc.code) { - case RC_OK: - if(!s_arg.decoded_something) { - char ch; - ASN_DEBUG("Primitive body is not recognized, " - "supplying empty one"); - /* - * Decoding opportunity has come and gone. - * Where's the result? - * Try to feed with empty body, see if it eats it. - */ - if(prim_body_decoder(s_arg.type_descriptor, - s_arg.struct_key, &ch, 0) - != XPBD_BODY_CONSUMED) { - /* - * This decoder does not like empty stuff. - */ - ASN__DECODE_FAILED; - } - } - break; - case RC_WMORE: - /* - * Redo the whole thing later. - * We don't have a context to save intermediate parsing state. - */ - rc.consumed = 0; - break; - case RC_FAIL: - rc.consumed = 0; - if(s_arg.want_more) - rc.code = RC_WMORE; - else - ASN__DECODE_FAILED; - break; - } - return rc; -} - +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +void +ASN__PRIMITIVE_TYPE_free(const asn_TYPE_descriptor_t *td, void *sptr, + enum asn_struct_free_method method) { + ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr; + + if(!td || !sptr) + return; + + ASN_DEBUG("Freeing %s as a primitive type", td->name); + + if(st->buf) + FREEMEM(st->buf); + + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(sptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(sptr, 0, sizeof(ASN__PRIMITIVE_TYPE_t)); + break; + } +} diff --git a/certgen/asncodec/asn_codecs_prim.h b/certgen/asncodec/asn_codecs_prim.h index 09bcec5..5bbd9cf 100644 --- a/certgen/asncodec/asn_codecs_prim.h +++ b/certgen/asncodec/asn_codecs_prim.h @@ -1,51 +1,56 @@ -/*- - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_CODECS_PRIM_H -#define ASN_CODECS_PRIM_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ASN__PRIMITIVE_TYPE_s { - uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ - size_t size; /* Size of the buffer */ -} ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ - -asn_struct_free_f ASN__PRIMITIVE_TYPE_free; -ber_type_decoder_f ber_decode_primitive; -der_type_encoder_f der_encode_primitive; - -/* - * A callback specification for the xer_decode_primitive() function below. - */ -enum xer_pbd_rval { - XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ - XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ - XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ - XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ - XPBD_BODY_CONSUMED /* Body is recognized and consumed */ -}; -typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)( - const asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf, - size_t chunk_size); - -/* - * Specific function to decode simple primitive types. - * Also see xer_decode_general() in xer_decoder.h - */ -asn_dec_rval_t xer_decode_primitive( - const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, - size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size, - xer_primitive_body_decoder_f *prim_body_decoder); - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_CODECS_PRIM_H */ +/*- + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_CODECS_PRIM_H +#define ASN_CODECS_PRIM_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ASN__PRIMITIVE_TYPE_s { + uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ + size_t size; /* Size of the buffer */ +} ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ + +asn_struct_free_f ASN__PRIMITIVE_TYPE_free; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f ber_decode_primitive; +der_type_encoder_f der_encode_primitive; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +/* + * A callback specification for the xer_decode_primitive() function below. + */ +enum xer_pbd_rval { + XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ + XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ + XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ + XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ + XPBD_BODY_CONSUMED /* Body is recognized and consumed */ +}; +typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)( + const asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf, + size_t chunk_size); + +/* + * Specific function to decode simple primitive types. + * Also see xer_decode_general() in xer_decoder.h + */ +asn_dec_rval_t xer_decode_primitive( + const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, + size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size, + xer_primitive_body_decoder_f *prim_body_decoder); +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_CODECS_PRIM_H */ diff --git a/certgen/asncodec/asn_codecs_prim_xer.c b/certgen/asncodec/asn_codecs_prim_xer.c new file mode 100644 index 0000000..70c91bc --- /dev/null +++ b/certgen/asncodec/asn_codecs_prim_xer.c @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * Local internal type passed around as an argument. + */ +struct xdp_arg_s { + const asn_TYPE_descriptor_t *type_descriptor; + void *struct_key; + xer_primitive_body_decoder_f *prim_body_decoder; + int decoded_something; + int want_more; +}; + +/* + * Since some kinds of primitive values can be encoded using value-specific + * tags (, , etc), the primitive decoder must + * be supplied with such tags to parse them as needed. + */ +static int +xer_decode__unexpected_tag(void *key, const void *chunk_buf, size_t chunk_size) { + struct xdp_arg_s *arg = (struct xdp_arg_s *)key; + enum xer_pbd_rval bret; + + /* + * The chunk_buf is guaranteed to start at '<'. + */ + assert(chunk_size && ((const char *)chunk_buf)[0] == 0x3c); + + /* + * Decoding was performed once already. Prohibit doing it again. + */ + if(arg->decoded_something) + return -1; + + bret = arg->prim_body_decoder(arg->type_descriptor, + arg->struct_key, chunk_buf, + chunk_size); + switch(bret) { + case XPBD_SYSTEM_FAILURE: + case XPBD_DECODER_LIMIT: + case XPBD_BROKEN_ENCODING: + break; + case XPBD_BODY_CONSUMED: + /* Tag decoded successfully */ + arg->decoded_something = 1; + /* Fall through */ + case XPBD_NOT_BODY_IGNORE: /* Safe to proceed further */ + return 0; + } + + return -1; +} + +static ssize_t +xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, int have_more) { + struct xdp_arg_s *arg = (struct xdp_arg_s *)key; + enum xer_pbd_rval bret; + size_t lead_wsp_size; + + if(arg->decoded_something) { + if(xer_whitespace_span(chunk_buf, chunk_size) == chunk_size) { + /* + * Example: + * "123 " + * ^- chunk_buf position. + */ + return chunk_size; + } + /* + * Decoding was done once already. Prohibit doing it again. + */ + return -1; + } + + if(!have_more) { + /* + * If we've received something like "1", we can't really + * tell whether it is really `1` or `123`, until we know + * that there is no more data coming. + * The have_more argument will be set to 1 once something + * like this is available to the caller of this callback: + * "1want_more = 1; + return -1; + } + + lead_wsp_size = xer_whitespace_span(chunk_buf, chunk_size); + chunk_buf = (chunk_buf == NULL)? NULL : ((const char *)chunk_buf + lead_wsp_size); + chunk_size -= lead_wsp_size; + + bret = arg->prim_body_decoder(arg->type_descriptor, + arg->struct_key, chunk_buf, + chunk_size); + switch(bret) { + case XPBD_SYSTEM_FAILURE: + case XPBD_DECODER_LIMIT: + case XPBD_BROKEN_ENCODING: + break; + case XPBD_BODY_CONSUMED: + /* Tag decoded successfully */ + arg->decoded_something = 1; + /* Fall through */ + case XPBD_NOT_BODY_IGNORE: /* Safe to proceed further */ + return lead_wsp_size + chunk_size; + } + + return -1; +} + +asn_dec_rval_t +xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **sptr, + size_t struct_size, const char *opt_mname, + const void *buf_ptr, size_t size, + xer_primitive_body_decoder_f *prim_body_decoder) { + const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; + asn_struct_ctx_t s_ctx; + struct xdp_arg_s s_arg; + asn_dec_rval_t rc; + + /* + * Create the structure if does not exist. + */ + if(!*sptr) { + *sptr = CALLOC(1, struct_size); + if(!*sptr) ASN__DECODE_FAILED; + } + + memset(&s_ctx, 0, sizeof(s_ctx)); + s_arg.type_descriptor = td; + s_arg.struct_key = *sptr; + s_arg.prim_body_decoder = prim_body_decoder; + s_arg.decoded_something = 0; + s_arg.want_more = 0; + + rc = xer_decode_general(opt_codec_ctx, &s_ctx, &s_arg, + xml_tag, buf_ptr, size, + xer_decode__unexpected_tag, + xer_decode__primitive_body); + switch(rc.code) { + case RC_OK: + if(!s_arg.decoded_something) { + char ch; + ASN_DEBUG("Primitive body is not recognized, " + "supplying empty one"); + /* + * Decoding opportunity has come and gone. + * Where's the result? + * Try to feed with empty body, see if it eats it. + */ + if(prim_body_decoder(s_arg.type_descriptor, + s_arg.struct_key, &ch, 0) + != XPBD_BODY_CONSUMED) { + /* + * This decoder does not like empty stuff. + */ + ASN__DECODE_FAILED; + } + } + break; + case RC_WMORE: + /* + * Redo the whole thing later. + * We don't have a context to save intermediate parsing state. + */ + rc.consumed = 0; + break; + case RC_FAIL: + rc.consumed = 0; + if(s_arg.want_more) + rc.code = RC_WMORE; + else + ASN__DECODE_FAILED; + break; + } + return rc; +} diff --git a/certgen/asncodec/asn_config.h b/certgen/asncodec/asn_config.h new file mode 100644 index 0000000..4f5e36f --- /dev/null +++ b/certgen/asncodec/asn_config.h @@ -0,0 +1,7 @@ +// Generated automatically. Don't edit manually! + +#define ASN_DISABLE_BER_SUPPORT 1 +#define ASN_DISABLE_UPER_SUPPORT 1 +#define ASN_DISABLE_APER_SUPPORT 1 +#define ASN_DISABLE_RFILL_SUPPORT 1 +#define ASN_DISABLE_JER_SUPPORT 1 diff --git a/certgen/asncodec/asn_constant.h b/certgen/asncodec/asn_constant.h new file mode 100644 index 0000000..6e5f7f1 --- /dev/null +++ b/certgen/asncodec/asn_constant.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.29-DF (http://lionet.info/asn1c) + */ + +#ifndef _ASN_CONSTANT_H +#define _ASN_CONSTANT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define min_val_CertificateFormat (1) +#define max_val_CertificateFormat (255) +#define min_val_PduFunctionalType (0) +#define max_val_PduFunctionalType (255) +#define min_val_HeaderInfoContributorId (0) +#define max_val_HeaderInfoContributorId (255) +#define min_val_Uint3 (0) +#define max_val_Uint3 (7) +#define min_val_Uint8 (0) +#define max_val_Uint8 (255) +#define min_val_Uint16 (0) +#define max_val_Uint16 (65535) +#define min_val_Uint32 (0) +#define max_val_Uint32 (4294967295) +#define min_val_Uint64 (0) +#define max_val_Uint64 (18446744073709551615ULL) +#define min_val_NinetyDegreeInt (-900000000) +#define max_val_NinetyDegreeInt (900000001) +#define min_val_OneEightyDegreeInt (-1799999999) +#define max_val_OneEightyDegreeInt (1800000001) +#define min_val_Psid (0) +#define max_val_Psid (321) +#define min_val_ExtId (0) +#define max_val_ExtId (255) +#define min_val_Ieee1609dot2dot1MsctlType (0) +#define max_val_Ieee1609dot2dot1MsctlType (255) +#define min_val_CtlSequenceNumber (0) +#define max_val_CtlSequenceNumber (65535) + + +#ifdef __cplusplus +} +#endif + +#endif /* _ASN_CONSTANT_H */ diff --git a/certgen/asncodec/asn_internal.c b/certgen/asncodec/asn_internal.c index 6a774f9..c2a8108 100644 --- a/certgen/asncodec/asn_internal.c +++ b/certgen/asncodec/asn_internal.c @@ -1,47 +1,48 @@ -#include - -ssize_t -asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key, - const char *fmt, ...) { - char scratch[64]; - char *buf = scratch; - size_t buf_size = sizeof(scratch); - int wrote; - int cb_ret; - - do { - va_list args; - va_start(args, fmt); - - wrote = vsnprintf(buf, buf_size, fmt, args); - if(wrote < (ssize_t)buf_size) { - if(wrote < 0) { - if(buf != scratch) FREEMEM(buf); - return -1; - } - break; - } - - buf_size <<= 1; - if(buf == scratch) { - buf = MALLOC(buf_size); - if(!buf) return -1; - } else { - void *p = REALLOC(buf, buf_size); - if(!p) { - FREEMEM(buf); - return -1; - } - buf = p; - } - } while(1); - - cb_ret = cb(buf, wrote, key); - if(buf != scratch) FREEMEM(buf); - if(cb_ret < 0) { - return -1; - } - - return wrote; -} - +#include + +ssize_t +asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key, + const char *fmt, ...) { + char scratch[64]; + char *buf = scratch; + size_t buf_size = sizeof(scratch); + int wrote; + int cb_ret; + + do { + va_list args; + va_start(args, fmt); + + wrote = vsnprintf(buf, buf_size, fmt, args); + va_end(args); + if(wrote < (ssize_t)buf_size) { + if(wrote < 0) { + if(buf != scratch) FREEMEM(buf); + return -1; + } + break; + } + + buf_size <<= 1; + if(buf == scratch) { + buf = MALLOC(buf_size); + if(!buf) return -1; + } else { + void *p = REALLOC(buf, buf_size); + if(!p) { + FREEMEM(buf); + return -1; + } + buf = p; + } + } while(1); + + cb_ret = cb(buf, wrote, key); + if(buf != scratch) FREEMEM(buf); + if(cb_ret < 0) { + return -1; + } + + return wrote; +} + diff --git a/certgen/asncodec/asn_internal.h b/certgen/asncodec/asn_internal.h index 032cc0c..7103b50 100644 --- a/certgen/asncodec/asn_internal.h +++ b/certgen/asncodec/asn_internal.h @@ -1,151 +1,170 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Declarations internally useful for the ASN.1 support code. - */ -#ifndef ASN_INTERNAL_H -#define ASN_INTERNAL_H -#define __EXTENSIONS__ /* for Sun */ - -#include "asn_application.h" /* Application-visible API */ - -#ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ -#include /* for assert() macro */ -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Environment version might be used to avoid running with the old library */ -#define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */ -int get_asn1c_environment_version(void); /* Run-time version */ - -#define CALLOC(nmemb, size) calloc(nmemb, size) -#define MALLOC(size) malloc(size) -#define REALLOC(oldptr, size) realloc(oldptr, size) -#define FREEMEM(ptr) free(ptr) - -#define asn_debug_indent 0 -#define ASN_DEBUG_INDENT_ADD(i) do{}while(0) - -#ifdef EMIT_ASN_DEBUG -#warning "Use ASN_EMIT_DEBUG instead of EMIT_ASN_DEBUG" -#define ASN_EMIT_DEBUG EMIT_ASN_DEBUG -#endif - -/* - * A macro for debugging the ASN.1 internals. - * You may enable or override it. - */ -#ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ -#if ASN_EMIT_DEBUG == 1 /* And it was asked to emit this code... */ -#if __STDC_VERSION__ >= 199901L -#ifdef ASN_THREAD_SAFE -/* Thread safety requires sacrifice in output indentation: - * Retain empty definition of ASN_DEBUG_INDENT_ADD. */ -#else /* !ASN_THREAD_SAFE */ -#undef ASN_DEBUG_INDENT_ADD -#undef asn_debug_indent -int asn_debug_indent; -#define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0) -#endif /* ASN_THREAD_SAFE */ -#define ASN_DEBUG(fmt, args...) do { \ - int adi = asn_debug_indent; \ - while(adi--) fprintf(stderr, " "); \ - fprintf(stderr, fmt, ##args); \ - fprintf(stderr, " (%s:%d)\n", \ - __FILE__, __LINE__); \ - } while(0) -#else /* !C99 */ -void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...); -#define ASN_DEBUG ASN_DEBUG_f -#endif /* C99 */ -#else /* ASN_EMIT_DEBUG != 1 */ -#if __STDC_VERSION__ >= 199901L -#define ASN_DEBUG(...) do{}while(0) -#else /* not C99 */ -static void CC_PRINTFLIKE(1, 2) ASN_DEBUG(const char *fmt, ...) { (void)fmt; } -#endif /* C99 or better */ -#endif /* ASN_EMIT_DEBUG */ -#endif /* ASN_DEBUG */ - -/* - * Print to a callback. - * The callback is expected to return negative values on error. - * 0 and positive values are treated as success. - * RETURN VALUES: - * -1: Failed to format or invoke the callback. - * >0: Size of the data that got delivered to the callback. - */ -ssize_t CC_PRINTFLIKE(3, 4) -asn__format_to_callback( - int (*callback)(const void *, size_t, void *key), void *key, - const char *fmt, ...); - -/* - * Invoke the application-supplied callback and fail, if something is wrong. - */ -#define ASN__E_cbc(buf, size) (cb((buf), (size), app_key) < 0) -#define ASN__E_CALLBACK(size, foo) \ - do { \ - if(foo) goto cb_failed; \ - er.encoded += (size); \ - } while(0) -#define ASN__CALLBACK(buf, size) ASN__E_CALLBACK(size, ASN__E_cbc(buf, size)) -#define ASN__CALLBACK2(buf1, size1, buf2, size2) \ - ASN__E_CALLBACK((size1) + (size2), \ - ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2)) -#define ASN__CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ - ASN__E_CALLBACK((size1) + (size2) + (size3), \ - ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2) \ - || ASN__E_cbc(buf3, size3)) - -#define ASN__TEXT_INDENT(nl, level) \ - do { \ - int tmp_level = (level); \ - int tmp_nl = ((nl) != 0); \ - int tmp_i; \ - if(tmp_nl) ASN__CALLBACK("\n", 1); \ - if(tmp_level < 0) tmp_level = 0; \ - for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) ASN__CALLBACK(" ", 4); \ - } while(0) - -#define _i_INDENT(nl) do { \ - int tmp_i; \ - if((nl) && cb("\n", 1, app_key) < 0) \ - return -1; \ - for(tmp_i = 0; tmp_i < ilevel; tmp_i++) \ - if(cb(" ", 4, app_key) < 0) \ - return -1; \ - } while(0) - -/* - * Check stack against overflow, if limit is set. - */ -#define ASN__DEFAULT_STACK_MAX (30000) -static int CC_NOTUSED -ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) { - if(ctx && ctx->max_stack_size) { - - /* ctx MUST be allocated on the stack */ - ptrdiff_t usedstack = ((const char *)ctx - (const char *)&ctx); - if(usedstack > 0) usedstack = -usedstack; /* grows up! */ - - /* double negative required to avoid int wrap-around */ - if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { - ASN_DEBUG("Stack limit %ld reached", - (long)ctx->max_stack_size); - return -1; - } - } - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_INTERNAL_H */ +/* + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Declarations internally useful for the ASN.1 support code. + */ +#ifndef ASN_INTERNAL_H +#define ASN_INTERNAL_H +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ /* for Sun */ +#endif + +#include "asn_application.h" /* Application-visible API */ + +#ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ +#include /* for assert() macro */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +#include +#include +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#include +#include +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +/* Environment version might be used to avoid running with the old library */ +#define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */ +int get_asn1c_environment_version(void); /* Run-time version */ + +#define CALLOC(nmemb, size) calloc(nmemb, size) +#define MALLOC(size) malloc(size) +#define REALLOC(oldptr, size) realloc(oldptr, size) +#define FREEMEM(ptr) free(ptr) + +#define asn_debug_indent 0 +#define ASN_DEBUG_INDENT_ADD(i) do{}while(0) + +#ifdef EMIT_ASN_DEBUG +#warning "Use ASN_EMIT_DEBUG instead of EMIT_ASN_DEBUG" +#define ASN_EMIT_DEBUG EMIT_ASN_DEBUG +#endif + +/* + * A macro for debugging the ASN.1 internals. + * You may enable or override it. + */ +#ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ +#if ASN_EMIT_DEBUG == 1 /* And it was asked to emit this code... */ +#if __STDC_VERSION__ >= 199901L +#ifdef ASN_THREAD_SAFE +/* Thread safety requires sacrifice in output indentation: + * Retain empty definition of ASN_DEBUG_INDENT_ADD. */ +#else /* !ASN_THREAD_SAFE */ +#undef ASN_DEBUG_INDENT_ADD +#undef asn_debug_indent +int asn_debug_indent; +#define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0) +#endif /* ASN_THREAD_SAFE */ +#define ASN_DEBUG(fmt, args...) do { \ + int adi = asn_debug_indent; \ + while(adi--) fprintf(stderr, " "); \ + fprintf(stderr, fmt, ##args); \ + fprintf(stderr, " (%s:%d)\n", \ + __FILE__, __LINE__); \ + } while(0) +#else /* !C99 */ +void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...); +#define ASN_DEBUG ASN_DEBUG_f +#endif /* C99 */ +#else /* ASN_EMIT_DEBUG != 1 */ +#if __STDC_VERSION__ >= 199901L +#define ASN_DEBUG(...) do{}while(0) +#else /* not C99 */ +static void CC_PRINTFLIKE(1, 2) ASN_DEBUG(const char *fmt, ...) { (void)fmt; } +#endif /* C99 or better */ +#endif /* ASN_EMIT_DEBUG */ +#endif /* ASN_DEBUG */ + +/* + * Print to a callback. + * The callback is expected to return negative values on error. + * 0 and positive values are treated as success. + * RETURN VALUES: + * -1: Failed to format or invoke the callback. + * >0: Size of the data that got delivered to the callback. + */ +ssize_t CC_PRINTFLIKE(3, 4) +asn__format_to_callback( + int (*callback)(const void *, size_t, void *key), void *key, + const char *fmt, ...); + +/* + * Invoke the application-supplied callback and fail, if something is wrong. + */ +#define ASN__E_cbc(buf, size) (cb((buf), (size), app_key) < 0) +#define ASN__E_CALLBACK(size, foo) \ + do { \ + if(foo) goto cb_failed; \ + er.encoded += (size); \ + } while(0) +#define ASN__CALLBACK(buf, size) ASN__E_CALLBACK(size, ASN__E_cbc(buf, size)) +#define ASN__CALLBACK2(buf1, size1, buf2, size2) \ + ASN__E_CALLBACK((size1) + (size2), \ + ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2)) +#define ASN__CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ + ASN__E_CALLBACK((size1) + (size2) + (size3), \ + ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2) \ + || ASN__E_cbc(buf3, size3)) + +#define ASN__TEXT_INDENT(nl, level) \ + do { \ + int tmp_level = (level); \ + int tmp_nl = ((nl) != 0); \ + int tmp_i; \ + if(tmp_nl) ASN__CALLBACK("\n", 1); \ + if(tmp_level < 0) tmp_level = 0; \ + for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) ASN__CALLBACK(" ", 4); \ + } while(0) + +#define _i_INDENT(nl) do { \ + int tmp_i; \ + if((nl) && cb("\n", 1, app_key) < 0) \ + return -1; \ + for(tmp_i = 0; tmp_i < ilevel; tmp_i++) \ + if(cb(" ", 4, app_key) < 0) \ + return -1; \ + } while(0) + +/* + * Check stack against overflow, if limit is set. + */ +#define ASN__DEFAULT_STACK_MAX (30000) +#ifdef ASN_DISABLE_STACK_OVERFLOW_CHECK +static int CC_NOTUSED +ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) { + (void)ctx; + return 0; +} +#else +static int CC_NOTUSED +ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) { + if(ctx && ctx->max_stack_size) { + + /* ctx MUST be allocated on the stack */ + ptrdiff_t usedstack = ((const char *)ctx - (const char *)&ctx); + if(usedstack > 0) usedstack = -usedstack; /* grows up! */ + + /* double negative required to avoid int wrap-around */ + if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { + ASN_DEBUG("Stack limit %ld reached", + (long)ctx->max_stack_size); + return -1; + } + } + return 0; +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_INTERNAL_H */ diff --git a/certgen/asncodec/asn_ioc.h b/certgen/asncodec/asn_ioc.h index f5ef777..7de210e 100644 --- a/certgen/asncodec/asn_ioc.h +++ b/certgen/asncodec/asn_ioc.h @@ -1,50 +1,51 @@ -/* - * Run-time support for Information Object Classes. - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_IOC_H -#define ASN_IOC_H - -#include /* Platform-specific types */ - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; -struct asn_ioc_cell_s; - -/* - * X.681, #13 - */ -typedef struct asn_ioc_set_s { - size_t rows_count; - size_t columns_count; - const struct asn_ioc_cell_s *rows; -} asn_ioc_set_t; - - -typedef struct asn_ioc_cell_s { - const char *field_name; /* Is equal to corresponding column_name */ - enum { - aioc__value, - aioc__type, - aioc__open_type, - } cell_kind; - struct asn_TYPE_descriptor_s *type_descriptor; - const void *value_sptr; - struct { - size_t types_count; - struct { - unsigned choice_position; - } *types; - } open_type; -} asn_ioc_cell_t; - - -#ifdef __cplusplus -} -#endif - -#endif /* ASN_IOC_H */ +/* + * Run-time support for Information Object Classes. + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN_IOC_H +#define ASN_IOC_H + +#include /* Platform-specific types */ + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; +struct asn_ioc_cell_s; + +/* + * X.681, #13 + */ +typedef struct asn_ioc_set_s { + size_t rows_count; + size_t columns_count; + const struct asn_ioc_cell_s *rows; +} asn_ioc_set_t; + + +typedef struct asn_ioc_cell_s { + const char *field_name; /* Is equal to corresponding column_name */ + enum { + aioc__undefined = 0, + aioc__value, + aioc__type, + aioc__open_type, + } cell_kind; + struct asn_TYPE_descriptor_s *type_descriptor; + const void *value_sptr; + struct { + size_t types_count; + struct { + unsigned choice_position; + } *types; + } open_type; +} asn_ioc_cell_t; + + +#ifdef __cplusplus +} +#endif + +#endif /* ASN_IOC_H */ diff --git a/certgen/asncodec/asn_random_fill.c b/certgen/asncodec/asn_random_fill.c deleted file mode 100644 index 2496a0f..0000000 --- a/certgen/asncodec/asn_random_fill.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -int -asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr, - size_t length) { - - if(td && td->op->random_fill) { - asn_random_fill_result_t res = - td->op->random_fill(td, struct_ptr, 0, length); - return (res.code == ARFILL_OK) ? 0 : -1; - } else { - return -1; - } -} - -static uintmax_t -asn__intmax_range(intmax_t lb, intmax_t ub) { - assert(lb <= ub); - if((ub < 0) == (lb < 0)) { - return ub - lb; - } else if(lb < 0) { - return 1 + ((uintmax_t)ub + (uintmax_t)-(lb + 1)); - } else { - assert(!"Unreachable"); - return 0; - } -} - -intmax_t -asn_random_between(intmax_t lb, intmax_t rb) { - if(lb == rb) { - return lb; - } else { - const uintmax_t intmax_max = ((~(uintmax_t)0) >> 1); - uintmax_t range = asn__intmax_range(lb, rb); - uintmax_t value = 0; - uintmax_t got_entropy = 0; - - assert(RAND_MAX > 0xffffff); /* Seen 7ffffffd! */ - assert(range < intmax_max); - - for(; got_entropy < range;) { - got_entropy = (got_entropy << 24) | 0xffffff; - value = (value << 24) | (random() % 0xffffff); - } - - return lb + (intmax_t)(value % (range + 1)); - } -} diff --git a/certgen/asncodec/asn_random_fill.h b/certgen/asncodec/asn_random_fill.h deleted file mode 100644 index d8b3e52..0000000 --- a/certgen/asncodec/asn_random_fill.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_RANDOM_FILL -#define ASN_RANDOM_FILL - -/* Forward declarations */ -struct asn_TYPE_descriptor_s; -struct asn_encoding_constraints_s; - -/* - * Initialize a structure with random data according to the type specification - * and optional member constraints. - * ARGUMENTS: - * (max_length) - See (approx_max_length_limit). - * (memb_constraints) - Member constraints, if exist. - * The type can be constrained differently according - * to PER and OER specifications, so we find a value - * at the intersection of these constraints. - * In case the return differs from ARFILL_OK, the (struct_ptr) contents - * and (current_length) value remain in their original state. - */ -typedef struct asn_random_fill_result_s { - enum { - ARFILL_FAILED = -1, /* System error (memory?) */ - ARFILL_OK = 0, /* Initialization succeeded */ - ARFILL_SKIPPED = 1 /* Not done due to (length?) constraint */ - } code; - size_t length; /* Approximate number of bytes created. */ -} asn_random_fill_result_t; -typedef asn_random_fill_result_t(asn_random_fill_f)( - const struct asn_TYPE_descriptor_s *td, void **struct_ptr, - const struct asn_encoding_constraints_s *memb_constraints, - size_t max_length); - -/* - * Returns 0 if the structure was properly initialized, -1 otherwise. - * The (approx_max_length_limit) specifies the approximate limit of the - * resulting structure in units closely resembling bytes. The actual result - * might be several times larger or smaller than the length limit. - */ -int asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr, - size_t approx_max_length_limit); - -/* - * Returns a random number between min and max. - */ -intmax_t asn_random_between(intmax_t min, intmax_t max); - -#endif /* ASN_RANDOM_FILL */ diff --git a/certgen/asncodec/asn_system.h b/certgen/asncodec/asn_system.h index a0cd091..43f7821 100644 --- a/certgen/asncodec/asn_system.h +++ b/certgen/asncodec/asn_system.h @@ -1,157 +1,179 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Miscellaneous system-dependent types. - */ -#ifndef ASN_SYSTEM_H -#define ASN_SYSTEM_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef _DEFAULT_SOURCE -#define _DEFAULT_SOURCE 1 -#endif - -#ifndef _BSD_SOURCE -#define _BSD_SOURCE /* for snprintf() on some linux systems */ -#endif - -#include /* For snprintf(3) */ -#include /* For *alloc(3) */ -#include /* For memcpy(3) */ -#include /* For size_t */ -#include /* For LONG_MAX */ -#include /* For va_start */ -#include /* for offsetof and ptrdiff_t */ - -#ifdef _WIN32 - -#include -#define snprintf _snprintf -#define vsnprintf _vsnprintf - -/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */ -#define sys_ntohl(l) ((((l) << 24) & 0xff000000) \ - | (((l) << 8) & 0xff0000) \ - | (((l) >> 8) & 0xff00) \ - | ((l >> 24) & 0xff)) - -#ifdef _MSC_VER /* MSVS.Net */ -#ifndef __cplusplus -#define inline __inline -#endif -#ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */ -#define ssize_t SSIZE_T -#if _MSC_VER < 1600 -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#else /* _MSC_VER >= 1600 */ -#include -#endif /* _MSC_VER < 1600 */ -#endif /* ASSUMESTDTYPES */ -#define WIN32_LEAN_AND_MEAN -#include -#include -#ifndef isnan -#define isnan _isnan -#endif -#define finite _finite -#define copysign _copysign -#define ilogb _logb -#else /* !_MSC_VER */ -#include -#endif /* _MSC_VER */ - -#else /* !_WIN32 */ - -#if defined(__vxworks) -#include -#else /* !defined(__vxworks) */ - -#include /* C99 specifies this file */ -#include /* for ntohl() */ -#define sys_ntohl(foo) ntohl(foo) -#endif /* defined(__vxworks) */ - -#endif /* _WIN32 */ - -#if __GNUC__ >= 3 || defined(__clang__) -#define CC_ATTRIBUTE(attr) __attribute__((attr)) -#else -#define CC_ATTRIBUTE(attr) -#endif -#define CC_PRINTFLIKE(fmt, var) CC_ATTRIBUTE(format(printf, fmt, var)) -#define CC_NOTUSED CC_ATTRIBUTE(unused) -#ifndef CC_ATTR_NO_SANITIZE -#define CC_ATTR_NO_SANITIZE(what) CC_ATTRIBUTE(no_sanitize(what)) -#endif - -/* Figure out if thread safety is requested */ -#if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT)) -#define ASN_THREAD_SAFE -#endif /* Thread safety */ - -#ifndef offsetof /* If not defined by */ -#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) -#endif /* offsetof */ - -#ifndef MIN /* Suitable for comparing primitive types (integers) */ -#if defined(__GNUC__) -#define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ - ((_a)<(_b)?(_a):(_b)); }) -#else /* !__GNUC__ */ -#define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ -#endif /* __GNUC__ */ -#endif /* MIN */ - -#if __STDC_VERSION__ >= 199901L -#ifndef SIZE_MAX -#define SIZE_MAX ((~((size_t)0)) >> 1) -#endif - -#ifndef RSIZE_MAX /* C11, Annex K */ -#define RSIZE_MAX (SIZE_MAX >> 1) -#endif -#ifndef RSSIZE_MAX /* Halve signed size even further than unsigned */ -#define RSSIZE_MAX ((ssize_t)(RSIZE_MAX >> 1)) -#endif -#else /* Old compiler */ -#undef SIZE_MAX -#undef RSIZE_MAX -#undef RSSIZE_MAX -#define SIZE_MAX ((~((size_t)0)) >> 1) -#define RSIZE_MAX (SIZE_MAX >> 1) -#define RSSIZE_MAX ((ssize_t)(RSIZE_MAX >> 1)) -#endif - -#if __STDC_VERSION__ >= 199901L -#define ASN_PRI_SIZE "zu" -#define ASN_PRI_SSIZE "zd" -#define ASN_PRIuMAX PRIuMAX -#define ASN_PRIdMAX PRIdMAX -#else -#if _MSC_VER >= 1800 -#define ASN_PRI_SIZE "zu" -#define ASN_PRI_SSIZE "zd" -#else -#define ASN_PRI_SIZE "lu" -#define ASN_PRI_SSIZE "ld" -#endif -#if LLONG_MAX > LONG_MAX -#define ASN_PRIuMAX "llu" -#define ASN_PRIdMAX "lld" -#else -#define ASN_PRIuMAX "lu" -#define ASN_PRIdMAX "ld" -#endif -#endif - -#endif /* ASN_SYSTEM_H */ +/* + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Miscellaneous system-dependent types. + */ +#ifndef ASN_SYSTEM_H +#define ASN_SYSTEM_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE 1 +#endif + +#ifndef _BSD_SOURCE +#define _BSD_SOURCE /* for snprintf() on some linux systems */ +#endif + +#include /* For snprintf(3) */ +#include /* For *alloc(3) */ +#include /* For memcpy(3) */ +#include /* For size_t */ +#include /* For LONG_MAX */ +#include /* For va_start */ +#include /* for offsetof and ptrdiff_t */ +#include /* for PRIdMAX */ + +#ifdef _WIN32 + +#include +#ifndef __MINGW32__ +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#endif + +/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */ +#define sys_ntohl(l) ((((l) << 24) & 0xff000000) \ + | (((l) << 8) & 0xff0000) \ + | (((l) >> 8) & 0xff00) \ + | ((l >> 24) & 0xff)) + +#ifdef _MSC_VER /* MSVS.Net */ +#ifndef __cplusplus +#ifndef inline +#define inline __inline +#endif +#endif +#ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */ +#define ssize_t SSIZE_T +#if _MSC_VER < 1600 +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#else /* _MSC_VER >= 1600 */ +#include +#endif /* _MSC_VER < 1600 */ +#endif /* ASSUMESTDTYPES */ +#define WIN32_LEAN_AND_MEAN +#include +#include +#ifndef isnan +#define isnan _isnan +#endif +#define finite _finite +#define copysign _copysign +#define ilogb _logb +#define random rand +#else /* !_MSC_VER */ +#include +#endif /* _MSC_VER */ + +#else /* !_WIN32 */ + +#if defined(__vxworks) +#include +#else /* !defined(__vxworks) */ + +#include /* C99 specifies this file */ +#ifdef HAVE_NETINET_IN_H +#include /* for ntohl() */ +#endif +#define sys_ntohl(foo) ntohl(foo) +#endif /* defined(__vxworks) */ + +#endif /* _WIN32 */ + +#if __GNUC__ >= 3 || defined(__clang__) +#define CC_ATTRIBUTE(attr) __attribute__((attr)) +#else +#define CC_ATTRIBUTE(attr) +#endif +#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__>= 4) || __GNUC__ > 4) +#define CC_PRINTFLIKE(fmt, var) CC_ATTRIBUTE(format(gnu_printf, fmt, var)) +#elif defined(__GNUC__) +#if defined(ANDROID) +#define CC_PRINTFLIKE(fmt, var) CC_ATTRIBUTE(__format__(__printf__, fmt, var)) +#else +#define CC_PRINTFLIKE(fmt, var) CC_ATTRIBUTE(format(printf, fmt, var)) +#endif +#else +#define CC_PRINTFLIKE(fmt, var) +#endif +#define CC_NOTUSED CC_ATTRIBUTE(unused) +#ifndef CC_ATTR_NO_SANITIZE +#if __GNUC__ < 8 +#define CC_ATTR_NO_SANITIZE(what) +#else +#define CC_ATTR_NO_SANITIZE(what) CC_ATTRIBUTE(no_sanitize(what)) +#endif +#endif + +/* Figure out if thread safety is requested */ +#if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT)) +#define ASN_THREAD_SAFE +#endif /* Thread safety */ + +#ifndef offsetof /* If not defined by */ +#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) +#endif /* offsetof */ + +#ifndef MIN /* Suitable for comparing primitive types (integers) */ +#if defined(__GNUC__) +#define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ + ((_a)<(_b)?(_a):(_b)); }) +#else /* !__GNUC__ */ +#define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ +#endif /* __GNUC__ */ +#endif /* MIN */ + +#if __STDC_VERSION__ >= 199901L +#ifndef SIZE_MAX +#define SIZE_MAX ((~((size_t)0)) >> 1) +#endif + +#ifndef RSIZE_MAX /* C11, Annex K */ +#define RSIZE_MAX (SIZE_MAX >> 1) +#endif +#ifndef RSSIZE_MAX /* Halve signed size even further than unsigned */ +#define RSSIZE_MAX ((ssize_t)(RSIZE_MAX >> 1)) +#endif +#else /* Old compiler */ +#undef SIZE_MAX +#undef RSIZE_MAX +#undef RSSIZE_MAX +#define SIZE_MAX ((~((size_t)0)) >> 1) +#define RSIZE_MAX (SIZE_MAX >> 1) +#define RSSIZE_MAX ((ssize_t)(RSIZE_MAX >> 1)) +#endif + +#if __STDC_VERSION__ >= 199901L +#define ASN_PRI_SIZE "zu" +#define ASN_PRI_SSIZE "zd" +#define ASN_PRIuMAX PRIuMAX +#define ASN_PRIdMAX PRIdMAX +#else +#if _MSC_VER >= 1800 +#define ASN_PRI_SIZE "zu" +#define ASN_PRI_SSIZE "zd" +#else +#define ASN_PRI_SIZE "lu" +#define ASN_PRI_SSIZE "ld" +#endif +#if LLONG_MAX > LONG_MAX +#define ASN_PRIuMAX "llu" +#define ASN_PRIdMAX "lld" +#else +#define ASN_PRIuMAX "lu" +#define ASN_PRIdMAX "ld" +#endif +#endif + +#endif /* ASN_SYSTEM_H */ diff --git a/certgen/asncodec/ber_decoder.c b/certgen/asncodec/ber_decoder.c deleted file mode 100644 index e913152..0000000 --- a/certgen/asncodec/ber_decoder.c +++ /dev/null @@ -1,283 +0,0 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include - -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) -#undef RETURN -#define RETURN(_code) do { \ - asn_dec_rval_t rval; \ - rval.code = _code; \ - if(opt_ctx) opt_ctx->step = step; /* Save context */ \ - if(_code == RC_OK || opt_ctx) \ - rval.consumed = consumed_myself; \ - else \ - rval.consumed = 0; /* Context-free */ \ - return rval; \ - } while(0) - -/* - * The BER decoder of any type. - */ -asn_dec_rval_t -ber_decode(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, - const void *ptr, size_t size) { - asn_codec_ctx_t s_codec_ctx; - - /* - * Stack checker requires that the codec context - * must be allocated on the stack. - */ - if(opt_codec_ctx) { - if(opt_codec_ctx->max_stack_size) { - s_codec_ctx = *opt_codec_ctx; - opt_codec_ctx = &s_codec_ctx; - } - } else { - /* If context is not given, be security-conscious anyway */ - memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); - s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX; - opt_codec_ctx = &s_codec_ctx; - } - - /* - * Invoke type-specific decoder. - */ - return type_descriptor->op->ber_decoder(opt_codec_ctx, type_descriptor, - struct_ptr, /* Pointer to the destination structure */ - ptr, size, /* Buffer and its size */ - 0 /* Default tag mode is 0 */ - ); -} - -/* - * Check the set of >> tags matches the definition. - */ -asn_dec_rval_t -ber_check_tags(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, - const void *ptr, size_t size, int tag_mode, int last_tag_form, - ber_tlv_len_t *last_length, int *opt_tlv_form) { - ssize_t consumed_myself = 0; - ssize_t tag_len; - ssize_t len_len; - ber_tlv_tag_t tlv_tag; - ber_tlv_len_t tlv_len; - ber_tlv_len_t limit_len = -1; - int expect_00_terminators = 0; - int tlv_constr = -1; /* If CHOICE, opt_tlv_form is not given */ - int step = opt_ctx ? opt_ctx->step : 0; /* Where we left previously */ - int tagno; - - /* - * Make sure we didn't exceed the maximum stack size. - */ - if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) - RETURN(RC_FAIL); - - /* - * So what does all this implicit skip stuff mean? - * Imagine two types, - * A ::= [5] IMPLICIT T - * B ::= [2] EXPLICIT T - * Where T is defined as - * T ::= [4] IMPLICIT SEQUENCE { ... } - * - * Let's say, we are starting to decode type A, given the - * following TLV stream: <5> <0>. What does this mean? - * It means that the type A contains type T which is, - * in turn, empty. - * Remember though, that we are still in A. We cannot - * just pass control to the type T decoder. Why? Because - * the type T decoder expects <4> <0>, not <5> <0>. - * So, we must make sure we are going to receive <5> while - * still in A, then pass control to the T decoder, indicating - * that the tag <4> was implicitly skipped. The decoder of T - * hence will be prepared to treat <4> as valid tag, and decode - * it appropriately. - */ - - tagno = step /* Continuing where left previously */ - + (tag_mode==1?-1:0) - ; - ASN_DEBUG("ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)", - td->name, (long)size, tag_mode, step, tagno); - /* assert(td->tags_count >= 1) May not be the case for CHOICE or ANY */ - - if(tag_mode == 0 && tagno == (int)td->tags_count) { - /* - * This must be the _untagged_ ANY type, - * which outermost tag isn't known in advance. - * Fetch the tag and length separately. - */ - tag_len = ber_fetch_tag(ptr, size, &tlv_tag); - switch(tag_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - tlv_constr = BER_TLV_CONSTRUCTED(ptr); - len_len = ber_fetch_length(tlv_constr, - (const char *)ptr + tag_len, size - tag_len, &tlv_len); - switch(len_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - ASN_DEBUG("Advancing %ld in ANY case", - (long)(tag_len + len_len)); - ADVANCE(tag_len + len_len); - } else { - assert(tagno < (int)td->tags_count); /* At least one loop */ - } - for((void)tagno; tagno < (int)td->tags_count; tagno++, step++) { - - /* - * Fetch and process T from TLV. - */ - tag_len = ber_fetch_tag(ptr, size, &tlv_tag); - ASN_DEBUG("Fetching tag from {%p,%ld}: " - "len %ld, step %d, tagno %d got %s", - ptr, (long)size, - (long)tag_len, step, tagno, - ber_tlv_tag_string(tlv_tag)); - switch(tag_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - - tlv_constr = BER_TLV_CONSTRUCTED(ptr); - - /* - * If {I}, don't check anything. - * If {I,B,C}, check B and C unless we're at I. - */ - if(tag_mode != 0 && step == 0) { - /* - * We don't expect tag to match here. - * It's just because we don't know how the tag - * is supposed to look like. - */ - } else { - assert(tagno >= 0); /* Guaranteed by the code above */ - if(tlv_tag != td->tags[tagno]) { - /* - * Unexpected tag. Too bad. - */ - ASN_DEBUG("Expected: %s, " - "expectation failed (tn=%d, tm=%d)", - ber_tlv_tag_string(td->tags[tagno]), - tagno, tag_mode - ); - RETURN(RC_FAIL); - } - } - - /* - * Attention: if there are more tags expected, - * ensure that the current tag is presented - * in constructed form (it contains other tags!). - * If this one is the last one, check that the tag form - * matches the one given in descriptor. - */ - if(tagno < ((int)td->tags_count - 1)) { - if(tlv_constr == 0) { - ASN_DEBUG("tlv_constr = %d, expfail", - tlv_constr); - RETURN(RC_FAIL); - } - } else { - if(last_tag_form != tlv_constr - && last_tag_form != -1) { - ASN_DEBUG("last_tag_form %d != %d", - last_tag_form, tlv_constr); - RETURN(RC_FAIL); - } - } - - /* - * Fetch and process L from TLV. - */ - len_len = ber_fetch_length(tlv_constr, - (const char *)ptr + tag_len, size - tag_len, &tlv_len); - ASN_DEBUG("Fetching len = %ld", (long)len_len); - switch(len_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - - /* - * FIXME - * As of today, the chain of tags - * must either contain several indefinite length TLVs, - * or several definite length ones. - * No mixing is allowed. - */ - if(tlv_len == -1) { - /* - * Indefinite length. - */ - if(limit_len == -1) { - expect_00_terminators++; - } else { - ASN_DEBUG("Unexpected indefinite length " - "in a chain of definite lengths"); - RETURN(RC_FAIL); - } - ADVANCE(tag_len + len_len); - continue; - } else { - if(expect_00_terminators) { - ASN_DEBUG("Unexpected definite length " - "in a chain of indefinite lengths"); - RETURN(RC_FAIL); - } - } - - /* - * Check that multiple TLVs specify ever decreasing length, - * which is consistent. - */ - if(limit_len == -1) { - limit_len = tlv_len + tag_len + len_len; - if(limit_len < 0) { - /* Too great tlv_len value? */ - RETURN(RC_FAIL); - } - } else if(limit_len != tlv_len + tag_len + len_len) { - /* - * Inner TLV specifies length which is inconsistent - * with the outer TLV's length value. - */ - ASN_DEBUG("Outer TLV is %ld and inner is %ld", - (long)limit_len, (long)tlv_len); - RETURN(RC_FAIL); - } - - ADVANCE(tag_len + len_len); - - limit_len -= (tag_len + len_len); - if((ssize_t)size > limit_len) { - /* - * Make sure that we won't consume more bytes - * from the parent frame than the inferred limit. - */ - size = limit_len; - } - } - - if(opt_tlv_form) - *opt_tlv_form = tlv_constr; - if(expect_00_terminators) - *last_length = -expect_00_terminators; - else - *last_length = tlv_len; - - RETURN(RC_OK); -} diff --git a/certgen/asncodec/ber_decoder.h b/certgen/asncodec/ber_decoder.h deleted file mode 100644 index 068084f..0000000 --- a/certgen/asncodec/ber_decoder.h +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _BER_DECODER_H_ -#define _BER_DECODER_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_codec_ctx_s; /* Forward declaration */ - -/* - * The BER decoder of any type. - * This function may be invoked directly from the application. - * Decodes BER, DER and CER data (DER and CER are different subsets of BER). - * - * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding - * which is compliant with ber_decode(). - */ -asn_dec_rval_t ber_decode( - const struct asn_codec_ctx_s *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of that buffer */ -); - -/* - * Type of generic function which decodes the byte stream into the structure. - */ -typedef asn_dec_rval_t(ber_type_decoder_f)( - const struct asn_codec_ctx_s *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, - const void *buf_ptr, size_t size, int tag_mode); - -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ - -/* - * Check that all tags correspond to the type definition (as given in head). - * On return, last_length would contain either a non-negative length of the - * value part of the last TLV, or the negative number of expected - * "end of content" sequences. The number may only be negative if the - * head->last_tag_form is non-zero. - */ -asn_dec_rval_t ber_check_tags( - const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ - const struct asn_TYPE_descriptor_s *type_descriptor, - asn_struct_ctx_t *opt_ctx, /* saved decoding context */ - const void *ptr, size_t size, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {-1,0:1}: any, primitive, constr */ - ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */ -); - -#ifdef __cplusplus -} -#endif - -#endif /* _BER_DECODER_H_ */ diff --git a/certgen/asncodec/ber_tlv_length.c b/certgen/asncodec/ber_tlv_length.c index 3bf14b0..0a0deec 100644 --- a/certgen/asncodec/ber_tlv_length.c +++ b/certgen/asncodec/ber_tlv_length.c @@ -1,168 +1,168 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -ssize_t -ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, - ber_tlv_len_t *len_r) { - const uint8_t *buf = (const uint8_t *)bufptr; - unsigned oct; - - if(size == 0) - return 0; /* Want more */ - - oct = *(const uint8_t *)buf; - if((oct & 0x80) == 0) { - /* - * Short definite length. - */ - *len_r = oct; /* & 0x7F */ - return 1; - } else { - ber_tlv_len_t len; - size_t skipped; - - if(_is_constructed && oct == 0x80) { - *len_r = -1; /* Indefinite length */ - return 1; - } - - if(oct == 0xff) { - /* Reserved in standard for future use. */ - return -1; - } - - oct &= 0x7F; /* Leave only the 7 LS bits */ - for(len = 0, buf++, skipped = 1; - oct && (++skipped <= size); buf++, oct--) { - - /* Verify that we won't overflow. */ - if(!(len >> ((8 * sizeof(len)) - (8+1)))) { - len = (len << 8) | *buf; - } else { - /* Too large length value. */ - return -1; - } - } - - if(oct == 0) { - if(len < 0 || len > RSSIZE_MAX) { - /* Length value out of sane range. */ - return -1; - } - - *len_r = len; - return skipped; - } - - return 0; /* Want more */ - } - -} - -ssize_t -ber_skip_length(const asn_codec_ctx_t *opt_codec_ctx, - int _is_constructed, const void *ptr, size_t size) { - ber_tlv_len_t vlen; /* Length of V in TLV */ - ssize_t tl; /* Length of L in TLV */ - ssize_t ll; /* Length of L in TLV */ - size_t skip; - - /* - * Make sure we didn't exceed the maximum stack size. - */ - if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) - return -1; - - /* - * Determine the size of L in TLV. - */ - ll = ber_fetch_length(_is_constructed, ptr, size, &vlen); - if(ll <= 0) return ll; - - /* - * Definite length. - */ - if(vlen >= 0) { - skip = ll + vlen; - if(skip > size) - return 0; /* Want more */ - return skip; - } - - /* - * Indefinite length! - */ - ASN_DEBUG("Skipping indefinite length"); - for(skip = ll, ptr = ((const char *)ptr) + ll, size -= ll;;) { - ber_tlv_tag_t tag; - - /* Fetch the tag */ - tl = ber_fetch_tag(ptr, size, &tag); - if(tl <= 0) return tl; - - ll = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - ((const char *)ptr) + tl, size - tl); - if(ll <= 0) return ll; - - skip += tl + ll; - - /* - * This may be the end of the indefinite length structure, - * two consecutive 0 octets. - * Check if it is true. - */ - if(((const uint8_t *)ptr)[0] == 0 - && ((const uint8_t *)ptr)[1] == 0) - return skip; - - ptr = ((const char *)ptr) + tl + ll; - size -= tl + ll; - } - - /* UNREACHABLE */ -} - -size_t -der_tlv_length_serialize(ber_tlv_len_t len, void *bufp, size_t size) { - size_t required_size; /* Size of len encoding */ - uint8_t *buf = (uint8_t *)bufp; - uint8_t *end; - int i; - - if(len <= 127) { - /* Encoded in 1 octet */ - if(size) *buf = (uint8_t)len; - return 1; - } - - /* - * Compute the size of the subsequent bytes. - */ - for(required_size = 1, i = 8; i < 8 * (int)sizeof(len); i += 8) { - if(len >> i) - required_size++; - else - break; - } - - if(size <= required_size) - return required_size + 1; - - *buf++ = (uint8_t)(0x80 | required_size); /* Length of the encoding */ - - /* - * Produce the len encoding, space permitting. - */ - end = buf + required_size; - for(i -= 8; buf < end; i -= 8, buf++) - *buf = (uint8_t)(len >> i); - - return required_size + 1; -} - +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +ssize_t +ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, + ber_tlv_len_t *len_r) { + const uint8_t *buf = (const uint8_t *)bufptr; + unsigned oct; + + if(size == 0) + return 0; /* Want more */ + + oct = *(const uint8_t *)buf; + if((oct & 0x80) == 0) { + /* + * Short definite length. + */ + *len_r = oct; /* & 0x7F */ + return 1; + } else { + ber_tlv_len_t len; + size_t skipped; + + if(_is_constructed && oct == 0x80) { + *len_r = -1; /* Indefinite length */ + return 1; + } + + if(oct == 0xff) { + /* Reserved in standard for future use. */ + return -1; + } + + oct &= 0x7F; /* Leave only the 7 LS bits */ + for(len = 0, buf++, skipped = 1; + oct && (++skipped <= size); buf++, oct--) { + + /* Verify that we won't overflow. */ + if(!(len >> ((8 * sizeof(len)) - (8+1)))) { + len = (len << 8) | *buf; + } else { + /* Too large length value. */ + return -1; + } + } + + if(oct == 0) { + if(len < 0 || len > RSSIZE_MAX) { + /* Length value out of sane range. */ + return -1; + } + + *len_r = len; + return skipped; + } + + return 0; /* Want more */ + } + +} + +ssize_t +ber_skip_length(const asn_codec_ctx_t *opt_codec_ctx, + int _is_constructed, const void *ptr, size_t size) { + ber_tlv_len_t vlen; /* Length of V in TLV */ + ssize_t tl; /* Length of L in TLV */ + ssize_t ll; /* Length of L in TLV */ + size_t skip; + + /* + * Make sure we didn't exceed the maximum stack size. + */ + if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) + return -1; + + /* + * Determine the size of L in TLV. + */ + ll = ber_fetch_length(_is_constructed, ptr, size, &vlen); + if(ll <= 0) return ll; + + /* + * Definite length. + */ + if(vlen >= 0) { + skip = ll + vlen; + if(skip > size) + return 0; /* Want more */ + return skip; + } + + /* + * Indefinite length! + */ + ASN_DEBUG("Skipping indefinite length"); + for(skip = ll, ptr = ((const char *)ptr) + ll, size -= ll;;) { + ber_tlv_tag_t tag; + + /* Fetch the tag */ + tl = ber_fetch_tag(ptr, size, &tag); + if(tl <= 0) return tl; + + ll = ber_skip_length(opt_codec_ctx, + BER_TLV_CONSTRUCTED(ptr), + ((const char *)ptr) + tl, size - tl); + if(ll <= 0) return ll; + + skip += tl + ll; + + /* + * This may be the end of the indefinite length structure, + * two consecutive 0 octets. + * Check if it is true. + */ + if(((const uint8_t *)ptr)[0] == 0 + && ((const uint8_t *)ptr)[1] == 0) + return skip; + + ptr = ((const char *)ptr) + tl + ll; + size -= tl + ll; + } + + /* UNREACHABLE */ +} + +size_t +der_tlv_length_serialize(ber_tlv_len_t len, void *bufp, size_t size) { + size_t required_size; /* Size of len encoding */ + uint8_t *buf = (uint8_t *)bufp; + uint8_t *end; + int i; + + if(len <= 127) { + /* Encoded in 1 octet */ + if(size) *buf = (uint8_t)len; + return 1; + } + + /* + * Compute the size of the subsequent bytes. + */ + for(required_size = 1, i = 8; i < 8 * (int)sizeof(len); i += 8) { + if(len >> i) + required_size++; + else + break; + } + + if(size <= required_size) + return required_size + 1; + + *buf++ = (uint8_t)(0x80 | required_size); /* Length of the encoding */ + + /* + * Produce the len encoding, space permitting. + */ + end = buf + required_size; + for(i -= 8; buf < end; i -= 8, buf++) + *buf = (uint8_t)(len >> i); + + return required_size + 1; +} + diff --git a/certgen/asncodec/ber_tlv_length.h b/certgen/asncodec/ber_tlv_length.h index ebae5e0..d1e4d48 100644 --- a/certgen/asncodec/ber_tlv_length.h +++ b/certgen/asncodec/ber_tlv_length.h @@ -1,50 +1,50 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _BER_TLV_LENGTH_H_ -#define _BER_TLV_LENGTH_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef ssize_t ber_tlv_len_t; - -/* - * This function tries to fetch the length of the BER TLV value and place it - * in *len_r. - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering length. - * >0: Number of bytes used from bufptr. - * On return with >0, len_r is constrained as -1..MAX, where -1 mean - * that the value is of indefinite length. - */ -ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, - ber_tlv_len_t *len_r); - -/* - * This function expects bufptr to be positioned over L in TLV. - * It returns number of bytes occupied by L and V together, suitable - * for skipping. The function properly handles indefinite length. - * RETURN VALUES: - * Standard {-1,0,>0} convention. - */ -ssize_t ber_skip_length( - const struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ - int _is_constructed, const void *bufptr, size_t size); - -/* - * This function serializes the length (L from TLV) in DER format. - * It always returns number of bytes necessary to represent the length, - * it is a caller's responsibility to check the return value - * against the supplied buffer's size. - */ -size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* _BER_TLV_LENGTH_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _BER_TLV_LENGTH_H_ +#define _BER_TLV_LENGTH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef ssize_t ber_tlv_len_t; + +/* + * This function tries to fetch the length of the BER TLV value and place it + * in *len_r. + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering length. + * >0: Number of bytes used from bufptr. + * On return with >0, len_r is constrained as -1..MAX, where -1 mean + * that the value is of indefinite length. + */ +ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, + ber_tlv_len_t *len_r); + +/* + * This function expects bufptr to be positioned over L in TLV. + * It returns number of bytes occupied by L and V together, suitable + * for skipping. The function properly handles indefinite length. + * RETURN VALUES: + * Standard {-1,0,>0} convention. + */ +ssize_t ber_skip_length( + const struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ + int _is_constructed, const void *bufptr, size_t size); + +/* + * This function serializes the length (L from TLV) in DER format. + * It always returns number of bytes necessary to represent the length, + * it is a caller's responsibility to check the return value + * against the supplied buffer's size. + */ +size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif /* _BER_TLV_LENGTH_H_ */ diff --git a/certgen/asncodec/ber_tlv_tag.c b/certgen/asncodec/ber_tlv_tag.c index 219b3e6..64ec14f 100644 --- a/certgen/asncodec/ber_tlv_tag.c +++ b/certgen/asncodec/ber_tlv_tag.c @@ -1,144 +1,144 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -ssize_t -ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) { - ber_tlv_tag_t val; - ber_tlv_tag_t tclass; - size_t skipped; - - if(size == 0) - return 0; - - val = *(const uint8_t *)ptr; - tclass = (val >> 6); - if((val &= 0x1F) != 0x1F) { - /* - * Simple form: everything encoded in a single octet. - * Tag Class is encoded using two least significant bits. - */ - *tag_r = (val << 2) | tclass; - return 1; - } - - /* - * Each octet contains 7 bits of useful information. - * The MSB is 0 if it is the last octet of the tag. - */ - for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; - skipped <= size; - ptr = ((const char *)ptr) + 1, skipped++) { - unsigned int oct = *(const uint8_t *)ptr; - if(oct & 0x80) { - val = (val << 7) | (oct & 0x7F); - /* - * Make sure there are at least 9 bits spare - * at the MS side of a value. - */ - if(val >> ((8 * sizeof(val)) - 9)) { - /* - * We would not be able to accomodate - * any more tag bits. - */ - return -1; - } - } else { - val = (val << 7) | oct; - *tag_r = (val << 2) | tclass; - return skipped; - } - } - - return 0; /* Want more */ -} - - -ssize_t -ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) { - char buf[sizeof("[APPLICATION ]") + 32]; - ssize_t ret; - - ret = ber_tlv_tag_snprint(tag, buf, sizeof(buf)); - if(ret >= (ssize_t)sizeof(buf) || ret < 2) { - errno = EPERM; - return -1; - } - - return fwrite(buf, 1, ret, f); -} - -ssize_t -ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) { - const char *type = 0; - int ret; - - switch(tag & 0x3) { - case ASN_TAG_CLASS_UNIVERSAL: type = "UNIVERSAL "; break; - case ASN_TAG_CLASS_APPLICATION: type = "APPLICATION "; break; - case ASN_TAG_CLASS_CONTEXT: type = ""; break; - case ASN_TAG_CLASS_PRIVATE: type = "PRIVATE "; break; - } - - ret = snprintf(buf, size, "[%s%u]", type, ((unsigned)tag) >> 2); - if(ret <= 0 && size) buf[0] = '\0'; /* against broken libc's */ - - return ret; -} - -char * -ber_tlv_tag_string(ber_tlv_tag_t tag) { - static char buf[sizeof("[APPLICATION ]") + 32]; - - (void)ber_tlv_tag_snprint(tag, buf, sizeof(buf)); - - return buf; -} - - -size_t -ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufp, size_t size) { - int tclass = BER_TAG_CLASS(tag); - ber_tlv_tag_t tval = BER_TAG_VALUE(tag); - uint8_t *buf = (uint8_t *)bufp; - uint8_t *end; - size_t required_size; - size_t i; - - if(tval <= 30) { - /* Encoded in 1 octet */ - if(size) buf[0] = (tclass << 6) | tval; - return 1; - } else if(size) { - *buf++ = (tclass << 6) | 0x1F; - size--; - } - - /* - * Compute the size of the subsequent bytes. - */ - for(required_size = 1, i = 7; i < 8 * sizeof(tval); i += 7) { - if(tval >> i) - required_size++; - else - break; - } - - if(size < required_size) - return required_size + 1; - - /* - * Fill in the buffer, space permitting. - */ - end = buf + required_size - 1; - for(i -= 7; buf < end; i -= 7, buf++) - *buf = 0x80 | ((tval >> i) & 0x7F); - *buf = (tval & 0x7F); /* Last octet without high bit */ - - return required_size + 1; -} - +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +ssize_t +ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) { + ber_tlv_tag_t val; + ber_tlv_tag_t tclass; + size_t skipped; + + if(size == 0) + return 0; + + val = *(const uint8_t *)ptr; + tclass = (val >> 6); + if((val &= 0x1F) != 0x1F) { + /* + * Simple form: everything encoded in a single octet. + * Tag Class is encoded using two least significant bits. + */ + *tag_r = (val << 2) | tclass; + return 1; + } + + /* + * Each octet contains 7 bits of useful information. + * The MSB is 0 if it is the last octet of the tag. + */ + for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; + skipped <= size; + ptr = ((const char *)ptr) + 1, skipped++) { + unsigned int oct = *(const uint8_t *)ptr; + if(oct & 0x80) { + val = (val << 7) | (oct & 0x7F); + /* + * Make sure there are at least 9 bits spare + * at the MS side of a value. + */ + if(val >> ((8 * sizeof(val)) - 9)) { + /* + * We would not be able to accommodate + * any more tag bits. + */ + return -1; + } + } else { + val = (val << 7) | oct; + *tag_r = (val << 2) | tclass; + return skipped; + } + } + + return 0; /* Want more */ +} + + +ssize_t +ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) { + char buf[sizeof("[APPLICATION ]") + 32]; + ssize_t ret; + + ret = ber_tlv_tag_snprint(tag, buf, sizeof(buf)); + if(ret >= (ssize_t)sizeof(buf) || ret < 2) { + errno = EPERM; + return -1; + } + + return fwrite(buf, 1, ret, f); +} + +ssize_t +ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) { + const char *type = 0; + int ret; + + switch(tag & 0x3) { + case ASN_TAG_CLASS_UNIVERSAL: type = "UNIVERSAL "; break; + case ASN_TAG_CLASS_APPLICATION: type = "APPLICATION "; break; + case ASN_TAG_CLASS_CONTEXT: type = ""; break; + case ASN_TAG_CLASS_PRIVATE: type = "PRIVATE "; break; + } + + ret = snprintf(buf, size, "[%s%u]", type, ((unsigned)tag) >> 2); + if(ret <= 0 && size) buf[0] = '\0'; /* against broken libc's */ + + return ret; +} + +char * +ber_tlv_tag_string(ber_tlv_tag_t tag) { + static char buf[sizeof("[APPLICATION ]") + 32]; + + (void)ber_tlv_tag_snprint(tag, buf, sizeof(buf)); + + return buf; +} + + +size_t +ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufp, size_t size) { + int tclass = BER_TAG_CLASS(tag); + ber_tlv_tag_t tval = BER_TAG_VALUE(tag); + uint8_t *buf = (uint8_t *)bufp; + uint8_t *end; + size_t required_size; + size_t i; + + if(tval <= 30) { + /* Encoded in 1 octet */ + if(size) buf[0] = (tclass << 6) | tval; + return 1; + } else if(size) { + *buf++ = (tclass << 6) | 0x1F; + size--; + } + + /* + * Compute the size of the subsequent bytes. + */ + for(required_size = 1, i = 7; i < 8 * sizeof(tval); i += 7) { + if(tval >> i) + required_size++; + else + break; + } + + if(size < required_size) + return required_size + 1; + + /* + * Fill in the buffer, space permitting. + */ + end = buf + required_size - 1; + for(i -= 7; buf < end; i -= 7, buf++) + *buf = 0x80 | ((tval >> i) & 0x7F); + *buf = (tval & 0x7F); /* Last octet without high bit */ + + return required_size + 1; +} + diff --git a/certgen/asncodec/ber_tlv_tag.h b/certgen/asncodec/ber_tlv_tag.h index 4386c2c..ce227ad 100644 --- a/certgen/asncodec/ber_tlv_tag.h +++ b/certgen/asncodec/ber_tlv_tag.h @@ -1,60 +1,60 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _BER_TLV_TAG_H_ -#define _BER_TLV_TAG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum asn_tag_class { - ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ - ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ - ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ - ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ -}; -typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ - -/* - * Tag class is encoded together with tag value for optimization purposes. - */ -#define BER_TAG_CLASS(tag) ((tag) & 0x3) -#define BER_TAG_VALUE(tag) ((tag) >> 2) -#define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) - -#define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) - -/* - * Several functions for printing the TAG in the canonical form - * (i.e. "[PRIVATE 0]"). - * Return values correspond to their libc counterparts (if any). - */ -ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); -ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); -char *ber_tlv_tag_string(ber_tlv_tag_t tag); - - -/* - * This function tries to fetch the tag from the input stream. - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering tag. - * >0: Number of bytes used from bufptr. tag_r will contain the tag. - */ -ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); - -/* - * This function serializes the tag (T from TLV) in BER format. - * It always returns number of bytes necessary to represent the tag, - * it is a caller's responsibility to check the return value - * against the supplied buffer's size. - */ -size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* _BER_TLV_TAG_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _BER_TLV_TAG_H_ +#define _BER_TLV_TAG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum asn_tag_class { + ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ + ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ + ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ + ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ +}; +typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ + +/* + * Tag class is encoded together with tag value for optimization purposes. + */ +#define BER_TAG_CLASS(tag) ((tag) & 0x3) +#define BER_TAG_VALUE(tag) ((tag) >> 2) +#define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) + +#define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) + +/* + * Several functions for printing the TAG in the canonical form + * (i.e. "[PRIVATE 0]"). + * Return values correspond to their libc counterparts (if any). + */ +ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); +ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); +char *ber_tlv_tag_string(ber_tlv_tag_t tag); + + +/* + * This function tries to fetch the tag from the input stream. + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering tag. + * >0: Number of bytes used from bufptr. tag_r will contain the tag. + */ +ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); + +/* + * This function serializes the tag (T from TLV) in BER format. + * It always returns number of bytes necessary to represent the tag, + * it is a caller's responsibility to check the return value + * against the supplied buffer's size. + */ +size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif /* _BER_TLV_TAG_H_ */ diff --git a/certgen/asncodec/constr_CHOICE.c b/certgen/asncodec/constr_CHOICE.c index ce979e8..5f52e3d 100644 --- a/certgen/asncodec/constr_CHOICE.c +++ b/certgen/asncodec/constr_CHOICE.c @@ -1,1338 +1,358 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Number of bytes left for this structure. - * (ctx->left) indicates the number of bytes _transferred_ for the structure. - * (size) contains the number of bytes in the buffer passed. - */ -#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) - -/* - * If the subprocessor function returns with an indication that it wants - * more data, it may well be a fatal decoding problem, because the - * size is constrained by the 's L, even if the buffer size allows - * reading more data. - * For example, consider the buffer containing the following TLVs: - * ... - * The TLV length clearly indicates that one byte is expected in V, but - * if the V processor returns with "want more data" even if the buffer - * contains way more data than the V processor have seen. - */ -#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) - -/* - * This macro "eats" the part of the buffer which is definitely "consumed", - * i.e. was correctly converted into local representation or rightfully skipped. - */ -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num;\ - size -= num; \ - if(ctx->left >= 0) \ - ctx->left -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) do { \ - rval.code = _code; \ - rval.consumed = consumed_myself;\ - return rval; \ - } while(0) - -/* - * See the definitions. - */ -static unsigned _fetch_present_idx(const void *struct_ptr, unsigned off, - unsigned size); -static void _set_present_idx(void *sptr, unsigned offset, unsigned size, - unsigned pres); -static const void *_get_member_ptr(const asn_TYPE_descriptor_t *, - const void *sptr, asn_TYPE_member_t **elm, - unsigned *present); - -/* - * Tags are canonically sorted in the tag to member table. - */ -static int -_search4tag(const void *ap, const void *bp) { - const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap; - const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp; - - int a_class = BER_TAG_CLASS(a->el_tag); - int b_class = BER_TAG_CLASS(b->el_tag); - - if(a_class == b_class) { - ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag); - ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag); - - if(a_value == b_value) - return 0; - else if(a_value < b_value) - return -1; - else - return 1; - } else if(a_class < b_class) { - return -1; - } else { - return 1; - } -} - -/* - * The decoder of the CHOICE type. - */ -asn_dec_rval_t -CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **struct_ptr, - const void *ptr, size_t size, int tag_mode) { - /* - * Bring closer parts of structure description. - */ - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - asn_TYPE_member_t *elements = td->elements; - - /* - * Parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - ber_tlv_tag_t tlv_tag; /* T from TLV */ - ssize_t tag_len; /* Length of TLV's T */ - asn_dec_rval_t rval; /* Return code from subparsers */ - - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - ASN_DEBUG("Decoding %s as CHOICE", td->name); - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Start to parse where left previously - */ - switch(ctx->phase) { - case 0: - /* - * PHASE 0. - * Check that the set of tags associated with given structure - * perfectly fits our expectations. - */ - - if(tag_mode || td->tags_count) { - rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, -1, &ctx->left, 0); - if(rval.code != RC_OK) { - ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); - return rval; - } - - if(ctx->left >= 0) { - /* ?Substracted below! */ - ctx->left += rval.consumed; - } - ADVANCE(rval.consumed); - } else { - ctx->left = -1; - } - - NEXT_PHASE(ctx); - - ASN_DEBUG("Structure consumes %ld bytes, buffer %ld", - (long)ctx->left, (long)size); - - /* Fall through */ - case 1: - /* - * Fetch the T from TLV. - */ - tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); - ASN_DEBUG("In %s CHOICE tag length %d", td->name, (int)tag_len); - switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - do { - const asn_TYPE_tag2member_t *t2m; - asn_TYPE_tag2member_t key; - - key.el_tag = tlv_tag; - t2m = (const asn_TYPE_tag2member_t *)bsearch(&key, - specs->tag2el, specs->tag2el_count, - sizeof(specs->tag2el[0]), _search4tag); - if(t2m) { - /* - * Found the element corresponding to the tag. - */ - NEXT_PHASE(ctx); - ctx->step = t2m->el_no; - break; - } else if(specs->ext_start == -1) { - ASN_DEBUG("Unexpected tag %s " - "in non-extensible CHOICE %s", - ber_tlv_tag_string(tlv_tag), td->name); - RETURN(RC_FAIL); - } else { - /* Skip this tag */ - ssize_t skip; - - ASN_DEBUG("Skipping unknown tag %s", - ber_tlv_tag_string(tlv_tag)); - - skip = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - (const char *)ptr + tag_len, - LEFT - tag_len); - - switch(skip) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - ADVANCE(skip + tag_len); - RETURN(RC_OK); - } - } while(0); - - case 2: - /* - * PHASE 2. - * Read in the element. - */ - do { - asn_TYPE_member_t *elm;/* CHOICE's element */ - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - - elm = &elements[ctx->step]; - - /* - * Compute the position of the member inside a structure, - * and also a type of containment (it may be contained - * as pointer or using inline inclusion). - */ - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - /* - * A pointer to a pointer - * holding the start of the structure - */ - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - /* Set presence to be able to free it properly at any time */ - _set_present_idx(st, specs->pres_offset, - specs->pres_size, ctx->step + 1); - /* - * Invoke the member fetch routine according to member's type - */ - rval = elm->type->op->ber_decoder(opt_codec_ctx, elm->type, - memb_ptr2, ptr, LEFT, elm->tag_mode); - switch(rval.code) { - case RC_OK: - break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); - } - RETURN(RC_FAIL); - case RC_FAIL: /* Fatal error */ - RETURN(rval.code); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } while(0); - - NEXT_PHASE(ctx); - - /* Fall through */ - case 3: - ASN_DEBUG("CHOICE %s Leftover: %ld, size = %ld, tm=%d, tc=%d", - td->name, (long)ctx->left, (long)size, - tag_mode, td->tags_count); - - if(ctx->left > 0) { - /* - * The type must be fully decoded - * by the CHOICE member-specific decoder. - */ - RETURN(RC_FAIL); - } - - if(ctx->left == -1 - && !(tag_mode || td->tags_count)) { - /* - * This is an untagged CHOICE. - * It doesn't contain nothing - * except for the member itself, including all its tags. - * The decoding is completed. - */ - NEXT_PHASE(ctx); - break; - } - - /* - * Read in the "end of data chunks"'s. - */ - while(ctx->left < 0) { - ssize_t tl; - - tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); - switch(tl) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - /* - * Expected <0><0>... - */ - if(((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) - RETURN(RC_FAIL); - else - RETURN(RC_WMORE); - } else if(((const uint8_t *)ptr)[1] == 0) { - /* - * Correctly finished with <0><0>. - */ - ADVANCE(2); - ctx->left++; - continue; - } - } else { - ASN_DEBUG("Unexpected continuation in %s", - td->name); - RETURN(RC_FAIL); - } - - /* UNREACHABLE */ - } - - NEXT_PHASE(ctx); - case 4: - /* No meaningful work here */ - break; - } - - RETURN(RC_OK); -} - -asn_enc_rval_t -CHOICE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr, - int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, - void *app_key) { - const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; - asn_TYPE_member_t *elm; /* CHOICE element */ - asn_enc_rval_t erval; - const void *memb_ptr; - size_t computed_size = 0; - unsigned present; - - if(!sptr) ASN__ENCODE_FAILED; - - ASN_DEBUG("%s %s as CHOICE", - cb?"Encoding":"Estimating", td->name); - - present = _fetch_present_idx(sptr, - specs->pres_offset, specs->pres_size); - - /* - * If the structure was not initialized, it cannot be encoded: - * can't deduce what to encode in the choice type. - */ - if(present == 0 || present > td->elements_count) { - if(present == 0 && td->elements_count == 0) { - /* The CHOICE is empty?! */ - erval.encoded = 0; - ASN__ENCODED_OK(erval); - } - ASN__ENCODE_FAILED; - } - - /* - * Seek over the present member of the structure. - */ - elm = &td->elements[present-1]; - if(elm->flags & ATF_POINTER) { - memb_ptr = - *(const void *const *)((const char *)sptr + elm->memb_offset); - if(memb_ptr == 0) { - if(elm->optional) { - erval.encoded = 0; - ASN__ENCODED_OK(erval); - } - /* Mandatory element absent */ - ASN__ENCODE_FAILED; - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - /* - * If the CHOICE itself is tagged EXPLICIT: - * T ::= [2] EXPLICIT CHOICE { ... } - * Then emit the appropriate tags. - */ - if(tag_mode == 1 || td->tags_count) { - /* - * For this, we need to pre-compute the member. - */ - ssize_t ret; - - /* Encode member with its tag */ - erval = elm->type->op->der_encoder(elm->type, memb_ptr, - elm->tag_mode, elm->tag, 0, 0); - if(erval.encoded == -1) - return erval; - - /* Encode CHOICE with parent or my own tag */ - ret = der_write_tags(td, erval.encoded, tag_mode, 1, tag, - cb, app_key); - if(ret == -1) - ASN__ENCODE_FAILED; - computed_size += ret; - } - - /* - * Encode the single underlying member. - */ - erval = elm->type->op->der_encoder(elm->type, memb_ptr, - elm->tag_mode, elm->tag, cb, app_key); - if(erval.encoded == -1) - return erval; - - ASN_DEBUG("Encoded CHOICE member in %ld bytes (+%ld)", - (long)erval.encoded, (long)computed_size); - - erval.encoded += computed_size; - - return erval; -} - -ber_tlv_tag_t -CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) { - const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; - unsigned present; - - assert(tag_mode == 0); (void)tag_mode; - assert(tag == 0); (void)tag; - - /* - * Figure out which CHOICE element is encoded. - */ - present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size); - - if(present > 0 && present <= td->elements_count) { - const asn_TYPE_member_t *elm = &td->elements[present-1]; - const void *memb_ptr; - - if(elm->flags & ATF_POINTER) { - memb_ptr = *(const void * const *) - ((const char *)ptr + elm->memb_offset); - } else { - memb_ptr = (const void *) - ((const char *)ptr + elm->memb_offset); - } - - return asn_TYPE_outmost_tag(elm->type, memb_ptr, - elm->tag_mode, elm->tag); - } else { - return (ber_tlv_tag_t)-1; - } -} - -int -CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - unsigned present; - - if(!sptr) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - /* - * Figure out which CHOICE element is encoded. - */ - present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); - if(present > 0 && present <= td->elements_count) { - asn_TYPE_member_t *elm = &td->elements[present-1]; - const void *memb_ptr; - - if(elm->flags & ATF_POINTER) { - memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) { - if(elm->optional) - return 0; - ASN__CTFAIL(app_key, td, sptr, - "%s: mandatory CHOICE element %s absent (%s:%d)", - td->name, elm->name, __FILE__, __LINE__); - return -1; - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - if(elm->encoding_constraints.general_constraints) { - return elm->encoding_constraints.general_constraints(elm->type, memb_ptr, - ctfailcb, app_key); - } else { - return elm->type->encoding_constraints.general_constraints(elm->type, - memb_ptr, ctfailcb, app_key); - } - } else { - ASN__CTFAIL(app_key, td, sptr, - "%s: no CHOICE element given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } -} - -#undef XER_ADVANCE -#define XER_ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - buf_ptr = (const void *)(((const char *)buf_ptr) + num); \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Decode the XER (XML) data. - */ -asn_dec_rval_t -CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **struct_ptr, - const char *opt_mname, const void *buf_ptr, size_t size) { - /* - * Bring closer parts of structure description. - */ - const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; - const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; - - /* - * Parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - asn_dec_rval_t rval; /* Return value of a decoder */ - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - size_t edx; /* Element index */ - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) RETURN(RC_FAIL); - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - if(ctx->phase == 0 && !*xml_tag) - ctx->phase = 1; /* Skip the outer tag checking phase */ - - /* - * Phases of XER/XML processing: - * Phase 0: Check that the opening tag matches our expectations. - * Phase 1: Processing body and reacting on closing tag. - * Phase 2: Processing inner type. - * Phase 3: Only waiting for closing tag. - * Phase 4: Skipping unknown extensions. - * Phase 5: PHASED OUT - */ - for(edx = ctx->step; ctx->phase <= 4;) { - pxer_chunk_type_e ch_type; /* XER chunk type */ - ssize_t ch_size; /* Chunk size */ - xer_check_tag_e tcv; /* Tag check value */ - asn_TYPE_member_t *elm; - - /* - * Go inside the member. - */ - if(ctx->phase == 2) { - asn_dec_rval_t tmprval; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - unsigned old_present; - - elm = &td->elements[edx]; - - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st - + elm->memb_offset); - } else { - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - - /* Start/Continue decoding the inner member */ - tmprval = elm->type->op->xer_decoder(opt_codec_ctx, - elm->type, memb_ptr2, elm->name, - buf_ptr, size); - XER_ADVANCE(tmprval.consumed); - ASN_DEBUG("XER/CHOICE: itdf: [%s] code=%d", - elm->type->name, tmprval.code); - old_present = _fetch_present_idx(st, - specs->pres_offset, specs->pres_size); - assert(old_present == 0 || old_present == edx + 1); - /* Record what we've got */ - _set_present_idx(st, - specs->pres_offset, specs->pres_size, edx + 1); - if(tmprval.code != RC_OK) - RETURN(tmprval.code); - ctx->phase = 3; - /* Fall through */ - } - - /* No need to wait for closing tag; special mode. */ - if(ctx->phase == 3 && !*xml_tag) { - ctx->phase = 5; /* Phase out */ - RETURN(RC_OK); - } - - /* - * Get the next part of the XML stream. - */ - ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); - if(ch_size == -1) { - RETURN(RC_FAIL); - } else { - switch(ch_type) { - case PXER_WMORE: - RETURN(RC_WMORE); - case PXER_COMMENT: /* Got XML comment */ - case PXER_TEXT: /* Ignore free-standing text */ - XER_ADVANCE(ch_size); /* Skip silently */ - continue; - case PXER_TAG: - break; /* Check the rest down there */ - } - } - - tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); - ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d", - ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', - ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', - ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', - ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - xml_tag, tcv); - - /* Skip the extensions section */ - if(ctx->phase == 4) { - ASN_DEBUG("skip_unknown(%d, %ld)", - tcv, (long)ctx->left); - switch(xer_skip_unknown(tcv, &ctx->left)) { - case -1: - ctx->phase = 5; - RETURN(RC_FAIL); - case 1: - ctx->phase = 3; - /* Fall through */ - case 0: - XER_ADVANCE(ch_size); - continue; - case 2: - ctx->phase = 3; - break; - } - } - - switch(tcv) { - case XCT_BOTH: - break; /* No CHOICE? */ - case XCT_CLOSING: - if(ctx->phase != 3) - break; - XER_ADVANCE(ch_size); - ctx->phase = 5; /* Phase out */ - RETURN(RC_OK); - case XCT_OPENING: - if(ctx->phase == 0) { - XER_ADVANCE(ch_size); - ctx->phase = 1; /* Processing body phase */ - continue; - } - /* Fall through */ - case XCT_UNKNOWN_OP: - case XCT_UNKNOWN_BO: - - if(ctx->phase != 1) - break; /* Really unexpected */ - - /* - * Search which inner member corresponds to this tag. - */ - for(edx = 0; edx < td->elements_count; edx++) { - elm = &td->elements[edx]; - tcv = xer_check_tag(buf_ptr,ch_size,elm->name); - switch(tcv) { - case XCT_BOTH: - case XCT_OPENING: - /* - * Process this member. - */ - ctx->step = edx; - ctx->phase = 2; - break; - case XCT_UNKNOWN_OP: - case XCT_UNKNOWN_BO: - continue; - default: - edx = td->elements_count; - break; /* Phase out */ - } - break; - } - if(edx != td->elements_count) - continue; - - /* It is expected extension */ - if(specs->ext_start != -1) { - ASN_DEBUG("Got anticipated extension"); - /* - * Check for (XCT_BOTH or XCT_UNKNOWN_BO) - * By using a mask. Only record a pure - * tags. - */ - if(tcv & XCT_CLOSING) { - /* Found without body */ - ctx->phase = 3; /* Terminating */ - } else { - ctx->left = 1; - ctx->phase = 4; /* Skip ...'s */ - } - XER_ADVANCE(ch_size); - continue; - } - - /* Fall through */ - default: - break; - } - - ASN_DEBUG("Unexpected XML tag [%c%c%c%c] in CHOICE [%s]" - " (ph=%d, tag=%s)", - ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', - ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', - ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', - ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - td->name, ctx->phase, xml_tag); - break; - } - - ctx->phase = 5; /* Phase out, just in case */ - RETURN(RC_FAIL); -} - - -asn_enc_rval_t -CHOICE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, - void *app_key) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - asn_enc_rval_t er; - unsigned present; - - if(!sptr) - ASN__ENCODE_FAILED; - - /* - * Figure out which CHOICE element is encoded. - */ - present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); - - if(present == 0 || present > td->elements_count) { - ASN__ENCODE_FAILED; - } else { - asn_enc_rval_t tmper; - asn_TYPE_member_t *elm = &td->elements[present-1]; - const void *memb_ptr; - const char *mname = elm->name; - unsigned int mlen = strlen(mname); - - if(elm->flags & ATF_POINTER) { - memb_ptr = - *(const void *const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) ASN__ENCODE_FAILED; - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - er.encoded = 0; - - if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel); - ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); - - tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, - ilevel + 1, flags, cb, app_key); - if(tmper.encoded == -1) return tmper; - er.encoded += tmper.encoded; - - ASN__CALLBACK3("", 1); - } - - if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel - 1); - - ASN__ENCODED_OK(er); -cb_failed: - ASN__ENCODE_FAILED; -} - -asn_dec_rval_t -CHOICE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - asn_dec_rval_t rv; - const asn_per_constraint_t *ct; - asn_TYPE_member_t *elm; /* CHOICE's element */ - void *memb_ptr; - void **memb_ptr2; - void *st = *sptr; - int value; - - if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) - ASN__DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(!st) { - st = *sptr = CALLOC(1, specs->struct_size); - if(!st) ASN__DECODE_FAILED; - } - - if(constraints) ct = &constraints->value; - else if(td->encoding_constraints.per_constraints) ct = &td->encoding_constraints.per_constraints->value; - else ct = 0; - - if(ct && ct->flags & APC_EXTENSIBLE) { - value = per_get_few_bits(pd, 1); - if(value < 0) ASN__DECODE_STARVED; - if(value) ct = 0; /* Not restricted */ - } - - if(ct && ct->range_bits >= 0) { - value = per_get_few_bits(pd, ct->range_bits); - if(value < 0) ASN__DECODE_STARVED; - ASN_DEBUG("CHOICE %s got index %d in range %d", - td->name, value, ct->range_bits); - if(value > ct->upper_bound) - ASN__DECODE_FAILED; - } else { - if(specs->ext_start == -1) - ASN__DECODE_FAILED; - value = uper_get_nsnnwn(pd); - if(value < 0) ASN__DECODE_STARVED; - value += specs->ext_start; - if((unsigned)value >= td->elements_count) - ASN__DECODE_FAILED; - } - - /* Adjust if canonical order is different from natural order */ - if(specs->from_canonical_order) { - ASN_DEBUG("CHOICE presence from wire %d", value); - value = specs->from_canonical_order[value]; - ASN_DEBUG("CHOICE presence index effective %d", value); - } - - /* Set presence to be able to free it later */ - _set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1); - - elm = &td->elements[value]; - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name); - - if(ct && ct->range_bits >= 0) { - rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type, - elm->encoding_constraints.per_constraints, memb_ptr2, pd); - } else { - rv = uper_open_type_get(opt_codec_ctx, elm->type, - elm->encoding_constraints.per_constraints, memb_ptr2, pd); - } - - if(rv.code != RC_OK) - ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d", - elm->name, td->name, rv.code); - return rv; -} - -asn_enc_rval_t -CHOICE_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_per_outp_t *po) { - const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; - asn_TYPE_member_t *elm; /* CHOICE's element */ - const asn_per_constraint_t *ct; - const void *memb_ptr; - unsigned present; - int present_enc; - - if(!sptr) ASN__ENCODE_FAILED; - - ASN_DEBUG("Encoding %s as CHOICE", td->name); - - if(constraints) ct = &constraints->value; - else if(td->encoding_constraints.per_constraints) - ct = &td->encoding_constraints.per_constraints->value; - else ct = 0; - - present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); - - /* - * If the structure was not initialized properly, it cannot be encoded: - * can't deduce what to encode in the choice type. - */ - if(present == 0 || present > td->elements_count) - ASN__ENCODE_FAILED; - else - present--; - - ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present); - - /* Adjust if canonical order is different from natural order */ - if(specs->to_canonical_order) - present_enc = specs->to_canonical_order[present]; - else - present_enc = present; - - if(ct && ct->range_bits >= 0) { - if(present_enc < ct->lower_bound - || present_enc > ct->upper_bound) { - if(ct->flags & APC_EXTENSIBLE) { - ASN_DEBUG( - "CHOICE member %d (enc %d) is an extension (%ld..%ld)", - present, present_enc, ct->lower_bound, ct->upper_bound); - if(per_put_few_bits(po, 1, 1)) - ASN__ENCODE_FAILED; - } else { - ASN__ENCODE_FAILED; - } - ct = 0; - } - } - if(ct && ct->flags & APC_EXTENSIBLE) { - ASN_DEBUG("CHOICE member %d (enc %d) is not an extension (%ld..%ld)", - present, present_enc, ct->lower_bound, ct->upper_bound); - if(per_put_few_bits(po, 0, 1)) - ASN__ENCODE_FAILED; - } - - - elm = &td->elements[present]; - ASN_DEBUG("CHOICE member \"%s\" %d (as %d)", elm->name, present, - present_enc); - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr = - *(const void *const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) ASN__ENCODE_FAILED; - } else { - memb_ptr = (const char *)sptr + elm->memb_offset; - } - - if(ct && ct->range_bits >= 0) { - if(per_put_few_bits(po, present_enc, ct->range_bits)) - ASN__ENCODE_FAILED; - - return elm->type->op->uper_encoder( - elm->type, elm->encoding_constraints.per_constraints, memb_ptr, po); - } else { - asn_enc_rval_t rval; - if(specs->ext_start == -1) ASN__ENCODE_FAILED; - if(uper_put_nsnnwn(po, present_enc - specs->ext_start)) - ASN__ENCODE_FAILED; - if(uper_open_type_put(elm->type, - elm->encoding_constraints.per_constraints, - memb_ptr, po)) - ASN__ENCODE_FAILED; - rval.encoded = 0; - ASN__ENCODED_OK(rval); - } -} - - -int -CHOICE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; - unsigned present; - - if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; - - /* - * Figure out which CHOICE element is encoded. - */ - present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); - - /* - * Print that element. - */ - if(present > 0 && present <= td->elements_count) { - asn_TYPE_member_t *elm = &td->elements[present-1]; - const void *memb_ptr; - - if(elm->flags & ATF_POINTER) { - memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) return (cb("", 8, app_key) < 0) ? -1 : 0; - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - /* Print member's name and stuff */ - if(cb(elm->name, strlen(elm->name), app_key) < 0 - || cb(" : ", 3, app_key) < 0) - return -1; - - return elm->type->op->print_struct(elm->type, memb_ptr, ilevel, cb, app_key); - - } else { - return (cb("", 8, app_key) < 0) ? -1 : 0; - } -} - -void -CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr, - enum asn_struct_free_method method) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - unsigned present; - - if(!td || !ptr) - return; - - ASN_DEBUG("Freeing %s as CHOICE", td->name); - - /* - * Figure out which CHOICE element is encoded. - */ - present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size); - - /* - * Free that element. - */ - if(present > 0 && present <= td->elements_count) { - asn_TYPE_member_t *elm = &td->elements[present-1]; - void *memb_ptr; - - if(elm->flags & ATF_POINTER) { - memb_ptr = *(void **)((char *)ptr + elm->memb_offset); - if(memb_ptr) - ASN_STRUCT_FREE(*elm->type, memb_ptr); - } else { - memb_ptr = (void *)((char *)ptr + elm->memb_offset); - ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr); - } - } - - switch(method) { - case ASFM_FREE_EVERYTHING: - FREEMEM(ptr); - break; - case ASFM_FREE_UNDERLYING: - break; - case ASFM_FREE_UNDERLYING_AND_RESET: - memset(ptr, 0, specs->struct_size); - break; - } -} - - -/* - * The following functions functions offer protection against -fshort-enums, - * compatible with little- and big-endian machines. - * If assertion is triggered, either disable -fshort-enums, or add an entry - * here with the ->pres_size of your target stracture. - * Unless the target structure is packed, the ".present" member - * is guaranteed to be aligned properly. ASN.1 compiler itself does not - * produce packed code. - */ -static unsigned -_fetch_present_idx(const void *struct_ptr, unsigned pres_offset, - unsigned pres_size) { - const void *present_ptr; - unsigned present; - - present_ptr = ((const char *)struct_ptr) + pres_offset; - - switch(pres_size) { - case sizeof(int): present = *(const unsigned int *)present_ptr; break; - case sizeof(short): present = *(const unsigned short *)present_ptr; break; - case sizeof(char): present = *(const unsigned char *)present_ptr; break; - default: - /* ANSI C mandates enum to be equivalent to integer */ - assert(pres_size != sizeof(int)); - return 0; /* If not aborted, pass back safe value */ - } - - return present; -} - -static void -_set_present_idx(void *struct_ptr, unsigned pres_offset, unsigned pres_size, - unsigned present) { - void *present_ptr; - present_ptr = ((char *)struct_ptr) + pres_offset; - - switch(pres_size) { - case sizeof(int): *(unsigned int *)present_ptr = present; break; - case sizeof(short): *(unsigned short *)present_ptr = present; break; - case sizeof(char): *(unsigned char *)present_ptr = present; break; - default: - /* ANSI C mandates enum to be equivalent to integer */ - assert(pres_size != sizeof(int)); - } -} - -static const void * -_get_member_ptr(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_TYPE_member_t **elm_ptr, unsigned *present_out) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - unsigned present; - - if(!sptr) { - *elm_ptr = NULL; - *present_out = 0; - return NULL; - } - - /* - * Figure out which CHOICE element is encoded. - */ - present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); - *present_out = present; - - /* - * The presence index is intentionally 1-based to avoid - * treating zeroed structure as a valid one. - */ - if(present > 0 && present <= td->elements_count) { - asn_TYPE_member_t *const elm = &td->elements[present - 1]; - const void *memb_ptr; - - if(elm->flags & ATF_POINTER) { - memb_ptr = - *(const void *const *)((const char *)sptr + elm->memb_offset); - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - *elm_ptr = elm; - return memb_ptr; - } else { - *elm_ptr = NULL; - return NULL; - } - -} - -int -CHOICE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) { - asn_TYPE_member_t *aelm; - asn_TYPE_member_t *belm; - unsigned apresent = 0; - unsigned bpresent = 0; - const void *amember = _get_member_ptr(td, aptr, &aelm, &apresent); - const void *bmember = _get_member_ptr(td, bptr, &belm, &bpresent); - - if(amember && bmember) { - if(apresent == bpresent) { - assert(aelm == belm); - return aelm->type->op->compare_struct(aelm->type, amember, bmember); - } else if(apresent < bpresent) { - return -1; - } else { - return 1; - } - } else if(!amember) { - return -1; - } else { - return 1; - } -} - -/* - * Return the 1-based choice variant presence index. - * Returns 0 in case of error. - */ -unsigned -CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - return _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); -} - -/* - * Sets or resets the 1-based choice variant presence index. - * In case a previous index is not zero, the currently selected structure - * member is freed and zeroed-out first. - * Returns 0 on success and -1 on error. - */ -int -CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *sptr, - unsigned present) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - unsigned old_present; - - if(!sptr) { - return -1; - } - - if(present > td->elements_count) - return -1; - - old_present = - _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); - if(present == old_present) - return 0; - - if(old_present != 0) { - assert(old_present <= td->elements_count); - ASN_STRUCT_RESET(*td, sptr); - } - - _set_present_idx(sptr, specs->pres_offset, specs->pres_size, present); - - return 0; -} - - -asn_random_fill_result_t -CHOICE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constr, - size_t max_length) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - asn_random_fill_result_t res; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - const asn_TYPE_member_t *elm; - unsigned present; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - void *st = *sptr; - - if(max_length == 0) return result_skipped; - - (void)constr; - - if(st == NULL) { - st = CALLOC(1, specs->struct_size); - if(st == NULL) { - return result_failed; - } - } - - present = asn_random_between(1, td->elements_count); - elm = &td->elements[present - 1]; - - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - - res = elm->type->op->random_fill(elm->type, memb_ptr2, - &elm->encoding_constraints, max_length); - _set_present_idx(st, specs->pres_offset, specs->pres_size, present); - if(res.code == ARFILL_OK) { - *sptr = st; - } else { - if(st == *sptr) { - ASN_STRUCT_RESET(*td, st); - } else { - ASN_STRUCT_FREE(*td, st); - } - } - - return res; -} - - -asn_TYPE_operation_t asn_OP_CHOICE = { - CHOICE_free, - CHOICE_print, - CHOICE_compare, - CHOICE_decode_ber, - CHOICE_encode_der, - CHOICE_decode_xer, - CHOICE_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - CHOICE_decode_oer, - CHOICE_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - CHOICE_decode_uper, - CHOICE_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - CHOICE_random_fill, - CHOICE_outmost_tag -}; +/* + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_TYPE_operation_t asn_OP_CHOICE = { + CHOICE_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + CHOICE_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + CHOICE_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + CHOICE_decode_ber, + CHOICE_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + CHOICE_decode_xer, + CHOICE_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + CHOICE_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + CHOICE_decode_oer, + CHOICE_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + CHOICE_decode_uper, + CHOICE_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + CHOICE_decode_aper, + CHOICE_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + CHOICE_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + CHOICE_outmost_tag +}; + +ber_tlv_tag_t +CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) { + const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; + unsigned present; + + assert(tag_mode == 0); (void)tag_mode; + assert(tag == 0); (void)tag; + + /* + * Figure out which CHOICE element is encoded. + */ + present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size); + + if(present > 0 && present <= td->elements_count) { + const asn_TYPE_member_t *elm = &td->elements[present-1]; + const void *memb_ptr; + + if(elm->flags & ATF_POINTER) { + memb_ptr = *(const void * const *) + ((const char *)ptr + elm->memb_offset); + } else { + memb_ptr = (const void *) + ((const char *)ptr + elm->memb_offset); + } + + return asn_TYPE_outmost_tag(elm->type, memb_ptr, + elm->tag_mode, elm->tag); + } else { + return (ber_tlv_tag_t)-1; + } +} + +/* + * See the definitions. + */ +static const void *_get_member_ptr(const asn_TYPE_descriptor_t *, + const void *sptr, asn_TYPE_member_t **elm, + unsigned *present); + +int +CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + unsigned present; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + /* + * Figure out which CHOICE element is encoded. + */ + present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); + if(present > 0 && present <= td->elements_count) { + asn_TYPE_member_t *elm = &td->elements[present-1]; + const void *memb_ptr; + + if(elm->flags & ATF_POINTER) { + memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); + if(!memb_ptr) { + if(elm->optional) + return 0; + ASN__CTFAIL(app_key, td, sptr, + "%s: mandatory CHOICE element %s absent (%s:%d)", + td->name, elm->name, __FILE__, __LINE__); + return -1; + } + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + + if(elm->encoding_constraints.general_constraints) { + return elm->encoding_constraints.general_constraints(elm->type, memb_ptr, + ctfailcb, app_key); + } else { + return elm->type->encoding_constraints.general_constraints(elm->type, + memb_ptr, ctfailcb, app_key); + } + } else { + ASN__CTFAIL(app_key, td, sptr, + "%s: no CHOICE element given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +void +CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr, + enum asn_struct_free_method method) { + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + unsigned present; + + if(!td || !ptr) + return; + + ASN_DEBUG("Freeing %s as CHOICE", td->name); + + /* + * Figure out which CHOICE element is encoded. + */ + present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size); + + /* + * Free that element. + */ + if(present > 0 && present <= td->elements_count) { + asn_TYPE_member_t *elm = &td->elements[present-1]; + void *memb_ptr; + + if(elm->flags & ATF_POINTER) { + memb_ptr = *(void **)((char *)ptr + elm->memb_offset); + if(memb_ptr) + ASN_STRUCT_FREE(*elm->type, memb_ptr); + } else { + memb_ptr = (void *)((char *)ptr + elm->memb_offset); + ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr); + } + } + + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(ptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(ptr, 0, specs->struct_size); + break; + } +} + + +/* + * The following functions functions offer protection against -fshort-enums, + * compatible with little- and big-endian machines. + * If assertion is triggered, either disable -fshort-enums, or add an entry + * here with the ->pres_size of your target stracture. + * Unless the target structure is packed, the ".present" member + * is guaranteed to be aligned properly. ASN.1 compiler itself does not + * produce packed code. + */ +unsigned +_fetch_present_idx(const void *struct_ptr, unsigned pres_offset, + unsigned pres_size) { + const void *present_ptr; + unsigned present; + + present_ptr = ((const char *)struct_ptr) + pres_offset; + + switch(pres_size) { + case sizeof(int): present = *(const unsigned int *)present_ptr; break; + case sizeof(short): present = *(const unsigned short *)present_ptr; break; + case sizeof(char): present = *(const unsigned char *)present_ptr; break; + default: + /* ANSI C mandates enum to be equivalent to integer */ + assert(pres_size != sizeof(int)); + return 0; /* If not aborted, pass back safe value */ + } + + return present; +} + +void +_set_present_idx(void *struct_ptr, unsigned pres_offset, unsigned pres_size, + unsigned present) { + void *present_ptr; + present_ptr = ((char *)struct_ptr) + pres_offset; + + switch(pres_size) { + case sizeof(int): *(unsigned int *)present_ptr = present; break; + case sizeof(short): *(unsigned short *)present_ptr = present; break; + case sizeof(char): *(unsigned char *)present_ptr = present; break; + default: + /* ANSI C mandates enum to be equivalent to integer */ + assert(pres_size != sizeof(int)); + } +} + +static const void * +_get_member_ptr(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_TYPE_member_t **elm_ptr, unsigned *present_out) { + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + unsigned present; + + if(!sptr) { + *elm_ptr = NULL; + *present_out = 0; + return NULL; + } + + /* + * Figure out which CHOICE element is encoded. + */ + present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); + *present_out = present; + + /* + * The presence index is intentionally 1-based to avoid + * treating zeroed structure as a valid one. + */ + if(present > 0 && present <= td->elements_count) { + asn_TYPE_member_t *const elm = &td->elements[present - 1]; + const void *memb_ptr; + + if(elm->flags & ATF_POINTER) { + memb_ptr = + *(const void *const *)((const char *)sptr + elm->memb_offset); + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + *elm_ptr = elm; + return memb_ptr; + } else { + *elm_ptr = NULL; + return NULL; + } + +} + +int +CHOICE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) { + asn_TYPE_member_t *aelm; + asn_TYPE_member_t *belm; + unsigned apresent = 0; + unsigned bpresent = 0; + const void *amember = _get_member_ptr(td, aptr, &aelm, &apresent); + const void *bmember = _get_member_ptr(td, bptr, &belm, &bpresent); + + if(amember && bmember) { + if(apresent == bpresent) { + assert(aelm == belm); + return aelm->type->op->compare_struct(aelm->type, amember, bmember); + } else if(apresent < bpresent) { + return -1; + } else { + return 1; + } + } else if(!amember) { + return -1; + } else { + return 1; + } +} + +/* + * Return the 1-based choice variant presence index. + * Returns 0 in case of error. + */ +unsigned +CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr) { + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + return _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); +} + +/* + * Sets or resets the 1-based choice variant presence index. + * In case a previous index is not zero, the currently selected structure + * member is freed and zeroed-out first. + * Returns 0 on success and -1 on error. + */ +int +CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *sptr, + unsigned present) { + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + unsigned old_present; + + if(!sptr) { + return -1; + } + + if(present > td->elements_count) + return -1; + + old_present = + _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); + if(present == old_present) + return 0; + + if(old_present != 0) { + assert(old_present <= td->elements_count); + ASN_STRUCT_RESET(*td, sptr); + } + + _set_present_idx(sptr, specs->pres_offset, specs->pres_size, present); + + return 0; +} diff --git a/certgen/asncodec/constr_CHOICE.h b/certgen/asncodec/constr_CHOICE.h index 5402a41..03d606c 100644 --- a/certgen/asncodec/constr_CHOICE.h +++ b/certgen/asncodec/constr_CHOICE.h @@ -1,78 +1,119 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _CONSTR_CHOICE_H_ -#define _CONSTR_CHOICE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct asn_CHOICE_specifics_s { - /* - * Target structure description. - */ - unsigned struct_size; /* Size of the target structure. */ - unsigned ctx_offset; /* Offset of the asn_codec_ctx_t member */ - unsigned pres_offset; /* Identifier of the present member */ - unsigned pres_size; /* Size of the identifier (enum) */ - - /* - * Tags to members mapping table. - */ - const asn_TYPE_tag2member_t *tag2el; - unsigned tag2el_count; - - /* Canonical ordering of CHOICE elements, for PER */ - const unsigned *to_canonical_order; - const unsigned *from_canonical_order; - - /* - * Extensions-related stuff. - */ - signed ext_start; /* First member of extensions, or -1 */ -} asn_CHOICE_specifics_t; - -/* - * A set specialized functions dealing with the CHOICE type. - */ -asn_struct_free_f CHOICE_free; -asn_struct_print_f CHOICE_print; -asn_struct_compare_f CHOICE_compare; -asn_constr_check_f CHOICE_constraint; -ber_type_decoder_f CHOICE_decode_ber; -der_type_encoder_f CHOICE_encode_der; -xer_type_decoder_f CHOICE_decode_xer; -xer_type_encoder_f CHOICE_encode_xer; -oer_type_decoder_f CHOICE_decode_oer; -oer_type_encoder_f CHOICE_encode_oer; -per_type_decoder_f CHOICE_decode_uper; -per_type_encoder_f CHOICE_encode_uper; -asn_outmost_tag_f CHOICE_outmost_tag; -asn_random_fill_f CHOICE_random_fill; -extern asn_TYPE_operation_t asn_OP_CHOICE; - -/* - * Return the 1-based choice variant presence index. - * Returns 0 in case of error. - */ -unsigned CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, - const void *structure_ptr); - -/* - * Sets or resets the 1-based choice variant presence index. - * In case a previous index is not zero, the currently selected structure - * member is freed and zeroed-out first. - * Returns 0 on success and -1 on error. - */ -int CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, - void *structure_ptr, unsigned present); - -#ifdef __cplusplus -} -#endif - -#endif /* _CONSTR_CHOICE_H_ */ +/* + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _CONSTR_CHOICE_H_ +#define _CONSTR_CHOICE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct asn_CHOICE_specifics_s { + /* + * Target structure description. + */ + unsigned struct_size; /* Size of the target structure. */ + unsigned ctx_offset; /* Offset of the asn_codec_ctx_t member */ + unsigned pres_offset; /* Identifier of the present member */ + unsigned pres_size; /* Size of the identifier (enum) */ + + /* + * Tags to members mapping table. + */ + const asn_TYPE_tag2member_t *tag2el; + unsigned tag2el_count; + + /* Canonical ordering of CHOICE elements, for PER */ + const unsigned *to_canonical_order; + const unsigned *from_canonical_order; + + /* + * Extensions-related stuff. + */ + signed ext_start; /* First member of extensions, or -1 */ +} asn_CHOICE_specifics_t; + +/* + * A set specialized functions dealing with the CHOICE type. + */ +asn_struct_free_f CHOICE_free; + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f CHOICE_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f CHOICE_compare; + +asn_constr_check_f CHOICE_constraint; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f CHOICE_decode_ber; +der_type_encoder_f CHOICE_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f CHOICE_decode_xer; +xer_type_encoder_f CHOICE_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f CHOICE_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f CHOICE_decode_oer; +oer_type_encoder_f CHOICE_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f CHOICE_decode_uper; +per_type_encoder_f CHOICE_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f CHOICE_decode_aper; +per_type_encoder_f CHOICE_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f CHOICE_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +asn_outmost_tag_f CHOICE_outmost_tag; + +extern asn_TYPE_operation_t asn_OP_CHOICE; + +unsigned _fetch_present_idx( + const void *struct_ptr, + unsigned off, + unsigned size); + +void _set_present_idx( + void *sptr, + unsigned offset, + unsigned size, + unsigned present); + +/* + * Return the 1-based choice variant presence index. + * Returns 0 in case of error. + */ +unsigned CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, + const void *structure_ptr); + +/* + * Sets or resets the 1-based choice variant presence index. + * In case a previous index is not zero, the currently selected structure + * member is freed and zeroed-out first. + * Returns 0 on success and -1 on error. + */ +int CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, + void *structure_ptr, unsigned present); + +#ifdef __cplusplus +} +#endif + +#endif /* _CONSTR_CHOICE_H_ */ diff --git a/certgen/asncodec/constr_CHOICE_oer.c b/certgen/asncodec/constr_CHOICE_oer.c index e8263b8..fc3c488 100644 --- a/certgen/asncodec/constr_CHOICE_oer.c +++ b/certgen/asncodec/constr_CHOICE_oer.c @@ -1,380 +1,377 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) \ - do { \ - asn_dec_rval_t rval; \ - rval.code = _code; \ - rval.consumed = consumed_myself; \ - return rval; \ - } while(0) - -#undef ADVANCE -#define ADVANCE(num_bytes) \ - do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#define NEXT_PHASE(ctx) \ - do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) -#undef SET_PHASE -#define SET_PHASE(ctx, value) \ - do { \ - ctx->phase = value; \ - ctx->step = 0; \ - } while(0) - -/* - * Tags are canonically sorted in the tag to member table. - */ -static int -_search4tag(const void *ap, const void *bp) { - const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap; - const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp; - - int a_class = BER_TAG_CLASS(a->el_tag); - int b_class = BER_TAG_CLASS(b->el_tag); - - if(a_class == b_class) { - ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag); - ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag); - - if(a_value == b_value) - return 0; - else if(a_value < b_value) - return -1; - else - return 1; - } else if(a_class < b_class) { - return -1; - } else { - return 1; - } -} - -/* - * X.696 (08/2015) #8.7 Encoding of tags - */ -static ssize_t -oer_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) { - ber_tlv_tag_t val; - ber_tlv_tag_t tclass; - size_t skipped; - - if(size == 0) - return 0; - - val = *(const uint8_t *)ptr; - tclass = (val >> 6); - if((val & 0x3F) != 0x3F) { - /* #8.7.1 */ - *tag_r = ((val & 0x3F) << 2) | tclass; - return 1; - } - - /* - * Each octet contains 7 bits of useful information. - * The MSB is 0 if it is the last octet of the tag. - */ - for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; skipped <= size; - ptr = ((const char *)ptr) + 1, skipped++) { - unsigned int oct = *(const uint8_t *)ptr; - if(oct & 0x80) { - val = (val << 7) | (oct & 0x7F); - /* - * Make sure there are at least 9 bits spare - * at the MS side of a value. - */ - if(val >> ((8 * sizeof(val)) - 9)) { - /* - * We would not be able to accomodate - * any more tag bits. - */ - return -1; - } - } else { - val = (val << 7) | oct; - *tag_r = (val << 2) | tclass; - return skipped; - } - } - - return 0; /* Want more */ -} - -asn_dec_rval_t -CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **struct_ptr, - const void *ptr, size_t size) { - /* - * Bring closer parts of structure description. - */ - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - asn_TYPE_member_t *elements = td->elements; - - /* - * Parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - (void)constraints; - - ASN_DEBUG("Decoding %s as CHOICE", td->name); - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - switch(ctx->phase) { - case 0: { - /* - * Discover the tag. - */ - ber_tlv_tag_t tlv_tag; /* T from TLV */ - ssize_t tag_len; /* Length of TLV's T */ - - tag_len = oer_fetch_tag(ptr, size, &tlv_tag); - switch(tag_len) { - case 0: - ASN__DECODE_STARVED; - case -1: - ASN__DECODE_FAILED; - } - - do { - const asn_TYPE_tag2member_t *t2m; - asn_TYPE_tag2member_t key = {0, 0, 0, 0}; - key.el_tag = tlv_tag; - - t2m = (const asn_TYPE_tag2member_t *)bsearch( - &key, specs->tag2el, specs->tag2el_count, - sizeof(specs->tag2el[0]), _search4tag); - if(t2m) { - /* - * Found the element corresponding to the tag. - */ - NEXT_PHASE(ctx); - ctx->step = t2m->el_no; - break; - } else if(specs->ext_start == -1) { - ASN_DEBUG( - "Unexpected tag %s " - "in non-extensible CHOICE %s", - ber_tlv_tag_string(tlv_tag), td->name); - RETURN(RC_FAIL); - } else { - /* Skip open type extension */ - ASN_DEBUG( - "Not implemented skipping open type extension for tag %s", - ber_tlv_tag_string(tlv_tag)); - RETURN(RC_FAIL); - } - } while(0); - - - ADVANCE(tag_len); - } - /* Fall through */ - case 1: { - asn_TYPE_member_t *elm = &elements[ctx->step]; /* CHOICE's element */ - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - asn_dec_rval_t rval; - - /* - * Compute the position of the member inside a structure, - * and also a type of containment (it may be contained - * as pointer or using inline inclusion). - */ - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - /* - * A pointer to a pointer - * holding the start of the structure - */ - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - - /* Set presence to be able to free it properly at any time */ - (void)CHOICE_variant_set_presence(td, st, ctx->step + 1); - - if(specs->ext_start >= 0 && specs->ext_start <= ctx->step) { - ssize_t got = - oer_open_type_get(opt_codec_ctx, elm->type, - elm->encoding_constraints.oer_constraints, - memb_ptr2, ptr, size); - if(got < 0) ASN__DECODE_FAILED; - if(got == 0) ASN__DECODE_STARVED; - rval.code = RC_OK; - rval.consumed = got; - } else { - rval = elm->type->op->oer_decoder( - opt_codec_ctx, elm->type, - elm->encoding_constraints.oer_constraints, memb_ptr2, ptr, - size); - } - rval.consumed += consumed_myself; - switch(rval.code) { - case RC_OK: - NEXT_PHASE(ctx); - case RC_WMORE: - break; - case RC_FAIL: - SET_PHASE(ctx, 3); /* => 3 */ - } - return rval; - } - case 2: - /* Already decoded everything */ - RETURN(RC_OK); - case 3: - /* Failed to decode, after all */ - RETURN(RC_FAIL); - } - - RETURN(RC_FAIL); -} - -/* - * X.696 (08/2015) #8.7 Encoding of tags - */ -static ssize_t -oer_put_tag(ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { - uint8_t tclass = BER_TAG_CLASS(tag); - ber_tlv_tag_t tval = BER_TAG_VALUE(tag); - - if(tval < 0x3F) { - uint8_t b = (uint8_t)((tclass << 6) | tval); - if(cb(&b, 1, app_key) < 0) { - return -1; - } - return 1; - } else { - uint8_t buf[1 + 2 * sizeof(tval)]; - uint8_t *b = &buf[sizeof(buf)-1]; /* Last addressable */ - size_t encoded; - for(; ; tval >>= 7) { - if(tval >> 7) { - *b-- = 0x80 | (tval & 0x7f); - } else { - *b-- = tval & 0x7f; - break; - } - } - *b = (uint8_t)((tclass << 6) | 0x3F); - encoded = sizeof(buf) - (b - buf); - if(cb(b, encoded, app_key) < 0) { - return -1; - } - return encoded; - } - -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -CHOICE_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - const asn_CHOICE_specifics_t *specs = - (const asn_CHOICE_specifics_t *)td->specifics; - asn_TYPE_member_t *elm; /* CHOICE element */ - unsigned present; - const void *memb_ptr; - ber_tlv_tag_t tag; - ssize_t tag_len; - asn_enc_rval_t er = {0, 0, 0}; - - (void)constraints; - - if(!sptr) ASN__ENCODE_FAILED; - - ASN_DEBUG("OER %s encoding as CHOICE", td->name); - - present = CHOICE_variant_get_presence(td, sptr); - if(present == 0 || present > td->elements_count) { - ASN_DEBUG("CHOICE %s member is not selected", td->name); - ASN__ENCODE_FAILED; - } - - elm = &td->elements[present-1]; - if(elm->flags & ATF_POINTER) { - memb_ptr = - *(const void *const *)((const char *)sptr + elm->memb_offset); - if(memb_ptr == 0) { - /* Mandatory element absent */ - ASN__ENCODE_FAILED; - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - tag = asn_TYPE_outmost_tag(elm->type, memb_ptr, elm->tag_mode, elm->tag); - if(tag == 0) { - ASN__ENCODE_FAILED; - } - - tag_len = oer_put_tag(tag, cb, app_key); - if(tag_len < 0) { - ASN__ENCODE_FAILED; - } - - if(specs->ext_start >= 0 && (unsigned)specs->ext_start <= (present-1)) { - ssize_t encoded = oer_open_type_put(elm->type, - elm->encoding_constraints.oer_constraints, - memb_ptr, cb, app_key); - if(encoded < 0) ASN__ENCODE_FAILED; - er.encoded = tag_len + encoded; - } else { - er = elm->type->op->oer_encoder( - elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb, - app_key); - if(er.encoded >= 0) er.encoded += tag_len; - } - - return er; -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) \ + do { \ + asn_dec_rval_t rval; \ + rval.code = _code; \ + rval.consumed = consumed_myself; \ + return rval; \ + } while(0) + +#undef ADVANCE +#define ADVANCE(num_bytes) \ + do { \ + size_t num = num_bytes; \ + ptr = ((const char *)ptr) + num; \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Switch to the next phase of parsing. + */ +#undef NEXT_PHASE +#define NEXT_PHASE(ctx) \ + do { \ + ctx->phase++; \ + ctx->step = 0; \ + } while(0) +#undef SET_PHASE +#define SET_PHASE(ctx, value) \ + do { \ + ctx->phase = value; \ + ctx->step = 0; \ + } while(0) + +/* + * Tags are canonically sorted in the tag to member table. + */ +static int +_search4tag(const void *ap, const void *bp) { + const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap; + const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp; + + int a_class = BER_TAG_CLASS(a->el_tag); + int b_class = BER_TAG_CLASS(b->el_tag); + + if(a_class == b_class) { + ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag); + ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag); + + if(a_value == b_value) + return 0; + else if(a_value < b_value) + return -1; + else + return 1; + } else if(a_class < b_class) { + return -1; + } else { + return 1; + } +} + +/* + * X.696 (08/2015) #8.7 Encoding of tags + */ +static ssize_t +oer_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) { + ber_tlv_tag_t val; + ber_tlv_tag_t tclass; + size_t skipped; + + if(size == 0) + return 0; + + val = *(const uint8_t *)ptr; + tclass = (val >> 6); + if((val & 0x3F) != 0x3F) { + /* #8.7.1 */ + *tag_r = ((val & 0x3F) << 2) | tclass; + return 1; + } + + /* + * Each octet contains 7 bits of useful information. + * The MSB is 0 if it is the last octet of the tag. + */ + for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; skipped <= size; + ptr = ((const char *)ptr) + 1, skipped++) { + unsigned int oct = *(const uint8_t *)ptr; + if(oct & 0x80) { + val = (val << 7) | (oct & 0x7F); + /* + * Make sure there are at least 9 bits spare + * at the MS side of a value. + */ + if(val >> ((8 * sizeof(val)) - 9)) { + /* + * We would not be able to accommodate + * any more tag bits. + */ + return -1; + } + } else { + val = (val << 7) | oct; + *tag_r = (val << 2) | tclass; + return skipped; + } + } + + return 0; /* Want more */ +} + +asn_dec_rval_t +CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **struct_ptr, + const void *ptr, size_t size) { + /* + * Bring closer parts of structure description. + */ + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + asn_TYPE_member_t *elements = td->elements; + + /* + * Parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + + (void)constraints; + + ASN_DEBUG("Decoding %s as CHOICE", td->name); + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) { + RETURN(RC_FAIL); + } + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + switch(ctx->phase) { + case 0: { + /* + * Discover the tag. + */ + ber_tlv_tag_t tlv_tag; /* T from TLV */ + ssize_t tag_len; /* Length of TLV's T */ + + tag_len = oer_fetch_tag(ptr, size, &tlv_tag); + switch(tag_len) { + case 0: + ASN__DECODE_STARVED; + case -1: + ASN__DECODE_FAILED; + } + ctx->start = ptr; + + do { + const asn_TYPE_tag2member_t *t2m; + asn_TYPE_tag2member_t key = {0, 0, 0, 0}; + key.el_tag = tlv_tag; + + t2m = (const asn_TYPE_tag2member_t *)bsearch( + &key, specs->tag2el, specs->tag2el_count, + sizeof(specs->tag2el[0]), _search4tag); + if(t2m) { + /* + * Found the element corresponding to the tag. + */ + NEXT_PHASE(ctx); + ctx->step = t2m->el_no; + break; + } else if(specs->ext_start == -1) { + ASN_DEBUG( + "Unexpected tag %s " + "in non-extensible CHOICE %s", + ber_tlv_tag_string(tlv_tag), td->name); + RETURN(RC_FAIL); + } else { + /* Skip open type extension */ + ASN_DEBUG( + "Not implemented skipping open type extension for tag %s", + ber_tlv_tag_string(tlv_tag)); + RETURN(RC_FAIL); + } + } while(0); + + + ADVANCE(tag_len); + } + /* Fall through */ + case 1: { + asn_TYPE_member_t *elm = &elements[ctx->step]; /* CHOICE's element */ + void *memb_ptr; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ + asn_dec_rval_t rval = {0,0}; + + /* + * Compute the position of the member inside a structure, + * and also a type of containment (it may be contained + * as pointer or using inline inclusion). + */ + if(elm->flags & ATF_POINTER) { + /* Member is a pointer to another structure */ + memb_ptr2 = (void **)((char *)st + elm->memb_offset); + } else { + /* + * A pointer to a pointer + * holding the start of the structure + */ + memb_ptr = (char *)st + elm->memb_offset; + memb_ptr2 = &memb_ptr; + } + + /* Set presence to be able to free it properly at any time */ + (void)CHOICE_variant_set_presence(td, st, ctx->step + 1); + + if(specs->ext_start >= 0 && specs->ext_start <= ctx->step) { + ssize_t got = + oer_open_type_get(opt_codec_ctx, elm->type, + elm->encoding_constraints.oer_constraints, + memb_ptr2, ptr, size); + if(got < 0) ASN__DECODE_FAILED; + if(got == 0) ASN__DECODE_STARVED; + rval.code = RC_OK; + rval.consumed = got; + } else { + rval = elm->type->op->oer_decoder( + opt_codec_ctx, elm->type, + elm->encoding_constraints.oer_constraints, memb_ptr2, ptr, + size); + } + rval.consumed += consumed_myself; + switch(rval.code) { + case RC_OK: + NEXT_PHASE(ctx); + case RC_WMORE: + break; + case RC_FAIL: + SET_PHASE(ctx, 3); /* => 3 */ + } + return rval; + } + case 2: + /* Already decoded everything */ + ctx->left = consumed_myself; + RETURN(RC_OK); + case 3: + /* Failed to decode, after all */ + RETURN(RC_FAIL); + } + + RETURN(RC_FAIL); +} + +/* + * X.696 (08/2015) #8.7 Encoding of tags + */ +static ssize_t +oer_put_tag(ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { + uint8_t tclass = BER_TAG_CLASS(tag); + ber_tlv_tag_t tval = BER_TAG_VALUE(tag); + + if(tval < 0x3F) { + uint8_t b = (uint8_t)((tclass << 6) | tval); + if(cb(&b, 1, app_key) < 0) { + return -1; + } + return 1; + } else { + uint8_t buf[1 + 2 * sizeof(tval)]; + uint8_t *b = &buf[sizeof(buf)-1]; /* Last addressable */ + size_t encoded; + for(; ; tval >>= 7) { + if(tval >> 7) { + *b-- = 0x80 | (tval & 0x7f); + } else { + *b-- = tval & 0x7f; + break; + } + } + *b = (uint8_t)((tclass << 6) | 0x3F); + encoded = sizeof(buf) - (b - buf); + if(cb(b, encoded, app_key) < 0) { + return -1; + } + return encoded; + } + +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +CHOICE_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + asn_TYPE_member_t *elm; /* CHOICE element */ + unsigned present; + const void *memb_ptr; + ber_tlv_tag_t tag; + ssize_t tag_len; + asn_enc_rval_t er = {0, 0, 0}; + + (void)constraints; + + if(!sptr) ASN__ENCODE_FAILED; + + ASN_DEBUG("OER %s encoding as CHOICE", td->name); + + present = CHOICE_variant_get_presence(td, sptr); + if(present == 0 || present > td->elements_count) { + ASN_DEBUG("CHOICE %s member is not selected", td->name); + ASN__ENCODE_FAILED; + } + + elm = &td->elements[present-1]; + if(elm->flags & ATF_POINTER) { + memb_ptr = + *(const void *const *)((const char *)sptr + elm->memb_offset); + if(memb_ptr == 0) { + /* Mandatory element absent */ + ASN__ENCODE_FAILED; + } + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + + tag = asn_TYPE_outmost_tag(elm->type, memb_ptr, elm->tag_mode, elm->tag); + if(tag == 0) { + ASN__ENCODE_FAILED; + } + + tag_len = oer_put_tag(tag, cb, app_key); + if(tag_len < 0) { + ASN__ENCODE_FAILED; + } + + if(specs->ext_start >= 0 && (unsigned)specs->ext_start <= (present-1)) { + ssize_t encoded = oer_open_type_put(elm->type, + elm->encoding_constraints.oer_constraints, + memb_ptr, cb, app_key); + if(encoded < 0) ASN__ENCODE_FAILED; + er.encoded = tag_len + encoded; + } else { + er = elm->type->op->oer_encoder( + elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb, + app_key); + if(er.encoded >= 0) er.encoded += tag_len; + } + + return er; +} diff --git a/certgen/asncodec/constr_CHOICE_print.c b/certgen/asncodec/constr_CHOICE_print.c new file mode 100644 index 0000000..a97202f --- /dev/null +++ b/certgen/asncodec/constr_CHOICE_print.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +CHOICE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; + unsigned present; + + if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; + + /* + * Figure out which CHOICE element is encoded. + */ + present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); + + /* + * Print that element. + */ + if(present > 0 && present <= td->elements_count) { + asn_TYPE_member_t *elm = &td->elements[present-1]; + const void *memb_ptr; + + if(elm->flags & ATF_POINTER) { + memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); + if(!memb_ptr) return (cb("", 8, app_key) < 0) ? -1 : 0; + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + + /* Print member's name and stuff */ + if(0) { + if(cb(elm->name, strlen(elm->name), app_key) < 0 + || cb(": ", 2, app_key) < 0) + return -1; + } + + return elm->type->op->print_struct(elm->type, memb_ptr, ilevel, + cb, app_key); + } else { + return (cb("", 8, app_key) < 0) ? -1 : 0; + } +} diff --git a/certgen/asncodec/constr_CHOICE_xer.c b/certgen/asncodec/constr_CHOICE_xer.c new file mode 100644 index 0000000..45b4290 --- /dev/null +++ b/certgen/asncodec/constr_CHOICE_xer.c @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) \ + do { \ + rval.code = _code; \ + rval.consumed = consumed_myself; \ + return rval; \ + } while(0) + +#undef XER_ADVANCE +#define XER_ADVANCE(num_bytes) \ + do { \ + size_t num = num_bytes; \ + buf_ptr = (const void *)(((const char *)buf_ptr) + num); \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Decode the XER (XML) data. + */ +asn_dec_rval_t +CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **struct_ptr, + const char *opt_mname, const void *buf_ptr, size_t size) { + /* + * Bring closer parts of structure description. + */ + const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics; + const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; + + /* + * Parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + asn_dec_rval_t rval; /* Return value of a decoder */ + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + size_t edx; /* Element index */ + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) RETURN(RC_FAIL); + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + if(ctx->phase == 0 && !*xml_tag) + ctx->phase = 1; /* Skip the outer tag checking phase */ + + /* + * Phases of XER/XML processing: + * Phase 0: Check that the opening tag matches our expectations. + * Phase 1: Processing body and reacting on closing tag. + * Phase 2: Processing inner type. + * Phase 3: Only waiting for closing tag. + * Phase 4: Skipping unknown extensions. + * Phase 5: PHASED OUT + */ + for(edx = ctx->step; ctx->phase <= 4;) { + pxer_chunk_type_e ch_type; /* XER chunk type */ + ssize_t ch_size; /* Chunk size */ + xer_check_tag_e tcv; /* Tag check value */ + asn_TYPE_member_t *elm; + + /* + * Go inside the member. + */ + if(ctx->phase == 2) { + asn_dec_rval_t tmprval; + void *memb_ptr; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ + unsigned old_present; + + elm = &td->elements[edx]; + + if(elm->flags & ATF_POINTER) { + /* Member is a pointer to another structure */ + memb_ptr2 = (void **)((char *)st + + elm->memb_offset); + } else { + memb_ptr = (char *)st + elm->memb_offset; + memb_ptr2 = &memb_ptr; + } + + /* Start/Continue decoding the inner member */ + tmprval = elm->type->op->xer_decoder(opt_codec_ctx, + elm->type, memb_ptr2, + elm->name, + buf_ptr, size); + XER_ADVANCE(tmprval.consumed); + ASN_DEBUG("XER/CHOICE: itdf: [%s] code=%d", + elm->type->name, tmprval.code); + old_present = _fetch_present_idx(st, + specs->pres_offset, + specs->pres_size); + assert(old_present == 0 || old_present == edx + 1); + /* Record what we've got */ + _set_present_idx(st, + specs->pres_offset, + specs->pres_size, edx + 1); + if(tmprval.code != RC_OK) + RETURN(tmprval.code); + ctx->phase = 3; + /* Fall through */ + } + + /* No need to wait for closing tag; special mode. */ + if(ctx->phase == 3 && !*xml_tag) { + ctx->phase = 5; /* Phase out */ + RETURN(RC_OK); + } + + /* + * Get the next part of the XML stream. + */ + ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); + if(ch_size == -1) { + RETURN(RC_FAIL); + } else { + switch(ch_type) { + case PXER_WMORE: + RETURN(RC_WMORE); + case PXER_COMMENT: /* Got XML comment */ + case PXER_TEXT: /* Ignore free-standing text */ + XER_ADVANCE(ch_size); /* Skip silently */ + continue; + case PXER_TAG: + break; /* Check the rest down there */ + } + } + + tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); + ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d", + ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', + ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', + ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', + ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', + xml_tag, tcv); + + /* Skip the extensions section */ + if(ctx->phase == 4) { + ASN_DEBUG("skip_unknown(%d, %ld)", + tcv, (long)ctx->left); + switch(xer_skip_unknown(tcv, &ctx->left)) { + case -1: + ctx->phase = 5; + RETURN(RC_FAIL); + case 1: + ctx->phase = 3; + /* Fall through */ + case 0: + XER_ADVANCE(ch_size); + continue; + case 2: + ctx->phase = 3; + break; + } + } + + switch(tcv) { + case XCT_BOTH: + break; /* No CHOICE? */ + case XCT_CLOSING: + if(ctx->phase != 3) + break; + XER_ADVANCE(ch_size); + ctx->phase = 5; /* Phase out */ + RETURN(RC_OK); + case XCT_OPENING: + if(ctx->phase == 0) { + XER_ADVANCE(ch_size); + ctx->phase = 1; /* Processing body phase */ + continue; + } + /* Fall through */ + case XCT_UNKNOWN_OP: + case XCT_UNKNOWN_BO: + + if(ctx->phase != 1) + break; /* Really unexpected */ + + /* + * Search which inner member corresponds to this tag. + */ + for(edx = 0; edx < td->elements_count; edx++) { + elm = &td->elements[edx]; + tcv = xer_check_tag(buf_ptr,ch_size,elm->name); + switch(tcv) { + case XCT_BOTH: + case XCT_OPENING: + /* + * Process this member. + */ + ctx->step = edx; + ctx->phase = 2; + break; + case XCT_UNKNOWN_OP: + case XCT_UNKNOWN_BO: + continue; + default: + edx = td->elements_count; + break; /* Phase out */ + } + break; + } + if(edx != td->elements_count) + continue; + + /* It is expected extension */ + if(specs->ext_start != -1) { + ASN_DEBUG("Got anticipated extension"); + /* + * Check for (XCT_BOTH or XCT_UNKNOWN_BO) + * By using a mask. Only record a pure + * tags. + */ + if(tcv & XCT_CLOSING) { + /* Found without body */ + ctx->phase = 3; /* Terminating */ + } else { + ctx->left = 1; + ctx->phase = 4; /* Skip ...'s */ + } + XER_ADVANCE(ch_size); + continue; + } + + /* Fall through */ + default: + break; + } + + ASN_DEBUG("Unexpected XML tag [%c%c%c%c] in CHOICE [%s]" + " (ph=%d, tag=%s)", + ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', + ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', + ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', + ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', + td->name, ctx->phase, xml_tag); + break; + } + + ctx->phase = 5; /* Phase out, just in case */ + RETURN(RC_FAIL); +} + +asn_enc_rval_t +CHOICE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, + void *app_key) { + const asn_CHOICE_specifics_t *specs = + (const asn_CHOICE_specifics_t *)td->specifics; + asn_enc_rval_t er = {0,0,0}; + unsigned present = 0; + + if(!sptr) + ASN__ENCODE_FAILED; + + /* + * Figure out which CHOICE element is encoded. + */ + present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); + + if(present == 0 || present > td->elements_count) { + ASN__ENCODE_FAILED; + } else { + asn_enc_rval_t tmper = {0,0,0}; + asn_TYPE_member_t *elm = &td->elements[present-1]; + const void *memb_ptr = NULL; + const char *mname = elm->name; + unsigned int mlen = strlen(mname); + + if(elm->flags & ATF_POINTER) { + memb_ptr = + *(const void *const *)((const char *)sptr + elm->memb_offset); + if(!memb_ptr) ASN__ENCODE_FAILED; + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + + er.encoded = 0; + + if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel); + ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); + + tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, + ilevel + 1, flags, cb, app_key); + if(tmper.encoded == -1) return tmper; + er.encoded += tmper.encoded; + + ASN__CALLBACK3("", 1); + } + + if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel - 1); + + ASN__ENCODED_OK(er); +cb_failed: + ASN__ENCODE_FAILED; +} diff --git a/certgen/asncodec/constr_SEQUENCE.c b/certgen/asncodec/constr_SEQUENCE.c index deb199e..8397d0c 100644 --- a/certgen/asncodec/constr_SEQUENCE.c +++ b/certgen/asncodec/constr_SEQUENCE.c @@ -1,1626 +1,197 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include -#include - -/* - * Number of bytes left for this structure. - * (ctx->left) indicates the number of bytes _transferred_ for the structure. - * (size) contains the number of bytes in the buffer passed. - */ -#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) - -/* - * If the subprocessor function returns with an indication that it wants - * more data, it may well be a fatal decoding problem, because the - * size is constrained by the 's L, even if the buffer size allows - * reading more data. - * For example, consider the buffer containing the following TLVs: - * ... - * The TLV length clearly indicates that one byte is expected in V, but - * if the V processor returns with "want more data" even if the buffer - * contains way more data than the V processor have seen. - */ -#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) - -/* - * This macro "eats" the part of the buffer which is definitely "consumed", - * i.e. was correctly converted into local representation or rightfully skipped. - */ -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num; \ - size -= num; \ - if(ctx->left >= 0) \ - ctx->left -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#undef PHASE_OUT -#define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) do { \ - rval.code = _code; \ - rval.consumed = consumed_myself;\ - return rval; \ - } while(0) - -/* - * Check whether we are inside the extensions group. - */ -#define IN_EXTENSION_GROUP(specs, memb_idx) \ - ((specs)->first_extension >= 0 \ - && (unsigned)(specs)->first_extension <= (memb_idx)) - -/* - * Tags are canonically sorted in the tag2element map. - */ -static int -_t2e_cmp(const void *ap, const void *bp) { - const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap; - const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp; - - int a_class = BER_TAG_CLASS(a->el_tag); - int b_class = BER_TAG_CLASS(b->el_tag); - - if(a_class == b_class) { - ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag); - ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag); - - if(a_value == b_value) { - if(a->el_no > b->el_no) - return 1; - /* - * Important: we do not check - * for a->el_no <= b->el_no! - */ - return 0; - } else if(a_value < b_value) - return -1; - else - return 1; - } else if(a_class < b_class) { - return -1; - } else { - return 1; - } -} - - -/* - * The decoder of the SEQUENCE type. - */ -asn_dec_rval_t -SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **struct_ptr, - const void *ptr, size_t size, int tag_mode) { - /* - * Bring closer parts of structure description. - */ - const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics; - const asn_TYPE_member_t *elements = td->elements; - - /* - * Parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - ber_tlv_tag_t tlv_tag; /* T from TLV */ - asn_dec_rval_t rval; /* Return code from subparsers */ - - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - size_t edx; /* SEQUENCE element's index */ - - ASN_DEBUG("Decoding %s as SEQUENCE", td->name); - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Start to parse where left previously - */ - switch(ctx->phase) { - case 0: - /* - * PHASE 0. - * Check that the set of tags associated with given structure - * perfectly fits our expectations. - */ - - rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, 1, &ctx->left, 0); - if(rval.code != RC_OK) { - ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); - return rval; - } - - if(ctx->left >= 0) - ctx->left += rval.consumed; /* ?Substracted below! */ - ADVANCE(rval.consumed); - - NEXT_PHASE(ctx); - - ASN_DEBUG("Structure consumes %ld bytes, buffer %ld", - (long)ctx->left, (long)size); - - /* Fall through */ - case 1: - /* - * PHASE 1. - * From the place where we've left it previously, - * try to decode the next member from the list of - * this structure's elements. - * (ctx->step) stores the member being processed - * between invocations and the microphase {0,1} of parsing - * that member: - * step = ( * 2 + ). - */ - for(edx = ((size_t)ctx->step >> 1); edx < td->elements_count; - edx++, ctx->step = (ctx->step & ~1) + 2) { - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - ssize_t tag_len; /* Length of TLV's T */ - size_t opt_edx_end; /* Next non-optional element */ - size_t n; - int use_bsearch; - - if(ctx->step & 1) - goto microphase2; - - /* - * MICROPHASE 1: Synchronize decoding. - */ - ASN_DEBUG("In %s SEQUENCE left %d, edx=%" ASN_PRI_SIZE " flags=%d" - " opt=%d ec=%d", - td->name, (int)ctx->left, edx, - elements[edx].flags, elements[edx].optional, - td->elements_count); - - if(ctx->left == 0 /* No more stuff is expected */ - && ( - /* Explicit OPTIONAL specification reaches the end */ - (edx + elements[edx].optional == td->elements_count) || - /* All extensions are optional */ - IN_EXTENSION_GROUP(specs, edx))) { - ASN_DEBUG("End of SEQUENCE %s", td->name); - /* - * Found the legitimate end of the structure. - */ - PHASE_OUT(ctx); - RETURN(RC_OK); - } - - /* - * Fetch the T from TLV. - */ - tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); - ASN_DEBUG("Current tag in %s SEQUENCE for element %" ASN_PRI_SIZE " " - "(%s) is %s encoded in %d bytes, of frame %ld", - td->name, edx, elements[edx].name, - ber_tlv_tag_string(tlv_tag), (int)tag_len, (long)LEFT); - switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) { - RETURN(RC_FAIL); - } else { - RETURN(RC_WMORE); - } - } else if(((const uint8_t *)ptr)[1] == 0) { - ASN_DEBUG("edx = %" ASN_PRI_SIZE ", opt = %d, ec=%d", edx, - elements[edx].optional, td->elements_count); - if((edx + elements[edx].optional == td->elements_count) - || IN_EXTENSION_GROUP(specs, edx)) { - /* - * Yeah, baby! Found the terminator - * of the indefinite length structure. - */ - /* - * Proceed to the canonical - * finalization function. - * No advancing is necessary. - */ - goto phase3; - } - } - } - - /* - * Find the next available type with this tag. - */ - use_bsearch = 0; - opt_edx_end = edx + elements[edx].optional + 1; - if(opt_edx_end > td->elements_count) - opt_edx_end = td->elements_count; /* Cap */ - else if(opt_edx_end - edx > 8) { - /* Limit the scope of linear search... */ - opt_edx_end = edx + 8; - use_bsearch = 1; - /* ... and resort to bsearch() */ - } - for(n = edx; n < opt_edx_end; n++) { - if(BER_TAGS_EQUAL(tlv_tag, elements[n].tag)) { - /* - * Found element corresponding to the tag - * being looked at. - * Reposition over the right element. - */ - edx = n; - ctx->step = 1 + 2 * edx; /* Remember! */ - goto microphase2; - } else if(elements[n].flags & ATF_ANY_TYPE) { - /* - * This is the ANY type, which may bear - * any flag whatsoever. - */ - edx = n; - ctx->step = 1 + 2 * edx; /* Remember! */ - goto microphase2; - } else if(elements[n].tag == (ber_tlv_tag_t)-1) { - use_bsearch = 1; - break; - } - } - if(use_bsearch) { - /* - * Resort to a binary search over - * sorted array of tags. - */ - const asn_TYPE_tag2member_t *t2m; - asn_TYPE_tag2member_t key = {0, 0, 0, 0}; - key.el_tag = tlv_tag; - key.el_no = edx; - t2m = (const asn_TYPE_tag2member_t *)bsearch(&key, - specs->tag2el, specs->tag2el_count, - sizeof(specs->tag2el[0]), _t2e_cmp); - if(t2m) { - const asn_TYPE_tag2member_t *best = 0; - const asn_TYPE_tag2member_t *t2m_f, *t2m_l; - size_t edx_max = edx + elements[edx].optional; - /* - * Rewind to the first element with that tag, - * `cause bsearch() does not guarantee order. - */ - t2m_f = t2m + t2m->toff_first; - t2m_l = t2m + t2m->toff_last; - for(t2m = t2m_f; t2m <= t2m_l; t2m++) { - if(t2m->el_no > edx_max) break; - if(t2m->el_no < edx) continue; - best = t2m; - } - if(best) { - edx = best->el_no; - ctx->step = 1 + 2 * edx; - goto microphase2; - } - } - n = opt_edx_end; - } - if(n == opt_edx_end) { - /* - * If tag is unknown, it may be either - * an unknown (thus, incorrect) tag, - * or an extension (...), - * or an end of the indefinite-length structure. - */ - if(!IN_EXTENSION_GROUP(specs, - edx + elements[edx].optional)) { - ASN_DEBUG("Unexpected tag %s (at %" ASN_PRI_SIZE ")", - ber_tlv_tag_string(tlv_tag), edx); - ASN_DEBUG("Expected tag %s (%s)%s", - ber_tlv_tag_string(elements[edx].tag), - elements[edx].name, - elements[edx].optional - ?" or alternatives":""); - RETURN(RC_FAIL); - } else { - /* Skip this tag */ - ssize_t skip; - edx += elements[edx].optional; - - ASN_DEBUG("Skipping unexpected %s (at %" ASN_PRI_SIZE ")", - ber_tlv_tag_string(tlv_tag), edx); - skip = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - (const char *)ptr + tag_len, - LEFT - tag_len); - ASN_DEBUG("Skip length %d in %s", - (int)skip, td->name); - switch(skip) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - ADVANCE(skip + tag_len); - ctx->step -= 2; - edx--; - continue; /* Try again with the next tag */ - } - } - - /* - * MICROPHASE 2: Invoke the member-specific decoder. - */ - ctx->step |= 1; /* Confirm entering next microphase */ - microphase2: - ASN_DEBUG("Inside SEQUENCE %s MF2", td->name); - - /* - * Compute the position of the member inside a structure, - * and also a type of containment (it may be contained - * as pointer or using inline inclusion). - */ - if(elements[edx].flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset); - } else { - /* - * A pointer to a pointer - * holding the start of the structure - */ - memb_ptr = (char *)st + elements[edx].memb_offset; - memb_ptr2 = &memb_ptr; - } - /* - * Invoke the member fetch routine according to member's type - */ - if(elements[edx].flags & ATF_OPEN_TYPE) { - rval = OPEN_TYPE_ber_get(opt_codec_ctx, td, st, &elements[edx], ptr, LEFT); - } else { - rval = elements[edx].type->op->ber_decoder(opt_codec_ctx, - elements[edx].type, - memb_ptr2, ptr, LEFT, - elements[edx].tag_mode); - } - ASN_DEBUG("In %s SEQUENCE decoded %" ASN_PRI_SIZE " %s of %d " - "in %d bytes rval.code %d, size=%d", - td->name, edx, elements[edx].type->name, - (int)LEFT, (int)rval.consumed, rval.code, (int)size); - switch(rval.code) { - case RC_OK: - break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); - } - ASN_DEBUG("Size violation (c->l=%ld <= s=%ld)", - (long)ctx->left, (long)size); - /* Fall through */ - case RC_FAIL: /* Fatal error */ - RETURN(RC_FAIL); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } /* for(all structure members) */ - - phase3: - ctx->phase = 3; - /* Fall through */ - case 3: /* 00 and other tags expected */ - case 4: /* only 00's expected */ - - ASN_DEBUG("SEQUENCE %s Leftover: %ld, size = %ld", - td->name, (long)ctx->left, (long)size); - - /* - * Skip everything until the end of the SEQUENCE. - */ - while(ctx->left) { - ssize_t tl, ll; - - tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); - switch(tl) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - /* - * If expected <0><0>... - */ - if(ctx->left < 0 - && ((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) - RETURN(RC_FAIL); - else - RETURN(RC_WMORE); - } else if(((const uint8_t *)ptr)[1] == 0) { - /* - * Correctly finished with <0><0>. - */ - ADVANCE(2); - ctx->left++; - ctx->phase = 4; - continue; - } - } - - if(!IN_EXTENSION_GROUP(specs, td->elements_count) - || ctx->phase == 4) { - ASN_DEBUG("Unexpected continuation " - "of a non-extensible type " - "%s (SEQUENCE): %s", - td->name, - ber_tlv_tag_string(tlv_tag)); - RETURN(RC_FAIL); - } - - ll = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - (const char *)ptr + tl, LEFT - tl); - switch(ll) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - ADVANCE(tl + ll); - } - - PHASE_OUT(ctx); - } - - RETURN(RC_OK); -} - - -/* - * The DER encoder of the SEQUENCE type. - */ -asn_enc_rval_t -SEQUENCE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - size_t computed_size = 0; - asn_enc_rval_t erval; - ssize_t ret; - size_t edx; - - ASN_DEBUG("%s %s as SEQUENCE", - cb?"Encoding":"Estimating", td->name); - - /* - * Gather the length of the underlying members sequence. - */ - for(edx = 0; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - - const void *memb_ptr; /* Pointer to the member */ - const void *const *memb_ptr2; /* Pointer to that pointer */ - - if(elm->flags & ATF_POINTER) { - memb_ptr2 = - (const void *const *)((const char *)sptr + elm->memb_offset); - if(!*memb_ptr2) { - ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present", - elm->name, edx); - if(elm->optional) - continue; - /* Mandatory element is missing */ - ASN__ENCODE_FAILED; - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - memb_ptr2 = &memb_ptr; - } - - /* Eliminate default values */ - if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0) - continue; - - erval = elm->type->op->der_encoder(elm->type, *memb_ptr2, - elm->tag_mode, elm->tag, - 0, 0); - if(erval.encoded == -1) - return erval; - computed_size += erval.encoded; - ASN_DEBUG("Member %" ASN_PRI_SIZE " %s estimated %ld bytes", - edx, elm->name, (long)erval.encoded); - } - - /* - * Encode the TLV for the sequence itself. - */ - ret = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key); - ASN_DEBUG("Wrote tags: %ld (+%ld)", (long)ret, (long)computed_size); - if(ret == -1) - ASN__ENCODE_FAILED; - erval.encoded = computed_size + ret; - - if(!cb) ASN__ENCODED_OK(erval); - - /* - * Encode all members. - */ - for(edx = 0; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - asn_enc_rval_t tmperval; - const void *memb_ptr; /* Pointer to the member */ - const void *const *memb_ptr2; /* Pointer to that pointer */ - - if(elm->flags & ATF_POINTER) { - memb_ptr2 = - (const void *const *)((const char *)sptr + elm->memb_offset); - if(!*memb_ptr2) continue; - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - memb_ptr2 = &memb_ptr; - } - - /* Eliminate default values */ - if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0) - continue; - - tmperval = elm->type->op->der_encoder(elm->type, *memb_ptr2, - elm->tag_mode, elm->tag, cb, app_key); - if(tmperval.encoded == -1) - return tmperval; - computed_size -= tmperval.encoded; - ASN_DEBUG("Member %" ASN_PRI_SIZE " %s of SEQUENCE %s encoded in %ld bytes", - edx, elm->name, td->name, (long)tmperval.encoded); - } - - if(computed_size != 0) - /* - * Encoded size is not equal to the computed size. - */ - ASN__ENCODE_FAILED; - - ASN__ENCODED_OK(erval); -} - - -#undef XER_ADVANCE -#define XER_ADVANCE(num_bytes) \ - do { \ - size_t num = (num_bytes); \ - ptr = ((const char *)ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Decode the XER (XML) data. - */ -asn_dec_rval_t -SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **struct_ptr, - const char *opt_mname, const void *ptr, size_t size) { - /* - * Bring closer parts of structure description. - */ - const asn_SEQUENCE_specifics_t *specs - = (const asn_SEQUENCE_specifics_t *)td->specifics; - asn_TYPE_member_t *elements = td->elements; - const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; - - /* - * ... and parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - asn_dec_rval_t rval; /* Return value from a decoder */ - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - size_t edx; /* Element index */ - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) RETURN(RC_FAIL); - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - - /* - * Phases of XER/XML processing: - * Phase 0: Check that the opening tag matches our expectations. - * Phase 1: Processing body and reacting on closing tag. - * Phase 2: Processing inner type. - * Phase 3: Skipping unknown extensions. - * Phase 4: PHASED OUT - */ - for(edx = ctx->step; ctx->phase <= 3;) { - pxer_chunk_type_e ch_type; /* XER chunk type */ - ssize_t ch_size; /* Chunk size */ - xer_check_tag_e tcv; /* Tag check value */ - asn_TYPE_member_t *elm; - - /* - * Go inside the inner member of a sequence. - */ - if(ctx->phase == 2) { - asn_dec_rval_t tmprval; - void *memb_ptr_dontuse; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - - elm = &td->elements[edx]; - - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - memb_ptr_dontuse = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr_dontuse; /* Only use of memb_ptr_dontuse */ - } - - if(elm->flags & ATF_OPEN_TYPE) { - tmprval = OPEN_TYPE_xer_get(opt_codec_ctx, td, st, elm, ptr, size); - } else { - /* Invoke the inner type decoder, m.b. multiple times */ - tmprval = elm->type->op->xer_decoder(opt_codec_ctx, - elm->type, memb_ptr2, elm->name, - ptr, size); - } - XER_ADVANCE(tmprval.consumed); - if(tmprval.code != RC_OK) - RETURN(tmprval.code); - ctx->phase = 1; /* Back to body processing */ - ctx->step = ++edx; - ASN_DEBUG("XER/SEQUENCE phase => %d, step => %d", - ctx->phase, ctx->step); - /* Fall through */ - } - - /* - * Get the next part of the XML stream. - */ - ch_size = xer_next_token(&ctx->context, ptr, size, - &ch_type); - if(ch_size == -1) { - RETURN(RC_FAIL); - } else { - switch(ch_type) { - case PXER_WMORE: - RETURN(RC_WMORE); - case PXER_COMMENT: /* Got XML comment */ - case PXER_TEXT: /* Ignore free-standing text */ - XER_ADVANCE(ch_size); /* Skip silently */ - continue; - case PXER_TAG: - break; /* Check the rest down there */ - } - } - - tcv = xer_check_tag(ptr, ch_size, xml_tag); - ASN_DEBUG("XER/SEQUENCE: tcv = %d, ph=%d [%s]", - tcv, ctx->phase, xml_tag); - - /* Skip the extensions section */ - if(ctx->phase == 3) { - switch(xer_skip_unknown(tcv, &ctx->left)) { - case -1: - ctx->phase = 4; - RETURN(RC_FAIL); - case 0: - XER_ADVANCE(ch_size); - continue; - case 1: - XER_ADVANCE(ch_size); - ctx->phase = 1; - continue; - case 2: - ctx->phase = 1; - break; - } - } - - switch(tcv) { - case XCT_CLOSING: - if(ctx->phase == 0) break; - ctx->phase = 0; - /* Fall through */ - case XCT_BOTH: - if(ctx->phase == 0) { - if(edx >= td->elements_count || - /* Explicit OPTIONAL specs reaches the end */ - (edx + elements[edx].optional == td->elements_count) || - /* All extensions are optional */ - IN_EXTENSION_GROUP(specs, edx)) { - XER_ADVANCE(ch_size); - ctx->phase = 4; /* Phase out */ - RETURN(RC_OK); - } else { - ASN_DEBUG("Premature end of XER SEQUENCE"); - RETURN(RC_FAIL); - } - } - /* Fall through */ - case XCT_OPENING: - if(ctx->phase == 0) { - XER_ADVANCE(ch_size); - ctx->phase = 1; /* Processing body phase */ - continue; - } - /* Fall through */ - case XCT_UNKNOWN_OP: - case XCT_UNKNOWN_BO: - - ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%" ASN_PRI_SIZE "", - tcv, ctx->phase, edx); - if(ctx->phase != 1) { - break; /* Really unexpected */ - } - - if(edx < td->elements_count) { - /* - * Search which member corresponds to this tag. - */ - size_t n; - size_t edx_end = edx + elements[edx].optional + 1; - if(edx_end > td->elements_count) - edx_end = td->elements_count; - for(n = edx; n < edx_end; n++) { - elm = &td->elements[n]; - tcv = xer_check_tag(ptr, ch_size, elm->name); - switch(tcv) { - case XCT_BOTH: - case XCT_OPENING: - /* - * Process this member. - */ - ctx->step = edx = n; - ctx->phase = 2; - break; - case XCT_UNKNOWN_OP: - case XCT_UNKNOWN_BO: - continue; - default: - n = edx_end; - break; /* Phase out */ - } - break; - } - if(n != edx_end) - continue; - } else { - ASN_DEBUG("Out of defined members: %" ASN_PRI_SIZE "/%u", - edx, td->elements_count); - } - - /* It is expected extension */ - if(IN_EXTENSION_GROUP(specs, - edx + (edx < td->elements_count - ? elements[edx].optional : 0))) { - ASN_DEBUG("Got anticipated extension at %" ASN_PRI_SIZE "", - edx); - /* - * Check for (XCT_BOTH or XCT_UNKNOWN_BO) - * By using a mask. Only record a pure - * tags. - */ - if(tcv & XCT_CLOSING) { - /* Found without body */ - } else { - ctx->left = 1; - ctx->phase = 3; /* Skip ...'s */ - } - XER_ADVANCE(ch_size); - continue; - } - - /* Fall through */ - default: - break; - } - - ASN_DEBUG("Unexpected XML tag in SEQUENCE [%c%c%c%c%c%c]", - size>0?((const char *)ptr)[0]:'.', - size>1?((const char *)ptr)[1]:'.', - size>2?((const char *)ptr)[2]:'.', - size>3?((const char *)ptr)[3]:'.', - size>4?((const char *)ptr)[4]:'.', - size>5?((const char *)ptr)[5]:'.'); - break; - } - - ctx->phase = 4; /* "Phase out" on hard failure */ - RETURN(RC_FAIL); -} - -asn_enc_rval_t -SEQUENCE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er; - int xcan = (flags & XER_F_CANONICAL); - asn_TYPE_descriptor_t *tmp_def_val_td = 0; - void *tmp_def_val = 0; - size_t edx; - - if(!sptr) ASN__ENCODE_FAILED; - - er.encoded = 0; - - for(edx = 0; edx < td->elements_count; edx++) { - asn_enc_rval_t tmper; - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr; - const char *mname = elm->name; - unsigned int mlen = strlen(mname); - - if(elm->flags & ATF_POINTER) { - memb_ptr = - *(const void *const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) { - assert(tmp_def_val == 0); - if(elm->default_value_set) { - if(elm->default_value_set(&tmp_def_val)) { - ASN__ENCODE_FAILED; - } else { - memb_ptr = tmp_def_val; - tmp_def_val_td = elm->type; - } - } else if(elm->optional) { - continue; - } else { - /* Mandatory element is missing */ - ASN__ENCODE_FAILED; - } - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - if(!xcan) ASN__TEXT_INDENT(1, ilevel); - ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); - - /* Print the member itself */ - tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1, - flags, cb, app_key); - if(tmp_def_val) { - ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val); - tmp_def_val = 0; - } - if(tmper.encoded == -1) return tmper; - er.encoded += tmper.encoded; - - ASN__CALLBACK3("", 1); - } - - if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); - - ASN__ENCODED_OK(er); -cb_failed: - if(tmp_def_val) ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val); - ASN__ENCODE_FAILED; -} - -int -SEQUENCE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - size_t edx; - int ret; - - if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; - - /* Dump preamble */ - if(cb(td->name, strlen(td->name), app_key) < 0 - || cb(" ::= {", 6, app_key) < 0) - return -1; - - for(edx = 0; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr; - - if(elm->flags & ATF_POINTER) { - memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) { - if(elm->optional) continue; - /* Print line */ - /* Fall through */ - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - /* Indentation */ - _i_INDENT(1); - - /* Print the member's name and stuff */ - if(cb(elm->name, strlen(elm->name), app_key) < 0 - || cb(": ", 2, app_key) < 0) - return -1; - - /* Print the member itself */ - ret = elm->type->op->print_struct(elm->type, memb_ptr, ilevel + 1, - cb, app_key); - if(ret) return ret; - } - - ilevel--; - _i_INDENT(1); - - return (cb("}", 1, app_key) < 0) ? -1 : 0; -} - -void -SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr, - enum asn_struct_free_method method) { - size_t edx; - const asn_SEQUENCE_specifics_t *specs = - (const asn_SEQUENCE_specifics_t *)td->specifics; - asn_struct_ctx_t *ctx; /* Decoder context */ - - if(!td || !sptr) - return; - - ASN_DEBUG("Freeing %s as SEQUENCE", td->name); - - for(edx = 0; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - void *memb_ptr; - if(elm->flags & ATF_POINTER) { - memb_ptr = *(void **)((char *)sptr + elm->memb_offset); - if(memb_ptr) - ASN_STRUCT_FREE(*elm->type, memb_ptr); - } else { - memb_ptr = (void *)((char *)sptr + elm->memb_offset); - ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr); - } - } - - /* Clean parsing context */ - ctx = (asn_struct_ctx_t *)((char *)sptr + specs->ctx_offset); - FREEMEM(ctx->ptr); - - switch(method) { - case ASFM_FREE_EVERYTHING: - FREEMEM(sptr); - break; - case ASFM_FREE_UNDERLYING: - break; - case ASFM_FREE_UNDERLYING_AND_RESET: - memset( - sptr, 0, - ((const asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size); - break; - } -} - -int -SEQUENCE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - size_t edx; - - if(!sptr) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - /* - * Iterate over structure members and check their validity. - */ - for(edx = 0; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr; - - if(elm->flags & ATF_POINTER) { - memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); - if(!memb_ptr) { - if(elm->optional) - continue; - ASN__CTFAIL(app_key, td, sptr, - "%s: mandatory element %s absent (%s:%d)", - td->name, elm->name, __FILE__, __LINE__); - return -1; - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - } - - if(elm->encoding_constraints.general_constraints) { - int ret = elm->encoding_constraints.general_constraints(elm->type, memb_ptr, - ctfailcb, app_key); - if(ret) return ret; - } else { - return elm->type->encoding_constraints.general_constraints(elm->type, - memb_ptr, ctfailcb, app_key); - } - } - - return 0; -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_dec_rval_t -SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics; - void *st = *sptr; /* Target structure. */ - int extpresent; /* Extension additions are present */ - uint8_t *opres; /* Presence of optional root members */ - asn_per_data_t opmd; - asn_dec_rval_t rv; - size_t edx; - - (void)constraints; - - if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) - ASN__DECODE_FAILED; - - if(!st) { - st = *sptr = CALLOC(1, specs->struct_size); - if(!st) ASN__DECODE_FAILED; - } - - ASN_DEBUG("Decoding %s as SEQUENCE (UPER)", td->name); - - /* Handle extensions */ - if(specs->first_extension < 0) { - extpresent = 0; - } else { - extpresent = per_get_few_bits(pd, 1); - if(extpresent < 0) ASN__DECODE_STARVED; - } - - /* Prepare a place and read-in the presence bitmap */ - memset(&opmd, 0, sizeof(opmd)); - if(specs->roms_count) { - opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1); - if(!opres) ASN__DECODE_FAILED; - /* Get the presence map */ - if(per_get_many_bits(pd, opres, 0, specs->roms_count)) { - FREEMEM(opres); - ASN__DECODE_STARVED; - } - opmd.buffer = opres; - opmd.nbits = specs->roms_count; - ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)", - td->name, specs->roms_count, *opres); - } else { - opres = 0; - } - - /* - * Get the sequence ROOT elements. - */ - for(edx = 0; - edx < (specs->first_extension < 0 ? td->elements_count - : (size_t)specs->first_extension); - edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - - assert(!IN_EXTENSION_GROUP(specs, edx)); - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - - /* Deal with optionality */ - if(elm->optional) { - int present = per_get_few_bits(&opmd, 1); - ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)", - td->name, elm->name, present, - (int)opmd.nboff, (int)opmd.nbits); - if(present == 0) { - /* This element is not present */ - if(elm->default_value_set) { - /* Fill-in DEFAULT */ - if(elm->default_value_set(memb_ptr2)) { - FREEMEM(opres); - ASN__DECODE_FAILED; - } - ASN_DEBUG("Filled-in default"); - } - /* The member is just not present */ - continue; - } - /* Fall through */ - } - - /* Fetch the member from the stream */ - ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name); - - if(elm->flags & ATF_OPEN_TYPE) { - rv = OPEN_TYPE_uper_get(opt_codec_ctx, td, st, elm, pd); - } else { - rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type, - elm->encoding_constraints.per_constraints, memb_ptr2, pd); - } - if(rv.code != RC_OK) { - ASN_DEBUG("Failed decode %s in %s", - elm->name, td->name); - FREEMEM(opres); - return rv; - } - } - - /* Optionality map is not needed anymore */ - FREEMEM(opres); - - /* - * Deal with extensions. - */ - if(extpresent) { - ssize_t bmlength; - uint8_t *epres; /* Presence of extension members */ - asn_per_data_t epmd; - - bmlength = uper_get_nslength(pd); - if(bmlength < 0) ASN__DECODE_STARVED; - - ASN_DEBUG("Extensions %" ASN_PRI_SSIZE " present in %s", bmlength, td->name); - - epres = (uint8_t *)MALLOC((bmlength + 15) >> 3); - if(!epres) ASN__DECODE_STARVED; - - /* Get the extensions map */ - if(per_get_many_bits(pd, epres, 0, bmlength)) { - FREEMEM(epres); - ASN__DECODE_STARVED; - } - - memset(&epmd, 0, sizeof(epmd)); - epmd.buffer = epres; - epmd.nbits = bmlength; - ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)", - td->name, (long)bmlength, *epres); - - /* Go over extensions and read them in */ - for(edx = specs->first_extension; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - int present; - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - memb_ptr = (void *)((char *)st + elm->memb_offset); - memb_ptr2 = &memb_ptr; - } - - present = per_get_few_bits(&epmd, 1); - if(present <= 0) { - if(present < 0) break; /* No more extensions */ - continue; - } - - ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, - *memb_ptr2); - rv = uper_open_type_get(opt_codec_ctx, elm->type, - elm->encoding_constraints.per_constraints, - memb_ptr2, pd); - if(rv.code != RC_OK) { - FREEMEM(epres); - return rv; - } - } - - /* Skip over overflow extensions which aren't present - * in this system's version of the protocol */ - for(;;) { - ASN_DEBUG("Getting overflow extensions"); - switch(per_get_few_bits(&epmd, 1)) { - case -1: break; - case 0: continue; - default: - if(uper_open_type_skip(opt_codec_ctx, pd)) { - FREEMEM(epres); - ASN__DECODE_STARVED; - } - ASN_DEBUG("Skipped overflow extension"); - continue; - } - break; - } - - FREEMEM(epres); - } - - if(specs->first_extension >= 0) { - unsigned i; - /* Fill DEFAULT members in extensions */ - for(i = specs->roms_count; i < specs->roms_count + specs->aoms_count; - i++) { - asn_TYPE_member_t *elm; - void **memb_ptr2; /* Pointer to member pointer */ - - edx = specs->oms[i]; - elm = &td->elements[edx]; - - if(!elm->default_value_set) continue; - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - if(*memb_ptr2) continue; - } else { - continue; /* Extensions are all optionals */ - } - - /* Set default value */ - if(elm->default_value_set(memb_ptr2)) { - ASN__DECODE_FAILED; - } - } - } - - rv.consumed = 0; - rv.code = RC_OK; - return rv; -} - -static int -SEQUENCE__handle_extensions(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_per_outp_t *po1, asn_per_outp_t *po2) { - const asn_SEQUENCE_specifics_t *specs = - (const asn_SEQUENCE_specifics_t *)td->specifics; - int exts_present = 0; - int exts_count = 0; - size_t edx; - - if(specs->first_extension < 0) { - return 0; - } - - /* Find out which extensions are present */ - for(edx = specs->first_extension; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr; /* Pointer to the member */ - const void *const *memb_ptr2; /* Pointer to that pointer */ - int present; - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = - (const void *const *)((const char *)sptr + elm->memb_offset); - present = (*memb_ptr2 != 0); - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - memb_ptr2 = &memb_ptr; - present = 1; - } - - ASN_DEBUG("checking %s:%s (@%" ASN_PRI_SIZE ") present => %d", elm->name, - elm->type->name, edx, present); - exts_count++; - exts_present += present; - - /* Encode as presence marker */ - if(po1 && per_put_few_bits(po1, present, 1)) { - return -1; - } - /* Encode as open type field */ - if(po2 && present - && uper_open_type_put(elm->type, - elm->encoding_constraints.per_constraints, - *memb_ptr2, po2)) - return -1; - } - - return exts_present ? exts_count : 0; -} - -asn_enc_rval_t -SEQUENCE_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_per_outp_t *po) { - const asn_SEQUENCE_specifics_t *specs - = (const asn_SEQUENCE_specifics_t *)td->specifics; - asn_enc_rval_t er; - int n_extensions; - size_t edx; - size_t i; - - (void)constraints; - - if(!sptr) - ASN__ENCODE_FAILED; - - er.encoded = 0; - - ASN_DEBUG("Encoding %s as SEQUENCE (UPER)", td->name); - - /* - * X.691#18.1 Whether structure is extensible - * and whether to encode extensions - */ - if(specs->first_extension < 0) { - n_extensions = 0; /* There are no extensions to encode */ - } else { - n_extensions = SEQUENCE__handle_extensions(td, sptr, 0, 0); - if(n_extensions < 0) ASN__ENCODE_FAILED; - if(per_put_few_bits(po, n_extensions ? 1 : 0, 1)) { - ASN__ENCODE_FAILED; - } - } - - /* Encode a presence bitmap */ - for(i = 0; i < specs->roms_count; i++) { - asn_TYPE_member_t *elm; - const void *memb_ptr; /* Pointer to the member */ - const void *const *memb_ptr2; /* Pointer to that pointer */ - int present; - - edx = specs->oms[i]; - elm = &td->elements[edx]; - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = - (const void *const *)((const char *)sptr + elm->memb_offset); - present = (*memb_ptr2 != 0); - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - memb_ptr2 = &memb_ptr; - present = 1; - } - - /* Eliminate default values */ - if(present && elm->default_value_cmp - && elm->default_value_cmp(*memb_ptr2) == 0) - present = 0; - - ASN_DEBUG("Element %s %s %s->%s is %s", - elm->flags & ATF_POINTER ? "ptr" : "inline", - elm->default_value_cmp ? "def" : "wtv", - td->name, elm->name, present ? "present" : "absent"); - if(per_put_few_bits(po, present, 1)) - ASN__ENCODE_FAILED; - } - - /* - * Encode the sequence ROOT elements. - */ - ASN_DEBUG("first_extension = %d, elements = %d", specs->first_extension, - td->elements_count); - for(edx = 0; - edx < ((specs->first_extension < 0) ? td->elements_count - : (size_t)specs->first_extension); - edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr; /* Pointer to the member */ - const void *const *memb_ptr2; /* Pointer to that pointer */ - - ASN_DEBUG("About to encode %s", elm->type->name); - - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = - (const void *const *)((const char *)sptr + elm->memb_offset); - if(!*memb_ptr2) { - ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present", - elm->name, edx); - if(elm->optional) - continue; - /* Mandatory element is missing */ - ASN__ENCODE_FAILED; - } - } else { - memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); - memb_ptr2 = &memb_ptr; - } - - /* Eliminate default values */ - if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0) - continue; - - ASN_DEBUG("Encoding %s->%s:%s", td->name, elm->name, elm->type->name); - er = elm->type->op->uper_encoder( - elm->type, elm->encoding_constraints.per_constraints, *memb_ptr2, - po); - if(er.encoded == -1) return er; - } - - /* No extensions to encode */ - if(!n_extensions) ASN__ENCODED_OK(er); - - ASN_DEBUG("Length of extensions %d bit-map", n_extensions); - /* #18.8. Write down the presence bit-map length. */ - if(uper_put_nslength(po, n_extensions)) - ASN__ENCODE_FAILED; - - ASN_DEBUG("Bit-map of %d elements", n_extensions); - /* #18.7. Encoding the extensions presence bit-map. */ - /* TODO: act upon NOTE in #18.7 for canonical PER */ - if(SEQUENCE__handle_extensions(td, sptr, po, 0) != n_extensions) - ASN__ENCODE_FAILED; - - ASN_DEBUG("Writing %d extensions", n_extensions); - /* #18.9. Encode extensions as open type fields. */ - if(SEQUENCE__handle_extensions(td, sptr, 0, po) != n_extensions) - ASN__ENCODE_FAILED; - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -int -SEQUENCE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, - const void *bptr) { - size_t edx; - - for(edx = 0; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *amemb; - const void *bmemb; - int ret; - - if(elm->flags & ATF_POINTER) { - amemb = - *(const void *const *)((const char *)aptr + elm->memb_offset); - bmemb = - *(const void *const *)((const char *)bptr + elm->memb_offset); - if(!amemb) { - if(!bmemb) continue; - if(elm->default_value_cmp - && elm->default_value_cmp(bmemb) == 0) { - /* A is absent, but B is present and equal to DEFAULT */ - continue; - } - return -1; - } else if(!bmemb) { - if(elm->default_value_cmp - && elm->default_value_cmp(amemb) == 0) { - /* B is absent, but A is present and equal to DEFAULT */ - continue; - } - return 1; - } - } else { - amemb = (const void *)((const char *)aptr + elm->memb_offset); - bmemb = (const void *)((const char *)bptr + elm->memb_offset); - } - - ret = elm->type->op->compare_struct(elm->type, amemb, bmemb); - if(ret != 0) return ret; - } - - return 0; -} - -asn_TYPE_operation_t asn_OP_SEQUENCE = { - SEQUENCE_free, - SEQUENCE_print, - SEQUENCE_compare, - SEQUENCE_decode_ber, - SEQUENCE_encode_der, - SEQUENCE_decode_xer, - SEQUENCE_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - SEQUENCE_decode_oer, - SEQUENCE_encode_oer, -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - SEQUENCE_decode_uper, - SEQUENCE_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - SEQUENCE_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; - - -asn_random_fill_result_t -SEQUENCE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constr, - size_t max_length) { - const asn_SEQUENCE_specifics_t *specs = - (const asn_SEQUENCE_specifics_t *)td->specifics; - asn_random_fill_result_t result_ok = {ARFILL_OK, 0}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - void *st = *sptr; - size_t edx; - - if(max_length == 0) return result_skipped; - - (void)constr; - - if(st == NULL) { - st = CALLOC(1, specs->struct_size); - if(st == NULL) { - return result_failed; - } - } - - for(edx = 0; edx < td->elements_count; edx++) { - const asn_TYPE_member_t *elm = &td->elements[edx]; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - asn_random_fill_result_t tmpres; - - if(elm->optional && asn_random_between(0, 4) == 2) { - /* Sometimes decide not to fill the optional value */ - continue; - } - - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - - tmpres = elm->type->op->random_fill( - elm->type, memb_ptr2, &elm->encoding_constraints, - max_length > result_ok.length ? max_length - result_ok.length : 0); - switch(tmpres.code) { - case ARFILL_OK: - result_ok.length += tmpres.length; - continue; - case ARFILL_SKIPPED: - assert(!(elm->flags & ATF_POINTER) || *memb_ptr2 == NULL); - continue; - case ARFILL_FAILED: - if(st == *sptr) { - ASN_STRUCT_RESET(*td, st); - } else { - ASN_STRUCT_FREE(*td, st); - } - return tmpres; - } - } - - *sptr = st; - - return result_ok; -} - +/* + * Copyright (c) 2003-2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_TYPE_operation_t asn_OP_SEQUENCE = { + SEQUENCE_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + SEQUENCE_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + SEQUENCE_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + SEQUENCE_decode_ber, + SEQUENCE_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + SEQUENCE_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + SEQUENCE_decode_aper, + SEQUENCE_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + SEQUENCE_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; + +void +SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr, + enum asn_struct_free_method method) { + size_t edx; + const asn_SEQUENCE_specifics_t *specs = + (const asn_SEQUENCE_specifics_t *)td->specifics; + asn_struct_ctx_t *ctx; /* Decoder context */ + + if(!td || !sptr) + return; + + ASN_DEBUG("Freeing %s as SEQUENCE", td->name); + + for(edx = 0; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + void *memb_ptr; + if(elm->flags & ATF_POINTER) { + memb_ptr = *(void **)((char *)sptr + elm->memb_offset); + if(memb_ptr) + ASN_STRUCT_FREE(*elm->type, memb_ptr); + } else { + memb_ptr = (void *)((char *)sptr + elm->memb_offset); + ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr); + } + } + + /* Clean parsing context */ + ctx = (asn_struct_ctx_t *)((char *)sptr + specs->ctx_offset); + FREEMEM(ctx->ptr); + + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(sptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset( + sptr, 0, + ((const asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size); + break; + } +} + +int +SEQUENCE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + size_t edx; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + /* + * Iterate over structure members and check their validity. + */ + for(edx = 0; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + const void *memb_ptr; + asn_constr_check_f *constr; + int ret; + + if(elm->flags & ATF_POINTER) { + memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); + if(!memb_ptr) { + if(elm->optional) + continue; + ASN__CTFAIL(app_key, td, sptr, + "%s: mandatory element %s absent (%s:%d)", + td->name, elm->name, __FILE__, __LINE__); + return -1; + } + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + + constr = elm->encoding_constraints.general_constraints; + if(!constr) + constr = elm->type->encoding_constraints.general_constraints; + + ret = constr(elm->type, memb_ptr, ctfailcb, app_key); + if(ret) return ret; + } + + return 0; +} + +int +SEQUENCE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, + const void *bptr) { + size_t edx; + + for(edx = 0; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + const void *amemb; + const void *bmemb; + int ret; + + if(elm->flags & ATF_POINTER) { + amemb = + *(const void *const *)((const char *)aptr + elm->memb_offset); + bmemb = + *(const void *const *)((const char *)bptr + elm->memb_offset); + if(!amemb) { + if(!bmemb) continue; + if(elm->default_value_cmp + && elm->default_value_cmp(bmemb) == 0) { + /* A is absent, but B is present and equal to DEFAULT */ + continue; + } + return -1; + } else if(!bmemb) { + if(elm->default_value_cmp + && elm->default_value_cmp(amemb) == 0) { + /* B is absent, but A is present and equal to DEFAULT */ + continue; + } + return 1; + } + } else { + amemb = (const void *)((const char *)aptr + elm->memb_offset); + bmemb = (const void *)((const char *)bptr + elm->memb_offset); + } + + ret = elm->type->op->compare_struct(elm->type, amemb, bmemb); + if(ret != 0) return ret; + } + + return 0; +} diff --git a/certgen/asncodec/constr_SEQUENCE.h b/certgen/asncodec/constr_SEQUENCE.h index b869b46..5ecfd8f 100644 --- a/certgen/asncodec/constr_SEQUENCE.h +++ b/certgen/asncodec/constr_SEQUENCE.h @@ -1,66 +1,95 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _CONSTR_SEQUENCE_H_ -#define _CONSTR_SEQUENCE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct asn_SEQUENCE_specifics_s { - /* - * Target structure description. - */ - unsigned struct_size; /* Size of the target structure. */ - unsigned ctx_offset; /* Offset of the asn_struct_ctx_t member */ - - /* - * Tags to members mapping table (sorted). - */ - const asn_TYPE_tag2member_t *tag2el; - unsigned tag2el_count; - - /* - * Optional members of the extensions root (roms) or additions (aoms). - * Meaningful for PER. - */ - const int *oms; /* Optional MemberS */ - unsigned roms_count; /* Root optional members count */ - unsigned aoms_count; /* Additions optional members count */ - - /* - * Description of an extensions group. - * Root components are clustered at the beginning of the structure, - * whereas extensions are clustered at the end. -1 means not extensible. - */ - signed first_extension; /* First extension addition */ -} asn_SEQUENCE_specifics_t; - - -/* - * A set specialized functions dealing with the SEQUENCE type. - */ -asn_struct_free_f SEQUENCE_free; -asn_struct_print_f SEQUENCE_print; -asn_struct_compare_f SEQUENCE_compare; -asn_constr_check_f SEQUENCE_constraint; -ber_type_decoder_f SEQUENCE_decode_ber; -der_type_encoder_f SEQUENCE_encode_der; -xer_type_decoder_f SEQUENCE_decode_xer; -xer_type_encoder_f SEQUENCE_encode_xer; -oer_type_decoder_f SEQUENCE_decode_oer; -oer_type_encoder_f SEQUENCE_encode_oer; -per_type_decoder_f SEQUENCE_decode_uper; -per_type_encoder_f SEQUENCE_encode_uper; -asn_random_fill_f SEQUENCE_random_fill; -extern asn_TYPE_operation_t asn_OP_SEQUENCE; - -#ifdef __cplusplus -} -#endif - -#endif /* _CONSTR_SEQUENCE_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _CONSTR_SEQUENCE_H_ +#define _CONSTR_SEQUENCE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct asn_SEQUENCE_specifics_s { + /* + * Target structure description. + */ + unsigned struct_size; /* Size of the target structure. */ + unsigned ctx_offset; /* Offset of the asn_struct_ctx_t member */ + + /* + * Tags to members mapping table (sorted). + */ + const asn_TYPE_tag2member_t *tag2el; + unsigned tag2el_count; + + /* + * Optional members of the extensions root (roms) or additions (aoms). + * Meaningful for PER. + */ + const int *oms; /* Optional MemberS */ + unsigned roms_count; /* Root optional members count */ + unsigned aoms_count; /* Additions optional members count */ + + /* + * Description of an extensions group. + * Root components are clustered at the beginning of the structure, + * whereas extensions are clustered at the end. -1 means not extensible. + */ + signed first_extension; /* First extension addition */ +} asn_SEQUENCE_specifics_t; + + +/* + * A set specialized functions dealing with the SEQUENCE type. + */ +asn_struct_free_f SEQUENCE_free; + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f SEQUENCE_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f SEQUENCE_compare; + +asn_constr_check_f SEQUENCE_constraint; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f SEQUENCE_decode_ber; +der_type_encoder_f SEQUENCE_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f SEQUENCE_decode_xer; +xer_type_encoder_f SEQUENCE_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f SEQUENCE_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f SEQUENCE_decode_oer; +oer_type_encoder_f SEQUENCE_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f SEQUENCE_decode_uper; +per_type_encoder_f SEQUENCE_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f SEQUENCE_decode_aper; +per_type_encoder_f SEQUENCE_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f SEQUENCE_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +extern asn_TYPE_operation_t asn_OP_SEQUENCE; + +#ifdef __cplusplus +} +#endif + +#endif /* _CONSTR_SEQUENCE_H_ */ diff --git a/certgen/asncodec/constr_SEQUENCE_OF.c b/certgen/asncodec/constr_SEQUENCE_OF.c index 464d412..9c5d6cd 100644 --- a/certgen/asncodec/constr_SEQUENCE_OF.c +++ b/certgen/asncodec/constr_SEQUENCE_OF.c @@ -1,284 +1,92 @@ -/*- - * Copyright (c) 2003, 2004, 2006 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * The DER encoder of the SEQUENCE OF type. - */ -asn_enc_rval_t -SEQUENCE_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(ptr); - size_t computed_size = 0; - ssize_t encoding_size = 0; - asn_enc_rval_t erval; - int edx; - - ASN_DEBUG("Estimating size of SEQUENCE OF %s", td->name); - - /* - * Gather the length of the underlying members sequence. - */ - for(edx = 0; edx < list->count; edx++) { - void *memb_ptr = list->array[edx]; - if(!memb_ptr) continue; - erval = elm->type->op->der_encoder(elm->type, memb_ptr, - 0, elm->tag, - 0, 0); - if(erval.encoded == -1) - return erval; - computed_size += erval.encoded; - } - - /* - * Encode the TLV for the sequence itself. - */ - encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, - cb, app_key); - if(encoding_size == -1) { - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - return erval; - } - - computed_size += encoding_size; - if(!cb) { - erval.encoded = computed_size; - ASN__ENCODED_OK(erval); - } - - ASN_DEBUG("Encoding members of SEQUENCE OF %s", td->name); - - /* - * Encode all members. - */ - for(edx = 0; edx < list->count; edx++) { - void *memb_ptr = list->array[edx]; - if(!memb_ptr) continue; - erval = elm->type->op->der_encoder(elm->type, memb_ptr, - 0, elm->tag, - cb, app_key); - if(erval.encoded == -1) - return erval; - encoding_size += erval.encoded; - } - - if(computed_size != (size_t)encoding_size) { - /* - * Encoded size is not equal to the computed size. - */ - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - } else { - erval.encoded = computed_size; - erval.structure_ptr = 0; - erval.failed_type = 0; - } - - return erval; -} - -asn_enc_rval_t -SEQUENCE_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er; - const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; - const asn_TYPE_member_t *elm = td->elements; - const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(sptr); - const char *mname = specs->as_XMLValueList - ? 0 - : ((*elm->name) ? elm->name : elm->type->xml_tag); - size_t mlen = mname ? strlen(mname) : 0; - int xcan = (flags & XER_F_CANONICAL); - int i; - - if(!sptr) ASN__ENCODE_FAILED; - - er.encoded = 0; - - for(i = 0; i < list->count; i++) { - asn_enc_rval_t tmper; - void *memb_ptr = list->array[i]; - if(!memb_ptr) continue; - - if(mname) { - if(!xcan) ASN__TEXT_INDENT(1, ilevel); - ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); - } - - tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1, - flags, cb, app_key); - if(tmper.encoded == -1) return tmper; - er.encoded += tmper.encoded; - if(tmper.encoded == 0 && specs->as_XMLValueList) { - const char *name = elm->type->xml_tag; - size_t len = strlen(name); - if(!xcan) ASN__TEXT_INDENT(1, ilevel + 1); - ASN__CALLBACK3("<", 1, name, len, "/>", 2); - } - - if(mname) { - ASN__CALLBACK3("", 1); - } - } - - if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); - - ASN__ENCODED_OK(er); -cb_failed: - ASN__ENCODE_FAILED; -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_enc_rval_t -SEQUENCE_OF_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, asn_per_outp_t *po) { - const asn_anonymous_sequence_ *list; - const asn_per_constraint_t *ct; - asn_enc_rval_t er; - const asn_TYPE_member_t *elm = td->elements; - size_t encoded_edx; - - if(!sptr) ASN__ENCODE_FAILED; - list = _A_CSEQUENCE_FROM_VOID(sptr); - - er.encoded = 0; - - ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count); - - if(constraints) ct = &constraints->size; - else if(td->encoding_constraints.per_constraints) - ct = &td->encoding_constraints.per_constraints->size; - else ct = 0; - - /* If extensible constraint, check if size is in root */ - if(ct) { - int not_in_root = - (list->count < ct->lower_bound || list->count > ct->upper_bound); - ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound, - ct->flags & APC_EXTENSIBLE ? "ext" : "fix"); - if(ct->flags & APC_EXTENSIBLE) { - /* Declare whether size is in extension root */ - if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED; - if(not_in_root) ct = 0; - } else if(not_in_root && ct->effective_bits >= 0) { - ASN__ENCODE_FAILED; - } - - } - - if(ct && ct->effective_bits >= 0) { - /* X.691, #19.5: No length determinant */ - if(per_put_few_bits(po, list->count - ct->lower_bound, - ct->effective_bits)) - ASN__ENCODE_FAILED; - } else if(list->count == 0) { - /* When the list is empty add only the length determinant - * X.691, #20.6 and #11.9.4.1 - */ - if (uper_put_length(po, 0, 0)) { - ASN__ENCODE_FAILED; - } - ASN__ENCODED_OK(er); - } - - for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) { - ssize_t may_encode; - size_t edx; - int need_eom = 0; - - if(ct && ct->effective_bits >= 0) { - may_encode = list->count; - } else { - may_encode = - uper_put_length(po, list->count - encoded_edx, &need_eom); - if(may_encode < 0) ASN__ENCODE_FAILED; - } - - for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) { - void *memb_ptr = list->array[edx]; - if(!memb_ptr) ASN__ENCODE_FAILED; - er = elm->type->op->uper_encoder( - elm->type, elm->encoding_constraints.per_constraints, memb_ptr, - po); - if(er.encoded == -1) ASN__ENCODE_FAILED; - } - - if(need_eom && uper_put_length(po, 0, 0)) - ASN__ENCODE_FAILED; /* End of Message length */ - - encoded_edx += may_encode; - } - - ASN__ENCODED_OK(er); -} - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -int -SEQUENCE_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr, - const void *bptr) { - const asn_anonymous_sequence_ *a = _A_CSEQUENCE_FROM_VOID(aptr); - const asn_anonymous_sequence_ *b = _A_CSEQUENCE_FROM_VOID(bptr); - ssize_t idx; - - if(a && b) { - ssize_t common_length = (a->count < b->count ? a->count : b->count); - for(idx = 0; idx < common_length; idx++) { - int ret = td->elements->type->op->compare_struct( - td->elements->type, a->array[idx], b->array[idx]); - if(ret) return ret; - } - - if(idx < b->count) /* more elements in b */ - return -1; /* a is shorter, so put it first */ - if(idx < a->count) return 1; - - } else if(!a) { - return -1; - } else if(!b) { - return 1; - } - - return 0; -} - - -asn_TYPE_operation_t asn_OP_SEQUENCE_OF = { - SEQUENCE_OF_free, - SEQUENCE_OF_print, - SEQUENCE_OF_compare, - SEQUENCE_OF_decode_ber, - SEQUENCE_OF_encode_der, - SEQUENCE_OF_decode_xer, - SEQUENCE_OF_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - SEQUENCE_OF_decode_oer, /* Same as SET OF decoder. */ - SEQUENCE_OF_encode_oer, /* Same as SET OF encoder */ -#endif /* ASN_DISABLE_OER_SUPPORT */ -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - SEQUENCE_OF_decode_uper, /* Same as SET OF decoder */ - SEQUENCE_OF_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - SEQUENCE_OF_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; - +/*- + * Copyright (c) 2003, 2004, 2006 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +asn_TYPE_operation_t asn_OP_SEQUENCE_OF = { + SEQUENCE_OF_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + SEQUENCE_OF_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + SEQUENCE_OF_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + SEQUENCE_OF_decode_ber, + SEQUENCE_OF_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + SEQUENCE_OF_decode_xer, + SEQUENCE_OF_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + SEQUENCE_OF_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + SEQUENCE_OF_decode_oer, /* Same as SET OF decoder. */ + SEQUENCE_OF_encode_oer, /* Same as SET OF encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + SEQUENCE_OF_decode_uper, /* Same as SET OF decoder */ + SEQUENCE_OF_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + SEQUENCE_OF_decode_aper, + SEQUENCE_OF_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + SEQUENCE_OF_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; + +int +SEQUENCE_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr, + const void *bptr) { + const asn_anonymous_sequence_ *a = _A_CSEQUENCE_FROM_VOID(aptr); + const asn_anonymous_sequence_ *b = _A_CSEQUENCE_FROM_VOID(bptr); + ssize_t idx; + + if(a && b) { + ssize_t common_length = (a->count < b->count ? a->count : b->count); + for(idx = 0; idx < common_length; idx++) { + int ret = td->elements->type->op->compare_struct( + td->elements->type, a->array[idx], b->array[idx]); + if(ret) return ret; + } + + if(idx < b->count) /* more elements in b */ + return -1; /* a is shorter, so put it first */ + if(idx < a->count) return 1; + + } else if(!a) { + return -1; + } else if(!b) { + return 1; + } + + return 0; +} diff --git a/certgen/asncodec/constr_SEQUENCE_OF.h b/certgen/asncodec/constr_SEQUENCE_OF.h index 2d18bad..1768582 100644 --- a/certgen/asncodec/constr_SEQUENCE_OF.h +++ b/certgen/asncodec/constr_SEQUENCE_OF.h @@ -1,39 +1,67 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _CONSTR_SEQUENCE_OF_H_ -#define _CONSTR_SEQUENCE_OF_H_ - -#include -#include /* Implemented using SET OF */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * A set specialized functions dealing with the SEQUENCE OF type. - * Generally implemented using SET OF. - */ -asn_struct_compare_f SEQUENCE_OF_compare; -der_type_encoder_f SEQUENCE_OF_encode_der; -xer_type_encoder_f SEQUENCE_OF_encode_xer; -per_type_encoder_f SEQUENCE_OF_encode_uper; -extern asn_TYPE_operation_t asn_OP_SEQUENCE_OF; - -#define SEQUENCE_OF_free SET_OF_free -#define SEQUENCE_OF_print SET_OF_print -#define SEQUENCE_OF_constraint SET_OF_constraint -#define SEQUENCE_OF_decode_ber SET_OF_decode_ber -#define SEQUENCE_OF_decode_xer SET_OF_decode_xer -#define SEQUENCE_OF_decode_uper SET_OF_decode_uper -#define SEQUENCE_OF_decode_oer SET_OF_decode_oer -#define SEQUENCE_OF_encode_oer SET_OF_encode_oer -#define SEQUENCE_OF_random_fill SET_OF_random_fill - -#ifdef __cplusplus -} -#endif - -#endif /* _CONSTR_SET_OF_H_ */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _CONSTR_SEQUENCE_OF_H_ +#define _CONSTR_SEQUENCE_OF_H_ + +#include +#include /* Implemented using SET OF */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * A set specialized functions dealing with the SEQUENCE OF type. + * Generally implemented using SET OF. + */ +#define SEQUENCE_OF_free SET_OF_free + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +#define SEQUENCE_OF_print SET_OF_print +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f SEQUENCE_OF_compare; + +#define SEQUENCE_OF_constraint SET_OF_constraint + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#define SEQUENCE_OF_decode_ber SET_OF_decode_ber +der_type_encoder_f SEQUENCE_OF_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#define SEQUENCE_OF_decode_xer SET_OF_decode_xer +xer_type_encoder_f SEQUENCE_OF_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f SEQUENCE_OF_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +#define SEQUENCE_OF_decode_oer SET_OF_decode_oer +#define SEQUENCE_OF_encode_oer SET_OF_encode_oer +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +#define SEQUENCE_OF_decode_uper SET_OF_decode_uper +per_type_encoder_f SEQUENCE_OF_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +#define SEQUENCE_OF_decode_aper SET_OF_decode_aper +per_type_encoder_f SEQUENCE_OF_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +#define SEQUENCE_OF_random_fill SET_OF_random_fill +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +extern asn_TYPE_operation_t asn_OP_SEQUENCE_OF; + +#ifdef __cplusplus +} +#endif + +#endif /* _CONSTR_SET_OF_H_ */ diff --git a/certgen/asncodec/constr_SEQUENCE_OF_xer.c b/certgen/asncodec/constr_SEQUENCE_OF_xer.c new file mode 100644 index 0000000..7bd3236 --- /dev/null +++ b/certgen/asncodec/constr_SEQUENCE_OF_xer.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +asn_enc_rval_t +SEQUENCE_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_enc_rval_t er = {0,0,0}; + const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; + const asn_TYPE_member_t *elm = td->elements; + const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(sptr); + const char *mname = specs->as_XMLValueList + ? 0 + : ((*elm->name) ? elm->name : elm->type->xml_tag); + size_t mlen = mname ? strlen(mname) : 0; + int xcan = (flags & XER_F_CANONICAL); + int i; + + if(!sptr) ASN__ENCODE_FAILED; + + er.encoded = 0; + + for(i = 0; i < list->count; i++) { + asn_enc_rval_t tmper = {0,0,0}; + void *memb_ptr = list->array[i]; + if(!memb_ptr) continue; + + if(mname) { + if(!xcan) ASN__TEXT_INDENT(1, ilevel); + ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); + } + + tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1, + flags, cb, app_key); + if(tmper.encoded == -1) return tmper; + er.encoded += tmper.encoded; + if(tmper.encoded == 0 && specs->as_XMLValueList) { + const char *name = elm->type->xml_tag; + size_t len = strlen(name); + if(!xcan) ASN__TEXT_INDENT(1, ilevel + 1); + ASN__CALLBACK3("<", 1, name, len, "/>", 2); + } + + if(mname) { + ASN__CALLBACK3("", 1); + } + } + + if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); + + ASN__ENCODED_OK(er); +cb_failed: + ASN__ENCODE_FAILED; +} diff --git a/certgen/asncodec/constr_SEQUENCE_oer.c b/certgen/asncodec/constr_SEQUENCE_oer.c index 47de75c..b286904 100644 --- a/certgen/asncodec/constr_SEQUENCE_oer.c +++ b/certgen/asncodec/constr_SEQUENCE_oer.c @@ -1,561 +1,559 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include -#include - -/* - * This macro "eats" the part of the buffer which is definitely "consumed", - * i.e. was correctly converted into local representation or rightfully skipped. - */ -#undef ADVANCE -#define ADVANCE(num_bytes) \ - do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#undef PHASE_OUT -#define NEXT_PHASE(ctx) \ - do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) - -/* - * Check whether we are inside the extensions group. - */ -#define IN_EXTENSION_GROUP(specs, memb_idx) \ - ((specs)->first_extension >= 0 \ - && (unsigned)(specs)->first_extension <= (memb_idx)) - -#define IN_ROOT_GROUP_PRED(edx) \ - edx < (specs->first_extension < 0 ? td->elements_count \ - : (size_t)specs->first_extension) - -#define FOR_IN_ROOT_GROUP(edx) for(edx = 0; IN_ROOT_GROUP_PRED(edx); edx++) - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) do { \ - rval.code = _code; \ - rval.consumed = consumed_myself;\ - return rval; \ - } while(0) - -/* - * Return pointer to a member. - */ -static void ** -element_ptrptr(void *struct_ptr, asn_TYPE_member_t *elm, void **tmp_save_ptr) { - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - return (void **)((char *)struct_ptr + elm->memb_offset); - } else { - assert(tmp_save_ptr); - *tmp_save_ptr = (void *)((char *)struct_ptr + elm->memb_offset); - return tmp_save_ptr; - } -} - -static const void * -element_ptr(const void *struct_ptr, const asn_TYPE_member_t *elm) { - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - return *(const void *const *)((const char *)struct_ptr - + elm->memb_offset); - } else { - return (const void *)((const char *)struct_ptr + elm->memb_offset); - } -} - -asn_dec_rval_t -SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **struct_ptr, - const void *ptr, size_t size) { - const asn_SEQUENCE_specifics_t *specs = - (const asn_SEQUENCE_specifics_t *)td->specifics; - asn_dec_rval_t rval = {RC_OK, 0}; - void *st = *struct_ptr; /* Target structure */ - asn_struct_ctx_t *ctx; /* Decoder context */ - size_t consumed_myself = 0; /* Consumed bytes from ptr. */ - - (void)constraints; - - if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) - ASN__DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Start to parse where left previously. - */ - switch(ctx->phase) { - case 0: { - /* - * Fetch preamble. - */ - asn_bit_data_t *preamble; - int has_extensions_bit = (specs->first_extension >= 0); - size_t preamble_bits = (has_extensions_bit + specs->roms_count); - size_t preamble_bytes = ((7 + preamble_bits) >> 3); - - ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 0", td->name); - - ASN_DEBUG( - "Expecting preamble bits %" ASN_PRI_SIZE " for %s (including %d extension bits)", - preamble_bits, td->name, has_extensions_bit); - - if(preamble_bytes > size) { - ASN__DECODE_STARVED; - } - - preamble = asn_bit_data_new_contiguous(ptr, preamble_bits); - if(!preamble) { - RETURN(RC_FAIL); - } - preamble->nboff = has_extensions_bit; - ctx->ptr = preamble; - ADVANCE(preamble_bytes); - } - NEXT_PHASE(ctx); - /* FALL THROUGH */ - case 1: { - /* Decode components of the extension root */ - asn_bit_data_t *preamble = ctx->ptr; - size_t edx; - - ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 1 (Root)", td->name); - - assert(preamble); - - for(edx = (ctx->step >> 1); IN_ROOT_GROUP_PRED(edx); - edx++, ctx->step = (ctx->step & ~1) + 2) { - asn_TYPE_member_t *elm = &td->elements[edx]; - - ASN_DEBUG("Decoding %s->%s", td->name, elm->name); - - assert(!IN_EXTENSION_GROUP(specs, edx)); - - if(ctx->step & 1) { - goto microphase2_decode_continues; - } - - - if(elm->optional) { - int32_t present = asn_get_few_bits(preamble, 1); - if(present < 0) { - ASN_DEBUG("Presence map ended prematurely: %d", present); - RETURN(RC_FAIL); - } else if(present == 0) { - if(elm->default_value_set) { - /* Fill-in DEFAULT */ - void *tmp; - if(elm->default_value_set( - element_ptrptr(st, elm, &tmp))) { - RETURN(RC_FAIL); - } - } - /* The member is not present. */ - continue; - } - /* Present OPTIONAL or DEFAULT component. */ - } - - /* - * MICROPHASE 2: Invoke the member-specific decoder. - */ - ctx->step |= 1; /* Confirm entering next microphase */ - microphase2_decode_continues: - if(elm->flags & ATF_OPEN_TYPE) { - rval = OPEN_TYPE_oer_get(opt_codec_ctx, td, st, elm, ptr, size); - } else { - void *save_memb_ptr; /* Temporary reference. */ - void **memb_ptr2; /* Pointer to a pointer to a memmber */ - - memb_ptr2 = element_ptrptr(st, elm, &save_memb_ptr); - - rval = elm->type->op->oer_decoder( - opt_codec_ctx, elm->type, - elm->encoding_constraints.oer_constraints, memb_ptr2, ptr, - size); - } - switch(rval.code) { - case RC_OK: - ADVANCE(rval.consumed); - break; - case RC_WMORE: - ASN_DEBUG("More bytes needed at element %s \"%s\"", td->name, - elm->name); - ADVANCE(rval.consumed); - RETURN(RC_WMORE); - case RC_FAIL: - ASN_DEBUG("Decoding failed at element %s \"%s\"", td->name, - elm->name); - RETURN(RC_FAIL); - } - } /* for(all root members) */ - - } - NEXT_PHASE(ctx); - /* FALL THROUGH */ - case 2: - assert(ctx->ptr); - { - /* Cleanup preamble. */ - asn_bit_data_t *preamble = ctx->ptr; - asn_bit_data_t *extadds; - int has_extensions_bit = (specs->first_extension >= 0); - int extensions_present = - has_extensions_bit - && (preamble->buffer == NULL - || (((const uint8_t *)preamble->buffer)[0] & 0x80)); - uint8_t unused_bits; - size_t len = 0; - ssize_t len_len; - - ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 2", td->name); - - preamble->buffer = 0; /* Will do extensions_present==1 next time. */ - - if(!extensions_present) { - ctx->phase = 10; - RETURN(RC_OK); - } - - /* - * X.696 (08/2015) #16.1 (c), #16.4 - * Read in the extension addition presence bitmap. - */ - - len_len = oer_fetch_length(ptr, size, &len); - if(len_len > 0) { - ADVANCE(len_len); - } else if(len_len < 0) { - RETURN(RC_FAIL); - } else { - RETURN(RC_WMORE); - } - - if(len == 0) { - /* 16.4.1-2 */ - RETURN(RC_FAIL); - } else if(len > size) { - RETURN(RC_WMORE); - } - - /* Account for unused bits */ - unused_bits = 0x7 & *(const uint8_t *)ptr; - ADVANCE(1); - len--; - if(unused_bits && len == 0) { - RETURN(RC_FAIL); - } - - /* Get the extensions map */ - extadds = asn_bit_data_new_contiguous(ptr, len * 8 - unused_bits); - if(!extadds) { - RETURN(RC_FAIL); - } - FREEMEM(preamble); - ctx->ptr = extadds; - ADVANCE(len); - } - NEXT_PHASE(ctx); - ctx->step = - (specs->first_extension < 0 ? td->elements_count - : (size_t)specs->first_extension); - /* Fall through */ - case 3: - ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 3 (Extensions)", td->name); - for(; ctx->step < (signed)td->elements_count; ctx->step++) { - asn_bit_data_t *extadds = ctx->ptr; - size_t edx = ctx->step; - asn_TYPE_member_t *elm = &td->elements[edx]; - void *tmp_memb_ptr; - void **memb_ptr2 = element_ptrptr(st, elm, &tmp_memb_ptr); - - switch(asn_get_few_bits(extadds, 1)) { - case -1: - /* - * Not every one of our extensions is known to the remote side. - * Continue filling in their defaults though. - */ - /* Fall through */ - case 0: - /* Fill-in DEFAULT */ - if(elm->default_value_set - && elm->default_value_set(memb_ptr2)) { - RETURN(RC_FAIL); - } - continue; - case 1: { - /* Read OER open type */ - ssize_t ot_size = - oer_open_type_get(opt_codec_ctx, elm->type, - elm->encoding_constraints.oer_constraints, - memb_ptr2, ptr, size); - assert(ot_size <= (ssize_t)size); - if(ot_size > 0) { - ADVANCE(ot_size); - } else if(ot_size < 0) { - RETURN(RC_FAIL); - } else { - /* Roll back open type parsing */ - asn_get_undo(extadds, 1); - RETURN(RC_WMORE); - } - break; - } - default: - RETURN(RC_FAIL); - } - } - - NEXT_PHASE(ctx); - /* Fall through */ - case 4: - ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 4", td->name); - /* Read in the rest of Open Types while ignoring them */ - for(;;) { - asn_bit_data_t *extadds = ctx->ptr; - switch(asn_get_few_bits(extadds, 1)) { - case 0: - continue; - case 1: { - ssize_t skipped = oer_open_type_skip(ptr, size); - if(skipped > 0) { - ADVANCE(skipped); - } else if(skipped < 0) { - RETURN(RC_FAIL); - } else { - asn_get_undo(extadds, 1); - RETURN(RC_WMORE); - } - continue; - } - case -1: - /* No more Open Type encoded components */ - break; - default: - RETURN(RC_FAIL); - } - break; - } - } - - RETURN(RC_OK); -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -SEQUENCE_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics; - size_t computed_size = 0; - int has_extensions_bit = (specs->first_extension >= 0); - size_t preamble_bits = (has_extensions_bit + specs->roms_count); - uint32_t has_extensions = 0; - size_t edx; - int ret; - - (void)constraints; - - if(preamble_bits) { - asn_bit_outp_t preamble; - - memset(&preamble, 0, sizeof(preamble)); - preamble.output = cb; - preamble.op_key = app_key; - - if(has_extensions_bit) { - for(edx = specs->first_extension; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr = element_ptr(sptr, elm); - if(memb_ptr) { - if(elm->default_value_cmp - && elm->default_value_cmp(memb_ptr) == 0) { - /* Do not encode default values in extensions */ - } else { - has_extensions = 1; - break; - } - } - } - ret = asn_put_few_bits(&preamble, has_extensions, 1); - assert(ret == 0); - if(ret < 0) { - ASN__ENCODE_FAILED; - } - } - - /* - * Encode optional components bitmap. - */ - if(specs->roms_count) { - FOR_IN_ROOT_GROUP(edx) { - asn_TYPE_member_t *elm = &td->elements[edx]; - - if(IN_EXTENSION_GROUP(specs, edx)) break; - - if(elm->optional) { - const void *memb_ptr = element_ptr(sptr, elm); - uint32_t has_component = memb_ptr != NULL; - if(has_component && elm->default_value_cmp - && elm->default_value_cmp(memb_ptr) == 0) { - has_component = 0; - } - ret = asn_put_few_bits(&preamble, has_component, 1); - if(ret < 0) { - ASN__ENCODE_FAILED; - } - } - } - } - - asn_put_aligned_flush(&preamble); - computed_size += preamble.flushed_bytes; - } /* if(preamble_bits) */ - - /* - * Put root components and extensions root. - */ - for(edx = 0; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - asn_enc_rval_t er; - const void *memb_ptr; - - if(IN_EXTENSION_GROUP(specs, edx)) break; - - memb_ptr = element_ptr(sptr, elm); - if(memb_ptr) { - if(elm->default_value_cmp - && elm->default_value_cmp(memb_ptr) == 0) { - /* Skip default values in encoding */ - continue; - } - } else { - if(elm->optional) continue; - /* Mandatory element is missing */ - ASN__ENCODE_FAILED; - } - if(!elm->type->op->oer_encoder) { - ASN_DEBUG("OER encoder is not defined for type %s", elm->type->name); - ASN__ENCODE_FAILED; - } - er = elm->type->op->oer_encoder( - elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb, - app_key); - if(er.encoded == -1) { - ASN_DEBUG("... while encoding %s member \"%s\"\n", td->name, - elm->name); - return er; - } - computed_size += er.encoded; - } - - /* - * Before encode extensions, encode extensions additions presense bitmap - # X.696 (08/2015) #16.4. - */ - if(has_extensions) { - asn_bit_outp_t extadds; - - /* Special case allowing us to use exactly one byte for #8.6 */ - size_t aoms_length_bits = specs->aoms_count; - size_t aoms_length_bytes = (7 + aoms_length_bits) >> 3; - uint8_t unused_bits = 0x07 & (8 - (aoms_length_bits & 0x07)); - - assert(1 + aoms_length_bytes <= 127); - - memset(&extadds, 0, sizeof(extadds)); - extadds.output = cb; - extadds.op_key = app_key; - - /* #8.6 length determinant */ - ret = asn_put_few_bits(&extadds, (1 + aoms_length_bytes), 8); - if(ret < 0) ASN__ENCODE_FAILED; - - /* Number of unused bytes, #16.4.2 */ - ret = asn_put_few_bits(&extadds, unused_bits, 8); - if(ret < 0) ASN__ENCODE_FAILED; - - /* Encode presence bitmap #16.4.3 */ - for(edx = specs->first_extension; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr = element_ptr(sptr, elm); - if(memb_ptr && elm->default_value_cmp - && elm->default_value_cmp(memb_ptr) == 0) { - memb_ptr = 0; /* Do not encode default value. */ - } - ret |= asn_put_few_bits(&extadds, memb_ptr ? 1 : 0, 1); - } - if(ret < 0) ASN__ENCODE_FAILED; - - asn_put_aligned_flush(&extadds); - computed_size += extadds.flushed_bytes; - - /* Now, encode extensions */ - for(edx = specs->first_extension; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - const void *memb_ptr = element_ptr(sptr, elm); - - if(memb_ptr) { - if(elm->default_value_cmp - && elm->default_value_cmp(memb_ptr) == 0) { - /* Do not encode default value. */ - } else { - ssize_t wrote = oer_open_type_put( - elm->type, elm->encoding_constraints.oer_constraints, - memb_ptr, cb, app_key); - if(wrote == -1) { - ASN__ENCODE_FAILED; - } - computed_size += wrote; - } - } else if(!elm->optional) { - ASN__ENCODE_FAILED; - } - } - } /* if(has_extensions) */ - - - { - asn_enc_rval_t er = {0, 0, 0}; - er.encoded = computed_size; - ASN__ENCODED_OK(er); - } -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include +#include + +/* + * This macro "eats" the part of the buffer which is definitely "consumed", + * i.e. was correctly converted into local representation or rightfully skipped. + */ +#undef ADVANCE +#define ADVANCE(num_bytes) \ + do { \ + size_t num = num_bytes; \ + ptr = ((const char *)ptr) + num; \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Switch to the next phase of parsing. + */ +#undef NEXT_PHASE +#undef PHASE_OUT +#define NEXT_PHASE(ctx) \ + do { \ + ctx->phase++; \ + ctx->step = 0; \ + } while(0) + +/* + * Check whether we are inside the extensions group. + */ +#define IN_EXTENSION_GROUP(specs, memb_idx) \ + ((specs)->first_extension >= 0 \ + && (unsigned)(specs)->first_extension <= (memb_idx)) + +#define IN_ROOT_GROUP_PRED(edx) \ + edx < (specs->first_extension < 0 ? td->elements_count \ + : (size_t)specs->first_extension) + +#define FOR_IN_ROOT_GROUP(edx) for(edx = 0; IN_ROOT_GROUP_PRED(edx); edx++) + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) do { \ + rval.code = _code; \ + rval.consumed = consumed_myself;\ + return rval; \ + } while(0) + +/* + * Return pointer to a member. + */ +static void ** +element_ptrptr(void *struct_ptr, asn_TYPE_member_t *elm, void **tmp_save_ptr) { + if(elm->flags & ATF_POINTER) { + /* Member is a pointer to another structure */ + return (void **)((char *)struct_ptr + elm->memb_offset); + } else { + assert(tmp_save_ptr); + *tmp_save_ptr = (void *)((char *)struct_ptr + elm->memb_offset); + return tmp_save_ptr; + } +} + +static const void * +element_ptr(const void *struct_ptr, const asn_TYPE_member_t *elm) { + if(elm->flags & ATF_POINTER) { + /* Member is a pointer to another structure */ + return *(const void *const *)((const char *)struct_ptr + + elm->memb_offset); + } else { + return (const void *)((const char *)struct_ptr + elm->memb_offset); + } +} + +asn_dec_rval_t +SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **struct_ptr, + const void *ptr, size_t size) { + const asn_SEQUENCE_specifics_t *specs = + (const asn_SEQUENCE_specifics_t *)td->specifics; + asn_dec_rval_t rval = {RC_OK, 0}; + void *st = *struct_ptr; /* Target structure */ + asn_struct_ctx_t *ctx; /* Decoder context */ + size_t consumed_myself = 0; /* Consumed bytes from ptr. */ + + (void)constraints; + + if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) + ASN__DECODE_FAILED; + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) { + RETURN(RC_FAIL); + } + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Start to parse where left previously. + */ + switch(ctx->phase) { + case 0: { + /* + * Fetch preamble. + */ + asn_bit_data_t *preamble; + int has_extensions_bit = (specs->first_extension >= 0); + size_t preamble_bits = (has_extensions_bit + specs->roms_count); + size_t preamble_bytes = ((7 + preamble_bits) >> 3); + + ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 0", td->name); + + ASN_DEBUG( + "Expecting preamble bits %" ASN_PRI_SIZE " for %s (including %d extension bits)", + preamble_bits, td->name, has_extensions_bit); + ctx->start = ptr; + if(preamble_bytes > size) { + ASN__DECODE_STARVED; + } + + preamble = asn_bit_data_new_contiguous(ptr, preamble_bits); + if(!preamble) { + RETURN(RC_FAIL); + } + preamble->nboff = has_extensions_bit; + ctx->ptr = preamble; + ADVANCE(preamble_bytes); + } + NEXT_PHASE(ctx); + /* FALL THROUGH */ + case 1: { + /* Decode components of the extension root */ + asn_bit_data_t *preamble = ctx->ptr; + size_t edx; + + ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 1 (Root)", td->name); + + assert(preamble); + + for(edx = (ctx->step >> 1); IN_ROOT_GROUP_PRED(edx); + edx++, ctx->step = (ctx->step & ~1) + 2) { + asn_TYPE_member_t *elm = &td->elements[edx]; + + ASN_DEBUG("Decoding %s->%s", td->name, elm->name); + + assert(!IN_EXTENSION_GROUP(specs, edx)); + + if(ctx->step & 1) { + goto microphase2_decode_continues; + } + + + if(elm->optional) { + int32_t present = asn_get_few_bits(preamble, 1); + if(present < 0) { + ASN_DEBUG("Presence map ended prematurely: %d", present); + RETURN(RC_FAIL); + } else if(present == 0) { + if(elm->default_value_set) { + /* Fill-in DEFAULT */ + void *tmp; + if(elm->default_value_set( + element_ptrptr(st, elm, &tmp))) { + RETURN(RC_FAIL); + } + } + /* The member is not present. */ + continue; + } + /* Present OPTIONAL or DEFAULT component. */ + } + + /* + * MICROPHASE 2: Invoke the member-specific decoder. + */ + ctx->step |= 1; /* Confirm entering next microphase */ + microphase2_decode_continues: + if(elm->flags & ATF_OPEN_TYPE) { + rval = OPEN_TYPE_oer_get(opt_codec_ctx, td, st, elm, ptr, size); + } else { + void *save_memb_ptr; /* Temporary reference. */ + void **memb_ptr2; /* Pointer to a pointer to a memmber */ + + memb_ptr2 = element_ptrptr(st, elm, &save_memb_ptr); + + rval = elm->type->op->oer_decoder( + opt_codec_ctx, elm->type, + elm->encoding_constraints.oer_constraints, memb_ptr2, ptr, + size); + } + switch(rval.code) { + case RC_OK: + ctx->left = consumed_myself; + ADVANCE(rval.consumed); + break; + case RC_WMORE: + ASN_DEBUG("More bytes needed at element %s \"%s\"", td->name, + elm->name); + ADVANCE(rval.consumed); + RETURN(RC_WMORE); + case RC_FAIL: + ASN_DEBUG("Decoding failed at element %s \"%s\"", td->name, + elm->name); + RETURN(RC_FAIL); + } + } /* for(all root members) */ + + } + NEXT_PHASE(ctx); + /* FALL THROUGH */ + case 2: + assert(ctx->ptr); + { + /* Cleanup preamble. */ + asn_bit_data_t *preamble = ctx->ptr; + asn_bit_data_t *extadds; + int has_extensions_bit = (specs->first_extension >= 0); + int extensions_present = + has_extensions_bit + && (preamble->buffer == NULL + || (((const uint8_t *)preamble->buffer)[0] & 0x80)); + uint8_t unused_bits; + size_t len = 0; + ssize_t len_len; + + ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 2", td->name); + + preamble->buffer = 0; /* Will do extensions_present==1 next time. */ + + if(!extensions_present) { + ctx->phase = 10; + ctx->left = consumed_myself; + RETURN(RC_OK); + } + + /* + * X.696 (08/2015) #16.1 (c), #16.4 + * Read in the extension addition presence bitmap. + */ + + len_len = oer_fetch_length(ptr, size, &len); + if(len_len > 0) { + ADVANCE(len_len); + } else if(len_len < 0) { + RETURN(RC_FAIL); + } else { + RETURN(RC_WMORE); + } + + if(len == 0) { + /* 16.4.1-2 */ + RETURN(RC_FAIL); + } else if(len > size) { + RETURN(RC_WMORE); + } + + /* Account for unused bits */ + unused_bits = 0x7 & *(const uint8_t *)ptr; + ADVANCE(1); + len--; + if(unused_bits && len == 0) { + RETURN(RC_FAIL); + } + + /* Get the extensions map */ + extadds = asn_bit_data_new_contiguous(ptr, len * 8 - unused_bits); + if(!extadds) { + RETURN(RC_FAIL); + } + FREEMEM(preamble); + ctx->ptr = extadds; + ADVANCE(len); + } + NEXT_PHASE(ctx); + ctx->step = + (specs->first_extension < 0 ? td->elements_count + : (size_t)specs->first_extension); + /* Fall through */ + case 3: + ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 3 (Extensions)", td->name); + for(; ctx->step < (signed)td->elements_count; ctx->step++) { + asn_bit_data_t *extadds = ctx->ptr; + size_t edx = ctx->step; + asn_TYPE_member_t *elm = &td->elements[edx]; + void *tmp_memb_ptr; + void **memb_ptr2 = element_ptrptr(st, elm, &tmp_memb_ptr); + + switch(asn_get_few_bits(extadds, 1)) { + case -1: + /* + * Not every one of our extensions is known to the remote side. + * Continue filling in their defaults though. + */ + /* Fall through */ + case 0: + /* Fill-in DEFAULT */ + if(elm->default_value_set + && elm->default_value_set(memb_ptr2)) { + RETURN(RC_FAIL); + } + continue; + case 1: { + /* Read OER open type */ + ssize_t ot_size = + oer_open_type_get(opt_codec_ctx, elm->type, + elm->encoding_constraints.oer_constraints, + memb_ptr2, ptr, size); + assert(ot_size <= (ssize_t)size); + if(ot_size > 0) { + ADVANCE(ot_size); + } else if(ot_size < 0) { + RETURN(RC_FAIL); + } else { + /* Roll back open type parsing */ + asn_get_undo(extadds, 1); + RETURN(RC_WMORE); + } + break; + } + default: + RETURN(RC_FAIL); + } + } + + NEXT_PHASE(ctx); + /* Fall through */ + case 4: + ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 4", td->name); + /* Read in the rest of Open Types while ignoring them */ + for(;;) { + asn_bit_data_t *extadds = ctx->ptr; + switch(asn_get_few_bits(extadds, 1)) { + case 0: + continue; + case 1: { + ssize_t skipped = oer_open_type_skip(ptr, size); + if(skipped > 0) { + ADVANCE(skipped); + } else if(skipped < 0) { + RETURN(RC_FAIL); + } else { + asn_get_undo(extadds, 1); + RETURN(RC_WMORE); + } + continue; + } + case -1: + /* No more Open Type encoded components */ + break; + default: + RETURN(RC_FAIL); + } + break; + } + } + ctx->left = consumed_myself; + RETURN(RC_OK); +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +SEQUENCE_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics; + size_t computed_size = 0; + int has_extensions_bit = (specs->first_extension >= 0); + size_t preamble_bits = (has_extensions_bit + specs->roms_count); + uint32_t has_extensions = 0; + size_t edx; + int ret; + + (void)constraints; + + if(preamble_bits) { + asn_bit_outp_t preamble; + + memset(&preamble, 0, sizeof(preamble)); + preamble.output = cb; + preamble.op_key = app_key; + + if(has_extensions_bit) { + for(edx = specs->first_extension; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + const void *memb_ptr = element_ptr(sptr, elm); + if(memb_ptr) { + if(elm->default_value_cmp + && elm->default_value_cmp(memb_ptr) == 0) { + /* Do not encode default values in extensions */ + } else { + has_extensions = 1; + break; + } + } + } + ret = asn_put_few_bits(&preamble, has_extensions, 1); + assert(ret == 0); + if(ret < 0) { + ASN__ENCODE_FAILED; + } + } + + /* + * Encode optional components bitmap. + */ + if(specs->roms_count) { + FOR_IN_ROOT_GROUP(edx) { + asn_TYPE_member_t *elm = &td->elements[edx]; + + if(IN_EXTENSION_GROUP(specs, edx)) break; + + if(elm->optional) { + const void *memb_ptr = element_ptr(sptr, elm); + uint32_t has_component = memb_ptr != NULL; + if(has_component && elm->default_value_cmp + && elm->default_value_cmp(memb_ptr) == 0) { + has_component = 0; + } + ret = asn_put_few_bits(&preamble, has_component, 1); + if(ret < 0) { + ASN__ENCODE_FAILED; + } + } + } + } + + asn_put_aligned_flush(&preamble); + computed_size += preamble.flushed_bytes; + } /* if(preamble_bits) */ + + /* + * Put root components and extensions root. + */ + for(edx = 0; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + asn_enc_rval_t er = {0,0,0}; + const void *memb_ptr; + + if(IN_EXTENSION_GROUP(specs, edx)) break; + + memb_ptr = element_ptr(sptr, elm); + if(memb_ptr) { + if(elm->default_value_cmp + && elm->default_value_cmp(memb_ptr) == 0) { + /* Skip default values in encoding */ + continue; + } + } else { + if(elm->optional) continue; + /* Mandatory element is missing */ + ASN__ENCODE_FAILED; + } + if(!elm->type->op->oer_encoder) { + ASN_DEBUG("OER encoder is not defined for type %s", elm->type->name); + ASN__ENCODE_FAILED; + } + er = elm->type->op->oer_encoder( + elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb, + app_key); + if(er.encoded == -1) { + ASN_DEBUG("... while encoding %s member \"%s\"\n", td->name, + elm->name); + return er; + } + computed_size += er.encoded; + } + + /* + * Before encode extensions, encode extensions additions presence bitmap + # X.696 (08/2015) #16.4. + */ + if(has_extensions) { + asn_bit_outp_t extadds; + + /* Special case allowing us to use exactly one byte for #8.6 */ + size_t aoms_length_bits = specs->aoms_count; + size_t aoms_length_bytes = (7 + aoms_length_bits) >> 3; + uint8_t unused_bits = 0x07 & (8 - (aoms_length_bits & 0x07)); + + assert(1 + aoms_length_bytes <= 127); + + memset(&extadds, 0, sizeof(extadds)); + extadds.output = cb; + extadds.op_key = app_key; + + /* #8.6 length determinant */ + ret = asn_put_few_bits(&extadds, (1 + aoms_length_bytes), 8); + if(ret < 0) ASN__ENCODE_FAILED; + + /* Number of unused bytes, #16.4.2 */ + ret = asn_put_few_bits(&extadds, unused_bits, 8); + if(ret < 0) ASN__ENCODE_FAILED; + + /* Encode presence bitmap #16.4.3 */ + for(edx = specs->first_extension; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + const void *memb_ptr = element_ptr(sptr, elm); + if(memb_ptr && elm->default_value_cmp + && elm->default_value_cmp(memb_ptr) == 0) { + memb_ptr = 0; /* Do not encode default value. */ + } + ret |= asn_put_few_bits(&extadds, memb_ptr ? 1 : 0, 1); + } + if(ret < 0) ASN__ENCODE_FAILED; + + asn_put_aligned_flush(&extadds); + computed_size += extadds.flushed_bytes; + + /* Now, encode extensions */ + for(edx = specs->first_extension; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + const void *memb_ptr = element_ptr(sptr, elm); + + if(memb_ptr) { + if(elm->default_value_cmp + && elm->default_value_cmp(memb_ptr) == 0) { + /* Do not encode default value. */ + } else { + ssize_t wrote = oer_open_type_put( + elm->type, elm->encoding_constraints.oer_constraints, + memb_ptr, cb, app_key); + if(wrote == -1) { + ASN__ENCODE_FAILED; + } + computed_size += wrote; + } + } else if(!elm->optional) { + ASN__ENCODE_FAILED; + } + } + } /* if(has_extensions) */ + + + { + asn_enc_rval_t er = {0, 0, 0}; + er.encoded = computed_size; + ASN__ENCODED_OK(er); + } +} diff --git a/certgen/asncodec/constr_SEQUENCE_print.c b/certgen/asncodec/constr_SEQUENCE_print.c new file mode 100644 index 0000000..7f9e231 --- /dev/null +++ b/certgen/asncodec/constr_SEQUENCE_print.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +SEQUENCE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + size_t edx; + int ret; + + if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; + + /* Dump preamble */ + if(cb(td->name, strlen(td->name), app_key) < 0 + || cb(" ::= {", 6, app_key) < 0) + return -1; + + for(edx = 0; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + const void *memb_ptr; + + if(elm->flags & ATF_POINTER) { + memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); + if(!memb_ptr) { + if(elm->optional) continue; + /* Print line */ + /* Fall through */ + } + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + + /* Indentation */ + _i_INDENT(1); + + /* Print the member's name and stuff */ + if(cb(elm->name, strlen(elm->name), app_key) < 0 + || cb(": ", 2, app_key) < 0) + return -1; + + /* Print the member itself */ + ret = elm->type->op->print_struct(elm->type, memb_ptr, ilevel + 1, + cb, app_key); + if(ret) return ret; + } + + ilevel--; + _i_INDENT(1); + + return (cb("}", 1, app_key) < 0) ? -1 : 0; +} diff --git a/certgen/asncodec/constr_SEQUENCE_xer.c b/certgen/asncodec/constr_SEQUENCE_xer.c new file mode 100644 index 0000000..c6475f7 --- /dev/null +++ b/certgen/asncodec/constr_SEQUENCE_xer.c @@ -0,0 +1,348 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) \ + do { \ + rval.code = _code; \ + rval.consumed = consumed_myself; \ + return rval; \ + } while(0) + +/* + * Check whether we are inside the extensions group. + */ +#define IN_EXTENSION_GROUP(specs, memb_idx) \ + ((specs)->first_extension >= 0 \ + && (unsigned)(specs)->first_extension <= (memb_idx)) + +#undef XER_ADVANCE +#define XER_ADVANCE(num_bytes) \ + do { \ + size_t num = (num_bytes); \ + ptr = ((const char *)ptr) + num; \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Decode the XER (XML) data. + */ +asn_dec_rval_t +SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **struct_ptr, + const char *opt_mname, const void *ptr, size_t size) { + /* + * Bring closer parts of structure description. + */ + const asn_SEQUENCE_specifics_t *specs + = (const asn_SEQUENCE_specifics_t *)td->specifics; + asn_TYPE_member_t *elements = td->elements; + const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; + + /* + * ... and parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + asn_dec_rval_t rval; /* Return value from a decoder */ + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + size_t edx; /* Element index */ + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) RETURN(RC_FAIL); + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + + /* + * Phases of XER/XML processing: + * Phase 0: Check that the opening tag matches our expectations. + * Phase 1: Processing body and reacting on closing tag. + * Phase 2: Processing inner type. + * Phase 3: Skipping unknown extensions. + * Phase 4: PHASED OUT + */ + for(edx = ctx->step; ctx->phase <= 3;) { + pxer_chunk_type_e ch_type; /* XER chunk type */ + ssize_t ch_size; /* Chunk size */ + xer_check_tag_e tcv; /* Tag check value */ + asn_TYPE_member_t *elm; + + /* + * Go inside the inner member of a sequence. + */ + if(ctx->phase == 2) { + asn_dec_rval_t tmprval; + void *memb_ptr_dontuse; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ + + elm = &td->elements[edx]; + + if(elm->flags & ATF_POINTER) { + /* Member is a pointer to another structure */ + memb_ptr2 = (void **)((char *)st + elm->memb_offset); + } else { + memb_ptr_dontuse = (char *)st + elm->memb_offset; + memb_ptr2 = &memb_ptr_dontuse; /* Only use of memb_ptr_dontuse */ + } + + if(elm->flags & ATF_OPEN_TYPE) { + tmprval = OPEN_TYPE_xer_get(opt_codec_ctx, td, st, elm, ptr, size); + } else { + /* Invoke the inner type decoder, m.b. multiple times */ + tmprval = elm->type->op->xer_decoder(opt_codec_ctx, + elm->type, memb_ptr2, elm->name, + ptr, size); + } + XER_ADVANCE(tmprval.consumed); + if(tmprval.code != RC_OK) + RETURN(tmprval.code); + ctx->phase = 1; /* Back to body processing */ + ctx->step = ++edx; + ASN_DEBUG("XER/SEQUENCE phase => %d, step => %d", + ctx->phase, ctx->step); + /* Fall through */ + } + + /* + * Get the next part of the XML stream. + */ + ch_size = xer_next_token(&ctx->context, ptr, size, + &ch_type); + if(ch_size == -1) { + RETURN(RC_FAIL); + } else { + switch(ch_type) { + case PXER_WMORE: + RETURN(RC_WMORE); + case PXER_COMMENT: /* Got XML comment */ + case PXER_TEXT: /* Ignore free-standing text */ + XER_ADVANCE(ch_size); /* Skip silently */ + continue; + case PXER_TAG: + break; /* Check the rest down there */ + } + } + + tcv = xer_check_tag(ptr, ch_size, xml_tag); + ASN_DEBUG("XER/SEQUENCE: tcv = %d, ph=%d [%s]", + tcv, ctx->phase, xml_tag); + + /* Skip the extensions section */ + if(ctx->phase == 3) { + switch(xer_skip_unknown(tcv, &ctx->left)) { + case -1: + ctx->phase = 4; + RETURN(RC_FAIL); + case 0: + XER_ADVANCE(ch_size); + continue; + case 1: + XER_ADVANCE(ch_size); + ctx->phase = 1; + continue; + case 2: + ctx->phase = 1; + break; + } + } + + switch(tcv) { + case XCT_CLOSING: + if(ctx->phase == 0) break; + ctx->phase = 0; + /* Fall through */ + case XCT_BOTH: + if(ctx->phase == 0) { + if(edx >= td->elements_count || + /* Explicit OPTIONAL specs reaches the end */ + (edx + elements[edx].optional == td->elements_count) || + /* All extensions are optional */ + IN_EXTENSION_GROUP(specs, edx)) { + XER_ADVANCE(ch_size); + ctx->phase = 4; /* Phase out */ + RETURN(RC_OK); + } else { + ASN_DEBUG("Premature end of XER SEQUENCE"); + RETURN(RC_FAIL); + } + } + /* Fall through */ + case XCT_OPENING: + if(ctx->phase == 0) { + XER_ADVANCE(ch_size); + ctx->phase = 1; /* Processing body phase */ + continue; + } + /* Fall through */ + case XCT_UNKNOWN_OP: + case XCT_UNKNOWN_BO: + + ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%" ASN_PRI_SIZE "", + tcv, ctx->phase, edx); + if(ctx->phase != 1) { + break; /* Really unexpected */ + } + + if(edx < td->elements_count) { + /* + * Search which member corresponds to this tag. + */ + size_t n; + size_t edx_end = edx + elements[edx].optional + 1; + if(edx_end > td->elements_count) + edx_end = td->elements_count; + for(n = edx; n < edx_end; n++) { + elm = &td->elements[n]; + tcv = xer_check_tag(ptr, ch_size, elm->name); + switch(tcv) { + case XCT_BOTH: + case XCT_OPENING: + /* + * Process this member. + */ + ctx->step = edx = n; + ctx->phase = 2; + break; + case XCT_UNKNOWN_OP: + case XCT_UNKNOWN_BO: + continue; + default: + n = edx_end; + break; /* Phase out */ + } + break; + } + if(n != edx_end) + continue; + } else { + ASN_DEBUG("Out of defined members: %" ASN_PRI_SIZE "/%u", + edx, td->elements_count); + } + + /* It is expected extension */ + if(IN_EXTENSION_GROUP(specs, + edx + (edx < td->elements_count + ? elements[edx].optional : 0))) { + ASN_DEBUG("Got anticipated extension at %" ASN_PRI_SIZE "", + edx); + /* + * Check for (XCT_BOTH or XCT_UNKNOWN_BO) + * By using a mask. Only record a pure + * tags. + */ + if(tcv & XCT_CLOSING) { + /* Found without body */ + } else { + ctx->left = 1; + ctx->phase = 3; /* Skip ...'s */ + } + XER_ADVANCE(ch_size); + continue; + } + + /* Fall through */ + default: + break; + } + + ASN_DEBUG("Unexpected XML tag in SEQUENCE [%c%c%c%c%c%c]", + size>0?((const char *)ptr)[0]:'.', + size>1?((const char *)ptr)[1]:'.', + size>2?((const char *)ptr)[2]:'.', + size>3?((const char *)ptr)[3]:'.', + size>4?((const char *)ptr)[4]:'.', + size>5?((const char *)ptr)[5]:'.'); + break; + } + + ctx->phase = 4; /* "Phase out" on hard failure */ + RETURN(RC_FAIL); +} + +asn_enc_rval_t +SEQUENCE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_enc_rval_t er = {0,0,0}; + int xcan = (flags & XER_F_CANONICAL); + asn_TYPE_descriptor_t *tmp_def_val_td = 0; + void *tmp_def_val = 0; + size_t edx; + + if(!sptr) ASN__ENCODE_FAILED; + + er.encoded = 0; + + for(edx = 0; edx < td->elements_count; edx++) { + asn_enc_rval_t tmper = {0,0,0}; + asn_TYPE_member_t *elm = &td->elements[edx]; + const void *memb_ptr; + const char *mname = elm->name; + unsigned int mlen = strlen(mname); + + if(elm->flags & ATF_POINTER) { + memb_ptr = + *(const void *const *)((const char *)sptr + elm->memb_offset); + if(!memb_ptr) { + assert(tmp_def_val == 0); + if(elm->default_value_set) { + if(elm->default_value_set(&tmp_def_val)) { + ASN__ENCODE_FAILED; + } else { + memb_ptr = tmp_def_val; + tmp_def_val_td = elm->type; + } + } else if(elm->optional) { + continue; + } else { + /* Mandatory element is missing */ + ASN__ENCODE_FAILED; + } + } + } else { + memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); + } + + if(!xcan) ASN__TEXT_INDENT(1, ilevel); + ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); + + /* Print the member itself */ + tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1, + flags, cb, app_key); + if(tmp_def_val) { + ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val); + tmp_def_val = 0; + } + if(tmper.encoded == -1) return tmper; + er.encoded += tmper.encoded; + + ASN__CALLBACK3("", 1); + } + + if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); + + ASN__ENCODED_OK(er); +cb_failed: + if(tmp_def_val) ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val); + ASN__ENCODE_FAILED; +} diff --git a/certgen/asncodec/constr_SET_OF.c b/certgen/asncodec/constr_SET_OF.c index ec71d5c..97a7cac 100644 --- a/certgen/asncodec/constr_SET_OF.c +++ b/certgen/asncodec/constr_SET_OF.c @@ -1,1348 +1,371 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Number of bytes left for this structure. - * (ctx->left) indicates the number of bytes _transferred_ for the structure. - * (size) contains the number of bytes in the buffer passed. - */ -#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) - -/* - * If the subprocessor function returns with an indication that it wants - * more data, it may well be a fatal decoding problem, because the - * size is constrained by the 's L, even if the buffer size allows - * reading more data. - * For example, consider the buffer containing the following TLVs: - * ... - * The TLV length clearly indicates that one byte is expected in V, but - * if the V processor returns with "want more data" even if the buffer - * contains way more data than the V processor have seen. - */ -#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) - -/* - * This macro "eats" the part of the buffer which is definitely "consumed", - * i.e. was correctly converted into local representation or rightfully skipped. - */ -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num;\ - size -= num; \ - if(ctx->left >= 0) \ - ctx->left -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#undef PHASE_OUT -#define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) do { \ - rval.code = _code; \ - rval.consumed = consumed_myself;\ - return rval; \ - } while(0) - -/* - * The decoder of the SET OF type. - */ -asn_dec_rval_t -SET_OF_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **struct_ptr, - const void *ptr, size_t size, int tag_mode) { - /* - * Bring closer parts of structure description. - */ - const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; - const asn_TYPE_member_t *elm = td->elements; /* Single one */ - - /* - * Parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - ber_tlv_tag_t tlv_tag; /* T from TLV */ - asn_dec_rval_t rval; /* Return code from subparsers */ - - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - ASN_DEBUG("Decoding %s as SET OF", td->name); - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Start to parse where left previously - */ - switch(ctx->phase) { - case 0: - /* - * PHASE 0. - * Check that the set of tags associated with given structure - * perfectly fits our expectations. - */ - - rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, 1, &ctx->left, 0); - if(rval.code != RC_OK) { - ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); - return rval; - } - - if(ctx->left >= 0) - ctx->left += rval.consumed; /* ?Substracted below! */ - ADVANCE(rval.consumed); - - ASN_DEBUG("Structure consumes %ld bytes, " - "buffer %ld", (long)ctx->left, (long)size); - - NEXT_PHASE(ctx); - /* Fall through */ - case 1: - /* - * PHASE 1. - * From the place where we've left it previously, - * try to decode the next item. - */ - for(;; ctx->step = 0) { - ssize_t tag_len; /* Length of TLV's T */ - - if(ctx->step & 1) - goto microphase2; - - /* - * MICROPHASE 1: Synchronize decoding. - */ - - if(ctx->left == 0) { - ASN_DEBUG("End of SET OF %s", td->name); - /* - * No more things to decode. - * Exit out of here. - */ - PHASE_OUT(ctx); - RETURN(RC_OK); - } - - /* - * Fetch the T from TLV. - */ - tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); - switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) - RETURN(RC_FAIL); - else - RETURN(RC_WMORE); - } else if(((const uint8_t *)ptr)[1] == 0) { - /* - * Found the terminator of the - * indefinite length structure. - */ - break; - } - } - - /* Outmost tag may be unknown and cannot be fetched/compared */ - if(elm->tag != (ber_tlv_tag_t)-1) { - if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { - /* - * The new list member of expected type has arrived. - */ - } else { - ASN_DEBUG("Unexpected tag %s fixed SET OF %s", - ber_tlv_tag_string(tlv_tag), td->name); - ASN_DEBUG("%s SET OF has tag %s", - td->name, ber_tlv_tag_string(elm->tag)); - RETURN(RC_FAIL); - } - } - - /* - * MICROPHASE 2: Invoke the member-specific decoder. - */ - ctx->step |= 1; /* Confirm entering next microphase */ - microphase2: - - /* - * Invoke the member fetch routine according to member's type - */ - rval = elm->type->op->ber_decoder(opt_codec_ctx, - elm->type, &ctx->ptr, ptr, LEFT, 0); - ASN_DEBUG("In %s SET OF %s code %d consumed %d", - td->name, elm->type->name, - rval.code, (int)rval.consumed); - switch(rval.code) { - case RC_OK: - { - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - if(ASN_SET_ADD(list, ctx->ptr) != 0) - RETURN(RC_FAIL); - else - ctx->ptr = 0; - } - break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); - } - /* Fall through */ - case RC_FAIL: /* Fatal error */ - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - RETURN(RC_FAIL); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } /* for(all list members) */ - - NEXT_PHASE(ctx); - case 2: - /* - * Read in all "end of content" TLVs. - */ - while(ctx->left < 0) { - if(LEFT < 2) { - if(LEFT > 0 && ((const char *)ptr)[0] != 0) { - /* Unexpected tag */ - RETURN(RC_FAIL); - } else { - RETURN(RC_WMORE); - } - } - if(((const char *)ptr)[0] == 0 - && ((const char *)ptr)[1] == 0) { - ADVANCE(2); - ctx->left++; - } else { - RETURN(RC_FAIL); - } - } - - PHASE_OUT(ctx); - } - - RETURN(RC_OK); -} - -/* - * Internally visible buffer holding a single encoded element. - */ -struct _el_buffer { - uint8_t *buf; - size_t length; - size_t allocated_size; - unsigned bits_unused; -}; -/* Append bytes to the above structure */ -static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) { - struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr; - - if(el_buf->length + size > el_buf->allocated_size) { - size_t new_size = el_buf->allocated_size ? el_buf->allocated_size : 8; - void *p; - - do { - new_size <<= 2; - } while(el_buf->length + size > new_size); - - p = REALLOC(el_buf->buf, new_size); - if(p) { - el_buf->buf = p; - el_buf->allocated_size = new_size; - } else { - return -1; - } - } - - memcpy(el_buf->buf + el_buf->length, buffer, size); - - el_buf->length += size; - return 0; -} - -static void assert_unused_bits(const struct _el_buffer* p) { - if(p->length) { - assert((p->buf[p->length-1] & ~(0xff << p->bits_unused)) == 0); - } else { - assert(p->bits_unused == 0); - } -} - -static int _el_buf_cmp(const void *ap, const void *bp) { - const struct _el_buffer *a = (const struct _el_buffer *)ap; - const struct _el_buffer *b = (const struct _el_buffer *)bp; - size_t common_len; - int ret = 0; - - if(a->length < b->length) - common_len = a->length; - else - common_len = b->length; - - if (a->buf && b->buf) { - ret = memcmp(a->buf, b->buf, common_len); - } - if(ret == 0) { - if(a->length < b->length) - ret = -1; - else if(a->length > b->length) - ret = 1; - /* Ignore unused bits. */ - assert_unused_bits(a); - assert_unused_bits(b); - } - - return ret; -} - -static void -SET_OF__encode_sorted_free(struct _el_buffer *el_buf, size_t count) { - size_t i; - - for(i = 0; i < count; i++) { - FREEMEM(el_buf[i].buf); - } - - FREEMEM(el_buf); -} - -enum SET_OF__encode_method { - SOES_DER, /* Distinguished Encoding Rules */ - SOES_CUPER /* Canonical Unaligned Packed Encoding Rules */ -}; - -static struct _el_buffer * -SET_OF__encode_sorted(const asn_TYPE_member_t *elm, - const asn_anonymous_set_ *list, - enum SET_OF__encode_method method) { - static struct _el_buffer *encoded_els; - int edx; - - encoded_els = - (struct _el_buffer *)CALLOC(list->count, sizeof(encoded_els[0])); - if(encoded_els == NULL) { - return NULL; - } - - /* - * Encode all members. - */ - for(edx = 0; edx < list->count; edx++) { - const void *memb_ptr = list->array[edx]; - struct _el_buffer *encoding_el = &encoded_els[edx]; - asn_enc_rval_t erval; - - if(!memb_ptr) break; - - /* - * Encode the member into the prepared space. - */ - switch(method) { - case SOES_DER: - erval = elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag, - _el_addbytes, encoding_el); - break; - case SOES_CUPER: - erval = uper_encode(elm->type, - elm->encoding_constraints.per_constraints, - memb_ptr, _el_addbytes, encoding_el); - if(erval.encoded != -1) { - size_t extra_bits = erval.encoded % 8; - assert(encoding_el->length == (size_t)(erval.encoded + 7) / 8); - encoding_el->bits_unused = (8 - extra_bits) & 0x7; - } - break; - default: - assert(!"Unreachable"); - break; - } - if(erval.encoded < 0) break; - } - - if(edx == list->count) { - /* - * Sort the encoded elements according to their encoding. - */ - qsort(encoded_els, list->count, sizeof(encoded_els[0]), _el_buf_cmp); - - return encoded_els; - } else { - SET_OF__encode_sorted_free(encoded_els, edx); - return NULL; - } -} - - -/* - * The DER encoder of the SET OF type. - */ -asn_enc_rval_t -SET_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr, - int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, - void *app_key) { - const asn_TYPE_member_t *elm = td->elements; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - size_t computed_size = 0; - ssize_t encoding_size = 0; - struct _el_buffer *encoded_els; - int edx; - - ASN_DEBUG("Estimating size for SET OF %s", td->name); - - /* - * Gather the length of the underlying members sequence. - */ - for(edx = 0; edx < list->count; edx++) { - void *memb_ptr = list->array[edx]; - asn_enc_rval_t erval; - - if(!memb_ptr) ASN__ENCODE_FAILED; - - erval = - elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag, 0, 0); - if(erval.encoded == -1) return erval; - computed_size += erval.encoded; - } - - - /* - * Encode the TLV for the sequence itself. - */ - encoding_size = - der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key); - if(encoding_size < 0) { - ASN__ENCODE_FAILED; - } - computed_size += encoding_size; - - if(!cb || list->count == 0) { - asn_enc_rval_t erval; - erval.encoded = computed_size; - ASN__ENCODED_OK(erval); - } - - ASN_DEBUG("Encoding members of %s SET OF", td->name); - - /* - * DER mandates dynamic sorting of the SET OF elements - * according to their encodings. Build an array of the - * encoded elements. - */ - encoded_els = SET_OF__encode_sorted(elm, list, SOES_DER); - - /* - * Report encoded elements to the application. - * Dispose of temporary sorted members table. - */ - for(edx = 0; edx < list->count; edx++) { - struct _el_buffer *encoded_el = &encoded_els[edx]; - /* Report encoded chunks to the application */ - if(cb(encoded_el->buf, encoded_el->length, app_key) < 0) { - break; - } else { - encoding_size += encoded_el->length; - } - } - - SET_OF__encode_sorted_free(encoded_els, list->count); - - if(edx == list->count) { - asn_enc_rval_t erval; - assert(computed_size == (size_t)encoding_size); - erval.encoded = computed_size; - ASN__ENCODED_OK(erval); - } else { - ASN__ENCODE_FAILED; - } -} - -#undef XER_ADVANCE -#define XER_ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - buf_ptr = ((const char *)buf_ptr) + num;\ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Decode the XER (XML) data. - */ -asn_dec_rval_t -SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **struct_ptr, - const char *opt_mname, const void *buf_ptr, size_t size) { - /* - * Bring closer parts of structure description. - */ - const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; - const asn_TYPE_member_t *element = td->elements; - const char *elm_tag; - const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; - - /* - * ... and parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - asn_dec_rval_t rval; /* Return value from a decoder */ - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) RETURN(RC_FAIL); - } - - /* Which tag is expected for the downstream */ - if(specs->as_XMLValueList) { - elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; - } else { - elm_tag = (*element->name) - ? element->name : element->type->xml_tag; - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Phases of XER/XML processing: - * Phase 0: Check that the opening tag matches our expectations. - * Phase 1: Processing body and reacting on closing tag. - * Phase 2: Processing inner type. - */ - for(; ctx->phase <= 2;) { - pxer_chunk_type_e ch_type; /* XER chunk type */ - ssize_t ch_size; /* Chunk size */ - xer_check_tag_e tcv; /* Tag check value */ - - /* - * Go inside the inner member of a set. - */ - if(ctx->phase == 2) { - asn_dec_rval_t tmprval; - - /* Invoke the inner type decoder, m.b. multiple times */ - ASN_DEBUG("XER/SET OF element [%s]", elm_tag); - tmprval = element->type->op->xer_decoder(opt_codec_ctx, - element->type, &ctx->ptr, elm_tag, - buf_ptr, size); - if(tmprval.code == RC_OK) { - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - if(ASN_SET_ADD(list, ctx->ptr) != 0) - RETURN(RC_FAIL); - ctx->ptr = 0; - XER_ADVANCE(tmprval.consumed); - } else { - XER_ADVANCE(tmprval.consumed); - RETURN(tmprval.code); - } - ctx->phase = 1; /* Back to body processing */ - ASN_DEBUG("XER/SET OF phase => %d", ctx->phase); - /* Fall through */ - } - - /* - * Get the next part of the XML stream. - */ - ch_size = xer_next_token(&ctx->context, - buf_ptr, size, &ch_type); - if(ch_size == -1) { - RETURN(RC_FAIL); - } else { - switch(ch_type) { - case PXER_WMORE: - RETURN(RC_WMORE); - case PXER_COMMENT: /* Got XML comment */ - case PXER_TEXT: /* Ignore free-standing text */ - XER_ADVANCE(ch_size); /* Skip silently */ - continue; - case PXER_TAG: - break; /* Check the rest down there */ - } - } - - tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); - ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", - tcv, ctx->phase, xml_tag); - switch(tcv) { - case XCT_CLOSING: - if(ctx->phase == 0) break; - ctx->phase = 0; - /* Fall through */ - case XCT_BOTH: - if(ctx->phase == 0) { - /* No more things to decode */ - XER_ADVANCE(ch_size); - ctx->phase = 3; /* Phase out */ - RETURN(RC_OK); - } - /* Fall through */ - case XCT_OPENING: - if(ctx->phase == 0) { - XER_ADVANCE(ch_size); - ctx->phase = 1; /* Processing body phase */ - continue; - } - /* Fall through */ - case XCT_UNKNOWN_OP: - case XCT_UNKNOWN_BO: - - ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase); - if(ctx->phase == 1) { - /* - * Process a single possible member. - */ - ctx->phase = 2; - continue; - } - /* Fall through */ - default: - break; - } - - ASN_DEBUG("Unexpected XML tag in SET OF"); - break; - } - - ctx->phase = 3; /* "Phase out" on hard failure */ - RETURN(RC_FAIL); -} - - - -typedef struct xer_tmp_enc_s { - void *buffer; - size_t offset; - size_t size; -} xer_tmp_enc_t; -static int -SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) { - xer_tmp_enc_t *t = (xer_tmp_enc_t *)key; - if(t->offset + size >= t->size) { - size_t newsize = (t->size << 2) + size; - void *p = REALLOC(t->buffer, newsize); - if(!p) return -1; - t->buffer = p; - t->size = newsize; - } - memcpy((char *)t->buffer + t->offset, buffer, size); - t->offset += size; - return 0; -} -static int -SET_OF_xer_order(const void *aptr, const void *bptr) { - const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr; - const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr; - size_t minlen = a->offset; - int ret; - if(b->offset < minlen) minlen = b->offset; - /* Well-formed UTF-8 has this nice lexicographical property... */ - ret = memcmp(a->buffer, b->buffer, minlen); - if(ret != 0) return ret; - if(a->offset == b->offset) - return 0; - if(a->offset == minlen) - return -1; - return 1; -} - - -asn_enc_rval_t -SET_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, - void *app_key) { - asn_enc_rval_t er; - const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; - const asn_TYPE_member_t *elm = td->elements; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - const char *mname = specs->as_XMLValueList - ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); - size_t mlen = mname ? strlen(mname) : 0; - int xcan = (flags & XER_F_CANONICAL); - xer_tmp_enc_t *encs = 0; - size_t encs_count = 0; - void *original_app_key = app_key; - asn_app_consume_bytes_f *original_cb = cb; - int i; - - if(!sptr) ASN__ENCODE_FAILED; - - if(xcan) { - encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); - if(!encs) ASN__ENCODE_FAILED; - cb = SET_OF_encode_xer_callback; - } - - er.encoded = 0; - - for(i = 0; i < list->count; i++) { - asn_enc_rval_t tmper; - - void *memb_ptr = list->array[i]; - if(!memb_ptr) continue; - - if(encs) { - memset(&encs[encs_count], 0, sizeof(encs[0])); - app_key = &encs[encs_count]; - encs_count++; - } - - if(mname) { - if(!xcan) ASN__TEXT_INDENT(1, ilevel); - ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); - } - - if(!xcan && specs->as_XMLValueList == 1) - ASN__TEXT_INDENT(1, ilevel + 1); - tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, - ilevel + (specs->as_XMLValueList != 2), - flags, cb, app_key); - if(tmper.encoded == -1) return tmper; - er.encoded += tmper.encoded; - if(tmper.encoded == 0 && specs->as_XMLValueList) { - const char *name = elm->type->xml_tag; - size_t len = strlen(name); - ASN__CALLBACK3("<", 1, name, len, "/>", 2); - } - - if(mname) { - ASN__CALLBACK3("", 1); - } - - } - - if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); - - if(encs) { - xer_tmp_enc_t *enc = encs; - xer_tmp_enc_t *end = encs + encs_count; - ssize_t control_size = 0; - - er.encoded = 0; - cb = original_cb; - app_key = original_app_key; - qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order); - - for(; enc < end; enc++) { - ASN__CALLBACK(enc->buffer, enc->offset); - FREEMEM(enc->buffer); - enc->buffer = 0; - control_size += enc->offset; - } - assert(control_size == er.encoded); - } - - goto cleanup; -cb_failed: - ASN__ENCODE_FAILED; -cleanup: - if(encs) { - size_t n; - for(n = 0; n < encs_count; n++) { - FREEMEM(encs[n].buffer); - } - FREEMEM(encs); - } - ASN__ENCODED_OK(er); -} - -int -SET_OF_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - int ret; - int i; - - if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; - - /* Dump preamble */ - if(cb(td->name, strlen(td->name), app_key) < 0 - || cb(" ::= {", 6, app_key) < 0) - return -1; - - for(i = 0; i < list->count; i++) { - const void *memb_ptr = list->array[i]; - if(!memb_ptr) continue; - - _i_INDENT(1); - - ret = elm->type->op->print_struct(elm->type, memb_ptr, - ilevel + 1, cb, app_key); - if(ret) return ret; - } - - ilevel--; - _i_INDENT(1); - - return (cb("}", 1, app_key) < 0) ? -1 : 0; -} - -void -SET_OF_free(const asn_TYPE_descriptor_t *td, void *ptr, - enum asn_struct_free_method method) { - if(td && ptr) { - const asn_SET_OF_specifics_t *specs; - asn_TYPE_member_t *elm = td->elements; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); - asn_struct_ctx_t *ctx; /* Decoder context */ - int i; - - /* - * Could not use set_of_empty() because of (*free) - * incompatibility. - */ - for(i = 0; i < list->count; i++) { - void *memb_ptr = list->array[i]; - if(memb_ptr) - ASN_STRUCT_FREE(*elm->type, memb_ptr); - } - list->count = 0; /* No meaningful elements left */ - - asn_set_empty(list); /* Remove (list->array) */ - - specs = (const asn_SET_OF_specifics_t *)td->specifics; - ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); - if(ctx->ptr) { - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - } - - switch(method) { - case ASFM_FREE_EVERYTHING: - FREEMEM(ptr); - break; - case ASFM_FREE_UNDERLYING: - break; - case ASFM_FREE_UNDERLYING_AND_RESET: - memset(ptr, 0, specs->struct_size); - break; - } - } -} - -int -SET_OF_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const asn_TYPE_member_t *elm = td->elements; - asn_constr_check_f *constr; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - int i; - - if(!sptr) { - ASN__CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - constr = elm->encoding_constraints.general_constraints; - if(!constr) constr = elm->type->encoding_constraints.general_constraints; - - /* - * Iterate over the members of an array. - * Validate each in turn, until one fails. - */ - for(i = 0; i < list->count; i++) { - const void *memb_ptr = list->array[i]; - int ret; - - if(!memb_ptr) continue; - - ret = constr(elm->type, memb_ptr, ctfailcb, app_key); - if(ret) return ret; - } - - return 0; -} - -#ifndef ASN_DISABLE_PER_SUPPORT - -asn_dec_rval_t -SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - asn_dec_rval_t rv; - const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; - const asn_TYPE_member_t *elm = td->elements; /* Single one */ - void *st = *sptr; - asn_anonymous_set_ *list; - const asn_per_constraint_t *ct; - int repeat = 0; - ssize_t nelems; - - if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) - ASN__DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(!st) { - st = *sptr = CALLOC(1, specs->struct_size); - if(!st) ASN__DECODE_FAILED; - } - list = _A_SET_FROM_VOID(st); - - /* Figure out which constraints to use */ - if(constraints) ct = &constraints->size; - else if(td->encoding_constraints.per_constraints) - ct = &td->encoding_constraints.per_constraints->size; - else ct = 0; - - if(ct && ct->flags & APC_EXTENSIBLE) { - int value = per_get_few_bits(pd, 1); - if(value < 0) ASN__DECODE_STARVED; - if(value) ct = 0; /* Not restricted! */ - } - - if(ct && ct->effective_bits >= 0) { - /* X.691, #19.5: No length determinant */ - nelems = per_get_few_bits(pd, ct->effective_bits); - ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s", - (long)nelems, ct->lower_bound, td->name); - if(nelems < 0) ASN__DECODE_STARVED; - nelems += ct->lower_bound; - } else { - nelems = -1; - } - - do { - int i; - if(nelems < 0) { - nelems = uper_get_length(pd, -1, 0, &repeat); - ASN_DEBUG("Got to decode %" ASN_PRI_SSIZE " elements (eff %d)", - nelems, (int)(ct ? ct->effective_bits : -1)); - if(nelems < 0) ASN__DECODE_STARVED; - } - - for(i = 0; i < nelems; i++) { - void *ptr = 0; - ASN_DEBUG("SET OF %s decoding", elm->type->name); - rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type, - elm->encoding_constraints.per_constraints, &ptr, pd); - ASN_DEBUG("%s SET OF %s decoded %d, %p", - td->name, elm->type->name, rv.code, ptr); - if(rv.code == RC_OK) { - if(ASN_SET_ADD(list, ptr) == 0) { - if(rv.consumed == 0 && nelems > 200) { - /* Protect from SET OF NULL compression bombs. */ - ASN__DECODE_FAILED; - } - continue; - } - ASN_DEBUG("Failed to add element into %s", - td->name); - /* Fall through */ - rv.code = RC_FAIL; - } else { - ASN_DEBUG("Failed decoding %s of %s (SET OF)", - elm->type->name, td->name); - } - if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); - return rv; - } - - nelems = -1; /* Allow uper_get_length() */ - } while(repeat); - - ASN_DEBUG("Decoded %s as SET OF", td->name); - - rv.code = RC_OK; - rv.consumed = 0; - return rv; -} - -asn_enc_rval_t -SET_OF_encode_uper(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_per_outp_t *po) { - const asn_anonymous_set_ *list; - const asn_per_constraint_t *ct; - const asn_TYPE_member_t *elm = td->elements; - struct _el_buffer *encoded_els; - asn_enc_rval_t er; - size_t encoded_edx; - - if(!sptr) ASN__ENCODE_FAILED; - - list = _A_CSET_FROM_VOID(sptr); - - er.encoded = 0; - - ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count); - - if(constraints) ct = &constraints->size; - else if(td->encoding_constraints.per_constraints) - ct = &td->encoding_constraints.per_constraints->size; - else ct = 0; - - /* If extensible constraint, check if size is in root */ - if(ct) { - int not_in_root = - (list->count < ct->lower_bound || list->count > ct->upper_bound); - ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound, - ct->flags & APC_EXTENSIBLE ? "ext" : "fix"); - if(ct->flags & APC_EXTENSIBLE) { - /* Declare whether size is in extension root */ - if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED; - if(not_in_root) ct = 0; - } else if(not_in_root && ct->effective_bits >= 0) { - ASN__ENCODE_FAILED; - } - - } - - if(ct && ct->effective_bits >= 0) { - /* X.691, #19.5: No length determinant */ - if(per_put_few_bits(po, list->count - ct->lower_bound, - ct->effective_bits)) - ASN__ENCODE_FAILED; - } else if(list->count == 0) { - /* When the list is empty add only the length determinant - * X.691, #20.6 and #11.9.4.1 - */ - if (uper_put_length(po, 0, 0)) { - ASN__ENCODE_FAILED; - } - ASN__ENCODED_OK(er); - } - - - /* - * Canonical UPER #22.1 mandates dynamic sorting of the SET OF elements - * according to their encodings. Build an array of the encoded elements. - */ - encoded_els = SET_OF__encode_sorted(elm, list, SOES_CUPER); - - for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) { - ssize_t may_encode; - size_t edx; - int need_eom = 0; - - if(ct && ct->effective_bits >= 0) { - may_encode = list->count; - } else { - may_encode = - uper_put_length(po, list->count - encoded_edx, &need_eom); - if(may_encode < 0) ASN__ENCODE_FAILED; - } - - for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) { - const struct _el_buffer *el = &encoded_els[edx]; - if(asn_put_many_bits(po, el->buf, - (8 * el->length) - el->bits_unused) < 0) { - break; - } - } - - if(need_eom && uper_put_length(po, 0, 0)) - ASN__ENCODE_FAILED; /* End of Message length */ - - encoded_edx += may_encode; - } - - SET_OF__encode_sorted_free(encoded_els, list->count); - - if((ssize_t)encoded_edx == list->count) { - ASN__ENCODED_OK(er); - } else { - ASN__ENCODE_FAILED; - } -} - - -#endif /* ASN_DISABLE_PER_SUPPORT */ - -struct comparable_ptr { - const asn_TYPE_descriptor_t *td; - const void *sptr; -}; - -static int -SET_OF__compare_cb(const void *aptr, const void *bptr) { - const struct comparable_ptr *a = aptr; - const struct comparable_ptr *b = bptr; - assert(a->td == b->td); - return a->td->op->compare_struct(a->td, a->sptr, b->sptr); -} - -int -SET_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr, - const void *bptr) { - const asn_anonymous_set_ *a = _A_CSET_FROM_VOID(aptr); - const asn_anonymous_set_ *b = _A_CSET_FROM_VOID(bptr); - - if(a && b) { - struct comparable_ptr *asorted; - struct comparable_ptr *bsorted; - ssize_t common_length; - ssize_t idx; - - if(a->count == 0) { - if(b->count) return -1; - return 0; - } else if(b->count == 0) { - return 1; - } - - asorted = MALLOC(a->count * sizeof(asorted[0])); - bsorted = MALLOC(b->count * sizeof(bsorted[0])); - if(!asorted || !bsorted) { - FREEMEM(asorted); - FREEMEM(bsorted); - return -1; - } - - for(idx = 0; idx < a->count; idx++) { - asorted[idx].td = td->elements->type; - asorted[idx].sptr = a->array[idx]; - } - - for(idx = 0; idx < b->count; idx++) { - bsorted[idx].td = td->elements->type; - bsorted[idx].sptr = b->array[idx]; - } - - qsort(asorted, a->count, sizeof(asorted[0]), SET_OF__compare_cb); - qsort(bsorted, b->count, sizeof(bsorted[0]), SET_OF__compare_cb); - - common_length = (a->count < b->count ? a->count : b->count); - for(idx = 0; idx < common_length; idx++) { - int ret = td->elements->type->op->compare_struct( - td->elements->type, asorted[idx].sptr, bsorted[idx].sptr); - if(ret) { - FREEMEM(asorted); - FREEMEM(bsorted); - return ret; - } - } - - FREEMEM(asorted); - FREEMEM(bsorted); - - if(idx < b->count) /* more elements in b */ - return -1; /* a is shorter, so put it first */ - if(idx < a->count) return 1; - } else if(!a) { - return -1; - } else if(!b) { - return 1; - } - - return 0; -} - - -asn_TYPE_operation_t asn_OP_SET_OF = { - SET_OF_free, - SET_OF_print, - SET_OF_compare, - SET_OF_decode_ber, - SET_OF_encode_der, - SET_OF_decode_xer, - SET_OF_encode_xer, -#ifdef ASN_DISABLE_OER_SUPPORT - 0, - 0, -#else - SET_OF_decode_oer, - SET_OF_encode_oer, -#endif -#ifdef ASN_DISABLE_PER_SUPPORT - 0, - 0, -#else - SET_OF_decode_uper, - SET_OF_encode_uper, -#endif /* ASN_DISABLE_PER_SUPPORT */ - SET_OF_random_fill, - 0 /* Use generic outmost tag fetcher */ -}; - - -asn_random_fill_result_t -SET_OF_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, - const asn_encoding_constraints_t *constraints, - size_t max_length) { - const asn_SET_OF_specifics_t *specs = - (const asn_SET_OF_specifics_t *)td->specifics; - asn_random_fill_result_t res_ok = {ARFILL_OK, 0}; - asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; - asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; - const asn_TYPE_member_t *elm = td->elements; - void *st = *sptr; - long max_elements = 5; - long slb = 0; /* Lower size bound */ - long sub = 0; /* Upper size bound */ - size_t rnd_len; - - if(max_length == 0) return result_skipped; - - if(st == NULL) { - st = (*sptr = CALLOC(1, specs->struct_size)); - if(st == NULL) { - return result_failed; - } - } - - switch(asn_random_between(0, 6)) { - case 0: max_elements = 0; break; - case 1: max_elements = 1; break; - case 2: max_elements = 5; break; - case 3: max_elements = max_length; break; - case 4: max_elements = max_length / 2; break; - case 5: max_elements = max_length / 4; break; - default: break; - } - sub = slb + max_elements; - - if(!constraints || !constraints->per_constraints) - constraints = &td->encoding_constraints; - if(constraints->per_constraints) { - const asn_per_constraint_t *pc = &constraints->per_constraints->size; - if(pc->flags & APC_SEMI_CONSTRAINED) { - slb = pc->lower_bound; - sub = pc->lower_bound + max_elements; - } else if(pc->flags & APC_CONSTRAINED) { - slb = pc->lower_bound; - sub = pc->upper_bound; - if(sub - slb > max_elements) sub = slb + max_elements; - } - } - - /* Bias towards edges of allowed space */ - switch(asn_random_between(-1, 4)) { - default: - case -1: - /* Prepare lengths somewhat outside of constrained range. */ - if(constraints->per_constraints - && (constraints->per_constraints->size.flags & APC_EXTENSIBLE)) { - switch(asn_random_between(0, 5)) { - default: - case 0: - rnd_len = 0; - break; - case 1: - if(slb > 0) { - rnd_len = slb - 1; - } else { - rnd_len = 0; - } - break; - case 2: - rnd_len = asn_random_between(0, slb); - break; - case 3: - if(sub < (ssize_t)max_length) { - rnd_len = sub + 1; - } else { - rnd_len = max_length; - } - break; - case 4: - if(sub < (ssize_t)max_length) { - rnd_len = asn_random_between(sub + 1, max_length); - } else { - rnd_len = max_length; - } - break; - case 5: - rnd_len = max_length; - break; - } - break; - } - /* Fall through */ - case 0: - rnd_len = asn_random_between(slb, sub); - break; - case 1: - if(slb < sub) { - rnd_len = asn_random_between(slb + 1, sub); - break; - } - /* Fall through */ - case 2: - rnd_len = asn_random_between(slb, slb); - break; - case 3: - if(slb < sub) { - rnd_len = asn_random_between(slb, sub - 1); - break; - } - /* Fall through */ - case 4: - rnd_len = asn_random_between(sub, sub); - break; - } - - for(; rnd_len > 0; rnd_len--) { - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - void *ptr = 0; - asn_random_fill_result_t tmpres = elm->type->op->random_fill( - elm->type, &ptr, &elm->encoding_constraints, - (max_length > res_ok.length ? max_length - res_ok.length : 0) - / rnd_len); - switch(tmpres.code) { - case ARFILL_OK: - ASN_SET_ADD(list, ptr); - res_ok.length += tmpres.length; - break; - case ARFILL_SKIPPED: - break; - case ARFILL_FAILED: - assert(ptr == 0); - return tmpres; - } - } - - return res_ok; -} - +/* + * Copyright (c) 2003-2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_TYPE_operation_t asn_OP_SET_OF = { + SET_OF_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + SET_OF_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + SET_OF_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + SET_OF_decode_ber, + SET_OF_encode_der, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + SET_OF_decode_xer, + SET_OF_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + SET_OF_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + SET_OF_decode_oer, + SET_OF_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + SET_OF_decode_uper, + SET_OF_encode_uper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + SET_OF_decode_aper, + SET_OF_encode_aper, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + SET_OF_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; + +/* Append bytes to the above structure */ +static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) { + struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr; + + if(el_buf->length + size > el_buf->allocated_size) { + size_t new_size = el_buf->allocated_size ? el_buf->allocated_size : 8; + void *p; + + do { + new_size <<= 2; + } while(el_buf->length + size > new_size); + + p = REALLOC(el_buf->buf, new_size); + if(p) { + el_buf->buf = p; + el_buf->allocated_size = new_size; + } else { + return -1; + } + } + + memcpy(el_buf->buf + el_buf->length, buffer, size); + + el_buf->length += size; + return 0; +} + +static void assert_unused_bits(const struct _el_buffer* p) { + if(p->length) { + assert((p->buf[p->length-1] & ~(0xff << p->bits_unused)) == 0); + } else { + assert(p->bits_unused == 0); + } +} + +static int _el_buf_cmp(const void *ap, const void *bp) { + const struct _el_buffer *a = (const struct _el_buffer *)ap; + const struct _el_buffer *b = (const struct _el_buffer *)bp; + size_t common_len; + int ret = 0; + + if(a->length < b->length) + common_len = a->length; + else + common_len = b->length; + + if (a->buf && b->buf) { + ret = memcmp(a->buf, b->buf, common_len); + } + if(ret == 0) { + if(a->length < b->length) + ret = -1; + else if(a->length > b->length) + ret = 1; + /* Ignore unused bits. */ + assert_unused_bits(a); + assert_unused_bits(b); + } + + return ret; +} + +void +SET_OF__encode_sorted_free(struct _el_buffer *el_buf, size_t count) { + size_t i; + + for(i = 0; i < count; i++) { + FREEMEM(el_buf[i].buf); + } + + FREEMEM(el_buf); +} + +struct _el_buffer * +SET_OF__encode_sorted(const asn_TYPE_member_t *elm, + const asn_anonymous_set_ *list, + enum SET_OF__encode_method method) { + struct _el_buffer *encoded_els; + int edx; + + encoded_els = + (struct _el_buffer *)CALLOC(list->count, sizeof(encoded_els[0])); + if(encoded_els == NULL) { + return NULL; + } + + /* + * Encode all members. + */ + for(edx = 0; edx < list->count; edx++) { + const void *memb_ptr = list->array[edx]; + struct _el_buffer *encoding_el = &encoded_els[edx]; + asn_enc_rval_t erval = {0,0,0}; + + if(!memb_ptr) break; + + /* + * Encode the member into the prepared space. + */ + switch(method) { +#if !defined(ASN_DISABLE_BER_SUPPORT) + case SOES_DER: + erval = elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag, + _el_addbytes, encoding_el); + break; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + case SOES_CUPER: + erval = uper_encode(elm->type, + elm->encoding_constraints.per_constraints, + memb_ptr, _el_addbytes, encoding_el); + if(erval.encoded != -1) { + size_t extra_bits = erval.encoded % 8; + assert(encoding_el->length == (size_t)(erval.encoded + 7) / 8); + encoding_el->bits_unused = (8 - extra_bits) & 0x7; + } + break; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + case SOES_CAPER: + erval = aper_encode(elm->type, + elm->encoding_constraints.per_constraints, + memb_ptr, _el_addbytes, encoding_el); + if(erval.encoded != -1) { + size_t extra_bits = erval.encoded % 8; + assert(encoding_el->length == (size_t)(erval.encoded + 7) / 8); + encoding_el->bits_unused = (8 - extra_bits) & 0x7; + } + break; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + + default: + assert(!"Unreachable"); + break; + } + if(erval.encoded < 0) break; + } + + if(edx == list->count) { + /* + * Sort the encoded elements according to their encoding. + */ + qsort(encoded_els, list->count, sizeof(encoded_els[0]), _el_buf_cmp); + + return encoded_els; + } else { + SET_OF__encode_sorted_free(encoded_els, edx); + return NULL; + } +} + +void +SET_OF_free(const asn_TYPE_descriptor_t *td, void *ptr, + enum asn_struct_free_method method) { + if(td && ptr) { + const asn_SET_OF_specifics_t *specs; + asn_TYPE_member_t *elm = td->elements; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); + asn_struct_ctx_t *ctx; /* Decoder context */ + int i; + + /* + * Could not use set_of_empty() because of (*free) + * incompatibility. + */ + for(i = 0; i < list->count; i++) { + void *memb_ptr = list->array[i]; + if(memb_ptr) + ASN_STRUCT_FREE(*elm->type, memb_ptr); + } + list->count = 0; /* No meaningful elements left */ + + asn_set_empty(list); /* Remove (list->array) */ + + specs = (const asn_SET_OF_specifics_t *)td->specifics; + ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); + if(ctx->ptr) { + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + } + + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(ptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(ptr, 0, specs->struct_size); + break; + } + } +} + +int +SET_OF_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const asn_TYPE_member_t *elm = td->elements; + asn_constr_check_f *constr; + const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); + int i; + + if(!sptr) { + ASN__CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + constr = elm->encoding_constraints.general_constraints; + if(!constr) constr = elm->type->encoding_constraints.general_constraints; + + /* + * Iterate over the members of an array. + * Validate each in turn, until one fails. + */ + for(i = 0; i < list->count; i++) { + const void *memb_ptr = list->array[i]; + int ret; + + if(!memb_ptr) continue; + + ret = constr(elm->type, memb_ptr, ctfailcb, app_key); + if(ret) return ret; + } + + return 0; +} + +struct comparable_ptr { + const asn_TYPE_descriptor_t *td; + const void *sptr; +}; + +static int +SET_OF__compare_cb(const void *aptr, const void *bptr) { + const struct comparable_ptr *a = aptr; + const struct comparable_ptr *b = bptr; + assert(a->td == b->td); + return a->td->op->compare_struct(a->td, a->sptr, b->sptr); +} + +int +SET_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr, + const void *bptr) { + const asn_anonymous_set_ *a = _A_CSET_FROM_VOID(aptr); + const asn_anonymous_set_ *b = _A_CSET_FROM_VOID(bptr); + + if(a && b) { + struct comparable_ptr *asorted; + struct comparable_ptr *bsorted; + ssize_t common_length; + ssize_t idx; + + if(a->count == 0) { + if(b->count) return -1; + return 0; + } else if(b->count == 0) { + return 1; + } + + asorted = MALLOC(a->count * sizeof(asorted[0])); + bsorted = MALLOC(b->count * sizeof(bsorted[0])); + if(!asorted || !bsorted) { + FREEMEM(asorted); + FREEMEM(bsorted); + return -1; + } + + for(idx = 0; idx < a->count; idx++) { + asorted[idx].td = td->elements->type; + asorted[idx].sptr = a->array[idx]; + } + + for(idx = 0; idx < b->count; idx++) { + bsorted[idx].td = td->elements->type; + bsorted[idx].sptr = b->array[idx]; + } + + qsort(asorted, a->count, sizeof(asorted[0]), SET_OF__compare_cb); + qsort(bsorted, b->count, sizeof(bsorted[0]), SET_OF__compare_cb); + + common_length = (a->count < b->count ? a->count : b->count); + for(idx = 0; idx < common_length; idx++) { + int ret = td->elements->type->op->compare_struct( + td->elements->type, asorted[idx].sptr, bsorted[idx].sptr); + if(ret) { + FREEMEM(asorted); + FREEMEM(bsorted); + return ret; + } + } + + FREEMEM(asorted); + FREEMEM(bsorted); + + if(idx < b->count) /* more elements in b */ + return -1; /* a is shorter, so put it first */ + if(idx < a->count) return 1; + } else if(!a) { + return -1; + } else if(!b) { + return 1; + } + + return 0; +} diff --git a/certgen/asncodec/constr_SET_OF.h b/certgen/asncodec/constr_SET_OF.h index 9180733..0e9dd39 100644 --- a/certgen/asncodec/constr_SET_OF.h +++ b/certgen/asncodec/constr_SET_OF.h @@ -1,47 +1,102 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef CONSTR_SET_OF_H -#define CONSTR_SET_OF_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct asn_SET_OF_specifics_s { - /* - * Target structure description. - */ - unsigned struct_size; /* Size of the target structure. */ - unsigned ctx_offset; /* Offset of the asn_struct_ctx_t member */ - - /* XER-specific stuff */ - int as_XMLValueList; /* The member type must be encoded like this */ -} asn_SET_OF_specifics_t; - -/* - * A set specialized functions dealing with the SET OF type. - */ -asn_struct_free_f SET_OF_free; -asn_struct_print_f SET_OF_print; -asn_struct_compare_f SET_OF_compare; -asn_constr_check_f SET_OF_constraint; -ber_type_decoder_f SET_OF_decode_ber; -der_type_encoder_f SET_OF_encode_der; -xer_type_decoder_f SET_OF_decode_xer; -xer_type_encoder_f SET_OF_encode_xer; -oer_type_decoder_f SET_OF_decode_oer; -oer_type_encoder_f SET_OF_encode_oer; -per_type_decoder_f SET_OF_decode_uper; -per_type_encoder_f SET_OF_encode_uper; -asn_random_fill_f SET_OF_random_fill; -extern asn_TYPE_operation_t asn_OP_SET_OF; - -#ifdef __cplusplus -} -#endif - -#endif /* CONSTR_SET_OF_H */ +/*- + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef CONSTR_SET_OF_H +#define CONSTR_SET_OF_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct asn_SET_OF_specifics_s { + /* + * Target structure description. + */ + unsigned struct_size; /* Size of the target structure. */ + unsigned ctx_offset; /* Offset of the asn_struct_ctx_t member */ + + /* XER-specific stuff */ + int as_XMLValueList; /* The member type must be encoded like this */ +} asn_SET_OF_specifics_t; + +/* + * A set specialized functions dealing with the SET OF type. + */ +asn_struct_free_f SET_OF_free; + +#if !defined(ASN_DISABLE_PRINT_SUPPORT) +asn_struct_print_f SET_OF_print; +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + +asn_struct_compare_f SET_OF_compare; + +asn_constr_check_f SET_OF_constraint; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +ber_type_decoder_f SET_OF_decode_ber; +der_type_encoder_f SET_OF_encode_der; +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +xer_type_decoder_f SET_OF_decode_xer; +xer_type_encoder_f SET_OF_encode_xer; +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +jer_type_encoder_f SET_OF_encode_jer; +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +oer_type_decoder_f SET_OF_decode_oer; +oer_type_encoder_f SET_OF_encode_oer; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) +per_type_decoder_f SET_OF_decode_uper; +per_type_encoder_f SET_OF_encode_uper; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) +per_type_decoder_f SET_OF_decode_aper; +per_type_encoder_f SET_OF_encode_aper; +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +asn_random_fill_f SET_OF_random_fill; +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +extern asn_TYPE_operation_t asn_OP_SET_OF; + +/* + * Internally visible buffer holding a single encoded element. + */ +struct _el_buffer { + uint8_t *buf; + size_t length; + size_t allocated_size; + unsigned bits_unused; +}; + +enum SET_OF__encode_method { + SOES_DER, /* Distinguished Encoding Rules */ + SOES_CUPER, /* Canonical Unaligned Packed Encoding Rules */ + SOES_CAPER /* Canonical Aligned Packed Encoding Rules */ +}; + +struct _el_buffer * SET_OF__encode_sorted( + const asn_TYPE_member_t *elm, + const asn_anonymous_set_ *list, + enum SET_OF__encode_method method); + +void SET_OF__encode_sorted_free( + struct _el_buffer *el_buf, + size_t count); + +#ifdef __cplusplus +} +#endif + +#endif /* CONSTR_SET_OF_H */ diff --git a/certgen/asncodec/constr_SET_OF_oer.c b/certgen/asncodec/constr_SET_OF_oer.c index 5a368ba..a0f0140 100644 --- a/certgen/asncodec/constr_SET_OF_oer.c +++ b/certgen/asncodec/constr_SET_OF_oer.c @@ -1,285 +1,281 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN_DISABLE_OER_SUPPORT - -#include -#include -#include -#include - -/* - * This macro "eats" the part of the buffer which is definitely "consumed", - * i.e. was correctly converted into local representation or rightfully skipped. - */ -#undef ADVANCE -#define ADVANCE(num_bytes) \ - do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#define NEXT_PHASE(ctx) \ - do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) -#undef SET_PHASE -#define SET_PHASE(ctx, value) \ - do { \ - ctx->phase = value; \ - ctx->step = 0; \ - } while(0) - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) \ - do { \ - asn_dec_rval_t rval; \ - rval.code = _code; \ - rval.consumed = consumed_myself; \ - return rval; \ - } while(0) - -/* - * The SEQUENCE OF and SET OF values utilize a "quantity field". - * It is is a pointless combination of #8.6 (length determinant, capable - * of encoding tiny and huge numbers in the shortest possible number of octets) - * and the variable sized integer. What could have been encoded by #8.6 alone - * is required to be encoded by #8.6 followed by that number of unsigned octets. - * This doesn't make too much sense. It seems that the original version of OER - * standard have been using the unconstrained unsigned integer as a quantity - * field, and this legacy have gone through ISO/ITU-T standardization process. - */ -static ssize_t -oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) { - const uint8_t *b; - const uint8_t *bend; - size_t len = 0; - size_t qty; - - ssize_t len_len = oer_fetch_length(ptr, size, &len); - if(len_len <= 0) { - *qty_r = 0; - return len_len; - } - - if((len_len + len) > size) { - *qty_r = 0; - return 0; - } - - b = (const uint8_t *)ptr + len_len; - bend = b + len; - - /* Skip the leading 0-bytes */ - for(; b < bend && *b == 0; b++) { - } - - if((bend - b) > (ssize_t)sizeof(size_t)) { - /* Length is not representable by the native size_t type */ - *qty_r = 0; - return -1; - } - - for(qty = 0; b < bend; b++) { - qty = (qty << 8) + *b; - } - - if(qty > RSIZE_MAX) { /* A bit of C11 validation */ - *qty_r = 0; - return -1; - } - - *qty_r = qty; - assert((size_t)len_len + len == (size_t)(bend - (const uint8_t *)ptr)); - return len_len + len; -} - -asn_dec_rval_t -SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **struct_ptr, - const void *ptr, size_t size) { - const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; - asn_dec_rval_t rval = {RC_OK, 0}; - void *st = *struct_ptr; /* Target structure */ - asn_struct_ctx_t *ctx; /* Decoder context */ - size_t consumed_myself = 0; /* Consumed bytes from ptr. */ - - (void)constraints; - - if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) - ASN__DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Start to parse where left previously. - */ - switch(ctx->phase) { - case 0: { - /* - * Fetch number of elements to decode. - */ - size_t length = 0; - size_t len_size = oer_fetch_quantity(ptr, size, &length); - switch(len_size) { - case 0: - RETURN(RC_WMORE); - case -1: - RETURN(RC_FAIL); - default: - ADVANCE(len_size); - ctx->left = length; - } - } - NEXT_PHASE(ctx); - /* FALL THROUGH */ - case 1: { - /* Decode components of the extension root */ - asn_TYPE_member_t *elm = td->elements; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - const void *base_ptr = ptr; - ber_tlv_len_t base_ctx_left = ctx->left; - - assert(td->elements_count == 1); - - ASN_DEBUG("OER SET OF %s Decoding PHASE 1", td->name); - - for(; ctx->left > 0; ctx->left--) { - asn_dec_rval_t rv = elm->type->op->oer_decoder( - opt_codec_ctx, elm->type, - elm->encoding_constraints.oer_constraints, &ctx->ptr, ptr, - size); - ADVANCE(rv.consumed); - switch(rv.code) { - case RC_OK: - if(ASN_SET_ADD(list, ctx->ptr) != 0) { - RETURN(RC_FAIL); - } else { - ctx->ptr = 0; - /* - * This check is to avoid compression bomb with - * specs like SEQUENCE/SET OF NULL which don't - * consume data at all. - */ - if(rv.consumed == 0 && base_ptr == ptr - && (base_ctx_left - ctx->left) > 200) { - ASN__DECODE_FAILED; - } - break; - } - case RC_WMORE: - RETURN(RC_WMORE); - case RC_FAIL: - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - SET_PHASE(ctx, 3); - RETURN(RC_FAIL); - } - } - /* Decoded decently. */ - NEXT_PHASE(ctx); - } - /* Fall through */ - case 2: - /* Ignore fully decoded */ - assert(ctx->left == 0); - RETURN(RC_OK); - case 3: - /* Failed to decode. */ - RETURN(RC_FAIL); - } - - return rval; -} - -static ssize_t -oer_put_quantity(size_t qty, asn_app_consume_bytes_f *cb, void *app_key) { - uint8_t buf[1 + sizeof(size_t)]; - uint8_t *b = &buf[sizeof(size_t)]; /* Last addressable */ - size_t encoded; - - do { - *b-- = qty; - qty >>= 8; - } while(qty); - - *b = sizeof(buf) - (b-buf) - 1; - encoded = sizeof(buf) - (b-buf); - if(cb(b, encoded, app_key) < 0) - return -1; - return encoded; -} - -/* - * Encode as Canonical OER. - */ -asn_enc_rval_t -SET_OF_encode_oer(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - const asn_TYPE_member_t *elm; - const asn_anonymous_set_ *list; - size_t computed_size = 0; - ssize_t qty_len; - int n; - - (void)constraints; - - if(!sptr) ASN__ENCODE_FAILED; - - elm = td->elements; - list = _A_CSET_FROM_VOID(sptr); - - qty_len = oer_put_quantity(list->count, cb, app_key); - if(qty_len < 0) { - ASN__ENCODE_FAILED; - } - computed_size += qty_len; - - for(n = 0; n < list->count; n++) { - void *memb_ptr = list->array[n]; - asn_enc_rval_t er; - er = elm->type->op->oer_encoder( - elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb, - app_key); - if(er.encoded < 0) { - return er; - } else { - computed_size += er.encoded; - } - } - - { - asn_enc_rval_t erval; - erval.encoded = computed_size; - ASN__ENCODED_OK(erval); - } -} - -#endif /* ASN_DISABLE_OER_SUPPORT */ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include +#include + +/* + * This macro "eats" the part of the buffer which is definitely "consumed", + * i.e. was correctly converted into local representation or rightfully skipped. + */ +#undef ADVANCE +#define ADVANCE(num_bytes) \ + do { \ + size_t num = num_bytes; \ + ptr = ((const char *)ptr) + num; \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Switch to the next phase of parsing. + */ +#undef NEXT_PHASE +#define NEXT_PHASE(ctx) \ + do { \ + ctx->phase++; \ + ctx->step = 0; \ + } while(0) +#undef SET_PHASE +#define SET_PHASE(ctx, value) \ + do { \ + ctx->phase = value; \ + ctx->step = 0; \ + } while(0) + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) \ + do { \ + asn_dec_rval_t _rval; \ + _rval.code = _code; \ + _rval.consumed = consumed_myself; \ + return _rval; \ + } while(0) + +/* + * The SEQUENCE OF and SET OF values utilize a "quantity field". + * It is is a pointless combination of #8.6 (length determinant, capable + * of encoding tiny and huge numbers in the shortest possible number of octets) + * and the variable sized integer. What could have been encoded by #8.6 alone + * is required to be encoded by #8.6 followed by that number of unsigned octets. + * This doesn't make too much sense. It seems that the original version of OER + * standard have been using the unconstrained unsigned integer as a quantity + * field, and this legacy have gone through ISO/ITU-T standardization process. + */ +static ssize_t +oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) { + const uint8_t *b; + const uint8_t *bend; + size_t len = 0; + size_t qty; + + ssize_t len_len = oer_fetch_length(ptr, size, &len); + if(len_len <= 0) { + *qty_r = 0; + return len_len; + } + + if((len_len + len) > size) { + *qty_r = 0; + return 0; + } + + b = (const uint8_t *)ptr + len_len; + bend = b + len; + + /* Skip the leading 0-bytes */ + for(; b < bend && *b == 0; b++) { + } + + if((bend - b) > (ssize_t)sizeof(size_t)) { + /* Length is not representable by the native size_t type */ + *qty_r = 0; + return -1; + } + + for(qty = 0; b < bend; b++) { + qty = (qty << 8) + *b; + } + + if(qty > RSIZE_MAX) { /* A bit of C11 validation */ + *qty_r = 0; + return -1; + } + + *qty_r = qty; + assert((size_t)len_len + len == (size_t)(bend - (const uint8_t *)ptr)); + return len_len + len; +} + +asn_dec_rval_t +SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **struct_ptr, + const void *ptr, size_t size) { + const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; + asn_dec_rval_t rval = {RC_OK, 0}; + void *st = *struct_ptr; /* Target structure */ + asn_struct_ctx_t *ctx; /* Decoder context */ + size_t consumed_myself = 0; /* Consumed bytes from ptr. */ + + (void)constraints; + + if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx)) + ASN__DECODE_FAILED; + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) { + RETURN(RC_FAIL); + } + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Start to parse where left previously. + */ + switch(ctx->phase) { + case 0: { + /* + * Fetch number of elements to decode. + */ + size_t length = 0; + size_t len_size = oer_fetch_quantity(ptr, size, &length); + switch(len_size) { + case 0: + RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + default: + ADVANCE(len_size); + ctx->left = length; + } + } + NEXT_PHASE(ctx); + /* FALL THROUGH */ + case 1: { + /* Decode components of the extension root */ + asn_TYPE_member_t *elm = td->elements; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); + const void *base_ptr = ptr; + ber_tlv_len_t base_ctx_left = ctx->left; + + assert(td->elements_count == 1); + + ASN_DEBUG("OER SET OF %s Decoding PHASE 1", td->name); + + for(; ctx->left > 0; ctx->left--) { + asn_dec_rval_t rv = elm->type->op->oer_decoder( + opt_codec_ctx, elm->type, + elm->encoding_constraints.oer_constraints, &ctx->ptr, ptr, + size); + ADVANCE(rv.consumed); + switch(rv.code) { + case RC_OK: + if(ASN_SET_ADD(list, ctx->ptr) != 0) { + RETURN(RC_FAIL); + } else { + ctx->ptr = 0; + /* + * This check is to avoid compression bomb with + * specs like SEQUENCE/SET OF NULL which don't + * consume data at all. + */ + if(rv.consumed == 0 && base_ptr == ptr + && (base_ctx_left - ctx->left) > 200) { + ASN__DECODE_FAILED; + } + break; + } + case RC_WMORE: + RETURN(RC_WMORE); + case RC_FAIL: + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + SET_PHASE(ctx, 3); + RETURN(RC_FAIL); + } + } + /* Decoded decently. */ + NEXT_PHASE(ctx); + } + /* Fall through */ + case 2: + /* Ignore fully decoded */ + assert(ctx->left == 0); + RETURN(RC_OK); + case 3: + /* Failed to decode. */ + RETURN(RC_FAIL); + } + + return rval; +} + +static ssize_t +oer_put_quantity(size_t qty, asn_app_consume_bytes_f *cb, void *app_key) { + uint8_t buf[1 + sizeof(size_t)]; + uint8_t *b = &buf[sizeof(size_t)]; /* Last addressable */ + size_t encoded; + + do { + *b-- = qty; + qty >>= 8; + } while(qty); + + *b = sizeof(buf) - (b-buf) - 1; + encoded = sizeof(buf) - (b-buf); + if(cb(b, encoded, app_key) < 0) + return -1; + return encoded; +} + +/* + * Encode as Canonical OER. + */ +asn_enc_rval_t +SET_OF_encode_oer(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + const asn_TYPE_member_t *elm; + const asn_anonymous_set_ *list; + size_t computed_size = 0; + ssize_t qty_len; + int n; + + (void)constraints; + + if(!sptr) ASN__ENCODE_FAILED; + + elm = td->elements; + list = _A_CSET_FROM_VOID(sptr); + + qty_len = oer_put_quantity(list->count, cb, app_key); + if(qty_len < 0) { + ASN__ENCODE_FAILED; + } + computed_size += qty_len; + + for(n = 0; n < list->count; n++) { + void *memb_ptr = list->array[n]; + asn_enc_rval_t er = {0,0,0}; + er = elm->type->op->oer_encoder( + elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb, + app_key); + if(er.encoded < 0) { + return er; + } else { + computed_size += er.encoded; + } + } + + { + asn_enc_rval_t erval = {0,0,0}; + erval.encoded = computed_size; + ASN__ENCODED_OK(erval); + } +} diff --git a/certgen/asncodec/constr_SET_OF_print.c b/certgen/asncodec/constr_SET_OF_print.c new file mode 100644 index 0000000..748dba7 --- /dev/null +++ b/certgen/asncodec/constr_SET_OF_print.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +int +SET_OF_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_TYPE_member_t *elm = td->elements; + const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); + int ret; + int i; + + if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; + + /* Dump preamble */ + if(cb(td->name, strlen(td->name), app_key) < 0 + || cb(" ::= {", 6, app_key) < 0) + return -1; + + for(i = 0; i < list->count; i++) { + const void *memb_ptr = list->array[i]; + if(!memb_ptr) continue; + + _i_INDENT(1); + + ret = elm->type->op->print_struct(elm->type, memb_ptr, + ilevel + 1, cb, app_key); + if(ret) return ret; + } + + ilevel--; + _i_INDENT(1); + + return (cb("}", 1, app_key) < 0) ? -1 : 0; +} diff --git a/certgen/asncodec/constr_SET_OF_xer.c b/certgen/asncodec/constr_SET_OF_xer.c new file mode 100644 index 0000000..1d97e5b --- /dev/null +++ b/certgen/asncodec/constr_SET_OF_xer.c @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) \ + do { \ + rval.code = _code; \ + rval.consumed = consumed_myself; \ + return rval; \ + } while(0) + +#undef XER_ADVANCE +#define XER_ADVANCE(num_bytes) \ + do { \ + size_t num = num_bytes; \ + buf_ptr = ((const char *)buf_ptr) + num; \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Decode the XER (XML) data. + */ +asn_dec_rval_t +SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **struct_ptr, + const char *opt_mname, const void *buf_ptr, size_t size) { + /* + * Bring closer parts of structure description. + */ + const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; + const asn_TYPE_member_t *element = td->elements; + const char *elm_tag; + const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; + + /* + * ... and parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + asn_dec_rval_t rval = {RC_OK, 0}; /* Return value from a decoder */ + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) RETURN(RC_FAIL); + } + + /* Which tag is expected for the downstream */ + if(specs->as_XMLValueList) { + elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; + } else { + elm_tag = (*element->name) + ? element->name : element->type->xml_tag; + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Phases of XER/XML processing: + * Phase 0: Check that the opening tag matches our expectations. + * Phase 1: Processing body and reacting on closing tag. + * Phase 2: Processing inner type. + */ + for(; ctx->phase <= 2;) { + pxer_chunk_type_e ch_type; /* XER chunk type */ + ssize_t ch_size; /* Chunk size */ + xer_check_tag_e tcv; /* Tag check value */ + + /* + * Go inside the inner member of a set. + */ + if(ctx->phase == 2) { + asn_dec_rval_t tmprval = {RC_OK, 0}; + + /* Invoke the inner type decoder, m.b. multiple times */ + ASN_DEBUG("XER/SET OF element [%s]", elm_tag); + tmprval = element->type->op->xer_decoder(opt_codec_ctx, + element->type, + &ctx->ptr, elm_tag, + buf_ptr, size); + if(tmprval.code == RC_OK) { + asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); + if(ASN_SET_ADD(list, ctx->ptr) != 0) + RETURN(RC_FAIL); + ctx->ptr = 0; + XER_ADVANCE(tmprval.consumed); + } else { + XER_ADVANCE(tmprval.consumed); + RETURN(tmprval.code); + } + ctx->phase = 1; /* Back to body processing */ + ASN_DEBUG("XER/SET OF phase => %d", ctx->phase); + /* Fall through */ + } + + /* + * Get the next part of the XML stream. + */ + ch_size = xer_next_token(&ctx->context, + buf_ptr, size, &ch_type); + if(ch_size == -1) { + RETURN(RC_FAIL); + } else { + switch(ch_type) { + case PXER_WMORE: + RETURN(RC_WMORE); + case PXER_COMMENT: /* Got XML comment */ + case PXER_TEXT: /* Ignore free-standing text */ + XER_ADVANCE(ch_size); /* Skip silently */ + continue; + case PXER_TAG: + break; /* Check the rest down there */ + } + } + + tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); + ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", + tcv, ctx->phase, xml_tag); + switch(tcv) { + case XCT_CLOSING: + if(ctx->phase == 0) break; + ctx->phase = 0; + /* Fall through */ + case XCT_BOTH: + if(ctx->phase == 0) { + /* No more things to decode */ + XER_ADVANCE(ch_size); + ctx->phase = 3; /* Phase out */ + RETURN(RC_OK); + } + /* Fall through */ + case XCT_OPENING: + if(ctx->phase == 0) { + XER_ADVANCE(ch_size); + ctx->phase = 1; /* Processing body phase */ + continue; + } + /* Fall through */ + case XCT_UNKNOWN_OP: + case XCT_UNKNOWN_BO: + + ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase); + if(ctx->phase == 1) { + /* + * Process a single possible member. + */ + ctx->phase = 2; + continue; + } + /* Fall through */ + default: + break; + } + + ASN_DEBUG("Unexpected XML tag in SET OF"); + break; + } + + ctx->phase = 3; /* "Phase out" on hard failure */ + RETURN(RC_FAIL); +} + +typedef struct xer_tmp_enc_s { + void *buffer; + size_t offset; + size_t size; +} xer_tmp_enc_t; + +static int +SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) { + xer_tmp_enc_t *t = (xer_tmp_enc_t *)key; + if(t->offset + size >= t->size) { + size_t newsize = (t->size << 2) + size; + void *p = REALLOC(t->buffer, newsize); + if(!p) return -1; + t->buffer = p; + t->size = newsize; + } + memcpy((char *)t->buffer + t->offset, buffer, size); + t->offset += size; + return 0; +} + +static int +SET_OF_xer_order(const void *aptr, const void *bptr) { + const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr; + const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr; + size_t minlen = a->offset; + int ret; + if(b->offset < minlen) minlen = b->offset; + /* Well-formed UTF-8 has this nice lexicographical property... */ + ret = memcmp(a->buffer, b->buffer, minlen); + if(ret != 0) return ret; + if(a->offset == b->offset) + return 0; + if(a->offset == minlen) + return -1; + return 1; +} + +asn_enc_rval_t +SET_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, + void *app_key) { + asn_enc_rval_t er = {0,0,0}; + const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; + const asn_TYPE_member_t *elm = td->elements; + const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); + const char *mname = specs->as_XMLValueList + ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); + size_t mlen = mname ? strlen(mname) : 0; + int xcan = (flags & XER_F_CANONICAL); + xer_tmp_enc_t *encs = 0; + size_t encs_count = 0; + void *original_app_key = app_key; + asn_app_consume_bytes_f *original_cb = cb; + int i; + + if(!sptr) ASN__ENCODE_FAILED; + + if(xcan) { + encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); + if(!encs) ASN__ENCODE_FAILED; + cb = SET_OF_encode_xer_callback; + } + + er.encoded = 0; + + for(i = 0; i < list->count; i++) { + asn_enc_rval_t tmper = {0,0,0}; + + void *memb_ptr = list->array[i]; + if(!memb_ptr) continue; + + if(encs) { + memset(&encs[encs_count], 0, sizeof(encs[0])); + app_key = &encs[encs_count]; + encs_count++; + } + + if(mname) { + if(!xcan) ASN__TEXT_INDENT(1, ilevel); + ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); + } + + if(!xcan && specs->as_XMLValueList == 1) + ASN__TEXT_INDENT(1, ilevel + 1); + tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, + ilevel + (specs->as_XMLValueList != 2), + flags, cb, app_key); + if(tmper.encoded == -1) return tmper; + er.encoded += tmper.encoded; + if(tmper.encoded == 0 && specs->as_XMLValueList) { + const char *name = elm->type->xml_tag; + size_t len = strlen(name); + ASN__CALLBACK3("<", 1, name, len, "/>", 2); + } + + if(mname) { + ASN__CALLBACK3("", 1); + } + + } + + if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1); + + if(encs) { + xer_tmp_enc_t *enc = encs; + xer_tmp_enc_t *end = encs + encs_count; + ssize_t control_size = 0; + + er.encoded = 0; + cb = original_cb; + app_key = original_app_key; + qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order); + + for(; enc < end; enc++) { + ASN__CALLBACK(enc->buffer, enc->offset); + FREEMEM(enc->buffer); + enc->buffer = 0; + control_size += enc->offset; + } + assert(control_size == er.encoded); + } + + goto cleanup; +cb_failed: + ASN__ENCODE_FAILED; +cleanup: + if(encs) { + size_t n; + for(n = 0; n < encs_count; n++) { + FREEMEM(encs[n].buffer); + } + FREEMEM(encs); + } + ASN__ENCODED_OK(er); +} diff --git a/certgen/asncodec/constr_TYPE.c b/certgen/asncodec/constr_TYPE.c index cece6ce..e634e75 100644 --- a/certgen/asncodec/constr_TYPE.c +++ b/certgen/asncodec/constr_TYPE.c @@ -1,80 +1,80 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Version of the ASN.1 infrastructure shipped with compiler. - */ -int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; } - -static asn_app_consume_bytes_f _print2fp; - -/* - * Return the outmost tag of the type. - */ -ber_tlv_tag_t -asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) { - - if(tag_mode) - return tag; - - if(type_descriptor->tags_count) - return type_descriptor->tags[0]; - - return type_descriptor->op->outmost_tag(type_descriptor, struct_ptr, 0, 0); -} - -/* - * Print the target language's structure in human readable form. - */ -int -asn_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, - const void *struct_ptr) { - if(!stream) stream = stdout; - if(!td || !struct_ptr) { - errno = EINVAL; - return -1; - } - - /* Invoke type-specific printer */ - if(td->op->print_struct(td, struct_ptr, 1, _print2fp, stream)) { - return -1; - } - - /* Terminate the output */ - if(_print2fp("\n", 1, stream)) { - return -1; - } - - return fflush(stream); -} - -/* Dump the data into the specified stdio stream */ -static int -_print2fp(const void *buffer, size_t size, void *app_key) { - FILE *stream = (FILE *)app_key; - - if(fwrite(buffer, 1, size, stream) != size) - return -1; - - return 0; -} - - -/* - * Some compilers do not support variable args macros. - * This function is a replacement of ASN_DEBUG() macro. - */ -void ASN_DEBUG_f(const char *fmt, ...); -void ASN_DEBUG_f(const char *fmt, ...) { - va_list ap; - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); - va_end(ap); -} +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * Version of the ASN.1 infrastructure shipped with compiler. + */ +int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; } + +static asn_app_consume_bytes_f _print2fp; + +/* + * Return the outmost tag of the type. + */ +ber_tlv_tag_t +asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor, + const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) { + + if(tag_mode) + return tag; + + if(type_descriptor->tags_count) + return type_descriptor->tags[0]; + + return type_descriptor->op->outmost_tag(type_descriptor, struct_ptr, 0, 0); +} + +/* + * Print the target language's structure in human readable form. + */ +int +asn_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, + const void *struct_ptr) { + if(!stream) stream = stdout; + if(!td || !struct_ptr) { + errno = EINVAL; + return -1; + } + + /* Invoke type-specific printer */ + if(td->op->print_struct(td, struct_ptr, 1, _print2fp, stream)) { + return -1; + } + + /* Terminate the output */ + if(_print2fp("\n", 1, stream)) { + return -1; + } + + return fflush(stream); +} + +/* Dump the data into the specified stdio stream */ +static int +_print2fp(const void *buffer, size_t size, void *app_key) { + FILE *stream = (FILE *)app_key; + + if(fwrite(buffer, 1, size, stream) != size) + return -1; + + return 0; +} + + +/* + * Some compilers do not support variable args macros. + * This function is a replacement of ASN_DEBUG() macro. + */ +void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...); +void ASN_DEBUG_f(const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} diff --git a/certgen/asncodec/constr_TYPE.h b/certgen/asncodec/constr_TYPE.h index e29829d..2fffadf 100644 --- a/certgen/asncodec/constr_TYPE.h +++ b/certgen/asncodec/constr_TYPE.h @@ -1,260 +1,296 @@ -/* - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * This file contains the declaration structure called "ASN.1 Type Definition", - * which holds all information necessary for encoding and decoding routines. - * This structure even contains pointer to these encoding and decoding routines - * for each defined ASN.1 type. - */ -#ifndef _CONSTR_TYPE_H_ -#define _CONSTR_TYPE_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_TYPE_member_s; /* Forward declaration */ - -/* - * This type provides the context information for various ASN.1 routines, - * primarily ones doing decoding. A member _asn_ctx of this type must be - * included into certain target language's structures, such as compound types. - */ -typedef struct asn_struct_ctx_s { - short phase; /* Decoding phase */ - short step; /* Elementary step of a phase */ - int context; /* Other context information */ - void *ptr; /* Decoder-specific stuff (stack elements) */ - ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ -} asn_struct_ctx_t; - -#include /* Basic Encoding Rules decoder */ -#include /* Distinguished Encoding Rules encoder */ -#include /* Decoder of XER (XML, text) */ -#include /* Encoder into XER (XML, text) */ -#include /* Packet Encoding Rules decoder */ -#include /* Packet Encoding Rules encoder */ -#include /* Subtype constraints support */ -#include /* Random structures support */ - -#ifdef ASN_DISABLE_OER_SUPPORT -typedef void (oer_type_decoder_f)(); -typedef void (oer_type_encoder_f)(); -typedef void asn_oer_constraints_t; -#else -#include /* Octet Encoding Rules encoder */ -#include /* Octet Encoding Rules encoder */ -#endif - -/* - * Free the structure according to its specification. - * Use one of ASN_STRUCT_{FREE,RESET,CONTENTS_ONLY} macros instead. - * Do not use directly. - */ -enum asn_struct_free_method { - ASFM_FREE_EVERYTHING, /* free(struct_ptr) and underlying members */ - ASFM_FREE_UNDERLYING, /* free underlying members */ - ASFM_FREE_UNDERLYING_AND_RESET /* FREE_UNDERLYING + memset(0) */ -}; -typedef void (asn_struct_free_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, enum asn_struct_free_method); - -/* - * Free the structure including freeing the memory pointed to by ptr itself. - */ -#define ASN_STRUCT_FREE(asn_DEF, ptr) \ - (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_EVERYTHING) - -/* - * Free the memory used by the members of the structure without freeing the - * the structure pointer itself. - * ZERO-OUT the structure to the safe clean state. - * (Retaining the pointer may be useful in case the structure is allocated - * statically or arranged on the stack, yet its elements are dynamic.) - */ -#define ASN_STRUCT_RESET(asn_DEF, ptr) \ - (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING_AND_RESET) - -/* - * Free memory used by the members of the structure without freeing - * the structure pointer itself. - * (Retaining the pointer may be useful in case the structure is allocated - * statically or arranged on the stack, yet its elements are dynamic.) - * AVOID using it in the application code; - * Use a safer ASN_STRUCT_RESET() instead. - */ -#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ - (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING) - -/* - * Print the structure according to its specification. - */ -typedef int(asn_struct_print_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, - int level, /* Indentation level */ - asn_app_consume_bytes_f *callback, void *app_key); - -/* - * Compare two structs between each other. - * Returns <0 if struct_A is "smaller" than struct_B, >0 if "greater", - * and =0 if "equal to", for some type-specific, stable definition of - * "smaller", "greater" and "equal to". - */ -typedef int (asn_struct_compare_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_A, - const void *struct_B); - -/* - * Return the outmost tag of the type. - * If the type is untagged CHOICE, the dynamic operation is performed. - * NOTE: This function pointer type is only useful internally. - * Do not use it in your application. - */ -typedef ber_tlv_tag_t (asn_outmost_tag_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); -/* The instance of the above function type; used internally. */ -asn_outmost_tag_f asn_TYPE_outmost_tag; - -/* - * Fetch the desired type of the Open Type based on the - * Information Object Set driven constraints. - */ -typedef struct asn_type_selector_result_s { - const struct asn_TYPE_descriptor_s *type_descriptor; /* Type encoded. */ - unsigned presence_index; /* Associated choice variant. */ -} asn_type_selector_result_t; -typedef asn_type_selector_result_t(asn_type_selector_f)( - const struct asn_TYPE_descriptor_s *parent_type_descriptor, - const void *parent_structure_ptr); - -/* - * Generalized functions for dealing with the speciic type. - * May be directly invoked by applications. - */ -typedef struct asn_TYPE_operation_s { - asn_struct_free_f *free_struct; /* Free the structure */ - asn_struct_print_f *print_struct; /* Human readable output */ - asn_struct_compare_f *compare_struct; /* Compare two structures */ - ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ - der_type_encoder_f *der_encoder; /* Canonical DER encoder */ - xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ - xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ - oer_type_decoder_f *oer_decoder; /* Generic OER decoder */ - oer_type_encoder_f *oer_encoder; /* Canonical OER encoder */ - per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ - per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ - asn_random_fill_f *random_fill; /* Initialize with a random value */ - asn_outmost_tag_f *outmost_tag; /* */ -} asn_TYPE_operation_t; - -/* - * A constraints tuple specifying both the OER and PER constraints. - */ -typedef struct asn_encoding_constraints_s { - const struct asn_oer_constraints_s *oer_constraints; - const struct asn_per_constraints_s *per_constraints; - asn_constr_check_f *general_constraints; -} asn_encoding_constraints_t; - -/* - * The definitive description of the destination language's structure. - */ -typedef struct asn_TYPE_descriptor_s { - const char *name; /* A name of the ASN.1 type. "" in some cases. */ - const char *xml_tag; /* Name used in XML tag */ - - /* - * Generalized functions for dealing with the specific type. - * May be directly invoked by applications. - */ - asn_TYPE_operation_t *op; - - /*********************************************************************** - * Internally useful members. Not to be used by applications directly. * - **********************************************************************/ - - /* - * Tags that are expected to occur. - */ - const ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ - unsigned tags_count; /* Number of tags which are expected */ - const ber_tlv_tag_t *all_tags; /* Every tag for BER/containment */ - unsigned all_tags_count; /* Number of tags */ - - /* OER, PER, and general constraints */ - asn_encoding_constraints_t encoding_constraints; - - /* - * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE). - */ - struct asn_TYPE_member_s *elements; - unsigned elements_count; - - /* - * Additional information describing the type, used by appropriate - * functions above. - */ - const void *specifics; -} asn_TYPE_descriptor_t; - -/* - * This type describes an element of the constructed type, - * i.e. SEQUENCE, SET, CHOICE, etc. - */ - enum asn_TYPE_flags_e { - ATF_NOFLAGS, - ATF_POINTER = 0x01, /* Represented by the pointer */ - ATF_OPEN_TYPE = 0x02, /* Open Type */ - ATF_ANY_TYPE = 0x04 /* ANY type (deprecated!) */ - }; -typedef struct asn_TYPE_member_s { - enum asn_TYPE_flags_e flags; /* Element's presentation flags */ - unsigned optional; /* Following optional members, including current */ - unsigned memb_offset; /* Offset of the element */ - ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ - int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ - asn_TYPE_descriptor_t *type; /* Member type descriptor */ - asn_type_selector_f *type_selector; /* IoS runtime type selector */ - asn_encoding_constraints_t encoding_constraints; - int (*default_value_cmp)(const void *sptr); /* Compare DEFAULT */ - int (*default_value_set)(void **sptr); /* Set DEFAULT */ - const char *name; /* ASN.1 identifier of the element */ -} asn_TYPE_member_t; - -/* - * BER tag to element number mapping. - */ -typedef struct asn_TYPE_tag2member_s { - ber_tlv_tag_t el_tag; /* Outmost tag of the member */ - unsigned el_no; /* Index of the associated member, base 0 */ - int toff_first; /* First occurence of the el_tag, relative */ - int toff_last; /* Last occurence of the el_tag, relative */ -} asn_TYPE_tag2member_t; - -/* - * This function prints out the contents of the target language's structure - * (struct_ptr) into the file pointer (stream) in human readable form. - * RETURN VALUES: - * 0: The structure is printed. - * -1: Problem dumping the structure. - * (See also xer_fprint() in xer_encoder.h) - */ -int asn_fprint(FILE *stream, /* Destination stream descriptor */ - const asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ - const void *struct_ptr); /* Structure to be printed */ - -#ifdef __cplusplus -} -#endif - -#endif /* _CONSTR_TYPE_H_ */ +/* + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * This file contains the declaration structure called "ASN.1 Type Definition", + * which holds all information necessary for encoding and decoding routines. + * This structure even contains pointer to these encoding and decoding routines + * for each defined ASN.1 type. + */ +#ifndef _CONSTR_TYPE_H_ +#define _CONSTR_TYPE_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ +struct asn_TYPE_member_s; /* Forward declaration */ + +/* + * This type provides the context information for various ASN.1 routines, + * primarily ones doing decoding. A member _asn_ctx of this type must be + * included into certain target language's structures, such as compound types. + */ +typedef struct asn_struct_ctx_s { + short phase; /* Decoding phase */ + short step; /* Elementary step of a phase */ + int context; /* Other context information */ + void *ptr; /* Decoder-specific stuff (stack elements) */ + ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ + char* start; +} asn_struct_ctx_t; + +#if !defined(ASN_DISABLE_BER_SUPPORT) +#include /* Basic Encoding Rules decoder */ +#include /* Distinguished Encoding Rules encoder */ +#else +typedef void (ber_type_decoder_f)(void); +typedef void (der_type_encoder_f)(void); +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ + +#if !defined(ASN_DISABLE_XER_SUPPORT) +#include /* Decoder of XER (XML, text) */ +#include /* Encoder into XER (XML, text) */ +#else +typedef void (xer_type_decoder_f)(void); +typedef void (xer_type_encoder_f)(void); +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ + +#if !defined(ASN_DISABLE_JER_SUPPORT) +#include /* Encoder into JER (JSON, text) */ +#else +typedef void (jer_type_encoder_f)(void); +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) +#include /* Packet Encoding Rules decoder */ +#include /* Packet Encoding Rules encoder */ +#else +typedef void (per_type_decoder_f)(void); +typedef void (per_type_encoder_f)(void); +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + +#include /* Subtype constraints support */ + +#if !defined(ASN_DISABLE_RFILL_SUPPORT) +#include /* Random structures support */ +#else +typedef void (asn_random_fill_f)(void); +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + +#if !defined(ASN_DISABLE_OER_SUPPORT) +#include /* Octet Encoding Rules encoder */ +#include /* Octet Encoding Rules encoder */ +#else +typedef void (oer_type_decoder_f)(void); +typedef void (oer_type_encoder_f)(void); +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ + +/* + * Free the structure according to its specification. + * Use one of ASN_STRUCT_{FREE,RESET,CONTENTS_ONLY} macros instead. + * Do not use directly. + */ +enum asn_struct_free_method { + ASFM_FREE_EVERYTHING, /* free(struct_ptr) and underlying members */ + ASFM_FREE_UNDERLYING, /* free underlying members */ + ASFM_FREE_UNDERLYING_AND_RESET /* FREE_UNDERLYING + memset(0) */ +}; +typedef void (asn_struct_free_f)( + const struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, enum asn_struct_free_method); + +/* + * Free the structure including freeing the memory pointed to by ptr itself. + */ +#define ASN_STRUCT_FREE(asn_DEF, ptr) \ + (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_EVERYTHING) + +/* + * Free the memory used by the members of the structure without freeing the + * the structure pointer itself. + * ZERO-OUT the structure to the safe clean state. + * (Retaining the pointer may be useful in case the structure is allocated + * statically or arranged on the stack, yet its elements are dynamic.) + */ +#define ASN_STRUCT_RESET(asn_DEF, ptr) \ + (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING_AND_RESET) + +/* + * Free memory used by the members of the structure without freeing + * the structure pointer itself. + * (Retaining the pointer may be useful in case the structure is allocated + * statically or arranged on the stack, yet its elements are dynamic.) + * AVOID using it in the application code; + * Use a safer ASN_STRUCT_RESET() instead. + */ +#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ + (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING) + +/* + * Print the structure according to its specification. + */ +typedef int(asn_struct_print_f)( + const struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, + int level, /* Indentation level */ + asn_app_consume_bytes_f *callback, void *app_key); + +/* + * Compare two structs between each other. + * Returns <0 if struct_A is "smaller" than struct_B, >0 if "greater", + * and =0 if "equal to", for some type-specific, stable definition of + * "smaller", "greater" and "equal to". + */ +typedef int (asn_struct_compare_f)( + const struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_A, + const void *struct_B); + +/* + * Return the outmost tag of the type. + * If the type is untagged CHOICE, the dynamic operation is performed. + * NOTE: This function pointer type is only useful internally. + * Do not use it in your application. + */ +typedef ber_tlv_tag_t (asn_outmost_tag_f)( + const struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); +/* The instance of the above function type; used internally. */ +asn_outmost_tag_f asn_TYPE_outmost_tag; + +/* + * Fetch the desired type of the Open Type based on the + * Information Object Set driven constraints. + */ +typedef struct asn_type_selector_result_s { + const struct asn_TYPE_descriptor_s *type_descriptor; /* Type encoded. */ + unsigned presence_index; /* Associated choice variant. */ +} asn_type_selector_result_t; +typedef asn_type_selector_result_t(asn_type_selector_f)( + const struct asn_TYPE_descriptor_s *parent_type_descriptor, + const void *parent_structure_ptr); + +/* + * Generalized functions for dealing with the speciic type. + * May be directly invoked by applications. + */ +typedef struct asn_TYPE_operation_s { + asn_struct_free_f *free_struct; /* Free the structure */ + asn_struct_print_f *print_struct; /* Human readable output */ + asn_struct_compare_f *compare_struct; /* Compare two structures */ + ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ + der_type_encoder_f *der_encoder; /* Canonical DER encoder */ + xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ + xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ + jer_type_encoder_f *jer_encoder; /* Generic JER encoder */ + oer_type_decoder_f *oer_decoder; /* Generic OER decoder */ + oer_type_encoder_f *oer_encoder; /* Canonical OER encoder */ + per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ + per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ + per_type_decoder_f *aper_decoder; /* Aligned PER decoder */ + per_type_encoder_f *aper_encoder; /* Aligned PER encoder */ + asn_random_fill_f *random_fill; /* Initialize with a random value */ + asn_outmost_tag_f *outmost_tag; /* */ +} asn_TYPE_operation_t; + +/* + * A constraints tuple specifying both the OER and PER constraints. + */ +typedef struct asn_encoding_constraints_s { +#if !defined(ASN_DISABLE_OER_SUPPORT) + const struct asn_oer_constraints_s *oer_constraints; +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + const struct asn_per_constraints_s *per_constraints; +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_constr_check_f *general_constraints; +} asn_encoding_constraints_t; + +/* + * The definitive description of the destination language's structure. + */ +typedef struct asn_TYPE_descriptor_s { + const char *name; /* A name of the ASN.1 type. "" in some cases. */ + const char *xml_tag; /* Name used in XML tag */ + + /* + * Generalized functions for dealing with the specific type. + * May be directly invoked by applications. + */ + asn_TYPE_operation_t *op; + + /*********************************************************************** + * Internally useful members. Not to be used by applications directly. * + **********************************************************************/ + + /* + * Tags that are expected to occur. + */ + const ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ + unsigned tags_count; /* Number of tags which are expected */ + const ber_tlv_tag_t *all_tags; /* Every tag for BER/containment */ + unsigned all_tags_count; /* Number of tags */ + + /* OER, PER, and general constraints */ + asn_encoding_constraints_t encoding_constraints; + + /* + * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE). + */ + struct asn_TYPE_member_s *elements; + unsigned elements_count; + + /* + * Additional information describing the type, used by appropriate + * functions above. + */ + const void *specifics; +} asn_TYPE_descriptor_t; + +/* + * This type describes an element of the constructed type, + * i.e. SEQUENCE, SET, CHOICE, etc. + */ + enum asn_TYPE_flags_e { + ATF_NOFLAGS, + ATF_POINTER = 0x01, /* Represented by the pointer */ + ATF_OPEN_TYPE = 0x02, /* Open Type */ + ATF_ANY_TYPE = 0x04 /* ANY type (deprecated!) */ + }; +typedef struct asn_TYPE_member_s { + enum asn_TYPE_flags_e flags; /* Element's presentation flags */ + unsigned optional; /* Following optional members, including current */ + unsigned memb_offset; /* Offset of the element */ + ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ + int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ + asn_TYPE_descriptor_t *type; /* Member type descriptor */ + asn_type_selector_f *type_selector; /* IoS runtime type selector */ + asn_encoding_constraints_t encoding_constraints; + int (*default_value_cmp)(const void *sptr); /* Compare DEFAULT */ + int (*default_value_set)(void **sptr); /* Set DEFAULT */ + const char *name; /* ASN.1 identifier of the element */ +} asn_TYPE_member_t; + +/* + * BER tag to element number mapping. + */ +typedef struct asn_TYPE_tag2member_s { + ber_tlv_tag_t el_tag; /* Outmost tag of the member */ + unsigned el_no; /* Index of the associated member, base 0 */ + int toff_first; /* First occurrence of the el_tag, relative */ + int toff_last; /* Last occurrence of the el_tag, relative */ +} asn_TYPE_tag2member_t; + +/* + * This function prints out the contents of the target language's structure + * (struct_ptr) into the file pointer (stream) in human readable form. + * RETURN VALUES: + * 0: The structure is printed. + * -1: Problem dumping the structure. + * (See also xer_fprint() in xer_encoder.h) + */ +int asn_fprint(FILE *stream, /* Destination stream descriptor */ + const asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ + const void *struct_ptr); /* Structure to be printed */ + +#ifdef __cplusplus +} +#endif + +#endif /* _CONSTR_TYPE_H_ */ diff --git a/certgen/asncodec/constraints.c b/certgen/asncodec/constraints.c index 984d330..72137cc 100644 --- a/certgen/asncodec/constraints.c +++ b/certgen/asncodec/constraints.c @@ -1,93 +1,94 @@ -#include -#include - -int -asn_generic_no_constraint(const asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, - asn_app_constraint_failed_f *cb, void *key) { - (void)type_descriptor; /* Unused argument */ - (void)struct_ptr; /* Unused argument */ - (void)cb; /* Unused argument */ - (void)key; /* Unused argument */ - - /* Nothing to check */ - return 0; -} - -int -asn_generic_unknown_constraint(const asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, - asn_app_constraint_failed_f *cb, void *key) { - (void)type_descriptor; /* Unused argument */ - (void)struct_ptr; /* Unused argument */ - (void)cb; /* Unused argument */ - (void)key; /* Unused argument */ - - /* Unknown how to check */ - return 0; -} - -struct errbufDesc { - const asn_TYPE_descriptor_t *failed_type; - const void *failed_struct_ptr; - char *errbuf; - size_t errlen; -}; - -static void -_asn_i_ctfailcb(void *key, const asn_TYPE_descriptor_t *td, const void *sptr, - const char *fmt, ...) { - struct errbufDesc *arg = key; - va_list ap; - ssize_t vlen; - ssize_t maxlen; - - arg->failed_type = td; - arg->failed_struct_ptr = sptr; - - maxlen = arg->errlen; - if(maxlen <= 0) - return; - - va_start(ap, fmt); - vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); - va_end(ap); - if(vlen >= maxlen) { - arg->errbuf[maxlen-1] = '\0'; /* Ensuring libc correctness */ - arg->errlen = maxlen - 1; /* Not counting termination */ - return; - } else if(vlen >= 0) { - arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ - arg->errlen = vlen; /* Not counting termination */ - } else { - /* - * The libc on this system is broken. - */ - vlen = sizeof("") - 1; - maxlen--; - arg->errlen = vlen < maxlen ? vlen : maxlen; - memcpy(arg->errbuf, "", arg->errlen); - arg->errbuf[arg->errlen] = 0; - } - - return; -} - -int -asn_check_constraints(const asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, char *errbuf, size_t *errlen) { - struct errbufDesc arg; - int ret; - - arg.failed_type = 0; - arg.failed_struct_ptr = 0; - arg.errbuf = errbuf; - arg.errlen = errlen ? *errlen : 0; - - ret = type_descriptor->encoding_constraints.general_constraints( - type_descriptor, struct_ptr, _asn_i_ctfailcb, &arg); - if(ret == -1 && errlen) *errlen = arg.errlen; - - return ret; -} - +#include +#include + +int +asn_generic_no_constraint(const asn_TYPE_descriptor_t *type_descriptor, + const void *struct_ptr, + asn_app_constraint_failed_f *cb, void *key) { + (void)type_descriptor; /* Unused argument */ + (void)struct_ptr; /* Unused argument */ + (void)cb; /* Unused argument */ + (void)key; /* Unused argument */ + + /* Nothing to check */ + return 0; +} + +int +asn_generic_unknown_constraint(const asn_TYPE_descriptor_t *type_descriptor, + const void *struct_ptr, + asn_app_constraint_failed_f *cb, void *key) { + (void)type_descriptor; /* Unused argument */ + (void)struct_ptr; /* Unused argument */ + (void)cb; /* Unused argument */ + (void)key; /* Unused argument */ + + /* Unknown how to check */ + return 0; +} + +struct errbufDesc { + const asn_TYPE_descriptor_t *failed_type; + const void *failed_struct_ptr; + char *errbuf; + size_t errlen; +}; + +static void +CC_PRINTFLIKE(4, 5) +_asn_i_ctfailcb(void *key, const asn_TYPE_descriptor_t *td, const void *sptr, + const char *fmt, ...) { + struct errbufDesc *arg = key; + va_list ap; + ssize_t vlen; + ssize_t maxlen; + + arg->failed_type = td; + arg->failed_struct_ptr = sptr; + + maxlen = arg->errlen; + if(maxlen <= 0) + return; + + va_start(ap, fmt); + vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); + va_end(ap); + if(vlen >= maxlen) { + arg->errbuf[maxlen-1] = '\0'; /* Ensuring libc correctness */ + arg->errlen = maxlen - 1; /* Not counting termination */ + return; + } else if(vlen >= 0) { + arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ + arg->errlen = vlen; /* Not counting termination */ + } else { + /* + * The libc on this system is broken. + */ + vlen = sizeof("") - 1; + maxlen--; + arg->errlen = vlen < maxlen ? vlen : maxlen; + memcpy(arg->errbuf, "", arg->errlen); + arg->errbuf[arg->errlen] = 0; + } + + return; +} + +int +asn_check_constraints(const asn_TYPE_descriptor_t *type_descriptor, + const void *struct_ptr, char *errbuf, size_t *errlen) { + struct errbufDesc arg; + int ret; + + arg.failed_type = 0; + arg.failed_struct_ptr = 0; + arg.errbuf = errbuf; + arg.errlen = errlen ? *errlen : 0; + + ret = type_descriptor->encoding_constraints.general_constraints( + type_descriptor, struct_ptr, _asn_i_ctfailcb, &arg); + if(ret == -1 && errlen) *errlen = arg.errlen; + + return ret; +} + diff --git a/certgen/asncodec/constraints.h b/certgen/asncodec/constraints.h index 37b89b1..0c093fa 100644 --- a/certgen/asncodec/constraints.h +++ b/certgen/asncodec/constraints.h @@ -1,62 +1,63 @@ -/*- - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef ASN1_CONSTRAINTS_VALIDATOR_H -#define ASN1_CONSTRAINTS_VALIDATOR_H - -#include /* Platform-dependent types */ - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * Validate the structure according to the ASN.1 constraints. - * If errbuf and errlen are given, they shall be pointing to the appropriate - * buffer space and its length before calling this function. Alternatively, - * they could be passed as NULL's. If constraints validation fails, - * errlen will contain the actual number of bytes taken from the errbuf - * to encode an error message (properly 0-terminated). - * - * RETURN VALUES: - * This function returns 0 in case all ASN.1 constraints are met - * and -1 if one or more constraints were failed. - */ -int asn_check_constraints( - const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Target language's structure */ - char *errbuf, /* Returned error description */ - size_t *errlen /* Length of the error description */ -); - - -/* - * Generic type for constraint checking callback, - * associated with every type descriptor. - */ -typedef int(asn_constr_check_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, - asn_app_constraint_failed_f *optional_callback, /* Log the error */ - void *optional_app_key /* Opaque key passed to a callback */ -); - -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ - -asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ -asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ - -/* - * Invoke the callback with a complete error message. - */ -#define ASN__CTFAIL if(ctfailcb) ctfailcb - -#ifdef __cplusplus -} -#endif - -#endif /* ASN1_CONSTRAINTS_VALIDATOR_H */ +/*- + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef ASN1_CONSTRAINTS_VALIDATOR_H +#define ASN1_CONSTRAINTS_VALIDATOR_H + +#include /* Platform-dependent types */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ + +/* + * Validate the structure according to the ASN.1 constraints. + * If errbuf and errlen are given, they shall be pointing to the appropriate + * buffer space and its length before calling this function. Alternatively, + * they could be passed as NULL's. If constraints validation fails, + * errlen will contain the actual number of bytes taken from the errbuf + * to encode an error message (properly 0-terminated). + * + * RETURN VALUES: + * This function returns 0 in case all ASN.1 constraints are met + * and -1 if one or more constraints were failed. + */ +int asn_check_constraints( + const struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, /* Target language's structure */ + char *errbuf, /* Returned error description */ + size_t *errlen /* Length of the error description */ +); + + +/* + * Generic type for constraint checking callback, + * associated with every type descriptor. + */ +typedef int(asn_constr_check_f)( + const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, + asn_app_constraint_failed_f *optional_callback, /* Log the error */ + void *optional_app_key /* Opaque key passed to a callback */ +); + +/******************************* + * INTERNALLY USEFUL FUNCTIONS * + *******************************/ + +asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ +asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ + +/* + * Invoke the callback with a complete error message. + */ +#define ASN__CTFAIL if(ctfailcb) ctfailcb + +#ifdef __cplusplus +} +#endif + +#endif /* ASN1_CONSTRAINTS_VALIDATOR_H */ diff --git a/certgen/asncodec/der_encoder.c b/certgen/asncodec/der_encoder.c deleted file mode 100644 index 8d9e82c..0000000 --- a/certgen/asncodec/der_encoder.c +++ /dev/null @@ -1,194 +0,0 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len, - asn_app_consume_bytes_f *cb, void *app_key, int constructed); - -/* - * The DER encoder of any type. - */ -asn_enc_rval_t -der_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr, - asn_app_consume_bytes_f *consume_bytes, void *app_key) { - ASN_DEBUG("DER encoder invoked for %s", - type_descriptor->name); - - /* - * Invoke type-specific encoder. - */ - return type_descriptor->op->der_encoder( - type_descriptor, struct_ptr, /* Pointer to the destination structure */ - 0, 0, consume_bytes, app_key); -} - -/* - * Argument type and callback necessary for der_encode_to_buffer(). - */ -typedef struct enc_to_buf_arg { - void *buffer; - size_t left; -} enc_to_buf_arg; -static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) { - enc_to_buf_arg *arg = (enc_to_buf_arg *)key; - - if(arg->left < size) - return -1; /* Data exceeds the available buffer size */ - - memcpy(arg->buffer, buffer, size); - arg->buffer = ((char *)arg->buffer) + size; - arg->left -= size; - - return 0; -} - -/* - * A variant of the der_encode() which encodes the data into the provided buffer - */ -asn_enc_rval_t -der_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, void *buffer, size_t buffer_size) { - enc_to_buf_arg arg; - asn_enc_rval_t ec; - - arg.buffer = buffer; - arg.left = buffer_size; - - ec = type_descriptor->op->der_encoder(type_descriptor, - struct_ptr, /* Pointer to the destination structure */ - 0, 0, encode_to_buffer_cb, &arg); - if(ec.encoded != -1) { - assert(ec.encoded == (ssize_t)(buffer_size - arg.left)); - /* Return the encoded contents size */ - } - return ec; -} - - -/* - * Write out leading TL[v] sequence according to the type definition. - */ -ssize_t -der_write_tags(const asn_TYPE_descriptor_t *sd, size_t struct_length, - int tag_mode, int last_tag_form, - ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */ - asn_app_consume_bytes_f *cb, void *app_key) { -#define ASN1_DER_MAX_TAGS_COUNT 4 - ber_tlv_tag_t - tags_buf_scratch[ASN1_DER_MAX_TAGS_COUNT * sizeof(ber_tlv_tag_t)]; - ssize_t lens[ASN1_DER_MAX_TAGS_COUNT * sizeof(ssize_t)]; - const ber_tlv_tag_t *tags; /* Copy of tags stream */ - int tags_count; /* Number of tags */ - size_t overall_length; - int i; - - ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)", - sd->name, tag_mode, sd->tags_count, - ber_tlv_tag_string(tag), - tag_mode - ?(sd->tags_count+1 - -((tag_mode == -1) && sd->tags_count)) - :sd->tags_count - ); - - if(sd->tags_count + 1 > ASN1_DER_MAX_TAGS_COUNT) { - ASN_DEBUG("System limit %d on tags count", ASN1_DER_MAX_TAGS_COUNT); - return -1; - } - - if(tag_mode) { - /* - * Instead of doing shaman dance like we do in ber_check_tags(), - * allocate a small array on the stack - * and initialize it appropriately. - */ - int stag_offset; - ber_tlv_tag_t *tags_buf = tags_buf_scratch; - tags_count = sd->tags_count - + 1 /* EXPLICIT or IMPLICIT tag is given */ - - ((tag_mode == -1) && sd->tags_count); - /* Copy tags over */ - tags_buf[0] = tag; - stag_offset = -1 + ((tag_mode == -1) && sd->tags_count); - for(i = 1; i < tags_count; i++) - tags_buf[i] = sd->tags[i + stag_offset]; - tags = tags_buf; - } else { - tags = sd->tags; - tags_count = sd->tags_count; - } - - /* No tags to write */ - if(tags_count == 0) - return 0; - - /* - * Array of tags is initialized. - * Now, compute the size of the TLV pairs, from right to left. - */ - overall_length = struct_length; - for(i = tags_count - 1; i >= 0; --i) { - lens[i] = der_write_TL(tags[i], overall_length, 0, 0, 0); - if(lens[i] == -1) return -1; - overall_length += lens[i]; - lens[i] = overall_length - lens[i]; - } - - if(!cb) return overall_length - struct_length; - - ASN_DEBUG("Encoding %s TL sequence (%d elements)", sd->name, - tags_count); - - /* - * Encode the TL sequence for real. - */ - for(i = 0; i < tags_count; i++) { - ssize_t len; - int _constr; - - /* Check if this tag happens to be constructed */ - _constr = (last_tag_form || i < (tags_count - 1)); - - len = der_write_TL(tags[i], lens[i], cb, app_key, _constr); - if(len == -1) return -1; - } - - return overall_length - struct_length; -} - -static ssize_t -der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len, - asn_app_consume_bytes_f *cb, void *app_key, - int constructed) { - uint8_t buf[32]; - size_t size = 0; - int buf_size = cb?sizeof(buf):0; - ssize_t tmp; - - /* Serialize tag (T from TLV) into possibly zero-length buffer */ - tmp = ber_tlv_tag_serialize(tag, buf, buf_size); - if(tmp == -1 || tmp > (ssize_t)sizeof(buf)) return -1; - size += tmp; - - /* Serialize length (L from TLV) into possibly zero-length buffer */ - tmp = der_tlv_length_serialize(len, buf+size, buf_size?buf_size-size:0); - if(tmp == -1) return -1; - size += tmp; - - if(size > sizeof(buf)) - return -1; - - /* - * If callback is specified, invoke it, and check its return value. - */ - if(cb) { - if(constructed) *buf |= 0x20; - if(cb(buf, size, app_key) < 0) - return -1; - } - - return size; -} diff --git a/certgen/asncodec/der_encoder.h b/certgen/asncodec/der_encoder.h deleted file mode 100644 index f8b07e1..0000000 --- a/certgen/asncodec/der_encoder.h +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _DER_ENCODER_H_ -#define _DER_ENCODER_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * The DER encoder of any type. May be invoked by the application. - * Produces DER- and BER-compliant encoding. (DER is a subset of BER). - * - * NOTE: Use the ber_decode() function (ber_decoder.h) to decode data - * produced by der_encode(). - */ -asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ -); - -/* A variant of der_encode() which encodes data into the pre-allocated buffer */ -asn_enc_rval_t der_encode_to_buffer( - const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (maximum) */ -); - -/* - * Type of the generic DER encoder. - */ -typedef asn_enc_rval_t(der_type_encoder_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Structure to be encoded */ - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ -); - - -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ - -/* - * Write out leading TL[v] sequence according to the type definition. - */ -ssize_t der_write_tags(const struct asn_TYPE_descriptor_s *type_descriptor, - size_t struct_length, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {0,!0}: prim, constructed */ - ber_tlv_tag_t tag, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key); - -#ifdef __cplusplus -} -#endif - -#endif /* _DER_ENCODER_H_ */ diff --git a/certgen/asncodec/oer_decoder.c b/certgen/asncodec/oer_decoder.c index 07bef7a..0701738 100644 --- a/certgen/asncodec/oer_decoder.c +++ b/certgen/asncodec/oer_decoder.c @@ -1,152 +1,152 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -/* - * The OER decoder of any type. - */ -asn_dec_rval_t -oer_decode(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, - const void *ptr, size_t size) { - asn_codec_ctx_t s_codec_ctx; - - /* - * Stack checker requires that the codec context - * must be allocated on the stack. - */ - if(opt_codec_ctx) { - if(opt_codec_ctx->max_stack_size) { - s_codec_ctx = *opt_codec_ctx; - opt_codec_ctx = &s_codec_ctx; - } - } else { - /* If context is not given, be security-conscious anyway */ - memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); - s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX; - opt_codec_ctx = &s_codec_ctx; - } - - /* - * Invoke type-specific decoder. - */ - return type_descriptor->op->oer_decoder(opt_codec_ctx, type_descriptor, 0, - struct_ptr, /* Pointer to the destination structure */ - ptr, size /* Buffer and its size */ - ); -} - -/* - * Open Type is encoded as a length (#8.6) followed by that number of bytes. - * Since we're just skipping, reading the length would be enough. - */ -ssize_t -oer_open_type_skip(const void *bufptr, size_t size) { - size_t len = 0; - return oer_fetch_length(bufptr, size, &len); -} - -/* - * Read the Open Type (X.696 (08/2015), #30). - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering length. - * >0: Number of bytes used from bufptr. - */ -ssize_t -oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *td, - const asn_oer_constraints_t *constraints, void **struct_ptr, - const void *bufptr, size_t size) { - asn_dec_rval_t dr; - size_t container_len = 0; - ssize_t len_len; - enum asn_struct_free_method dispose_method = - (*struct_ptr) ? ASFM_FREE_UNDERLYING_AND_RESET : ASFM_FREE_EVERYTHING; - - /* Get the size of a length determinant */ - len_len = oer_fetch_length(bufptr, size, &container_len); - if(len_len <= 0) { - return len_len; /* Error or more data expected */ - } - - /* - * len_len can't be bigger than size, but size without len_len - * should be bigger or equal to container length - */ - if(size - len_len < container_len) { - /* More data is expected */ - return 0; - } - - dr = td->op->oer_decoder(opt_codec_ctx, td, constraints, struct_ptr, - (const uint8_t *)bufptr + len_len, container_len); - if(dr.code == RC_OK) { - return len_len + container_len; - } else { - /* Even if RC_WMORE, we can't get more data into a closed container. */ - td->op->free_struct(td, *struct_ptr, dispose_method); - *struct_ptr = NULL; - return -1; - } -} - - -asn_dec_rval_t -oer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, void **sptr, - const void *ptr, size_t size) { - ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr; - asn_dec_rval_t rval = {RC_OK, 0}; - size_t expected_length = 0; - ssize_t len_len; - - (void)td; - (void)opt_codec_ctx; - (void)constraints; - - if(!st) { - st = (ASN__PRIMITIVE_TYPE_t *)(*sptr = CALLOC( - 1, sizeof(ASN__PRIMITIVE_TYPE_t))); - if(!st) ASN__DECODE_FAILED; - } - - - /* - * X.696 (08/2015) #27.2 - * Encode length determinant as _number of octets_, but only - * if upper bound is not equal to lower bound. - */ - len_len = oer_fetch_length(ptr, size, &expected_length); - if(len_len > 0) { - rval.consumed = len_len; - ptr = (const char *)ptr + len_len; - size -= len_len; - } else if(len_len == 0) { - ASN__DECODE_STARVED; - } else if(len_len < 0) { - ASN__DECODE_FAILED; - } - - if(size < expected_length) { - ASN__DECODE_STARVED; - } else { - uint8_t *buf = MALLOC(expected_length + 1); - if(buf == NULL) { - ASN__DECODE_FAILED; - } else { - memcpy(buf, ptr, expected_length); - buf[expected_length] = '\0'; - } - FREEMEM(st->buf); - st->buf = buf; - st->size = expected_length; - - rval.consumed += expected_length; - return rval; - } -} +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * The OER decoder of any type. + */ +asn_dec_rval_t +oer_decode(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, + const void *ptr, size_t size) { + asn_codec_ctx_t s_codec_ctx; + + /* + * Stack checker requires that the codec context + * must be allocated on the stack. + */ + if(opt_codec_ctx) { + if(opt_codec_ctx->max_stack_size) { + s_codec_ctx = *opt_codec_ctx; + opt_codec_ctx = &s_codec_ctx; + } + } else { + /* If context is not given, be security-conscious anyway */ + memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); + s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX; + opt_codec_ctx = &s_codec_ctx; + } + + /* + * Invoke type-specific decoder. + */ + return type_descriptor->op->oer_decoder(opt_codec_ctx, type_descriptor, 0, + struct_ptr, /* Pointer to the destination structure */ + ptr, size /* Buffer and its size */ + ); +} + +/* + * Open Type is encoded as a length (#8.6) followed by that number of bytes. + * Since we're just skipping, reading the length would be enough. + */ +ssize_t +oer_open_type_skip(const void *bufptr, size_t size) { + size_t len = 0; + return oer_fetch_length(bufptr, size, &len); +} + +/* + * Read the Open Type (X.696 (08/2015), #30). + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering length. + * >0: Number of bytes used from bufptr. + */ +ssize_t +oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, + const asn_oer_constraints_t *constraints, void **struct_ptr, + const void *bufptr, size_t size) { + asn_dec_rval_t dr; + size_t container_len = 0; + ssize_t len_len; + enum asn_struct_free_method dispose_method = + (*struct_ptr) ? ASFM_FREE_UNDERLYING_AND_RESET : ASFM_FREE_EVERYTHING; + + /* Get the size of a length determinant */ + len_len = oer_fetch_length(bufptr, size, &container_len); + if(len_len <= 0) { + return len_len; /* Error or more data expected */ + } + + /* + * len_len can't be bigger than size, but size without len_len + * should be bigger or equal to container length + */ + if(size - len_len < container_len) { + /* More data is expected */ + return 0; + } + + dr = td->op->oer_decoder(opt_codec_ctx, td, constraints, struct_ptr, + (const uint8_t *)bufptr + len_len, container_len); + if(dr.code == RC_OK) { + return len_len + container_len; + } else { + /* Even if RC_WMORE, we can't get more data into a closed container. */ + td->op->free_struct(td, *struct_ptr, dispose_method); + *struct_ptr = NULL; + return -1; + } +} + + +asn_dec_rval_t +oer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, void **sptr, + const void *ptr, size_t size) { + ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr; + asn_dec_rval_t rval = {RC_OK, 0}; + size_t expected_length = 0; + ssize_t len_len; + + (void)td; + (void)opt_codec_ctx; + (void)constraints; + + if(!st) { + st = (ASN__PRIMITIVE_TYPE_t *)(*sptr = CALLOC( + 1, sizeof(ASN__PRIMITIVE_TYPE_t))); + if(!st) ASN__DECODE_FAILED; + } + + + /* + * X.696 (08/2015) #27.2 + * Encode length determinant as _number of octets_, but only + * if upper bound is not equal to lower bound. + */ + len_len = oer_fetch_length(ptr, size, &expected_length); + if(len_len > 0) { + rval.consumed = len_len; + ptr = (const char *)ptr + len_len; + size -= len_len; + } else if(len_len == 0) { + ASN__DECODE_STARVED; + } else if(len_len < 0) { + ASN__DECODE_FAILED; + } + + if(size < expected_length) { + ASN__DECODE_STARVED; + } else { + uint8_t *buf = MALLOC(expected_length + 1); + if(buf == NULL) { + ASN__DECODE_FAILED; + } else { + memcpy(buf, ptr, expected_length); + buf[expected_length] = '\0'; + } + FREEMEM(st->buf); + st->buf = buf; + st->size = expected_length; + + rval.consumed += expected_length; + return rval; + } +} diff --git a/certgen/asncodec/oer_decoder.h b/certgen/asncodec/oer_decoder.h index b1c3e74..40992e9 100644 --- a/certgen/asncodec/oer_decoder.h +++ b/certgen/asncodec/oer_decoder.h @@ -1,72 +1,72 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef OER_DECODER_H -#define OER_DECODER_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_codec_ctx_s; /* Forward declaration */ - -/* - * The Octet Encoding Rules (OER, X.696 08/2015) decoder for any given type. - * This function may be invoked directly by the application. - * Parses CANONICAL-OER and BASIC-OER. - */ -asn_dec_rval_t oer_decode(const struct asn_codec_ctx_s *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of that buffer */ - ); - -/* - * Type of generic function which decodes the byte stream into the structure. - */ -typedef asn_dec_rval_t(oer_type_decoder_f)( - const struct asn_codec_ctx_s *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_oer_constraints_t *constraints, - void **struct_ptr, - const void *buf_ptr, - size_t size); - -/* - * Swallow the Open Type (X.696 (08/2015), #30) into /dev/null. - * RETURN VALUES: - * -1: Fatal error deciphering length. - * 0: More data expected than bufptr contains. - * >0: Number of bytes used from bufptr. - */ -ssize_t oer_open_type_skip(const void *bufptr, size_t size); - -/* - * Read the Open Type (X.696 (08/2015), #30). - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering length. - * >0: Number of bytes used from bufptr. - */ -ssize_t oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *td, - const asn_oer_constraints_t *constraints, - void **struct_ptr, const void *bufptr, size_t size); - -/* - * Length-prefixed buffer decoding for primitive types. - */ -oer_type_decoder_f oer_decode_primitive; - - -#ifdef __cplusplus -} -#endif - -#endif /* OER_DECODER_H */ +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef OER_DECODER_H +#define OER_DECODER_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ +struct asn_codec_ctx_s; /* Forward declaration */ + +/* + * The Octet Encoding Rules (OER, X.696 08/2015) decoder for any given type. + * This function may be invoked directly by the application. + * Parses CANONICAL-OER and BASIC-OER. + */ +asn_dec_rval_t oer_decode(const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of that buffer */ + ); + +/* + * Type of generic function which decodes the byte stream into the structure. + */ +typedef asn_dec_rval_t(oer_type_decoder_f)( + const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *type_descriptor, + const asn_oer_constraints_t *constraints, + void **struct_ptr, + const void *buf_ptr, + size_t size); + +/* + * Swallow the Open Type (X.696 (08/2015), #30) into /dev/null. + * RETURN VALUES: + * -1: Fatal error deciphering length. + * 0: More data expected than bufptr contains. + * >0: Number of bytes used from bufptr. + */ +ssize_t oer_open_type_skip(const void *bufptr, size_t size); + +/* + * Read the Open Type (X.696 (08/2015), #30). + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering length. + * >0: Number of bytes used from bufptr. + */ +ssize_t oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, + const asn_oer_constraints_t *constraints, + void **struct_ptr, const void *bufptr, size_t size); + +/* + * Length-prefixed buffer decoding for primitive types. + */ +oer_type_decoder_f oer_decode_primitive; + + +#ifdef __cplusplus +} +#endif + +#endif /* OER_DECODER_H */ diff --git a/certgen/asncodec/oer_encoder.c b/certgen/asncodec/oer_encoder.c index f6ab364..a284cc2 100644 --- a/certgen/asncodec/oer_encoder.c +++ b/certgen/asncodec/oer_encoder.c @@ -1,141 +1,141 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -/* - * The OER encoder of any type. - */ -asn_enc_rval_t -oer_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr, - asn_app_consume_bytes_f *consume_bytes, void *app_key) { - ASN_DEBUG("OER encoder invoked for %s", type_descriptor->name); - - /* - * Invoke type-specific encoder. - */ - return type_descriptor->op->oer_encoder( - type_descriptor, 0, - struct_ptr, /* Pointer to the destination structure */ - consume_bytes, app_key); -} - -/* - * Argument type and callback necessary for oer_encode_to_buffer(). - */ -typedef struct enc_to_buf_arg { - void *buffer; - size_t left; -} enc_to_buf_arg; -static int -encode_to_buffer_cb(const void *buffer, size_t size, void *key) { - enc_to_buf_arg *arg = (enc_to_buf_arg *)key; - - if(arg->left < size) return -1; /* Data exceeds the available buffer size */ - - memcpy(arg->buffer, buffer, size); - arg->buffer = ((char *)arg->buffer) + size; - arg->left -= size; - - return 0; -} - -/* - * A variant of the oer_encode() which encodes the data into the provided buffer - */ -asn_enc_rval_t -oer_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor, - const asn_oer_constraints_t *constraints, - const void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (maximum) */ -) { - enc_to_buf_arg arg; - asn_enc_rval_t ec; - - arg.buffer = buffer; - arg.left = buffer_size; - - if(type_descriptor->op->oer_encoder == NULL) { - ec.encoded = -1; - ec.failed_type = type_descriptor; - ec.structure_ptr = struct_ptr; - ASN_DEBUG("OER encoder is not defined for %s", - type_descriptor->name); - } else { - ec = type_descriptor->op->oer_encoder( - type_descriptor, constraints, - struct_ptr, /* Pointer to the destination structure */ - encode_to_buffer_cb, &arg); - if(ec.encoded != -1) { - assert(ec.encoded == (ssize_t)(buffer_size - arg.left)); - /* Return the encoded contents size */ - } - } - return ec; -} - -asn_enc_rval_t -oer_encode_primitive(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr; - asn_enc_rval_t er = {0, 0, 0}; - ssize_t ret; - - (void)constraints; - - if(!st) ASN__ENCODE_FAILED; - - ASN_DEBUG("Encoding %s (%" ASN_PRI_SIZE " bytes)", td ? td->name : "", st->size); - - /* - * X.696 (08/2015) #27.2 - */ - ret = oer_serialize_length(st->size, cb, app_key); - if(ret < 0) { - ASN__ENCODE_FAILED; - } - er.encoded += ret; - - er.encoded += st->size; - if(cb(st->buf, st->size, app_key) < 0) { - ASN__ENCODE_FAILED; - } else { - ASN__ENCODED_OK(er); - } -} - -static int -oer__count_bytes(const void *buffer, size_t size, void *bytes_ptr) { - size_t *bytes = bytes_ptr; - (void)buffer; - *bytes += size; - return 0; -} - -ssize_t -oer_open_type_put(const asn_TYPE_descriptor_t *td, - const asn_oer_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - size_t serialized_byte_count = 0; - asn_enc_rval_t er; - ssize_t len_len; - - er = td->op->oer_encoder(td, constraints, sptr, oer__count_bytes, - &serialized_byte_count); - if(er.encoded < 0) return -1; - assert(serialized_byte_count == (size_t)er.encoded); - - len_len = oer_serialize_length(serialized_byte_count, cb, app_key); - if(len_len == -1) return -1; - - er = td->op->oer_encoder(td, constraints, sptr, cb, app_key); - if(er.encoded < 0) return -1; - assert(serialized_byte_count == (size_t)er.encoded); - - return len_len + er.encoded; -} - +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * The OER encoder of any type. + */ +asn_enc_rval_t +oer_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr, + asn_app_consume_bytes_f *consume_bytes, void *app_key) { + ASN_DEBUG("OER encoder invoked for %s", type_descriptor->name); + + /* + * Invoke type-specific encoder. + */ + return type_descriptor->op->oer_encoder( + type_descriptor, 0, + struct_ptr, /* Pointer to the destination structure */ + consume_bytes, app_key); +} + +/* + * Argument type and callback necessary for oer_encode_to_buffer(). + */ +typedef struct enc_to_buf_arg { + void *buffer; + size_t left; +} enc_to_buf_arg; +static int +encode_to_buffer_cb(const void *buffer, size_t size, void *key) { + enc_to_buf_arg *arg = (enc_to_buf_arg *)key; + + if(arg->left < size) return -1; /* Data exceeds the available buffer size */ + + memcpy(arg->buffer, buffer, size); + arg->buffer = ((char *)arg->buffer) + size; + arg->left -= size; + + return 0; +} + +/* + * A variant of the oer_encode() which encodes the data into the provided buffer + */ +asn_enc_rval_t +oer_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor, + const asn_oer_constraints_t *constraints, + const void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (maximum) */ +) { + enc_to_buf_arg arg; + asn_enc_rval_t ec; + + arg.buffer = buffer; + arg.left = buffer_size; + + if(type_descriptor->op->oer_encoder == NULL) { + ec.encoded = -1; + ec.failed_type = type_descriptor; + ec.structure_ptr = struct_ptr; + ASN_DEBUG("OER encoder is not defined for %s", + type_descriptor->name); + } else { + ec = type_descriptor->op->oer_encoder( + type_descriptor, constraints, + struct_ptr, /* Pointer to the destination structure */ + encode_to_buffer_cb, &arg); + if(ec.encoded != -1) { + assert(ec.encoded == (ssize_t)(buffer_size - arg.left)); + /* Return the encoded contents size */ + } + } + return ec; +} + +asn_enc_rval_t +oer_encode_primitive(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr; + asn_enc_rval_t er = {0, 0, 0}; + ssize_t ret; + + (void)constraints; + + if(!st) ASN__ENCODE_FAILED; + + ASN_DEBUG("Encoding %s (%" ASN_PRI_SIZE " bytes)", td ? td->name : "", st->size); + + /* + * X.696 (08/2015) #27.2 + */ + ret = oer_serialize_length(st->size, cb, app_key); + if(ret < 0) { + ASN__ENCODE_FAILED; + } + er.encoded += ret; + + er.encoded += st->size; + if(cb(st->buf, st->size, app_key) < 0) { + ASN__ENCODE_FAILED; + } else { + ASN__ENCODED_OK(er); + } +} + +static int +oer__count_bytes(const void *buffer, size_t size, void *bytes_ptr) { + size_t *bytes = bytes_ptr; + (void)buffer; + *bytes += size; + return 0; +} + +ssize_t +oer_open_type_put(const asn_TYPE_descriptor_t *td, + const asn_oer_constraints_t *constraints, const void *sptr, + asn_app_consume_bytes_f *cb, void *app_key) { + size_t serialized_byte_count = 0; + asn_enc_rval_t er = {0,0,0}; + ssize_t len_len; + + er = td->op->oer_encoder(td, constraints, sptr, oer__count_bytes, + &serialized_byte_count); + if(er.encoded < 0) return -1; + assert(serialized_byte_count == (size_t)er.encoded); + + len_len = oer_serialize_length(serialized_byte_count, cb, app_key); + if(len_len == -1) return -1; + + er = td->op->oer_encoder(td, constraints, sptr, cb, app_key); + if(er.encoded < 0) return -1; + assert(serialized_byte_count == (size_t)er.encoded); + + return len_len + er.encoded; +} + diff --git a/certgen/asncodec/oer_encoder.h b/certgen/asncodec/oer_encoder.h index de6df1a..6a7b681 100644 --- a/certgen/asncodec/oer_encoder.h +++ b/certgen/asncodec/oer_encoder.h @@ -1,70 +1,70 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef OER_ENCODER_H -#define OER_ENCODER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * The Octet Encoding Rules (OER, X.696 08/2015) encoder for any type. - * This function may be invoked directly by the application. - * Produces CANONICAL-OER output compatible with CANONICAL-OER - * and BASIC-OER decoders. - */ -asn_enc_rval_t oer_encode(const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ -); - -/* A variant of oer_encode() which encodes data into the pre-allocated buffer */ -asn_enc_rval_t oer_encode_to_buffer( - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_oer_constraints_t *constraints, - const void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (maximum) */ -); - -/* - * Type of the generic OER encoder. - */ -typedef asn_enc_rval_t(oer_type_encoder_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_oer_constraints_t *constraints, - const void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ -); - -/* - * Write out the Open Type (X.696 (08/2015), #30). - * RETURN VALUES: - * -1: Fatal error encoding the type. - * >0: Number of bytes serialized. - */ -ssize_t oer_open_type_put(const struct asn_TYPE_descriptor_s *td, - const asn_oer_constraints_t *constraints, - const void *struct_ptr, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key); - - -/* - * Length-prefixed buffer encoding for primitive types. - */ -oer_type_encoder_f oer_encode_primitive; - -#ifdef __cplusplus -} -#endif - -#endif /* OER_ENCODER_H */ +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef OER_ENCODER_H +#define OER_ENCODER_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ + +/* + * The Octet Encoding Rules (OER, X.696 08/2015) encoder for any type. + * This function may be invoked directly by the application. + * Produces CANONICAL-OER output compatible with CANONICAL-OER + * and BASIC-OER decoders. + */ +asn_enc_rval_t oer_encode(const struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ +); + +/* A variant of oer_encode() which encodes data into the pre-allocated buffer */ +asn_enc_rval_t oer_encode_to_buffer( + const struct asn_TYPE_descriptor_s *type_descriptor, + const asn_oer_constraints_t *constraints, + const void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (maximum) */ +); + +/* + * Type of the generic OER encoder. + */ +typedef asn_enc_rval_t(oer_type_encoder_f)( + const struct asn_TYPE_descriptor_s *type_descriptor, + const asn_oer_constraints_t *constraints, + const void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ +); + +/* + * Write out the Open Type (X.696 (08/2015), #30). + * RETURN VALUES: + * -1: Fatal error encoding the type. + * >0: Number of bytes serialized. + */ +ssize_t oer_open_type_put(const struct asn_TYPE_descriptor_s *td, + const asn_oer_constraints_t *constraints, + const void *struct_ptr, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key); + + +/* + * Length-prefixed buffer encoding for primitive types. + */ +oer_type_encoder_f oer_encode_primitive; + +#ifdef __cplusplus +} +#endif + +#endif /* OER_ENCODER_H */ diff --git a/certgen/asncodec/oer_support.c b/certgen/asncodec/oer_support.c index 79bd160..b15a3bc 100644 --- a/certgen/asncodec/oer_support.c +++ b/certgen/asncodec/oer_support.c @@ -1,122 +1,122 @@ -/* - * Copyright (c) 2017 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -#include - -/* - * Fetch the length determinant (X.696 08/2015, #8.6) into *len_r. - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering length. - * >0: Number of bytes used from bufptr. - */ -ssize_t -oer_fetch_length(const void *bufptr, size_t size, size_t *len_r) { - uint8_t first_byte; - size_t len_len; /* Length of the length determinant */ - const uint8_t *b; - const uint8_t *bend; - size_t len; - - if(size == 0) { - *len_r = 0; - return 0; - } - - first_byte = *(const uint8_t *)bufptr; - if((first_byte & 0x80) == 0) { /* Short form */ - *len_r = first_byte; /* 0..127 */ - return 1; - } - - len_len = (first_byte & 0x7f); - if((1 + len_len) > size) { - *len_r = 0; - return 0; - } - - b = (const uint8_t *)bufptr + 1; - bend = b + len_len; - - for(; b < bend && *b == 0; b++) { - /* Skip the leading 0-bytes */ - } - - if((bend - b) > (ssize_t)sizeof(size_t)) { - /* Length is not representable by the native size_t type */ - *len_r = 0; - return -1; - } - - for(len = 0; b < bend; b++) { - len = (len << 8) + *b; - } - - if(len > RSIZE_MAX) { /* A bit of C11 validation */ - *len_r = 0; - return -1; - } - - *len_r = len; - assert(len_len + 1 == (size_t)(bend - (const uint8_t *)bufptr)); - return len_len + 1; -} - - -/* - * Serialize OER length. Returns the number of bytes serialized - * or -1 if a given callback returned with negative result. - */ -ssize_t -oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, - void *app_key) { - uint8_t scratch[1 + sizeof(length)]; - uint8_t *sp = scratch; - int littleEndian = 1; /* Run-time detection */ - const uint8_t *pstart; - const uint8_t *pend; - const uint8_t *p; - int add; - - if(length <= 127) { - uint8_t b = length; - if(cb(&b, 1, app_key) < 0) { - return -1; - } - return 1; - } - - if(*(char *)&littleEndian) { - pstart = (const uint8_t *)&length + sizeof(length) - 1; - pend = (const uint8_t *)&length; - add = -1; - } else { - pstart = (const uint8_t *)&length; - pend = pstart + sizeof(length); - add = 1; - } - - for(p = pstart; p != pend; p += add) { - /* Skip leading zeros. */ - if(*p) break; - } - - for(sp = scratch + 1; ; p += add) { - *sp++ = *p; - if(p == pend) break; - } - assert((sp - scratch) - 1 <= 0x7f); - scratch[0] = 0x80 + ((sp - scratch) - 1); - - if(cb(scratch, sp - scratch, app_key) < 0) { - return -1; - } - - return sp - scratch; -} - +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +#include + +/* + * Fetch the length determinant (X.696 08/2015, #8.6) into *len_r. + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering length. + * >0: Number of bytes used from bufptr. + */ +ssize_t +oer_fetch_length(const void *bufptr, size_t size, size_t *len_r) { + uint8_t first_byte; + size_t len_len; /* Length of the length determinant */ + const uint8_t *b; + const uint8_t *bend; + size_t len; + + if(size == 0) { + *len_r = 0; + return 0; + } + + first_byte = *(const uint8_t *)bufptr; + if((first_byte & 0x80) == 0) { /* Short form */ + *len_r = first_byte; /* 0..127 */ + return 1; + } + + len_len = (first_byte & 0x7f); + if((1 + len_len) > size) { + *len_r = 0; + return 0; + } + + b = (const uint8_t *)bufptr + 1; + bend = b + len_len; + + for(; b < bend && *b == 0; b++) { + /* Skip the leading 0-bytes */ + } + + if((bend - b) > (ssize_t)sizeof(size_t)) { + /* Length is not representable by the native size_t type */ + *len_r = 0; + return -1; + } + + for(len = 0; b < bend; b++) { + len = (len << 8) + *b; + } + + if(len > RSIZE_MAX) { /* A bit of C11 validation */ + *len_r = 0; + return -1; + } + + *len_r = len; + assert(len_len + 1 == (size_t)(bend - (const uint8_t *)bufptr)); + return len_len + 1; +} + + +/* + * Serialize OER length. Returns the number of bytes serialized + * or -1 if a given callback returned with negative result. + */ +ssize_t +oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, + void *app_key) { + uint8_t scratch[1 + sizeof(length)]; + uint8_t *sp = scratch; + int littleEndian = 1; /* Run-time detection */ + const uint8_t *pstart; + const uint8_t *pend; + const uint8_t *p; + int add; + + if(length <= 127) { + uint8_t b = length; + if(cb(&b, 1, app_key) < 0) { + return -1; + } + return 1; + } + + if(*(char *)&littleEndian) { + pstart = (const uint8_t *)&length + sizeof(length) - 1; + pend = (const uint8_t *)&length; + add = -1; + } else { + pstart = (const uint8_t *)&length; + pend = pstart + sizeof(length); + add = 1; + } + + for(p = pstart; p != pend; p += add) { + /* Skip leading zeros. */ + if(*p) break; + } + + for(sp = scratch + 1; ; p += add) { + *sp++ = *p; + if(p == pend) break; + } + assert((sp - scratch) - 1 <= 0x7f); + scratch[0] = 0x80 + ((sp - scratch) - 1); + + if(cb(scratch, sp - scratch, app_key) < 0) { + return -1; + } + + return sp - scratch; +} + diff --git a/certgen/asncodec/oer_support.h b/certgen/asncodec/oer_support.h index 7b5e83e..dbc9b5f 100644 --- a/certgen/asncodec/oer_support.h +++ b/certgen/asncodec/oer_support.h @@ -1,47 +1,47 @@ -/* - * Copyright (c) 2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef OER_SUPPORT_H -#define OER_SUPPORT_H - -#include /* Platform-specific types */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Pre-computed OER constraints. - */ -typedef struct asn_oer_constraint_number_s { - unsigned width; /* ±8,4,2,1 fixed bytes */ - unsigned positive; /* 1 for unsigned number, 0 for signed */ -} asn_oer_constraint_number_t; -typedef struct asn_oer_constraints_s { - asn_oer_constraint_number_t value; - ssize_t size; /* -1 (no constraint) or >= 0 */ -} asn_oer_constraints_t; - - -/* - * Fetch the length determinant (X.696 (08/2015), #8.6) into *len_r. - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering length. - * >0: Number of bytes used from bufptr. - */ -ssize_t oer_fetch_length(const void *bufptr, size_t size, size_t *len_r); - -/* - * Serialize OER length. Returns the number of bytes serialized - * or -1 if a given callback returned with negative result. - */ -ssize_t oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, void *app_key); - - -#ifdef __cplusplus -} -#endif - -#endif /* OER_SUPPORT_H */ +/* + * Copyright (c) 2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef OER_SUPPORT_H +#define OER_SUPPORT_H + +#include /* Platform-specific types */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Pre-computed OER constraints. + */ +typedef struct asn_oer_constraint_number_s { + unsigned width; /* ±8,4,2,1 fixed bytes */ + unsigned positive; /* 1 for unsigned number, 0 for signed */ +} asn_oer_constraint_number_t; +typedef struct asn_oer_constraints_s { + asn_oer_constraint_number_t value; + ssize_t size; /* -1 (no constraint) or >= 0 */ +} asn_oer_constraints_t; + + +/* + * Fetch the length determinant (X.696 (08/2015), #8.6) into *len_r. + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering length. + * >0: Number of bytes used from bufptr. + */ +ssize_t oer_fetch_length(const void *bufptr, size_t size, size_t *len_r); + +/* + * Serialize OER length. Returns the number of bytes serialized + * or -1 if a given callback returned with negative result. + */ +ssize_t oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, void *app_key); + + +#ifdef __cplusplus +} +#endif + +#endif /* OER_SUPPORT_H */ diff --git a/certgen/asncodec/per_decoder.c b/certgen/asncodec/per_decoder.c deleted file mode 100644 index dbd6bd5..0000000 --- a/certgen/asncodec/per_decoder.c +++ /dev/null @@ -1,97 +0,0 @@ -#include -#include -#include - -/* - * Decode a "Production of a complete encoding", X.691#10.1. - * The complete encoding contains at least one byte, and is an integral - * multiple of 8 bytes. - */ -asn_dec_rval_t -uper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, - const void *buffer, size_t size) { - asn_dec_rval_t rval; - - rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0); - if(rval.consumed) { - /* - * We've always given 8-aligned data, - * so convert bits to integral bytes. - */ - rval.consumed += 7; - rval.consumed >>= 3; - } else if(rval.code == RC_OK) { - if(size) { - if(((const uint8_t *)buffer)[0] == 0) { - rval.consumed = 1; /* 1 byte */ - } else { - ASN_DEBUG("Expecting single zeroed byte"); - rval.code = RC_FAIL; - } - } else { - /* Must contain at least 8 bits. */ - rval.code = RC_WMORE; - } - } - - return rval; -} - -asn_dec_rval_t -uper_decode(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, - size_t size, int skip_bits, int unused_bits) { - asn_codec_ctx_t s_codec_ctx; - asn_dec_rval_t rval; - asn_per_data_t pd; - - if(skip_bits < 0 || skip_bits > 7 - || unused_bits < 0 || unused_bits > 7 - || (unused_bits > 0 && !size)) - ASN__DECODE_FAILED; - - /* - * Stack checker requires that the codec context - * must be allocated on the stack. - */ - if(opt_codec_ctx) { - if(opt_codec_ctx->max_stack_size) { - s_codec_ctx = *opt_codec_ctx; - opt_codec_ctx = &s_codec_ctx; - } - } else { - /* If context is not given, be security-conscious anyway */ - memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); - s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX; - opt_codec_ctx = &s_codec_ctx; - } - - /* Fill in the position indicator */ - memset(&pd, 0, sizeof(pd)); - pd.buffer = (const uint8_t *)buffer; - pd.nboff = skip_bits; - pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from */ - if(pd.nboff > pd.nbits) - ASN__DECODE_FAILED; - - /* - * Invoke type-specific decoder. - */ - if(!td->op->uper_decoder) - ASN__DECODE_FAILED; /* PER is not compiled in */ - rval = td->op->uper_decoder(opt_codec_ctx, td, 0, sptr, &pd); - if(rval.code == RC_OK) { - /* Return the number of consumed bits */ - rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3) - + pd.nboff - skip_bits; - ASN_DEBUG("PER decoding consumed %ld, counted %ld", - (long)rval.consumed, (long)pd.moved); - assert(rval.consumed == pd.moved); - } else { - /* PER codec is not a restartable */ - rval.consumed = 0; - } - return rval; -} - diff --git a/certgen/asncodec/per_decoder.h b/certgen/asncodec/per_decoder.h deleted file mode 100644 index 3b0f037..0000000 --- a/certgen/asncodec/per_decoder.h +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * Copyright (c) 2005-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _PER_DECODER_H_ -#define _PER_DECODER_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * Unaligned PER decoder of a "complete encoding" as per X.691 (08/2015) #11.1. - * On success, this call always returns (.consumed >= 1), as per #11.1.3. - */ -asn_dec_rval_t uper_decode_complete( - const struct asn_codec_ctx_s *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ -); - -/* - * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. - * WARNING: This call returns the number of BITS read from the stream. Beware. - */ -asn_dec_rval_t uper_decode( - const struct asn_codec_ctx_s *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size, /* Size of the input data buffer, in bytes */ - int skip_bits, /* Number of unused leading bits, 0..7 */ - int unused_bits /* Number of unused tailing bits, 0..7 */ -); - - -/* - * Type of the type-specific PER decoder function. - */ -typedef asn_dec_rval_t(per_type_decoder_f)( - const asn_codec_ctx_t *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_per_constraints_t *constraints, void **struct_ptr, - asn_per_data_t *per_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _PER_DECODER_H_ */ diff --git a/certgen/asncodec/per_encoder.c b/certgen/asncodec/per_encoder.c deleted file mode 100644 index abb5b73..0000000 --- a/certgen/asncodec/per_encoder.c +++ /dev/null @@ -1,165 +0,0 @@ -#include -#include -#include - -static int _uper_encode_flush_outp(asn_per_outp_t *po); - -static int -ignore_output(const void *data, size_t size, void *app_key) { - (void)data; - (void)size; - (void)app_key; - return 0; -} - -asn_enc_rval_t -uper_encode(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_per_outp_t po; - asn_enc_rval_t er; - - /* - * Invoke type-specific encoder. - */ - if(!td || !td->op->uper_encoder) - ASN__ENCODE_FAILED; /* PER is not compiled in */ - - po.buffer = po.tmpspace; - po.nboff = 0; - po.nbits = 8 * sizeof(po.tmpspace); - po.output = cb ? cb : ignore_output; - po.op_key = app_key; - po.flushed_bytes = 0; - - er = td->op->uper_encoder(td, constraints, sptr, &po); - if(er.encoded != -1) { - size_t bits_to_flush; - - bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff; - - /* Set number of bits encoded to a firm value */ - er.encoded = (po.flushed_bytes << 3) + bits_to_flush; - - if(_uper_encode_flush_outp(&po)) ASN__ENCODE_FAILED; - } - - return er; -} - -/* - * Argument type and callback necessary for uper_encode_to_buffer(). - */ -typedef struct enc_to_buf_arg { - void *buffer; - size_t left; -} enc_to_buf_arg; -static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) { - enc_to_buf_arg *arg = (enc_to_buf_arg *)key; - - if(arg->left < size) - return -1; /* Data exceeds the available buffer size */ - - memcpy(arg->buffer, buffer, size); - arg->buffer = ((char *)arg->buffer) + size; - arg->left -= size; - - return 0; -} - -asn_enc_rval_t -uper_encode_to_buffer(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, void *buffer, size_t buffer_size) { - enc_to_buf_arg key; - - key.buffer = buffer; - key.left = buffer_size; - - if(td) ASN_DEBUG("Encoding \"%s\" using UNALIGNED PER", td->name); - - return uper_encode(td, constraints, sptr, encode_to_buffer_cb, &key); -} - -typedef struct enc_dyn_arg { - void *buffer; - size_t length; - size_t allocated; -} enc_dyn_arg; -static int -encode_dyn_cb(const void *buffer, size_t size, void *key) { - enc_dyn_arg *arg = key; - if(arg->length + size >= arg->allocated) { - size_t new_size = arg->allocated ? arg->allocated : 8; - void *p; - - do { - new_size <<= 2; - } while(arg->length + size >= new_size); - - p = REALLOC(arg->buffer, new_size); - if(!p) { - FREEMEM(arg->buffer); - memset(arg, 0, sizeof(*arg)); - return -1; - } - arg->buffer = p; - arg->allocated = new_size; - } - memcpy(((char *)arg->buffer) + arg->length, buffer, size); - arg->length += size; - return 0; -} -ssize_t -uper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, void **buffer_r) { - asn_enc_rval_t er; - enc_dyn_arg key; - - memset(&key, 0, sizeof(key)); - - er = uper_encode(td, constraints, sptr, encode_dyn_cb, &key); - switch(er.encoded) { - case -1: - FREEMEM(key.buffer); - return -1; - case 0: - FREEMEM(key.buffer); - key.buffer = MALLOC(1); - if(key.buffer) { - *(char *)key.buffer = '\0'; - *buffer_r = key.buffer; - return 1; - } else { - return -1; - } - default: - *buffer_r = key.buffer; - ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded); - return ((er.encoded + 7) >> 3); - } -} - -/* - * Internally useful functions. - */ - -/* Flush partially filled buffer */ -static int -_uper_encode_flush_outp(asn_per_outp_t *po) { - uint8_t *buf; - - if(po->nboff == 0 && po->buffer == po->tmpspace) - return 0; - - buf = po->buffer + (po->nboff >> 3); - /* Make sure we account for the last, partially filled */ - if(po->nboff & 0x07) { - buf[0] &= 0xff << (8 - (po->nboff & 0x07)); - buf++; - } - - return po->output(po->tmpspace, buf - po->tmpspace, po->op_key); -} - diff --git a/certgen/asncodec/per_encoder.h b/certgen/asncodec/per_encoder.h deleted file mode 100644 index e5ed46b..0000000 --- a/certgen/asncodec/per_encoder.h +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * Copyright (c) 2006-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _PER_ENCODER_H_ -#define _PER_ENCODER_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. - * WARNING: This function returns the number of encoded bits in the .encoded - * field of the return value. Use the following formula to convert to bytes: - * bytes = ((.encoded + 7) / 8) - */ -asn_enc_rval_t uper_encode( - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_per_constraints_t *constraints, - const void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ - void *app_key /* Arbitrary callback argument */ -); - -/* - * A variant of uper_encode() which encodes data into the existing buffer - * WARNING: This function returns the number of encoded bits in the .encoded - * field of the return value. - */ -asn_enc_rval_t uper_encode_to_buffer( - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_per_constraints_t *constraints, - const void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (max) */ -); - -/* - * A variant of uper_encode_to_buffer() which allocates buffer itself. - * Returns the number of bytes in the buffer or -1 in case of failure. - * WARNING: This function produces a "Production of the complete encoding", - * with length of at least one octet. Contrast this to precise bit-packing - * encoding of uper_encode() and uper_encode_to_buffer(). - */ -ssize_t uper_encode_to_new_buffer( - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_per_constraints_t *constraints, - const void *struct_ptr, /* Structure to be encoded */ - void **buffer_r /* Buffer allocated and returned */ -); - -/* - * Type of the generic PER encoder function. - */ -typedef asn_enc_rval_t(per_type_encoder_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - const asn_per_constraints_t *constraints, const void *struct_ptr, - asn_per_outp_t *per_output); - -#ifdef __cplusplus -} -#endif - -#endif /* _PER_ENCODER_H_ */ diff --git a/certgen/asncodec/per_opentype.c b/certgen/asncodec/per_opentype.c deleted file mode 100644 index 79161db..0000000 --- a/certgen/asncodec/per_opentype.c +++ /dev/null @@ -1,396 +0,0 @@ -/* - * Copyright (c) 2007 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include -#include - -typedef struct uper_ugot_key { - asn_per_data_t oldpd; /* Old per data source */ - size_t unclaimed; - size_t ot_moved; /* Number of bits moved by OT processing */ - int repeat; -} uper_ugot_key; - -static int uper_ugot_refill(asn_per_data_t *pd); -static int per_skip_bits(asn_per_data_t *pd, int skip_nbits); -static asn_dec_rval_t uper_sot_suck(const asn_codec_ctx_t *, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - void **sptr, asn_per_data_t *pd); - -/* - * Encode an "open type field". - * #10.1, #10.2 - */ -int -uper_open_type_put(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, const void *sptr, - asn_per_outp_t *po) { - void *buf; - void *bptr; - ssize_t size; - - ASN_DEBUG("Open type put %s ...", td->name); - - size = uper_encode_to_new_buffer(td, constraints, sptr, &buf); - if(size <= 0) return -1; - - ASN_DEBUG("Open type put %s of length %" ASN_PRI_SSIZE " + overhead (1byte?)", td->name, - size); - - bptr = buf; - do { - int need_eom = 0; - ssize_t may_save = uper_put_length(po, size, &need_eom); - ASN_DEBUG("Prepending length %" ASN_PRI_SSIZE - " to %s and allowing to save %" ASN_PRI_SSIZE, - size, td->name, may_save); - if(may_save < 0) break; - if(per_put_many_bits(po, bptr, may_save * 8)) break; - bptr = (char *)bptr + may_save; - size -= may_save; - if(need_eom && uper_put_length(po, 0, 0)) { - FREEMEM(buf); - return -1; - } - } while(size); - - FREEMEM(buf); - if(size) return -1; - - return 0; -} - -static asn_dec_rval_t -uper_open_type_get_simple(const asn_codec_ctx_t *ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - asn_dec_rval_t rv; - ssize_t chunk_bytes; - int repeat; - uint8_t *buf = 0; - size_t bufLen = 0; - size_t bufSize = 0; - asn_per_data_t spd; - size_t padding; - - ASN__STACK_OVERFLOW_CHECK(ctx); - - ASN_DEBUG("Getting open type %s...", td->name); - - do { - chunk_bytes = uper_get_length(pd, -1, 0, &repeat); - if(chunk_bytes < 0) { - FREEMEM(buf); - ASN__DECODE_STARVED; - } - if(bufLen + chunk_bytes > bufSize) { - void *ptr; - bufSize = chunk_bytes + (bufSize << 2); - ptr = REALLOC(buf, bufSize); - if(!ptr) { - FREEMEM(buf); - ASN__DECODE_FAILED; - } - buf = ptr; - } - if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) { - FREEMEM(buf); - ASN__DECODE_STARVED; - } - bufLen += chunk_bytes; - } while(repeat); - - ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name, - (long)bufLen); - - memset(&spd, 0, sizeof(spd)); - spd.buffer = buf; - spd.nbits = bufLen << 3; - - ASN_DEBUG_INDENT_ADD(+4); - rv = td->op->uper_decoder(ctx, td, constraints, sptr, &spd); - ASN_DEBUG_INDENT_ADD(-4); - - if(rv.code == RC_OK) { - /* Check padding validity */ - padding = spd.nbits - spd.nboff; - if ((padding < 8 || - /* X.691#10.1.3 */ - (spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) && - per_get_few_bits(&spd, padding) == 0) { - /* Everything is cool */ - FREEMEM(buf); - return rv; - } - FREEMEM(buf); - if(padding >= 8) { - ASN_DEBUG("Too large padding %d in open type", (int)padding); - ASN__DECODE_FAILED; - } else { - ASN_DEBUG("Non-zero padding"); - ASN__DECODE_FAILED; - } - } else { - FREEMEM(buf); - /* rv.code could be RC_WMORE, nonsense in this context */ - rv.code = RC_FAIL; /* Noone would give us more */ - } - - return rv; -} - -static asn_dec_rval_t CC_NOTUSED -uper_open_type_get_complex(const asn_codec_ctx_t *ctx, - const asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - uper_ugot_key arg; - asn_dec_rval_t rv; - ssize_t padding; - - ASN__STACK_OVERFLOW_CHECK(ctx); - - ASN_DEBUG("Getting open type %s from %s", td->name, - asn_bit_data_string(pd)); - arg.oldpd = *pd; - arg.unclaimed = 0; - arg.ot_moved = 0; - arg.repeat = 1; - pd->refill = uper_ugot_refill; - pd->refill_key = &arg; - pd->nbits = pd->nboff; /* 0 good bits at this point, will refill */ - pd->moved = 0; /* This now counts the open type size in bits */ - - ASN_DEBUG_INDENT_ADD(+4); - rv = td->op->uper_decoder(ctx, td, constraints, sptr, pd); - ASN_DEBUG_INDENT_ADD(-4); - -#define UPDRESTOREPD do { \ - /* buffer and nboff are valid, preserve them. */ \ - pd->nbits = arg.oldpd.nbits - (pd->moved - arg.ot_moved); \ - pd->moved = arg.oldpd.moved + (pd->moved - arg.ot_moved); \ - pd->refill = arg.oldpd.refill; \ - pd->refill_key = arg.oldpd.refill_key; \ - } while(0) - - if(rv.code != RC_OK) { - UPDRESTOREPD; - return rv; - } - - ASN_DEBUG("OpenType %s pd%s old%s unclaimed=%d, repeat=%d", td->name, - asn_bit_data_string(pd), - asn_bit_data_string(&arg.oldpd), - (int)arg.unclaimed, (int)arg.repeat); - - padding = pd->moved % 8; - if(padding) { - int32_t pvalue; - if(padding > 7) { - ASN_DEBUG("Too large padding %d in open type", - (int)padding); - rv.code = RC_FAIL; - UPDRESTOREPD; - return rv; - } - padding = 8 - padding; - ASN_DEBUG("Getting padding of %d bits", (int)padding); - pvalue = per_get_few_bits(pd, padding); - switch(pvalue) { - case -1: - ASN_DEBUG("Padding skip failed"); - UPDRESTOREPD; - ASN__DECODE_STARVED; - case 0: break; - default: - ASN_DEBUG("Non-blank padding (%d bits 0x%02x)", - (int)padding, (int)pvalue); - UPDRESTOREPD; - ASN__DECODE_FAILED; - } - } - if(pd->nboff != pd->nbits) { - ASN_DEBUG("Open type %s overhead pd%s old%s", td->name, - asn_bit_data_string(pd), asn_bit_data_string(&arg.oldpd)); - if(1) { - UPDRESTOREPD; - ASN__DECODE_FAILED; - } else { - arg.unclaimed += pd->nbits - pd->nboff; - } - } - - /* Adjust pd back so it points to original data */ - UPDRESTOREPD; - - /* Skip data not consumed by the decoder */ - if(arg.unclaimed) { - ASN_DEBUG("Getting unclaimed %d", (int)arg.unclaimed); - switch(per_skip_bits(pd, arg.unclaimed)) { - case -1: - ASN_DEBUG("Claim of %d failed", (int)arg.unclaimed); - ASN__DECODE_STARVED; - case 0: - ASN_DEBUG("Got claim of %d", (int)arg.unclaimed); - break; - default: - /* Padding must be blank */ - ASN_DEBUG("Non-blank unconsumed padding"); - ASN__DECODE_FAILED; - } - arg.unclaimed = 0; - } - - if(arg.repeat) { - ASN_DEBUG("Not consumed the whole thing"); - rv.code = RC_FAIL; - return rv; - } - - return rv; -} - - -asn_dec_rval_t -uper_open_type_get(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - return uper_open_type_get_simple(ctx, td, constraints, sptr, pd); -} - -int -uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) { - asn_TYPE_descriptor_t s_td; - asn_TYPE_operation_t s_op; - asn_dec_rval_t rv; - - s_td.name = ""; - s_td.op = &s_op; - s_op.uper_decoder = uper_sot_suck; - - rv = uper_open_type_get(ctx, &s_td, 0, 0, pd); - if(rv.code != RC_OK) - return -1; - else - return 0; -} - -/* - * Internal functions. - */ - -static asn_dec_rval_t -uper_sot_suck(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, void **sptr, - asn_per_data_t *pd) { - asn_dec_rval_t rv; - - (void)ctx; - (void)td; - (void)constraints; - (void)sptr; - - while(per_get_few_bits(pd, 24) >= 0); - - rv.code = RC_OK; - rv.consumed = pd->moved; - - return rv; -} - -static int -uper_ugot_refill(asn_per_data_t *pd) { - uper_ugot_key *arg = pd->refill_key; - ssize_t next_chunk_bytes, next_chunk_bits; - ssize_t avail; - - asn_per_data_t *oldpd = &arg->oldpd; - - ASN_DEBUG("REFILLING pd->moved=%ld, oldpd->moved=%ld", - (long)pd->moved, (long)oldpd->moved); - - /* Advance our position to where pd is */ - oldpd->buffer = pd->buffer; - oldpd->nboff = pd->nboff; - oldpd->nbits -= pd->moved - arg->ot_moved; - oldpd->moved += pd->moved - arg->ot_moved; - arg->ot_moved = pd->moved; - - if(arg->unclaimed) { - /* Refill the container */ - if(per_get_few_bits(oldpd, 1)) - return -1; - if(oldpd->nboff == 0) { - assert(0); - return -1; - } - pd->buffer = oldpd->buffer; - pd->nboff = oldpd->nboff - 1; - pd->nbits = oldpd->nbits; - ASN_DEBUG("UNCLAIMED <- return from (pd->moved=%ld)", - (long)pd->moved); - return 0; - } - - if(!arg->repeat) { - ASN_DEBUG("Want more but refill doesn't have it"); - return -1; - } - - next_chunk_bytes = uper_get_length(oldpd, -1, 0, &arg->repeat); - ASN_DEBUG("Open type LENGTH %ld bytes at off %ld, repeat %ld", - (long)next_chunk_bytes, (long)oldpd->moved, (long)arg->repeat); - if(next_chunk_bytes < 0) return -1; - if(next_chunk_bytes == 0) { - pd->refill = 0; /* No more refills, naturally */ - assert(!arg->repeat); /* Implementation guarantee */ - } - next_chunk_bits = next_chunk_bytes << 3; - avail = oldpd->nbits - oldpd->nboff; - if(avail >= next_chunk_bits) { - pd->nbits = oldpd->nboff + next_chunk_bits; - arg->unclaimed = 0; - ASN_DEBUG("!+Parent frame %ld bits, alloting %ld [%ld..%ld] (%ld)", - (long)next_chunk_bits, (long)oldpd->moved, - (long)oldpd->nboff, (long)oldpd->nbits, - (long)(oldpd->nbits - oldpd->nboff)); - } else { - pd->nbits = oldpd->nbits; - arg->unclaimed = next_chunk_bits - avail; - ASN_DEBUG("!-Parent frame %ld, require %ld, will claim %ld", - (long)avail, (long)next_chunk_bits, - (long)arg->unclaimed); - } - pd->buffer = oldpd->buffer; - pd->nboff = oldpd->nboff; - ASN_DEBUG("Refilled pd%s old%s", - asn_bit_data_string(pd), asn_bit_data_string(oldpd)); - return 0; -} - -static int -per_skip_bits(asn_per_data_t *pd, int skip_nbits) { - int hasNonZeroBits = 0; - while(skip_nbits > 0) { - int skip; - - /* per_get_few_bits() is more efficient when nbits <= 24 */ - if(skip_nbits < 24) - skip = skip_nbits; - else - skip = 24; - skip_nbits -= skip; - - switch(per_get_few_bits(pd, skip)) { - case -1: return -1; /* Starving */ - case 0: continue; /* Skipped empty space */ - default: hasNonZeroBits = 1; continue; - } - } - return hasNonZeroBits; -} diff --git a/certgen/asncodec/per_opentype.h b/certgen/asncodec/per_opentype.h deleted file mode 100644 index 89675fa..0000000 --- a/certgen/asncodec/per_opentype.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2007-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _PER_OPENTYPE_H_ -#define _PER_OPENTYPE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -asn_dec_rval_t uper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - void **sptr, asn_per_data_t *pd); - -int uper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx, - asn_per_data_t *pd); - -/* - * X.691 (2015/08), #11.2 - * Returns -1 if error is encountered. 0 if all OK. - */ -int uper_open_type_put(const asn_TYPE_descriptor_t *td, - const asn_per_constraints_t *constraints, - const void *sptr, asn_per_outp_t *po); - -#ifdef __cplusplus -} -#endif - -#endif /* _PER_OPENTYPE_H_ */ diff --git a/certgen/asncodec/per_support.c b/certgen/asncodec/per_support.c deleted file mode 100644 index 289e0f8..0000000 --- a/certgen/asncodec/per_support.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 2005-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * X.691-201508 #10.9 General rules for encoding a length determinant. - * Get the optionally constrained length "n" from the stream. - */ -ssize_t -uper_get_length(asn_per_data_t *pd, int ebits, size_t lower_bound, - int *repeat) { - ssize_t value; - - *repeat = 0; - - /* #11.9.4.1 Encoding if constrained (according to effective bits) */ - if(ebits >= 0 && ebits <= 16) { - value = per_get_few_bits(pd, ebits); - if(value >= 0) value += lower_bound; - return value; - } - - value = per_get_few_bits(pd, 8); - if((value & 0x80) == 0) { /* #11.9.3.6 */ - return (value & 0x7F); - } else if((value & 0x40) == 0) { /* #11.9.3.7 */ - /* bit 8 ... set to 1 and bit 7 ... set to zero */ - value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8); - return value; /* potential -1 from per_get_few_bits passes through. */ - } else if(value < 0) { - ASN_DEBUG("END of stream reached for PER"); - return -1; - } - value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */ - if(value < 1 || value > 4) { - return -1; /* Prohibited by #11.9.3.8 */ - } - *repeat = 1; - return (16384 * value); -} - -/* - * Get the normally small length "n". - * This procedure used to decode length of extensions bit-maps - * for SET and SEQUENCE types. - */ -ssize_t -uper_get_nslength(asn_per_data_t *pd) { - ssize_t length; - - ASN_DEBUG("Getting normally small length"); - - if(per_get_few_bits(pd, 1) == 0) { - length = per_get_few_bits(pd, 6) + 1; - if(length <= 0) return -1; - ASN_DEBUG("l=%d", (int)length); - return length; - } else { - int repeat; - length = uper_get_length(pd, -1, 0, &repeat); - if(length >= 0 && !repeat) return length; - return -1; /* Error, or do not support >16K extensions */ - } -} - -/* - * Get the normally small non-negative whole number. - * X.691, #10.6 - */ -ssize_t -uper_get_nsnnwn(asn_per_data_t *pd) { - ssize_t value; - - value = per_get_few_bits(pd, 7); - if(value & 64) { /* implicit (value < 0) */ - value &= 63; - value <<= 2; - value |= per_get_few_bits(pd, 2); - if(value & 128) /* implicit (value < 0) */ - return -1; - if(value == 0) - return 0; - if(value >= 3) - return -1; - value = per_get_few_bits(pd, 8 * value); - return value; - } - - return value; -} - -/* - * X.691-11/2008, #11.6 - * Encoding of a normally small non-negative whole number - */ -int -uper_put_nsnnwn(asn_per_outp_t *po, int n) { - int bytes; - - if(n <= 63) { - if(n < 0) return -1; - return per_put_few_bits(po, n, 7); - } - if(n < 256) - bytes = 1; - else if(n < 65536) - bytes = 2; - else if(n < 256 * 65536) - bytes = 3; - else - return -1; /* This is not a "normally small" value */ - if(per_put_few_bits(po, bytes, 8)) - return -1; - - return per_put_few_bits(po, n, 8 * bytes); -} - - -/* X.691-2008/11, #11.5.6 -> #11.3 */ -int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) { - unsigned long lhalf; /* Lower half of the number*/ - long half; - - if(nbits <= 31) { - half = per_get_few_bits(pd, nbits); - if(half < 0) return -1; - *out_value = half; - return 0; - } - - if((size_t)nbits > 8 * sizeof(*out_value)) - return -1; /* RANGE */ - - half = per_get_few_bits(pd, 31); - if(half < 0) return -1; - - if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31)) - return -1; - - *out_value = ((unsigned long)half << (nbits - 31)) | lhalf; - return 0; -} - - -/* X.691-2008/11, #11.5.6 -> #11.3 */ -int -uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, - int nbits) { - if(nbits <= 31) { - return per_put_few_bits(po, v, nbits); - } else { - /* Put higher portion first, followed by lower 31-bit */ - if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31)) - return -1; - return per_put_few_bits(po, v, 31); - } -} - -/* - * X.691 (08/2015) #11.9 "General rules for encoding a length determinant" - * Put the length "n" (or part of it) into the stream. - */ -ssize_t -uper_put_length(asn_per_outp_t *po, size_t length, int *need_eom) { - int dummy = 0; - if(!need_eom) need_eom = &dummy; - - if(length <= 127) { /* #11.9.3.6 */ - *need_eom = 0; - return per_put_few_bits(po, length, 8) - ? -1 : (ssize_t)length; - } else if(length < 16384) { /* #10.9.3.7 */ - *need_eom = 0; - return per_put_few_bits(po, length|0x8000, 16) - ? -1 : (ssize_t)length; - } - - *need_eom = 0 == (length & 16383); - length >>= 14; - if(length > 4) { - *need_eom = 0; - length = 4; - } - - return per_put_few_bits(po, 0xC0 | length, 8) - ? -1 : (ssize_t)(length << 14); - -} - - -/* - * Put the normally small length "n" into the stream. - * This procedure used to encode length of extensions bit-maps - * for SET and SEQUENCE types. - */ -int -uper_put_nslength(asn_per_outp_t *po, size_t length) { - if(length <= 64) { - /* #11.9.3.4 */ - if(length == 0) return -1; - return per_put_few_bits(po, length - 1, 7) ? -1 : 0; - } else { - int need_eom = 0; - if(uper_put_length(po, length, &need_eom) != (ssize_t)length - || need_eom) { - /* This might happen in case of >16K extensions */ - return -1; - } - } - - return 0; -} - -static int -per__long_range(long lb, long ub, unsigned long *range_r) { - unsigned long bounds_range; - if((ub < 0) == (lb < 0)) { - bounds_range = ub - lb; - } else if(lb < 0) { - assert(ub >= 0); - bounds_range = 1 + ((unsigned long)ub + (unsigned long)-(lb + 1)); - } else { - assert(!"Unreachable"); - return -1; - } - *range_r = bounds_range; - return 0; -} - -int -per_long_range_rebase(long v, long lb, long ub, unsigned long *output) { - unsigned long range; - - assert(lb <= ub); - - if(v < lb || v > ub || per__long_range(lb, ub, &range) < 0) { - /* Range error. */ - return -1; - } - - /* - * Fundamentally what we're doing is returning (v-lb). - * However, this triggers undefined behavior when the word width - * of signed (v) is the same as the size of unsigned (*output). - * In practice, it triggers the UndefinedSanitizer. Therefore we shall - * compute the ranges accurately to avoid C's undefined behavior. - */ - if((v < 0) == (lb < 0)) { - *output = v-lb; - return 0; - } else if(v < 0) { - unsigned long rebased = 1 + (unsigned long)-(v+1) + (unsigned long)lb; - assert(rebased <= range); /* By construction */ - *output = rebased; - return 0; - } else if(lb < 0) { - unsigned long rebased = 1 + (unsigned long)-(lb+1) + (unsigned long)v; - assert(rebased <= range); /* By construction */ - *output = rebased; - return 0; - } else { - assert(!"Unreachable"); - return -1; - } -} - -int -per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp) { - unsigned long range; - - if(per__long_range(lb, ub, &range) != 0) { - return -1; - } - - if(inp > range) { - /* - * We can encode something in the given number of bits that technically - * exceeds the range. This is an avenue for security errors, - * so we don't allow that. - */ - return -1; - } - - if(inp <= LONG_MAX) { - *outp = (long)inp + lb; - } else { - *outp = (lb + LONG_MAX + 1) + (long)((inp - LONG_MAX) - 1); - } - - return 0; -} diff --git a/certgen/asncodec/per_support.h b/certgen/asncodec/per_support.h deleted file mode 100644 index c2b61d7..0000000 --- a/certgen/asncodec/per_support.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2005-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _PER_SUPPORT_H_ -#define _PER_SUPPORT_H_ - -#include /* Platform-specific types */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Pre-computed PER constraints. - */ -typedef struct asn_per_constraint_s { - enum asn_per_constraint_flags { - APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ - APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ - APC_CONSTRAINED = 0x2, /* Fully constrained */ - APC_EXTENSIBLE = 0x4 /* May have extension */ - } flags; - int range_bits; /* Full number of bits in the range */ - int effective_bits; /* Effective bits */ - long lower_bound; /* "lb" value */ - long upper_bound; /* "ub" value */ -} asn_per_constraint_t; -typedef struct asn_per_constraints_s { - asn_per_constraint_t value; - asn_per_constraint_t size; - int (*value2code)(unsigned int value); - int (*code2value)(unsigned int code); -} asn_per_constraints_t; - -/* Temporary compatibility layer. Will get removed. */ -typedef struct asn_bit_data_s asn_per_data_t; -#define per_get_few_bits(data, bits) asn_get_few_bits(data, bits) -#define per_get_undo(data, bits) asn_get_undo(data, bits) -#define per_get_many_bits(data, dst, align, bits) \ - asn_get_many_bits(data, dst, align, bits) - -/* - * X.691 (08/2015) #11.9 "General rules for encoding a length determinant" - * Get the length "n" from the Unaligned PER stream. - */ -ssize_t uper_get_length(asn_per_data_t *pd, int effective_bound_bits, - size_t lower_bound, int *repeat); - -/* - * Get the normally small length "n". - */ -ssize_t uper_get_nslength(asn_per_data_t *pd); - -/* - * Get the normally small non-negative whole number. - */ -ssize_t uper_get_nsnnwn(asn_per_data_t *pd); - -/* X.691-2008/11, #11.5.6 */ -int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits); - - -/* Temporary compatibility layer. Will get removed. */ -typedef struct asn_bit_outp_s asn_per_outp_t; -#define per_put_few_bits(out, bits, obits) asn_put_few_bits(out, bits, obits) -#define per_put_many_bits(out, src, nbits) asn_put_many_bits(out, src, nbits) -#define per_put_aligned_flush(out) asn_put_aligned_flush(out) - - -/* - * Rebase the given value as an offset into the range specified by the - * lower bound (lb) and upper bound (ub). - * RETURN VALUES: - * -1: Conversion failed due to range problems. - * 0: Conversion was successful. - */ -int per_long_range_rebase(long v, long lb, long ub, unsigned long *output); -/* The inverse operation: restores the value by the offset and its bounds. */ -int per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp); - -/* X.691-2008/11, #11.5 */ -int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits); - -/* - * X.691 (08/2015) #11.9 "General rules for encoding a length determinant" - * Put the length "whole_length" to the Unaligned PER stream. - * If (opt_need_eom) is given, it will be set to 1 if final 0-length is needed. - * In that case, invoke uper_put_length(po, 0, 0) after encoding the last block. - * This function returns the number of units which may be flushed - * in the next units saving iteration. - */ -ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length, - int *opt_need_eom); - -/* - * Put the normally small length "n" to the Unaligned PER stream. - * Returns 0 or -1. - */ -int uper_put_nslength(asn_per_outp_t *po, size_t length); - -/* - * Put the normally small non-negative whole number. - */ -int uper_put_nsnnwn(asn_per_outp_t *po, int n); - -#ifdef __cplusplus -} -#endif - -#endif /* _PER_SUPPORT_H_ */ diff --git a/certgen/asncodec/xer_decoder.c b/certgen/asncodec/xer_decoder.c index c34a6c6..2a14557 100644 --- a/certgen/asncodec/xer_decoder.c +++ b/certgen/asncodec/xer_decoder.c @@ -1,369 +1,369 @@ -/* - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include /* XER/XML parsing support */ - - -/* - * Decode the XER encoding of a given type. - */ -asn_dec_rval_t -xer_decode(const asn_codec_ctx_t *opt_codec_ctx, - const asn_TYPE_descriptor_t *td, void **struct_ptr, - const void *buffer, size_t size) { - asn_codec_ctx_t s_codec_ctx; - - /* - * Stack checker requires that the codec context - * must be allocated on the stack. - */ - if(opt_codec_ctx) { - if(opt_codec_ctx->max_stack_size) { - s_codec_ctx = *opt_codec_ctx; - opt_codec_ctx = &s_codec_ctx; - } - } else { - /* If context is not given, be security-conscious anyway */ - memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); - s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX; - opt_codec_ctx = &s_codec_ctx; - } - - /* - * Invoke type-specific decoder. - */ - return td->op->xer_decoder(opt_codec_ctx, td, struct_ptr, 0, buffer, size); -} - - - -struct xer__cb_arg { - pxml_chunk_type_e chunk_type; - size_t chunk_size; - const void *chunk_buf; - int callback_not_invoked; -}; - -static int -xer__token_cb(pxml_chunk_type_e type, const void *_chunk_data, size_t _chunk_size, void *key) { - struct xer__cb_arg *arg = (struct xer__cb_arg *)key; - arg->chunk_type = type; - arg->chunk_size = _chunk_size; - arg->chunk_buf = _chunk_data; - arg->callback_not_invoked = 0; - return -1; /* Terminate the XML parsing */ -} - -/* - * Fetch the next token from the XER/XML stream. - */ -ssize_t -xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_type_e *ch_type) { - struct xer__cb_arg arg; - int new_stateContext = *stateContext; - ssize_t ret; - - arg.callback_not_invoked = 1; - ret = pxml_parse(&new_stateContext, buffer, size, xer__token_cb, &arg); - if(ret < 0) return -1; - if(arg.callback_not_invoked) { - assert(ret == 0); /* No data was consumed */ - *ch_type = PXER_WMORE; - return 0; /* Try again with more data */ - } else { - assert(arg.chunk_size); - assert(arg.chunk_buf == buffer); - } - - /* - * Translate the XML chunk types into more convenient ones. - */ - switch(arg.chunk_type) { - case PXML_TEXT: - *ch_type = PXER_TEXT; - break; - case PXML_TAG: - *ch_type = PXER_WMORE; - return 0; /* Want more */ - case PXML_TAG_END: - *ch_type = PXER_TAG; - break; - case PXML_COMMENT: - case PXML_COMMENT_END: - *ch_type = PXER_COMMENT; - break; - } - - *stateContext = new_stateContext; - return arg.chunk_size; -} - -#define CSLASH 0x2f /* '/' */ -#define LANGLE 0x3c /* '<' */ -#define RANGLE 0x3e /* '>' */ - -xer_check_tag_e -xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { - const char *buf = (const char *)buf_ptr; - const char *end; - xer_check_tag_e ct = XCT_OPENING; - - if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) { - if(size >= 2) - ASN_DEBUG("Broken XML tag: \"%c...%c\"", - buf[0], buf[size - 1]); - return XCT_BROKEN; - } - - /* - * Determine the tag class. - */ - if(buf[1] == CSLASH) { - buf += 2; /* advance past "" */ - ct = XCT_CLOSING; - if(size > 0 && buf[size-1] == CSLASH) - return XCT_BROKEN; /* */ - } else { - buf++; /* advance past "<" */ - size -= 2; /* strip "<" and ">" */ - if(size > 0 && buf[size-1] == CSLASH) { - ct = XCT_BOTH; - size--; /* One more, for "/" */ - } - } - - /* Sometimes we don't care about the tag */ - if(!need_tag || !*need_tag) - return (xer_check_tag_e)(XCT__UNK__MASK | ct); - - /* - * Determine the tag name. - */ - for(end = buf + size; buf < end; buf++, need_tag++) { - int b = *buf, n = *need_tag; - if(b != n) { - if(n == 0) { - switch(b) { - case 0x09: case 0x0a: case 0x0c: case 0x0d: - case 0x20: - /* "": whitespace is normal */ - return ct; - } - } - return (xer_check_tag_e)(XCT__UNK__MASK | ct); - } - if(b == 0) - return XCT_BROKEN; /* Embedded 0 in buf?! */ - } - if(*need_tag) - return (xer_check_tag_e)(XCT__UNK__MASK | ct); - - return ct; -} - - -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = (num_bytes); \ - buf_ptr = ((const char *)buf_ptr) + num; \ - size -= num; \ - consumed_myself += num; \ - } while(0) - -#undef RETURN -#define RETURN(_code) do { \ - rval.code = _code; \ - rval.consumed = consumed_myself; \ - if(rval.code != RC_OK) \ - ASN_DEBUG("Failed with %d", rval.code); \ - return rval; \ - } while(0) - -#define XER_GOT_BODY(chunk_buf, chunk_size, size) do { \ - ssize_t converted_size = body_receiver \ - (struct_key, chunk_buf, chunk_size, \ - (size_t)chunk_size < size); \ - if(converted_size == -1) RETURN(RC_FAIL); \ - if(converted_size == 0 \ - && size == (size_t)chunk_size) \ - RETURN(RC_WMORE); \ - chunk_size = converted_size; \ - } while(0) -#define XER_GOT_EMPTY() do { \ - if(body_receiver(struct_key, 0, 0, size > 0) == -1) \ - RETURN(RC_FAIL); \ - } while(0) - -/* - * Generalized function for decoding the primitive values. - */ -asn_dec_rval_t -xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, - asn_struct_ctx_t *ctx, /* Type decoder context */ - void *struct_key, - const char *xml_tag, /* Expected XML tag */ - const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder) - (void *struct_key, const void *chunk_buf, size_t chunk_size), - ssize_t (*body_receiver) - (void *struct_key, const void *chunk_buf, size_t chunk_size, - int have_more) - ) { - - asn_dec_rval_t rval; - ssize_t consumed_myself = 0; - - (void)opt_codec_ctx; - - /* - * Phases of XER/XML processing: - * Phase 0: Check that the opening tag matches our expectations. - * Phase 1: Processing body and reacting on closing tag. - */ - if(ctx->phase > 1) RETURN(RC_FAIL); - for(;;) { - pxer_chunk_type_e ch_type; /* XER chunk type */ - ssize_t ch_size; /* Chunk size */ - xer_check_tag_e tcv; /* Tag check value */ - - /* - * Get the next part of the XML stream. - */ - ch_size = xer_next_token(&ctx->context, buf_ptr, size, - &ch_type); - if(ch_size == -1) { - RETURN(RC_FAIL); - } else { - switch(ch_type) { - case PXER_WMORE: - RETURN(RC_WMORE); - case PXER_COMMENT: /* Got XML comment */ - ADVANCE(ch_size); /* Skip silently */ - continue; - case PXER_TEXT: - if(ctx->phase == 0) { - /* - * We have to ignore whitespace here, - * but in order to be forward compatible - * with EXTENDED-XER (EMBED-VALUES, #25) - * any text is just ignored here. - */ - } else { - XER_GOT_BODY(buf_ptr, ch_size, size); - } - ADVANCE(ch_size); - continue; - case PXER_TAG: - break; /* Check the rest down there */ - } - } - - assert(ch_type == PXER_TAG && size); - - tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); - /* - * Phase 0: - * Expecting the opening tag - * for the type being processed. - * Phase 1: - * Waiting for the closing XML tag. - */ - switch(tcv) { - case XCT_BOTH: - if(ctx->phase) break; - /* Finished decoding of an empty element */ - XER_GOT_EMPTY(); - ADVANCE(ch_size); - ctx->phase = 2; /* Phase out */ - RETURN(RC_OK); - case XCT_OPENING: - if(ctx->phase) break; - ADVANCE(ch_size); - ctx->phase = 1; /* Processing body phase */ - continue; - case XCT_CLOSING: - if(!ctx->phase) break; - ADVANCE(ch_size); - ctx->phase = 2; /* Phase out */ - RETURN(RC_OK); - case XCT_UNKNOWN_BO: - /* - * Certain tags in the body may be expected. - */ - if(opt_unexpected_tag_decoder - && opt_unexpected_tag_decoder(struct_key, - buf_ptr, ch_size) >= 0) { - /* Tag's processed fine */ - ADVANCE(ch_size); - if(!ctx->phase) { - /* We are not expecting - * the closing tag anymore. */ - ctx->phase = 2; /* Phase out */ - RETURN(RC_OK); - } - continue; - } - /* Fall through */ - default: - break; /* Unexpected tag */ - } - - ASN_DEBUG("Unexpected XML tag (expected \"%s\")", xml_tag); - break; /* Dark and mysterious things have just happened */ - } - - RETURN(RC_FAIL); -} - - -size_t -xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { - const char *p = (const char *)chunk_buf; - const char *pend = p + chunk_size; - - for(; p < pend; p++) { - switch(*p) { - /* X.693, #8.1.4 - * HORISONTAL TAB (9) - * LINE FEED (10) - * CARRIAGE RETURN (13) - * SPACE (32) - */ - case 0x09: case 0x0a: case 0x0d: case 0x20: - continue; - default: - break; - } - break; - } - return (p - (const char *)chunk_buf); -} - -/* - * This is a vastly simplified, non-validating XML tree skipper. - */ -int -xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth) { - assert(*depth > 0); - switch(tcv) { - case XCT_BOTH: - case XCT_UNKNOWN_BO: - /* These negate each other. */ - return 0; - case XCT_OPENING: - case XCT_UNKNOWN_OP: - ++(*depth); - return 0; - case XCT_CLOSING: - case XCT_UNKNOWN_CL: - if(--(*depth) == 0) - return (tcv == XCT_CLOSING) ? 2 : 1; - return 0; - default: - return -1; - } -} +/* + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include /* XER/XML parsing support */ + + +/* + * Decode the XER encoding of a given type. + */ +asn_dec_rval_t +xer_decode(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, void **struct_ptr, + const void *buffer, size_t size) { + asn_codec_ctx_t s_codec_ctx; + + /* + * Stack checker requires that the codec context + * must be allocated on the stack. + */ + if(opt_codec_ctx) { + if(opt_codec_ctx->max_stack_size) { + s_codec_ctx = *opt_codec_ctx; + opt_codec_ctx = &s_codec_ctx; + } + } else { + /* If context is not given, be security-conscious anyway */ + memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); + s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX; + opt_codec_ctx = &s_codec_ctx; + } + + /* + * Invoke type-specific decoder. + */ + return td->op->xer_decoder(opt_codec_ctx, td, struct_ptr, 0, buffer, size); +} + + + +struct xer__cb_arg { + pxml_chunk_type_e chunk_type; + size_t chunk_size; + const void *chunk_buf; + int callback_not_invoked; +}; + +static int +xer__token_cb(pxml_chunk_type_e type, const void *_chunk_data, size_t _chunk_size, void *key) { + struct xer__cb_arg *arg = (struct xer__cb_arg *)key; + arg->chunk_type = type; + arg->chunk_size = _chunk_size; + arg->chunk_buf = _chunk_data; + arg->callback_not_invoked = 0; + return -1; /* Terminate the XML parsing */ +} + +/* + * Fetch the next token from the XER/XML stream. + */ +ssize_t +xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_type_e *ch_type) { + struct xer__cb_arg arg; + int new_stateContext = *stateContext; + ssize_t ret; + + arg.callback_not_invoked = 1; + ret = pxml_parse(&new_stateContext, buffer, size, xer__token_cb, &arg); + if(ret < 0) return -1; + if(arg.callback_not_invoked) { + assert(ret == 0); /* No data was consumed */ + *ch_type = PXER_WMORE; + return 0; /* Try again with more data */ + } else { + assert(arg.chunk_size); + assert(arg.chunk_buf == buffer); + } + + /* + * Translate the XML chunk types into more convenient ones. + */ + switch(arg.chunk_type) { + case PXML_TEXT: + *ch_type = PXER_TEXT; + break; + case PXML_TAG: + *ch_type = PXER_WMORE; + return 0; /* Want more */ + case PXML_TAG_END: + *ch_type = PXER_TAG; + break; + case PXML_COMMENT: + case PXML_COMMENT_END: + *ch_type = PXER_COMMENT; + break; + } + + *stateContext = new_stateContext; + return arg.chunk_size; +} + +#define CSLASH 0x2f /* '/' */ +#define LANGLE 0x3c /* '<' */ +#define RANGLE 0x3e /* '>' */ + +xer_check_tag_e +xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { + const char *buf = (const char *)buf_ptr; + const char *end; + xer_check_tag_e ct = XCT_OPENING; + + if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) { + if(size >= 2) + ASN_DEBUG("Broken XML tag: \"%c...%c\"", + buf[0], buf[size - 1]); + return XCT_BROKEN; + } + + /* + * Determine the tag class. + */ + if(buf[1] == CSLASH) { + buf += 2; /* advance past "" */ + ct = XCT_CLOSING; + if(size > 0 && buf[size-1] == CSLASH) + return XCT_BROKEN; /* */ + } else { + buf++; /* advance past "<" */ + size -= 2; /* strip "<" and ">" */ + if(size > 0 && buf[size-1] == CSLASH) { + ct = XCT_BOTH; + size--; /* One more, for "/" */ + } + } + + /* Sometimes we don't care about the tag */ + if(!need_tag || !*need_tag) + return (xer_check_tag_e)(XCT__UNK__MASK | ct); + + /* + * Determine the tag name. + */ + for(end = buf + size; buf < end; buf++, need_tag++) { + int b = *buf, n = *need_tag; + if(b != n) { + if(n == 0) { + switch(b) { + case 0x09: case 0x0a: case 0x0c: case 0x0d: + case 0x20: + /* "": whitespace is normal */ + return ct; + } + } + return (xer_check_tag_e)(XCT__UNK__MASK | ct); + } + if(b == 0) + return XCT_BROKEN; /* Embedded 0 in buf?! */ + } + if(*need_tag) + return (xer_check_tag_e)(XCT__UNK__MASK | ct); + + return ct; +} + + +#undef ADVANCE +#define ADVANCE(num_bytes) do { \ + size_t num = (num_bytes); \ + buf_ptr = ((const char *)buf_ptr) + num; \ + size -= num; \ + consumed_myself += num; \ + } while(0) + +#undef RETURN +#define RETURN(_code) do { \ + rval.code = _code; \ + rval.consumed = consumed_myself; \ + if(rval.code != RC_OK) \ + ASN_DEBUG("Failed with %d", rval.code); \ + return rval; \ + } while(0) + +#define XER_GOT_BODY(chunk_buf, chunk_size, size) do { \ + ssize_t converted_size = body_receiver \ + (struct_key, chunk_buf, chunk_size, \ + (size_t)chunk_size < size); \ + if(converted_size == -1) RETURN(RC_FAIL); \ + if(converted_size == 0 \ + && size == (size_t)chunk_size) \ + RETURN(RC_WMORE); \ + chunk_size = converted_size; \ + } while(0) +#define XER_GOT_EMPTY() do { \ + if(body_receiver(struct_key, 0, 0, size > 0) == -1) \ + RETURN(RC_FAIL); \ + } while(0) + +/* + * Generalized function for decoding the primitive values. + */ +asn_dec_rval_t +xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, + asn_struct_ctx_t *ctx, /* Type decoder context */ + void *struct_key, + const char *xml_tag, /* Expected XML tag */ + const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder) + (void *struct_key, const void *chunk_buf, size_t chunk_size), + ssize_t (*body_receiver) + (void *struct_key, const void *chunk_buf, size_t chunk_size, + int have_more) + ) { + + asn_dec_rval_t rval; + ssize_t consumed_myself = 0; + + (void)opt_codec_ctx; + + /* + * Phases of XER/XML processing: + * Phase 0: Check that the opening tag matches our expectations. + * Phase 1: Processing body and reacting on closing tag. + */ + if(ctx->phase > 1) RETURN(RC_FAIL); + for(;;) { + pxer_chunk_type_e ch_type; /* XER chunk type */ + ssize_t ch_size; /* Chunk size */ + xer_check_tag_e tcv; /* Tag check value */ + + /* + * Get the next part of the XML stream. + */ + ch_size = xer_next_token(&ctx->context, buf_ptr, size, + &ch_type); + if(ch_size == -1) { + RETURN(RC_FAIL); + } else { + switch(ch_type) { + case PXER_WMORE: + RETURN(RC_WMORE); + case PXER_COMMENT: /* Got XML comment */ + ADVANCE(ch_size); /* Skip silently */ + continue; + case PXER_TEXT: + if(ctx->phase == 0) { + /* + * We have to ignore whitespace here, + * but in order to be forward compatible + * with EXTENDED-XER (EMBED-VALUES, #25) + * any text is just ignored here. + */ + } else { + XER_GOT_BODY(buf_ptr, ch_size, size); + } + ADVANCE(ch_size); + continue; + case PXER_TAG: + break; /* Check the rest down there */ + } + } + + assert(ch_type == PXER_TAG && size); + + tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); + /* + * Phase 0: + * Expecting the opening tag + * for the type being processed. + * Phase 1: + * Waiting for the closing XML tag. + */ + switch(tcv) { + case XCT_BOTH: + if(ctx->phase) break; + /* Finished decoding of an empty element */ + XER_GOT_EMPTY(); + ADVANCE(ch_size); + ctx->phase = 2; /* Phase out */ + RETURN(RC_OK); + case XCT_OPENING: + if(ctx->phase) break; + ADVANCE(ch_size); + ctx->phase = 1; /* Processing body phase */ + continue; + case XCT_CLOSING: + if(!ctx->phase) break; + ADVANCE(ch_size); + ctx->phase = 2; /* Phase out */ + RETURN(RC_OK); + case XCT_UNKNOWN_BO: + /* + * Certain tags in the body may be expected. + */ + if(opt_unexpected_tag_decoder + && opt_unexpected_tag_decoder(struct_key, + buf_ptr, ch_size) >= 0) { + /* Tag's processed fine */ + ADVANCE(ch_size); + if(!ctx->phase) { + /* We are not expecting + * the closing tag anymore. */ + ctx->phase = 2; /* Phase out */ + RETURN(RC_OK); + } + continue; + } + /* Fall through */ + default: + break; /* Unexpected tag */ + } + + ASN_DEBUG("Unexpected XML tag (expected \"%s\")", xml_tag); + break; /* Dark and mysterious things have just happened */ + } + + RETURN(RC_FAIL); +} + + +size_t +xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { + const char *p = (const char *)chunk_buf; + const char *pend = (p == NULL)? NULL : p + chunk_size; + + for(; p < pend; p++) { + switch(*p) { + /* X.693, #8.1.4 + * HORISONTAL TAB (9) + * LINE FEED (10) + * CARRIAGE RETURN (13) + * SPACE (32) + */ + case 0x09: case 0x0a: case 0x0d: case 0x20: + continue; + default: + break; + } + break; + } + return (p - (const char *)chunk_buf); +} + +/* + * This is a vastly simplified, non-validating XML tree skipper. + */ +int +xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth) { + assert(*depth > 0); + switch(tcv) { + case XCT_BOTH: + case XCT_UNKNOWN_BO: + /* These negate each other. */ + return 0; + case XCT_OPENING: + case XCT_UNKNOWN_OP: + ++(*depth); + return 0; + case XCT_CLOSING: + case XCT_UNKNOWN_CL: + if(--(*depth) == 0) + return (tcv == XCT_CLOSING) ? 2 : 1; + return 0; + default: + return -1; + } +} diff --git a/certgen/asncodec/xer_decoder.h b/certgen/asncodec/xer_decoder.h index 143a21f..b951c41 100644 --- a/certgen/asncodec/xer_decoder.h +++ b/certgen/asncodec/xer_decoder.h @@ -1,106 +1,106 @@ -/*- - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _XER_DECODER_H_ -#define _XER_DECODER_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * The XER decoder of any ASN.1 type. May be invoked by the application. - * Decodes CANONICAL-XER and BASIC-XER. - */ -asn_dec_rval_t xer_decode( - const struct asn_codec_ctx_s *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ -); - -/* - * Type of the type-specific XER decoder function. - */ -typedef asn_dec_rval_t(xer_type_decoder_f)( - const asn_codec_ctx_t *opt_codec_ctx, - const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, - const char *opt_mname, /* Member name */ - const void *buf_ptr, size_t size); - -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ - -/* - * Generalized function for decoding the primitive values. - * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8 - * and others. This function should not be used by applications, as its API - * is subject to changes. - */ -asn_dec_rval_t xer_decode_general( - const asn_codec_ctx_t *opt_codec_ctx, - asn_struct_ctx_t *ctx, /* Type decoder context */ - void *struct_key, /* Treated as opaque pointer */ - const char *xml_tag, /* Expected XML tag name */ - const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf, - size_t chunk_size), - ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf, - size_t chunk_size, int have_more)); - - -/* - * Fetch the next XER (XML) token from the stream. - * The function returns the number of bytes occupied by the chunk type, - * returned in the _ch_type. The _ch_type is only set (and valid) when - * the return value is >= 0. - */ - typedef enum pxer_chunk_type { - PXER_WMORE, /* Chunk type is not clear, more data expected. */ - PXER_TAG, /* Complete XER tag */ - PXER_TEXT, /* Plain text between XER tags */ - PXER_COMMENT /* A comment, may be part of */ - } pxer_chunk_type_e; -ssize_t xer_next_token(int *stateContext, - const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); - -/* - * This function checks the buffer against the tag name is expected to occur. - */ - typedef enum xer_check_tag { - XCT_BROKEN = 0, /* The tag is broken */ - XCT_OPENING = 1, /* This is the tag */ - XCT_CLOSING = 2, /* This is the tag */ - XCT_BOTH = 3, /* This is the tag */ - XCT__UNK__MASK = 4, /* Mask of everything unexpected */ - XCT_UNKNOWN_OP = 5, /* Unexpected tag */ - XCT_UNKNOWN_CL = 6, /* Unexpected tag */ - XCT_UNKNOWN_BO = 7 /* Unexpected tag */ - } xer_check_tag_e; -xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, - const char *need_tag); - -/* - * Get the number of bytes consisting entirely of XER whitespace characters. - * RETURN VALUES: - * >=0: Number of whitespace characters in the string. - */ -size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size); - -/* - * Skip the series of anticipated extensions. - */ -int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); - -#ifdef __cplusplus -} -#endif - -#endif /* _XER_DECODER_H_ */ +/*- + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _XER_DECODER_H_ +#define _XER_DECODER_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ + +/* + * The XER decoder of any ASN.1 type. May be invoked by the application. + * Decodes CANONICAL-XER and BASIC-XER. + */ +asn_dec_rval_t xer_decode( + const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of data buffer */ +); + +/* + * Type of the type-specific XER decoder function. + */ +typedef asn_dec_rval_t(xer_type_decoder_f)( + const asn_codec_ctx_t *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, + const char *opt_mname, /* Member name */ + const void *buf_ptr, size_t size); + +/******************************* + * INTERNALLY USEFUL FUNCTIONS * + *******************************/ + +/* + * Generalized function for decoding the primitive values. + * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8 + * and others. This function should not be used by applications, as its API + * is subject to changes. + */ +asn_dec_rval_t xer_decode_general( + const asn_codec_ctx_t *opt_codec_ctx, + asn_struct_ctx_t *ctx, /* Type decoder context */ + void *struct_key, /* Treated as opaque pointer */ + const char *xml_tag, /* Expected XML tag name */ + const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf, + size_t chunk_size), + ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf, + size_t chunk_size, int have_more)); + + +/* + * Fetch the next XER (XML) token from the stream. + * The function returns the number of bytes occupied by the chunk type, + * returned in the _ch_type. The _ch_type is only set (and valid) when + * the return value is >= 0. + */ + typedef enum pxer_chunk_type { + PXER_WMORE, /* Chunk type is not clear, more data expected. */ + PXER_TAG, /* Complete XER tag */ + PXER_TEXT, /* Plain text between XER tags */ + PXER_COMMENT /* A comment, may be part of */ + } pxer_chunk_type_e; +ssize_t xer_next_token(int *stateContext, + const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); + +/* + * This function checks the buffer against the tag name is expected to occur. + */ + typedef enum xer_check_tag { + XCT_BROKEN = 0, /* The tag is broken */ + XCT_OPENING = 1, /* This is the tag */ + XCT_CLOSING = 2, /* This is the tag */ + XCT_BOTH = 3, /* This is the tag */ + XCT__UNK__MASK = 4, /* Mask of everything unexpected */ + XCT_UNKNOWN_OP = 5, /* Unexpected tag */ + XCT_UNKNOWN_CL = 6, /* Unexpected tag */ + XCT_UNKNOWN_BO = 7 /* Unexpected tag */ + } xer_check_tag_e; +xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, + const char *need_tag); + +/* + * Get the number of bytes consisting entirely of XER whitespace characters. + * RETURN VALUES: + * >=0: Number of whitespace characters in the string. + */ +size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size); + +/* + * Skip the series of anticipated extensions. + */ +int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); + +#ifdef __cplusplus +} +#endif + +#endif /* _XER_DECODER_H_ */ diff --git a/certgen/asncodec/xer_encoder.c b/certgen/asncodec/xer_encoder.c index 3fae5ed..4177ede 100644 --- a/certgen/asncodec/xer_encoder.c +++ b/certgen/asncodec/xer_encoder.c @@ -1,237 +1,237 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * The XER encoder of any type. May be invoked by the application. - */ -asn_enc_rval_t -xer_encode(const asn_TYPE_descriptor_t *td, const void *sptr, - enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *cb, - void *app_key) { - asn_enc_rval_t er = {0, 0, 0}; - asn_enc_rval_t tmper; - const char *mname; - size_t mlen; - int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2; - - if(!td || !sptr) goto cb_failed; - - mname = td->xml_tag; - mlen = strlen(mname); - - ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); - - tmper = td->op->xer_encoder(td, sptr, 1, xer_flags, cb, app_key); - if(tmper.encoded == -1) return tmper; - er.encoded += tmper.encoded; - - ASN__CALLBACK3("\n", xcan); - - ASN__ENCODED_OK(er); -cb_failed: - ASN__ENCODE_FAILED; -} - -/* - * This is a helper function for xer_fprint, which directs all incoming data - * into the provided file descriptor. - */ -static int -xer__print2fp(const void *buffer, size_t size, void *app_key) { - FILE *stream = (FILE *)app_key; - - if(fwrite(buffer, 1, size, stream) != size) - return -1; - - return 0; -} - -int -xer_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, const void *sptr) { - asn_enc_rval_t er; - - if(!stream) stream = stdout; - if(!td || !sptr) - return -1; - - er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream); - if(er.encoded == -1) - return -1; - - return fflush(stream); -} - -struct xer_buffer { - char *buffer; - size_t buffer_size; - size_t allocated_size; -}; - -static int -xer__buffer_append(const void *buffer, size_t size, void *app_key) { - struct xer_buffer *xb = app_key; - - while(xb->buffer_size + size + 1 > xb->allocated_size) { - size_t new_size = 2 * (xb->allocated_size ? xb->allocated_size : 64); - char *new_buf = MALLOC(new_size); - if(!new_buf) return -1; - if (xb->buffer) { - memcpy(new_buf, xb->buffer, xb->buffer_size); - } - FREEMEM(xb->buffer); - xb->buffer = new_buf; - xb->allocated_size = new_size; - } - - memcpy(xb->buffer + xb->buffer_size, buffer, size); - xb->buffer_size += size; - xb->buffer[xb->buffer_size] = '\0'; - return 0; -} - -enum xer_equivalence_e -xer_equivalent(const struct asn_TYPE_descriptor_s *td, const void *struct1, - const void *struct2, FILE *opt_debug_stream) { - struct xer_buffer xb1 = {0, 0, 0}; - struct xer_buffer xb2 = {0, 0, 0}; - asn_enc_rval_t e1, e2; - asn_dec_rval_t rval; - void *sptr = NULL; - - if(!td || !struct1 || !struct2) { - if(opt_debug_stream) { - if(!td) fprintf(opt_debug_stream, "Type descriptor missing\n"); - if(!struct1) fprintf(opt_debug_stream, "Structure 1 missing\n"); - if(!struct2) fprintf(opt_debug_stream, "Structure 2 missing\n"); - } - return XEQ_FAILURE; - } - - e1 = xer_encode(td, struct1, XER_F_BASIC, xer__buffer_append, &xb1); - if(e1.encoded == -1) { - if(opt_debug_stream) { - fprintf(stderr, "XER Encoding of %s failed\n", td->name); - } - FREEMEM(xb1.buffer); - return XEQ_ENCODE1_FAILED; - } - - e2 = xer_encode(td, struct2, XER_F_BASIC, xer__buffer_append, &xb2); - if(e2.encoded == -1) { - if(opt_debug_stream) { - fprintf(stderr, "XER Encoding of %s failed\n", td->name); - } - FREEMEM(xb1.buffer); - FREEMEM(xb2.buffer); - return XEQ_ENCODE1_FAILED; - } - - if(xb1.buffer_size != xb2.buffer_size - || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) { - if(opt_debug_stream) { - fprintf(opt_debug_stream, - "Structures XER-encoded into different byte streams:\n=== " - "Structure 1 ===\n%s\n=== Structure 2 ===\n%s\n", - xb1.buffer, xb2.buffer); - } - FREEMEM(xb1.buffer); - FREEMEM(xb2.buffer); - return XEQ_DIFFERENT; - } else { - if(opt_debug_stream) { - fprintf(opt_debug_stream, - "Both structures encoded into the same XER byte stream " - "of size %" ASN_PRI_SIZE ":\n%s", - xb1.buffer_size, xb1.buffer); - } - } - - rval = xer_decode(NULL, td, (void **)&sptr, xb1.buffer, - xb1.buffer_size); - switch(rval.code) { - case RC_OK: - break; - case RC_WMORE: - if(opt_debug_stream) { - fprintf(opt_debug_stream, - "Structure %s XER decode unexpectedly requires " - "more data:\n%s\n", - td->name, xb1.buffer); - } - /* Fall through */ - case RC_FAIL: - default: - if(opt_debug_stream) { - fprintf(opt_debug_stream, - "Structure %s XER decoding resulted in failure.\n", - td->name); - } - ASN_STRUCT_FREE(*td, sptr); - FREEMEM(xb1.buffer); - FREEMEM(xb2.buffer); - return XEQ_DECODE_FAILED; - } - - if(rval.consumed != xb1.buffer_size - && ((rval.consumed > xb1.buffer_size) - || xer_whitespace_span(xb1.buffer + rval.consumed, - xb1.buffer_size - rval.consumed) - != (xb1.buffer_size - rval.consumed))) { - if(opt_debug_stream) { - fprintf(opt_debug_stream, - "Round-trip decode of %s required less bytes (%" ASN_PRI_SIZE ") than " - "encoded (%" ASN_PRI_SIZE ")\n", - td->name, rval.consumed, xb1.buffer_size); - } - ASN_STRUCT_FREE(*td, sptr); - FREEMEM(xb1.buffer); - FREEMEM(xb2.buffer); - return XEQ_ROUND_TRIP_FAILED; - } - - /* - * Reuse xb2 to encode newly decoded structure. - */ - FREEMEM(xb2.buffer); - memset(&xb2, 0, sizeof(xb2)); - - e2 = xer_encode(td, sptr, XER_F_BASIC, xer__buffer_append, &xb2); - if(e2.encoded == -1) { - if(opt_debug_stream) { - fprintf(stderr, "XER Encoding of round-trip decode of %s failed\n", - td->name); - } - ASN_STRUCT_FREE(*td, sptr); - FREEMEM(xb1.buffer); - FREEMEM(xb2.buffer); - return XEQ_ROUND_TRIP_FAILED; - } - - ASN_STRUCT_FREE(*td, sptr); - sptr = 0; - - if(xb1.buffer_size != xb2.buffer_size - || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) { - if(opt_debug_stream) { - fprintf(opt_debug_stream, - "XER Encoding of round-trip decode of %s resulted in " - "different byte stream:\n" - "=== Original ===\n%s\n" - "=== Round-tripped ===\n%s\n", - xb1.buffer, xb2.buffer, td->name); - } - FREEMEM(xb1.buffer); - FREEMEM(xb2.buffer); - return XEQ_ROUND_TRIP_FAILED; - } - - FREEMEM(xb1.buffer); - FREEMEM(xb2.buffer); - return XEQ_SUCCESS; -} - +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * The XER encoder of any type. May be invoked by the application. + */ +asn_enc_rval_t +xer_encode(const asn_TYPE_descriptor_t *td, const void *sptr, + enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *cb, + void *app_key) { + asn_enc_rval_t er = {0, 0, 0}; + asn_enc_rval_t tmper; + const char *mname; + size_t mlen; + int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2; + + if(!td || !sptr) goto cb_failed; + + mname = td->xml_tag; + mlen = strlen(mname); + + ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); + + tmper = td->op->xer_encoder(td, sptr, 1, xer_flags, cb, app_key); + if(tmper.encoded == -1) return tmper; + er.encoded += tmper.encoded; + + ASN__CALLBACK3("\n", xcan); + + ASN__ENCODED_OK(er); +cb_failed: + ASN__ENCODE_FAILED; +} + +/* + * This is a helper function for xer_fprint, which directs all incoming data + * into the provided file descriptor. + */ +static int +xer__print2fp(const void *buffer, size_t size, void *app_key) { + FILE *stream = (FILE *)app_key; + + if(fwrite(buffer, 1, size, stream) != size) + return -1; + + return 0; +} + +int +xer_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, const void *sptr) { + asn_enc_rval_t er = {0,0,0}; + + if(!stream) stream = stdout; + if(!td || !sptr) + return -1; + + er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream); + if(er.encoded == -1) + return -1; + + return fflush(stream); +} + +struct xer_buffer { + char *buffer; + size_t buffer_size; + size_t allocated_size; +}; + +static int +xer__buffer_append(const void *buffer, size_t size, void *app_key) { + struct xer_buffer *xb = app_key; + + while(xb->buffer_size + size + 1 > xb->allocated_size) { + size_t new_size = 2 * (xb->allocated_size ? xb->allocated_size : 64); + char *new_buf = MALLOC(new_size); + if(!new_buf) return -1; + if (xb->buffer) { + memcpy(new_buf, xb->buffer, xb->buffer_size); + } + FREEMEM(xb->buffer); + xb->buffer = new_buf; + xb->allocated_size = new_size; + } + + memcpy(xb->buffer + xb->buffer_size, buffer, size); + xb->buffer_size += size; + xb->buffer[xb->buffer_size] = '\0'; + return 0; +} + +enum xer_equivalence_e +xer_equivalent(const struct asn_TYPE_descriptor_s *td, const void *struct1, + const void *struct2, FILE *opt_debug_stream) { + struct xer_buffer xb1 = {0, 0, 0}; + struct xer_buffer xb2 = {0, 0, 0}; + asn_enc_rval_t e1, e2; + asn_dec_rval_t rval; + void *sptr = NULL; + + if(!td || !struct1 || !struct2) { + if(opt_debug_stream) { + if(!td) fprintf(opt_debug_stream, "Type descriptor missing\n"); + if(!struct1) fprintf(opt_debug_stream, "Structure 1 missing\n"); + if(!struct2) fprintf(opt_debug_stream, "Structure 2 missing\n"); + } + return XEQ_FAILURE; + } + + e1 = xer_encode(td, struct1, XER_F_BASIC, xer__buffer_append, &xb1); + if(e1.encoded == -1) { + if(opt_debug_stream) { + fprintf(stderr, "XER Encoding of %s failed\n", td->name); + } + FREEMEM(xb1.buffer); + return XEQ_ENCODE1_FAILED; + } + + e2 = xer_encode(td, struct2, XER_F_BASIC, xer__buffer_append, &xb2); + if(e2.encoded == -1) { + if(opt_debug_stream) { + fprintf(stderr, "XER Encoding of %s failed\n", td->name); + } + FREEMEM(xb1.buffer); + FREEMEM(xb2.buffer); + return XEQ_ENCODE1_FAILED; + } + + if(xb1.buffer_size != xb2.buffer_size + || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) { + if(opt_debug_stream) { + fprintf(opt_debug_stream, + "Structures XER-encoded into different byte streams:\n=== " + "Structure 1 ===\n%s\n=== Structure 2 ===\n%s\n", + xb1.buffer, xb2.buffer); + } + FREEMEM(xb1.buffer); + FREEMEM(xb2.buffer); + return XEQ_DIFFERENT; + } else { + if(opt_debug_stream) { + fprintf(opt_debug_stream, + "Both structures encoded into the same XER byte stream " + "of size %" ASN_PRI_SIZE ":\n%s", + xb1.buffer_size, xb1.buffer); + } + } + + rval = xer_decode(NULL, td, (void **)&sptr, xb1.buffer, + xb1.buffer_size); + switch(rval.code) { + case RC_OK: + break; + case RC_WMORE: + if(opt_debug_stream) { + fprintf(opt_debug_stream, + "Structure %s XER decode unexpectedly requires " + "more data:\n%s\n", + td->name, xb1.buffer); + } + /* Fall through */ + case RC_FAIL: + default: + if(opt_debug_stream) { + fprintf(opt_debug_stream, + "Structure %s XER decoding resulted in failure.\n", + td->name); + } + ASN_STRUCT_FREE(*td, sptr); + FREEMEM(xb1.buffer); + FREEMEM(xb2.buffer); + return XEQ_DECODE_FAILED; + } + + if(rval.consumed != xb1.buffer_size + && ((rval.consumed > xb1.buffer_size) + || xer_whitespace_span(xb1.buffer + rval.consumed, + xb1.buffer_size - rval.consumed) + != (xb1.buffer_size - rval.consumed))) { + if(opt_debug_stream) { + fprintf(opt_debug_stream, + "Round-trip decode of %s required less bytes (%" ASN_PRI_SIZE ") than " + "encoded (%" ASN_PRI_SIZE ")\n", + td->name, rval.consumed, xb1.buffer_size); + } + ASN_STRUCT_FREE(*td, sptr); + FREEMEM(xb1.buffer); + FREEMEM(xb2.buffer); + return XEQ_ROUND_TRIP_FAILED; + } + + /* + * Reuse xb2 to encode newly decoded structure. + */ + FREEMEM(xb2.buffer); + memset(&xb2, 0, sizeof(xb2)); + + e2 = xer_encode(td, sptr, XER_F_BASIC, xer__buffer_append, &xb2); + if(e2.encoded == -1) { + if(opt_debug_stream) { + fprintf(stderr, "XER Encoding of round-trip decode of %s failed\n", + td->name); + } + ASN_STRUCT_FREE(*td, sptr); + FREEMEM(xb1.buffer); + FREEMEM(xb2.buffer); + return XEQ_ROUND_TRIP_FAILED; + } + + ASN_STRUCT_FREE(*td, sptr); + sptr = 0; + + if(xb1.buffer_size != xb2.buffer_size + || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) { + if(opt_debug_stream) { + fprintf(opt_debug_stream, + "XER Encoding of round-trip decode of %s resulted in " + "different byte stream:\n" + "=== Original ===\n%s\n" + "=== Round-tripped ===\n%s\n", + xb1.buffer, xb2.buffer, td->name); + } + FREEMEM(xb1.buffer); + FREEMEM(xb2.buffer); + return XEQ_ROUND_TRIP_FAILED; + } + + FREEMEM(xb1.buffer); + FREEMEM(xb2.buffer); + return XEQ_SUCCESS; +} + diff --git a/certgen/asncodec/xer_encoder.h b/certgen/asncodec/xer_encoder.h index 8a5fc58..6cfc505 100644 --- a/certgen/asncodec/xer_encoder.h +++ b/certgen/asncodec/xer_encoder.h @@ -1,83 +1,83 @@ -/*- - * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _XER_ENCODER_H_ -#define _XER_ENCODER_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ -enum xer_encoder_flags_e { - /* Mode of encoding */ - XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ - XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ -}; - -/* - * The XER encoder of any type. May be invoked by the application. - * Produces CANONICAL-XER and BASIC-XER depending on the (xer_flags). - */ -asn_enc_rval_t xer_encode(const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Structure to be encoded */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ -); - -/* - * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) - * output into the chosen file pointer. - * RETURN VALUES: - * 0: The structure is printed. - * -1: Problem printing the structure. - * WARNING: No sensible errno value is returned. - */ -int xer_fprint(FILE *stream, const struct asn_TYPE_descriptor_s *td, - const void *struct_ptr); - -/* - * A helper function that uses XER encoding/decoding to verify that: - * - Both structures encode into the same BASIC XER. - * - Both resulting XER byte streams can be decoded back. - * - Both decoded structures encode into the same BASIC XER (round-trip). - * All of this verifies equivalence between structures and a round-trip. - * ARGUMENTS: - * (opt_debug_stream) - If specified, prints ongoing details. - */ -enum xer_equivalence_e { - XEQ_SUCCESS, /* The only completely positive return value */ - XEQ_FAILURE, /* General failure */ - XEQ_ENCODE1_FAILED, /* First sructure XER encoding failed */ - XEQ_ENCODE2_FAILED, /* Second structure XER encoding failed */ - XEQ_DIFFERENT, /* Structures encoded into different XER */ - XEQ_DECODE_FAILED, /* Decode of the XER data failed */ - XEQ_ROUND_TRIP_FAILED /* Bad round-trip */ -}; -enum xer_equivalence_e xer_equivalent( - const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct1, - const void *struct2, FILE *opt_debug_stream); - -/* - * Type of the generic XER encoder. - */ -typedef asn_enc_rval_t(xer_type_encoder_f)( - const struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Structure to be encoded */ - int ilevel, /* Level of indentation */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ -); - -#ifdef __cplusplus -} -#endif - -#endif /* _XER_ENCODER_H_ */ +/*- + * Copyright (c) 2004-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _XER_ENCODER_H_ +#define _XER_ENCODER_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ + +/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ +enum xer_encoder_flags_e { + /* Mode of encoding */ + XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ + XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ +}; + +/* + * The XER encoder of any type. May be invoked by the application. + * Produces CANONICAL-XER and BASIC-XER depending on the (xer_flags). + */ +asn_enc_rval_t xer_encode(const struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, /* Structure to be encoded */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ +); + +/* + * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) + * output into the chosen file pointer. + * RETURN VALUES: + * 0: The structure is printed. + * -1: Problem printing the structure. + * WARNING: No sensible errno value is returned. + */ +int xer_fprint(FILE *stream, const struct asn_TYPE_descriptor_s *td, + const void *struct_ptr); + +/* + * A helper function that uses XER encoding/decoding to verify that: + * - Both structures encode into the same BASIC XER. + * - Both resulting XER byte streams can be decoded back. + * - Both decoded structures encode into the same BASIC XER (round-trip). + * All of this verifies equivalence between structures and a round-trip. + * ARGUMENTS: + * (opt_debug_stream) - If specified, prints ongoing details. + */ +enum xer_equivalence_e { + XEQ_SUCCESS, /* The only completely positive return value */ + XEQ_FAILURE, /* General failure */ + XEQ_ENCODE1_FAILED, /* First structure XER encoding failed */ + XEQ_ENCODE2_FAILED, /* Second structure XER encoding failed */ + XEQ_DIFFERENT, /* Structures encoded into different XER */ + XEQ_DECODE_FAILED, /* Decode of the XER data failed */ + XEQ_ROUND_TRIP_FAILED /* Bad round-trip */ +}; +enum xer_equivalence_e xer_equivalent( + const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct1, + const void *struct2, FILE *opt_debug_stream); + +/* + * Type of the generic XER encoder. + */ +typedef asn_enc_rval_t(xer_type_encoder_f)( + const struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, /* Structure to be encoded */ + int ilevel, /* Level of indentation */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ +); + +#ifdef __cplusplus +} +#endif + +#endif /* _XER_ENCODER_H_ */ diff --git a/certgen/asncodec/xer_support.c b/certgen/asncodec/xer_support.c index e767e9f..36b4bfb 100644 --- a/certgen/asncodec/xer_support.c +++ b/certgen/asncodec/xer_support.c @@ -1,227 +1,227 @@ -/* - * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. - * Copyright (c) 2003, 2004, 2005 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -/* Parser states */ -typedef enum { - ST_TEXT, - ST_TAG_START, - ST_TAG_BODY, - ST_TAG_QUOTE_WAIT, - ST_TAG_QUOTED_STRING, - ST_TAG_UNQUOTED_STRING, - ST_COMMENT_WAIT_DASH1, /* ""[0] */ - ST_COMMENT_CLO_RT /* "-->"[1] */ -} pstate_e; - -static const int -_charclass[256] = { - 0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0, - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, - 1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, - 2,2,2,2,2,2,2,2, 2,2,0,0,0,0,0,0, /* 01234567 89 */ - 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, /* ABCDEFG HIJKLMNO */ - 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0, /* PQRSTUVW XYZ */ - 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, /* abcdefg hijklmno */ - 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0 /* pqrstuvw xyz */ -}; -#define WHITESPACE(c) (_charclass[(unsigned char)(c)] == 1) -#define ALNUM(c) (_charclass[(unsigned char)(c)] >= 2) -#define ALPHA(c) (_charclass[(unsigned char)(c)] == 3) - -/* Aliases for characters, ASCII/UTF-8 */ -#define EXCLAM 0x21 /* '!' */ -#define CQUOTE 0x22 /* '"' */ -#define CDASH 0x2d /* '-' */ -#define CSLASH 0x2f /* '/' */ -#define LANGLE 0x3c /* '<' */ -#define CEQUAL 0x3d /* '=' */ -#define RANGLE 0x3e /* '>' */ -#define CQUEST 0x3f /* '?' */ - -/* Invoke token callback */ -#define TOKEN_CB_CALL(type, _ns, _current_too, _final) do { \ - int _ret; \ - pstate_e ns = _ns; \ - ssize_t _sz = (p - chunk_start) + _current_too; \ - if (!_sz) { \ - /* Shortcut */ \ - state = _ns; \ - break; \ - } \ - _ret = cb(type, chunk_start, _sz, key); \ - if(_ret < _sz) { \ - if(_current_too && _ret == -1) \ - state = ns; \ - goto finish; \ - } \ - chunk_start = p + _current_too; \ - state = ns; \ - } while(0) - -#define TOKEN_CB(_type, _ns, _current_too) \ - TOKEN_CB_CALL(_type, _ns, _current_too, 0) - -#define PXML_TAG_FINAL_CHUNK_TYPE PXML_TAG_END -#define PXML_COMMENT_FINAL_CHUNK_TYPE PXML_COMMENT_END - -#define TOKEN_CB_FINAL(_type, _ns, _current_too) \ - TOKEN_CB_CALL( _type ## _FINAL_CHUNK_TYPE , _ns, _current_too, 1) - -/* - * Parser itself - */ -ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_callback_f *cb, void *key) { - pstate_e state = (pstate_e)*stateContext; - const char *chunk_start = (const char *)xmlbuf; - const char *p = chunk_start; - const char *end = p + size; - - for(; p < end; p++) { - int C = *(const unsigned char *)p; - switch(state) { - case ST_TEXT: - /* - * Initial state: we're in the middle of some text, - * or just have started. - */ - if (C == LANGLE) - /* We're now in the tag, probably */ - TOKEN_CB(PXML_TEXT, ST_TAG_START, 0); - break; - case ST_TAG_START: - if (ALPHA(C) || (C == CSLASH)) - state = ST_TAG_BODY; - else if (C == EXCLAM) - state = ST_COMMENT_WAIT_DASH1; - else - /* - * Not characters and not whitespace. - * Must be something like "3 < 4". - */ - TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */ - break; - case ST_TAG_BODY: - switch(C) { - case RANGLE: - /* End of the tag */ - TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); - break; - case LANGLE: - /* - * The previous tag wasn't completed, but still - * recognized as valid. (Mozilla-compatible) - */ - TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0); - break; - case CEQUAL: - state = ST_TAG_QUOTE_WAIT; - break; - } - break; - case ST_TAG_QUOTE_WAIT: - /* - * State after the equal sign ("=") in the tag. - */ - switch(C) { - case CQUOTE: - state = ST_TAG_QUOTED_STRING; - break; - case RANGLE: - /* End of the tag */ - TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); - break; - default: - if(!WHITESPACE(C)) - /* Unquoted string value */ - state = ST_TAG_UNQUOTED_STRING; - } - break; - case ST_TAG_QUOTED_STRING: - /* - * Tag attribute's string value in quotes. - */ - if(C == CQUOTE) { - /* Return back to the tag state */ - state = ST_TAG_BODY; - } - break; - case ST_TAG_UNQUOTED_STRING: - if(C == RANGLE) { - /* End of the tag */ - TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); - } else if(WHITESPACE(C)) { - /* Return back to the tag state */ - state = ST_TAG_BODY; - } - break; - case ST_COMMENT_WAIT_DASH1: - if(C == CDASH) { - state = ST_COMMENT_WAIT_DASH2; - } else { - /* Some ordinary tag. */ - state = ST_TAG_BODY; - } - break; - case ST_COMMENT_WAIT_DASH2: - if(C == CDASH) { - /* Seen "<--" */ - state = ST_COMMENT; - } else { - /* Some ordinary tag */ - state = ST_TAG_BODY; - } - break; - case ST_COMMENT: - if(C == CDASH) { - state = ST_COMMENT_CLO_DASH2; - } - break; - case ST_COMMENT_CLO_DASH2: - if(C == CDASH) { - state = ST_COMMENT_CLO_RT; - } else { - /* This is not an end of a comment */ - state = ST_COMMENT; - } - break; - case ST_COMMENT_CLO_RT: - if(C == RANGLE) { - TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1); - } else if(C == CDASH) { - /* Maintain current state, still waiting for '>' */ - } else { - state = ST_COMMENT; - } - break; - } /* switch(*ptr) */ - } /* for() */ - - /* - * Flush the partially processed chunk, state permitting. - */ - if(p - chunk_start) { - switch (state) { - case ST_COMMENT: - TOKEN_CB(PXML_COMMENT, state, 0); - break; - case ST_TEXT: - TOKEN_CB(PXML_TEXT, state, 0); - break; - default: break; /* a no-op */ - } - } - -finish: - *stateContext = (int)state; - return chunk_start - (const char *)xmlbuf; -} - +/* + * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. + * Copyright (c) 2003, 2004, 2005 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* Parser states */ +typedef enum { + ST_TEXT, + ST_TAG_START, + ST_TAG_BODY, + ST_TAG_QUOTE_WAIT, + ST_TAG_QUOTED_STRING, + ST_TAG_UNQUOTED_STRING, + ST_COMMENT_WAIT_DASH1, /* ""[0] */ + ST_COMMENT_CLO_RT /* "-->"[1] */ +} pstate_e; + +static const int +_charclass[256] = { + 0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 2,2,2,2,2,2,2,2, 2,2,0,0,0,0,0,0, /* 01234567 89 */ + 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, /* ABCDEFG HIJKLMNO */ + 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0, /* PQRSTUVW XYZ */ + 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, /* abcdefg hijklmno */ + 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0 /* pqrstuvw xyz */ +}; +#define WHITESPACE(c) (_charclass[(unsigned char)(c)] == 1) +#define ALNUM(c) (_charclass[(unsigned char)(c)] >= 2) +#define ALPHA(c) (_charclass[(unsigned char)(c)] == 3) + +/* Aliases for characters, ASCII/UTF-8 */ +#define EXCLAM 0x21 /* '!' */ +#define CQUOTE 0x22 /* '"' */ +#define CDASH 0x2d /* '-' */ +#define CSLASH 0x2f /* '/' */ +#define LANGLE 0x3c /* '<' */ +#define CEQUAL 0x3d /* '=' */ +#define RANGLE 0x3e /* '>' */ +#define CQUEST 0x3f /* '?' */ + +/* Invoke token callback */ +#define TOKEN_CB_CALL(type, _ns, _current_too, _final) do { \ + int _ret; \ + pstate_e ns = _ns; \ + ssize_t _sz = (p - chunk_start) + _current_too; \ + if (!_sz) { \ + /* Shortcut */ \ + state = _ns; \ + break; \ + } \ + _ret = cb(type, chunk_start, _sz, key); \ + if(_ret < _sz) { \ + if(_current_too && _ret == -1) \ + state = ns; \ + goto finish; \ + } \ + chunk_start = p + _current_too; \ + state = ns; \ + } while(0) + +#define TOKEN_CB(_type, _ns, _current_too) \ + TOKEN_CB_CALL(_type, _ns, _current_too, 0) + +#define PXML_TAG_FINAL_CHUNK_TYPE PXML_TAG_END +#define PXML_COMMENT_FINAL_CHUNK_TYPE PXML_COMMENT_END + +#define TOKEN_CB_FINAL(_type, _ns, _current_too) \ + TOKEN_CB_CALL( _type ## _FINAL_CHUNK_TYPE , _ns, _current_too, 1) + +/* + * Parser itself + */ +ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_callback_f *cb, void *key) { + pstate_e state = (pstate_e)*stateContext; + const char *chunk_start = (const char *)xmlbuf; + const char *p = chunk_start; + const char *end = p + size; + + for(; p < end; p++) { + int C = *(const unsigned char *)p; + switch(state) { + case ST_TEXT: + /* + * Initial state: we're in the middle of some text, + * or just have started. + */ + if (C == LANGLE) + /* We're now in the tag, probably */ + TOKEN_CB(PXML_TEXT, ST_TAG_START, 0); + break; + case ST_TAG_START: + if (ALPHA(C) || (C == CSLASH)) + state = ST_TAG_BODY; + else if (C == EXCLAM) + state = ST_COMMENT_WAIT_DASH1; + else + /* + * Not characters and not whitespace. + * Must be something like "3 < 4". + */ + TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */ + break; + case ST_TAG_BODY: + switch(C) { + case RANGLE: + /* End of the tag */ + TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + break; + case LANGLE: + /* + * The previous tag wasn't completed, but still + * recognized as valid. (Mozilla-compatible) + */ + TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0); + break; + case CEQUAL: + state = ST_TAG_QUOTE_WAIT; + break; + } + break; + case ST_TAG_QUOTE_WAIT: + /* + * State after the equal sign ("=") in the tag. + */ + switch(C) { + case CQUOTE: + state = ST_TAG_QUOTED_STRING; + break; + case RANGLE: + /* End of the tag */ + TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + break; + default: + if(!WHITESPACE(C)) + /* Unquoted string value */ + state = ST_TAG_UNQUOTED_STRING; + } + break; + case ST_TAG_QUOTED_STRING: + /* + * Tag attribute's string value in quotes. + */ + if(C == CQUOTE) { + /* Return back to the tag state */ + state = ST_TAG_BODY; + } + break; + case ST_TAG_UNQUOTED_STRING: + if(C == RANGLE) { + /* End of the tag */ + TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + } else if(WHITESPACE(C)) { + /* Return back to the tag state */ + state = ST_TAG_BODY; + } + break; + case ST_COMMENT_WAIT_DASH1: + if(C == CDASH) { + state = ST_COMMENT_WAIT_DASH2; + } else { + /* Some ordinary tag. */ + state = ST_TAG_BODY; + } + break; + case ST_COMMENT_WAIT_DASH2: + if(C == CDASH) { + /* Seen "<--" */ + state = ST_COMMENT; + } else { + /* Some ordinary tag */ + state = ST_TAG_BODY; + } + break; + case ST_COMMENT: + if(C == CDASH) { + state = ST_COMMENT_CLO_DASH2; + } + break; + case ST_COMMENT_CLO_DASH2: + if(C == CDASH) { + state = ST_COMMENT_CLO_RT; + } else { + /* This is not an end of a comment */ + state = ST_COMMENT; + } + break; + case ST_COMMENT_CLO_RT: + if(C == RANGLE) { + TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1); + } else if(C == CDASH) { + /* Maintain current state, still waiting for '>' */ + } else { + state = ST_COMMENT; + } + break; + } /* switch(*ptr) */ + } /* for() */ + + /* + * Flush the partially processed chunk, state permitting. + */ + if(p - chunk_start) { + switch (state) { + case ST_COMMENT: + TOKEN_CB(PXML_COMMENT, state, 0); + break; + case ST_TEXT: + TOKEN_CB(PXML_TEXT, state, 0); + break; + default: break; /* a no-op */ + } + } + +finish: + *stateContext = (int)state; + return chunk_start - (const char *)xmlbuf; +} + diff --git a/certgen/asncodec/xer_support.h b/certgen/asncodec/xer_support.h index 9cc5f59..2c3f369 100644 --- a/certgen/asncodec/xer_support.h +++ b/certgen/asncodec/xer_support.h @@ -1,55 +1,55 @@ -/* - * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _XER_SUPPORT_H_ -#define _XER_SUPPORT_H_ - -#include /* Platform-specific types */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Types of data transferred to the application. - */ -typedef enum { - PXML_TEXT, /* Plain text between XML tags. */ - PXML_TAG, /* A tag, starting with '<'. */ - PXML_COMMENT, /* An XML comment, including "". */ - /* - * The following chunk types are reported if the chunk - * terminates the specified XML element. - */ - PXML_TAG_END, /* Tag ended */ - PXML_COMMENT_END /* Comment ended */ -} pxml_chunk_type_e; - -/* - * Callback function that is called by the parser when parsed data is - * available. The _opaque is the pointer to a field containing opaque user - * data specified in pxml_create() call. The chunk type is _type and the text - * data is the piece of buffer identified by _bufid (as supplied to - * pxml_feed() call) starting at offset _offset and of _size bytes size. - * The chunk is NOT '\0'-terminated. - */ -typedef int (pxml_callback_f)(pxml_chunk_type_e _type, - const void *_chunk_data, size_t _chunk_size, void *_key); - -/* - * Parse the given buffer as it were a chunk of XML data. - * Invoke the specified callback each time the meaninful data is found. - * This function returns number of bytes consumed from the bufer. - * It will always be lesser than or equal to the specified _size. - * The next invocation of this function must account the difference. - */ -ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, - pxml_callback_f *cb, void *_key); - -#ifdef __cplusplus -} -#endif - -#endif /* _XER_SUPPORT_H_ */ +/* + * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. + * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _XER_SUPPORT_H_ +#define _XER_SUPPORT_H_ + +#include /* Platform-specific types */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Types of data transferred to the application. + */ +typedef enum { + PXML_TEXT, /* Plain text between XML tags. */ + PXML_TAG, /* A tag, starting with '<'. */ + PXML_COMMENT, /* An XML comment, including "". */ + /* + * The following chunk types are reported if the chunk + * terminates the specified XML element. + */ + PXML_TAG_END, /* Tag ended */ + PXML_COMMENT_END /* Comment ended */ +} pxml_chunk_type_e; + +/* + * Callback function that is called by the parser when parsed data is + * available. The _opaque is the pointer to a field containing opaque user + * data specified in pxml_create() call. The chunk type is _type and the text + * data is the piece of buffer identified by _bufid (as supplied to + * pxml_feed() call) starting at offset _offset and of _size bytes size. + * The chunk is NOT '\0'-terminated. + */ +typedef int (pxml_callback_f)(pxml_chunk_type_e _type, + const void *_chunk_data, size_t _chunk_size, void *_key); + +/* + * Parse the given buffer as it were a chunk of XML data. + * Invoke the specified callback each time the meaningful data is found. + * This function returns number of bytes consumed from the buffer. + * It will always be lesser than or equal to the specified _size. + * The next invocation of this function must account the difference. + */ +ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, + pxml_callback_f *cb, void *_key); + +#ifdef __cplusplus +} +#endif + +#endif /* _XER_SUPPORT_H_ */ diff --git a/certgen/certgen.c b/certgen/certgen.c index 3e47689..c176f44 100644 --- a/certgen/certgen.c +++ b/certgen/certgen.c @@ -11,6 +11,7 @@ #include "asn_application.h" #include "EtsiTs103097Certificate.h" +#include "CountryOnly.h" #include "xer_support.h" #define CERT_MAX_SIZE 0x10000 @@ -29,17 +30,6 @@ static int _debug = 0; static int _xer = 0; static int _view = 0; -static const char _sha256_emptyString[] = { - 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, - 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55 -}; - -static const char _sha384_emptyString[] = { - 0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38, 0x4c, 0xd9, 0x32, 0x7e, 0xb1, 0xb1, 0xe3, 0x6a, - 0x21, 0xfd, 0xb7, 0x11, 0x14, 0xbe, 0x07, 0x43, 0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda, - 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb, 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b -}; - EtsiTs103097Certificate_t * _cert = NULL; EtsiTs103097Certificate_t * _issuer = NULL; @@ -91,6 +81,8 @@ static int is_CurvePoint_empty(EccP256CurvePoint_t* point); static int fill_curve_point_eccP256(EccP256CurvePoint_t* point, ecc_curve_id curveType, char * keyPath); static int fill_curve_point_eccP384(EccP384CurvePoint_t* point, ecc_curve_id curveType, char * keyPath); +static void * fill_reconstruction_value(EccP256CurvePoint_t * point, void * r_key); +static void process_reconstruction_value(void * r_key, void * eph, void * ca, unsigned char * H, char * keyPath); static int _issuer_parser_cb(pxml_chunk_type_e _type, const void *_chunk_data, size_t _chunk_size, void *_key) @@ -162,30 +154,57 @@ static ecc_curve_id _pk_type_to_curveid[] = { 0, ecies_nistp256, //Signature_PR_ecdsaNistP256Signature, ecies_brainpoolp256r, //Signature_PR_ecdsaBrainpoolP256r1Signature, - ecies_brainpoolp384r //Signature_PR_ecdsaBrainpoolP384r1Signature + ecies_brainpoolp384r, //Signature_PR_ecdsaBrainpoolP384r1Signature, + ecies_nistp384, //Signature_PR_ecdsaNistP384Signature }; +static const char _unsupported [] = "unsupported"; static const char * _pk_curve_names[] = { "nistp256", "brainpoolp256r", "brainpoolp384r", - "unsupported" + "nistp384", + "sm2", + &_unsupported[0], + &_unsupported[0], + &_unsupported[0] }; static ecc_curve_id _pk_type_to_hashid[] = { 0, - sha_256, //Signature_PR_ecdsaNistP256Signature, - sha_256, //Signature_PR_ecdsaBrainpoolP256r1Signature, - sha_384 //Signature_PR_ecdsaBrainpoolP384r1Signature + sha_256, //Signature_PR_ecdsaNistP256Signature, + sha_256, //Signature_PR_ecdsaBrainpoolP256r1Signature, + sha_384, //Signature_PR_ecdsaBrainpoolP384r1Signature + sha_384, //Signature_PR_ecdsaNistP384Signature, + sm3 //Signature_PR_sm2Signature }; static size_t _pk_type_to_hashsize[] = { 0, - sha256_hash_size, //Signature_PR_ecdsaNistP256Signature, - sha256_hash_size, //Signature_PR_ecdsaBrainpoolP256r1Signature, - sha384_hash_size //Signature_PR_ecdsaBrainpoolP384r1Signature + sha256_hash_size, //Signature_PR_ecdsaNistP256Signature, + sha256_hash_size, //Signature_PR_ecdsaBrainpoolP256r1Signature, + sha384_hash_size, //Signature_PR_ecdsaBrainpoolP384r1Signature + sha384_hash_size, //Signature_PR_ecdsaNistP384Signature, + sm3_hash_size //Signature_PR_sm2Signature }; +static void * search_private_key(const char * sName, ecc_curve_id alg) +{ + char* pk = cvstrdup(_keyPath, "/", sName, EXT_VKEY, NULL); + void *k = ecc_key_private_load(pk, alg); + if (k==NULL){ + free(pk); + pk = cvstrdup(_searchPath, "/", sName, EXT_VKEY, NULL); + k = ecc_key_private_load(pk, alg); + if (k==NULL){ + fprintf(stderr, "%s: Private key not found\n", pk); + } + } + free(pk); + return k; +} + + static asn_enc_rval_t Signature_oer_encoder(const asn_TYPE_descriptor_t *td, const asn_oer_constraints_t *constraints, const void *sptr, asn_app_consume_bytes_f *cb, void *app_key) @@ -200,55 +219,50 @@ static asn_enc_rval_t Signature_oer_encoder(const asn_TYPE_descriptor_t *td, if (sName == NULL && _cert->issuer.present == IssuerIdentifier_PR_self) sName = _certName; - char* pk = cvstrdup(_keyPath, "/", sName, EXT_VKEY, NULL); - void *k = ecc_key_private_load(pk, alg); - if (k==NULL){ - free(pk); - pk = cvstrdup(_searchPath, "/", sName, EXT_VKEY, NULL); - k = ecc_key_private_load(pk, alg); - if (k==NULL){ - fprintf(stderr, "%s: Private key not found\n", pk); - ASN__ENCODE_FAILED; - } + void * k = search_private_key(sName, alg); + if(k == NULL){ + ASN__ENCODE_FAILED; } - free(pk); - char h[48]; - int hl = 0; - // calculate joint hash - memcpy(_tbsHash+_tbsHashLength, _signerHash, _signerHashLength); - switch (hashId) - { - case sha_256: - sha256_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); - hl = sha256_hash_size; - break; - case sha_384: - sha384_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); - hl = sha384_hash_size; - break; - } + char h[48]; + int hl = 0; + // calculate joint hash + memcpy(_tbsHash+_tbsHashLength, _signerHash, _signerHashLength); + switch (hashId) + { + case sha_256: + sha256_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); + hl = sha256_hash_size; + break; + case sha_384: + sha384_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); + hl = sha384_hash_size; + break; + case sm3: + sm3_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); + hl = sm3_hash_size; + break; + } - if (_debug){ - char hex[48*3+1]; - *_bin2hex(hex, sizeof(hex), _tbsHash, _tbsHashLength) = 0; - fprintf(stderr, "DEBUG: ToBeSignedHash[%d]=%s\n", _tbsHashLength, hex); - *_bin2hex(hex, sizeof(hex), _signerHash, _signerHashLength) = 0; - fprintf(stderr, "DEBUG: SignerHash[%d]=%s\n", _signerHashLength, hex); - *_bin2hex(hex, sizeof(hex), h, hl) = 0; - fprintf(stderr, "DEBUG: JoinedHash[%d]=%s\n",hl, hex); - } + if (_debug){ + char hex[48*3+1]; + *_bin2hex(hex, sizeof(hex), _tbsHash, _tbsHashLength) = 0; + fprintf(stderr, "DEBUG: ToBeSignedHash[%d]=%s\n", _tbsHashLength, hex); + *_bin2hex(hex, sizeof(hex), _signerHash, _signerHashLength) = 0; + fprintf(stderr, "DEBUG: SignerHash[%d]=%s\n", _signerHashLength, hex); + *_bin2hex(hex, sizeof(hex), h, hl) = 0; + fprintf(stderr, "DEBUG: JoinedHash[%d]=%s\n",hl, hex); + } - // initialize buffers - OCTET_STRING_fromBuf(&s->choice.ecdsaNistP256Signature.rSig.choice.x_only, h, hl); - OCTET_STRING_fromBuf(&s->choice.ecdsaNistP256Signature.sSig, h, hl); + // initialize buffers + OCTET_STRING_fromBuf(&s->choice.ecdsaNistP256Signature.rSig.choice.x_only, h, hl); + OCTET_STRING_fromBuf(&s->choice.ecdsaNistP256Signature.sSig, h, hl); - ecc_sign(k, h, hl, s->choice.ecdsaNistP256Signature.rSig.choice.x_only.buf, s->choice.ecdsaNistP256Signature.sSig.buf); - } + ecc_sign(k, h, hl, s->choice.ecdsaNistP256Signature.rSig.choice.x_only.buf, s->choice.ecdsaNistP256Signature.sSig.buf); + } return asn_OP_CHOICE.oer_encoder(td, constraints, sptr, cb, app_key); } - static asn_dec_rval_t PublicVerificationKey_oer_decoder(const struct asn_codec_ctx_s *opt_codec_ctx, const struct asn_TYPE_descriptor_s *td, const asn_oer_constraints_t *constraints, void **struct_ptr, const void *buf_ptr, size_t size) @@ -401,6 +415,9 @@ int main(int argc, char ** argv) return 0; } + void * rv_req_key = NULL; + void * rv_eph_key = NULL; + PublicVerificationKey_PR hashType = PublicVerificationKey_PR_NOTHING; rc_d = asn_decode(NULL, ATS_BASIC_XER, &asn_DEF_EtsiTs103097Certificate, (void**)&cert, buf, ebuf - buf); @@ -458,6 +475,7 @@ int main(int argc, char ** argv) OCTET_STRING_fromBuf(&cert->issuer.choice.sha256AndDigest, &_signerHash[sha256_hash_size-8], 8); break; case PublicVerificationKey_PR_ecdsaBrainpoolP384r1: + case PublicVerificationKey_PR_ecdsaNistP384: if (cert->issuer.present == IssuerIdentifier_PR_NOTHING) cert->issuer.present = IssuerIdentifier_PR_sha384AndDigest; sha384_calculate(_signerHashBuf, buf, ebuf - buf); @@ -465,7 +483,8 @@ int main(int argc, char ** argv) _signerHashLength = sha384_hash_size; OCTET_STRING_fromBuf(&cert->issuer.choice.sha384AndDigest, &_signerHash[sha384_hash_size - 8], 8); break; - case PublicVerificationKey_PR_NOTHING: + case PublicVerificationKey_PR_ecsigSm2: + default: fprintf(stderr, "%s: signer verification key type curve is unknown\n", _signerName); return -1; } @@ -480,8 +499,8 @@ int main(int argc, char ** argv) hashType = cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.present; break; case VerificationKeyIndicator_PR_reconstructionValue: - hashType = PublicVerificationKey_PR_ecdsaNistP256; - break; + fprintf(stderr, "%s: self-signed certificate can not contain reconstruction value\n", _signerName); + return -1; case VerificationKeyIndicator_PR_NOTHING: fprintf(stderr, "%s: signer verification indicator type is unknown\n", _signerName); return -1; @@ -492,13 +511,18 @@ int main(int argc, char ** argv) switch (hashType) { case PublicVerificationKey_PR_ecdsaBrainpoolP256r1: case PublicVerificationKey_PR_ecdsaNistP256: - _signerHash = &_sha256_emptyString[0]; + _signerHash = &sha256_emptyString[0]; _signerHashLength = sha256_hash_size; break; case PublicVerificationKey_PR_ecdsaBrainpoolP384r1: - _signerHash = &_sha384_emptyString[0]; + case PublicVerificationKey_PR_ecdsaNistP384: + _signerHash = &sha384_emptyString[0]; _signerHashLength = sha384_hash_size; break; + case PublicVerificationKey_PR_ecsigSm2: + _signerHash = &sm3_emptyString[0]; + _signerHashLength = sm3_hash_size; + break; default: fprintf(stderr, "Unknown verification key curve type\n"); return -1; @@ -521,6 +545,9 @@ int main(int argc, char ** argv) case PublicVerificationKey_PR_ecdsaBrainpoolP384r1: rc = fill_curve_point_eccP384(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaBrainpoolP384r1, ecies_brainpoolp384r, buf); break; + case PublicVerificationKey_PR_ecdsaNistP384: + rc = fill_curve_point_eccP384(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaNistP384, ecies_nistp384, buf); + break; default: fprintf(stderr, "Unknown verification key curve type\n"); return -1; @@ -533,7 +560,16 @@ int main(int argc, char ** argv) } break; case VerificationKeyIndicator_PR_reconstructionValue: - fprintf(stderr, "TODO: reconstruction value generation is unsupported yet\n"); + rv_req_key = ecc_key_gen(ecies_nistp256); + // look for CA key + rv_eph_key = fill_reconstruction_value(&cert->toBeSigned.verifyKeyIndicator.choice.reconstructionValue, rv_req_key); + if (rv_eph_key == NULL) { + fprintf(stderr, "%s: Cannot calculate reconstruction value \n", buf); + ecc_key_free(rv_req_key); + rv_req_key = NULL; + return -1; + } + rc = 0; break; case VerificationKeyIndicator_PR_NOTHING: default: @@ -579,10 +615,43 @@ int main(int argc, char ** argv) fprintf(stderr, "%s: OER encoding failed for %s\n", _certName, rc_e.failed_type->name); return -1; } - fwrite(buf, 1, rc_e.encoded, f); fclose(f); + if(rv_eph_key){ + const char * sName = _signerName; + if (sName == NULL && _cert->issuer.present == IssuerIdentifier_PR_self) + sName = _certName; + + void * ca = search_private_key(sName, ecies_nistp256); + if(ca == NULL){ + fprintf(stderr, "FATAL: Private key for %s not found\n", sName); + } + + char h[48]; + int hl = 0; + // calculate joint hash + memcpy(_tbsHash+_tbsHashLength, _signerHash, _signerHashLength); + sha256_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); + hl = sha256_hash_size; + + if (_debug){ + char hex[48*3+1]; + *_bin2hex(hex, sizeof(hex), _tbsHash, _tbsHashLength) = 0; + fprintf(stderr, "DEBUG: ToBeSignedHash[%d]=%s\n", _tbsHashLength, hex); + *_bin2hex(hex, sizeof(hex), _signerHash, _signerHashLength) = 0; + fprintf(stderr, "DEBUG: SignerHash[%d]=%s\n", _signerHashLength, hex); + *_bin2hex(hex, sizeof(hex), h, hl) = 0; + fprintf(stderr, "DEBUG: JoinedHash[%d]=%s\n",hl, hex); + } + + cvstrncpy(buf, CERT_MAX_SIZE, _keyPath, "/", _certName, NULL); + process_reconstruction_value(rv_req_key, rv_eph_key, ca, h, buf); + ecc_key_free(ca); + ecc_key_free(rv_eph_key); + ecc_key_free(rv_req_key); + } + if(cert){ ASN_STRUCT_FREE(asn_DEF_EtsiTs103097Certificate, cert); } @@ -603,18 +672,10 @@ static int is_CurvePoint_empty(EccP256CurvePoint_t* point) } return 1; } -static int fill_curve_point_eccP256(EccP256CurvePoint_t* point, ecc_curve_id curveType, char * keyPath) -{ - return fill_curve_point_eccP384((EccP384CurvePoint_t*)point, curveType, keyPath); -} -static int fill_curve_point_eccP384(EccP384CurvePoint_t* point, ecc_curve_id curveType, char * keyPath) +static void * gen_or_load_public_key(ecc_curve_id curveType, char * keyPath) { void * key = NULL; - char x[48], y[48]; - int compressed_y; - int fsize; - int rc = -1; char * e_pub = keyPath + strlen(keyPath); if(!_force){ // check for public key @@ -632,15 +693,15 @@ static int fill_curve_point_eccP384(EccP384CurvePoint_t* point, ecc_curve_id cur if (key == NULL){ if (_no_gen){ fprintf(stderr, "ERROR: Key %s or %s%s not found\n", keyPath, keyPath, EXT_PUB); - return rc; + return NULL; } if (_debug){ fprintf(stderr, "DEBUG: generate key %s\n", keyPath); } key = ecc_key_gen(curveType); if(key == NULL){ - fprintf(stderr, "ERROR: key %s generation failed for curve %s\n", keyPath, _pk_curve_names[curveType & 3]); - return rc; + fprintf(stderr, "ERROR: key %s generation failed for curve %s\n", keyPath, _pk_curve_names[curveType & 7]); + return NULL; } ecc_key_private_save(key, keyPath, _outKeyFormat); strcpy(e_pub, EXT_PUB); @@ -651,16 +712,38 @@ static int fill_curve_point_eccP384(EccP384CurvePoint_t* point, ecc_curve_id cur } } } + return key; +} + +static int fill_curve_point_eccP256(EccP256CurvePoint_t* point, ecc_curve_id curveType, char * keyPath) +{ + return fill_curve_point_eccP384((EccP384CurvePoint_t*)point, curveType, keyPath); +} + +static void _fill_curve_point(EccP384CurvePoint_t * point, int fsize, const char * x, const char * y, int sign) +{ + OCTET_STRING_fromBuf(&point->choice.x_only, x, fsize); + if (point->present == EccP384CurvePoint_PR_uncompressedP384){ + OCTET_STRING_fromBuf(&point->choice.uncompressedP384.y, y, fsize); + } + else if (point->present == EccP384CurvePoint_PR_compressed_y_0 || point->present == EccP384CurvePoint_PR_compressed_y_1){ + point->present = sign ? EccP384CurvePoint_PR_compressed_y_1 : EccP384CurvePoint_PR_compressed_y_0; + } +} + +static int fill_curve_point_eccP384(EccP384CurvePoint_t* point, ecc_curve_id curveType, char * keyPath) +{ + char x[48], y[48]; + int compressed_y; + int fsize; + int rc = -1; + void * key = gen_or_load_public_key(curveType, keyPath); + if(NULL == key) return -1; fsize = ecc_key_public(key, x, y, &compressed_y); + if (fsize > 0){ - OCTET_STRING_fromBuf(&point->choice.x_only, x, fsize); - if (point->present == EccP384CurvePoint_PR_uncompressedP384){ - OCTET_STRING_fromBuf(&point->choice.uncompressedP384.y, y, fsize); - } - else if (point->present == EccP384CurvePoint_PR_compressed_y_0 || point->present == EccP384CurvePoint_PR_compressed_y_1){ - point->present = compressed_y ? EccP384CurvePoint_PR_compressed_y_1 : EccP384CurvePoint_PR_compressed_y_0; - } + _fill_curve_point(point, fsize, x, y, compressed_y); if (_debug){ char hex [256]; *_bin2hex(hex, sizeof(hex), x, fsize) = 0; @@ -675,3 +758,29 @@ static int fill_curve_point_eccP384(EccP384CurvePoint_t* point, ecc_curve_id cur ecc_key_free(key); return rc; } + +static void * fill_reconstruction_value(EccP256CurvePoint_t * point, void * r_key) +{ + char x[48], y[48]; + int compressed_y; + + void * eph = ecc_recvalue(r_key, x, y, &compressed_y); + if(eph){ + + _fill_curve_point((EccP384CurvePoint_t*)point, sha256_hash_size, x, y, compressed_y); + } + return eph; +} + +static void process_reconstruction_value(void * r_key, void * eph, void * ca, unsigned char * H, char * keyPath){ + // reconstruct private key + void * u_key = ecc_reconstruct(r_key, eph, ca, H); + if(u_key){ + char * e = keyPath + strlen(keyPath); + e = cstrcpy(e, EXT_VKEY); + ecc_key_private_save(u_key, keyPath, _outKeyFormat); + strcpy(e, EXT_PUB); + ecc_key_public_save(u_key, keyPath, _outKeyFormat); + ecc_key_free(u_key); + } +} diff --git a/certgen/certgen.vcxproj b/certgen/certgen.vcxproj index e94bdea..1c4c4af 100644 --- a/certgen/certgen.vcxproj +++ b/certgen/certgen.vcxproj @@ -20,14 +20,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - @@ -40,7 +269,6 @@ - @@ -81,7 +309,6 @@ - @@ -91,7 +318,6 @@ - @@ -158,10 +384,6 @@ - - - - @@ -196,7 +418,6 @@ - @@ -238,14 +459,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -259,63 +503,123 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - + + + + + + @@ -323,23 +627,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -348,32 +683,48 @@ + + + + + + + + + + + + + + + + - - - - + + + + @@ -382,14 +733,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -400,13 +791,20 @@ + + + + + - + + + @@ -414,32 +812,50 @@ + + + + + + + + + + + + + + + + + + diff --git a/certgen/ecc_api.h b/certgen/ecc_api.h index 4a62322..7b7fa0d 100644 --- a/certgen/ecc_api.h +++ b/certgen/ecc_api.h @@ -22,6 +22,8 @@ typedef enum { ecies_nistp256, ecies_brainpoolp256r, ecies_brainpoolp384r, + ecies_nistp384, + ecies_sm2 }ecc_curve_id; int ecc_api_init(); @@ -29,7 +31,8 @@ int ecc_api_done(); const char* ecc_curve_name(ecc_curve_id curve); typedef enum { sha_256, - sha_384 + sha_384, + sm3 }ecc_hash_id; typedef enum { @@ -49,6 +52,10 @@ typedef enum { ecc_uncompressed = 4 }ecc_point_type; +extern const char sha256_emptyString[]; +extern const char sha384_emptyString[]; +extern const char sm3_emptyString[]; + void * ecc_key_gen(ecc_curve_id pk_alg); void * ecc_key_init(ecc_curve_id pk_alg, const char* pkey); void ecc_key_free(void*); @@ -62,9 +69,14 @@ void * ecc_key_public_set(ecc_curve_id pk_alg, ecc_point_type ptype, const char #define sha256_hash_size 32 #define sha384_hash_size 48 +#define sm3_hash_size 32 int sha256_calculate(char* hash, const char * ptr, size_t len); int sha384_calculate(char* hash, const char * ptr, size_t len); +int sm3_calculate(char* hash, const char * ptr, size_t len); + +void * ecc_recvalue(void * req, char * px, char * py, int * psign); +void * ecc_reconstruct(void * req, void * eph, void * ca, unsigned char * H); int ecc_sign(void * key, const char * hash, int hlength, char *r, char *s); int ecc_verify(void * key, const char * hash, int hlength, const char *r, const char *s); diff --git a/certgen/ecc_openssl.c b/certgen/ecc_openssl.c index 4d475a1..73083ee 100644 --- a/certgen/ecc_openssl.c +++ b/certgen/ecc_openssl.c @@ -61,17 +61,40 @@ static ecc_api_curve_data _config[] = { { NID_brainpoolP384r1, SN_brainpoolP384r1, 48 }, + { + NID_secp384r1, SN_secp384r1, 48 + }, + { + NID_sm2, SN_sm2, 32 + }, }; static EC_GROUP * _curves[ARRAYSIZE(_config)] = { NULL }; +const char sha256_emptyString[] = { + 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, + 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55 +}; + +const char sha384_emptyString[] = { + 0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38, 0x4c, 0xd9, 0x32, 0x7e, 0xb1, 0xb1, 0xe3, 0x6a, + 0x21, 0xfd, 0xb7, 0x11, 0x14, 0xbe, 0x07, 0x43, 0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda, + 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb, 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b +}; +const char sm3_emptyString[] = { + 0x1A, 0xB2, 0x1D, 0x83, 0x55, 0xCF, 0xA1, 0x7F, 0x8E, 0x61, 0x19, 0x48, 0x31, 0xE8, 0x1A, 0x8F, + 0x22, 0xBE, 0xC8, 0xC7, 0x28, 0xFE, 0xFB, 0x74, 0x7E, 0xD0, 0x35, 0xEB, 0x50, 0x82, 0xAA, 0x2B +}; + +static BIGNUM * bn_256 = NULL; int ecc_api_init() { int i; for (i = 0; i < ARRAYSIZE(_config); i++){ _curves[i] = EC_GROUP_new_by_curve_name(_config[i].nid); } + bn_256 = BN_new(); BN_set_word(bn_256, 256); return 0; } @@ -81,6 +104,7 @@ int ecc_api_done() for (i = 0; i < ARRAYSIZE(_config); i++){ EC_GROUP_free(_curves[i]); } + BN_free(bn_256); return 0; } @@ -92,33 +116,45 @@ const char* ecc_curve_name(ecc_curve_id curve) return "unknown curve id"; } -void * ecc_key_gen(ecc_curve_id pk_alg) +static EC_KEY * EC_KEY_new_with_group(const EC_GROUP * g) { - EC_KEY * key = NULL; - if (_curves[pk_alg]){ - key = EC_KEY_new(); - if (key){ - EC_KEY_set_group(key, _curves[pk_alg]); - EC_KEY_set_asn1_flag(key, OPENSSL_EC_NAMED_CURVE); - if (!EC_KEY_generate_key(key)){ - ERR_print_errors_fp(stderr); - fflush(stderr); - EC_KEY_free(key); - key = NULL; - } + EC_KEY * key = EC_KEY_new(); + if (key){ + EC_KEY_set_group(key, g); + EC_KEY_set_asn1_flag(key, OPENSSL_EC_NAMED_CURVE); + } + return key; +} + +static EC_KEY * EC_KEY_generate_with_group(const EC_GROUP * g) +{ + EC_KEY * key = EC_KEY_new(); + if (key){ + EC_KEY_set_group(key, g); + EC_KEY_set_asn1_flag(key, OPENSSL_EC_NAMED_CURVE); + if (!EC_KEY_generate_key(key)){ + ERR_print_errors_fp(stderr); + fflush(stderr); + EC_KEY_free(key); + key = NULL; } } return key; } -void * ecc_key_init(ecc_curve_id pk_alg, const char* buf) +void * ecc_key_gen(ecc_curve_id pk_alg) +{ + return EC_KEY_generate_with_group(_curves[pk_alg]); +} + +void * ecc_key_init(ecc_curve_id pk_alg, const char* priv_buf) { EC_KEY * eckey = NULL; BIGNUM * bn = BN_new(); const EC_GROUP * group = _curves[pk_alg]; int fsize = (EC_GROUP_get_degree(group) + 7) / 8; if (group){ - if (BN_bin2bn((const unsigned char*)buf, fsize, bn)){ + if (BN_bin2bn((const unsigned char*)priv_buf, fsize, bn)){ eckey = EC_KEY_new(); if (eckey){ if (EC_KEY_set_group(eckey, group)){ @@ -159,37 +195,43 @@ int ecc_key_private(void* key, char* buf) return len; } +static int ecc_fill_point(const EC_GROUP * g, const EC_POINT * p, char * px, char * py, int * psign) +{ + BIGNUM *x, *y; + int fsize = -1; + //fill public key data + x = BN_new(); + y = BN_new(); + if (EC_POINT_get_affine_coordinates_GFp(g, p, x, y, NULL)){ + fsize = (EC_GROUP_get_degree(g) + 7) / 8; + int bcount = BN_num_bytes(x); + for(; bcount < fsize; bcount++) + *(px++) = 0; // add padding with zeros + BN_bn2bin(x, (unsigned char*)px); + + bcount = BN_num_bytes(y); + for(; bcount < fsize; bcount++) + *(py++) = 0; // add padding with zeros + BN_bn2bin(y, (unsigned char*)py); + if (psign) * psign = BN_is_odd(y); + } + BN_clear_free(x); BN_clear_free(y); + return fsize; +} + int ecc_key_public(void* key, char * px, char * py, int * psign) { const EC_GROUP * ecgroup; const EC_POINT * ecpoint; const EC_KEY * eckey = (EC_KEY*)key; - BIGNUM *x, *y; - int fsize = -1, bcount = -1; - if( key && px && py ) { ecgroup = EC_KEY_get0_group(eckey); ecpoint = EC_KEY_get0_public_key(eckey); - fsize = (EC_GROUP_get_degree(ecgroup) + 7) / 8; - - //fill public key data - x = BN_new(); - y = BN_new(); - if (EC_POINT_get_affine_coordinates_GFp(ecgroup, ecpoint, x, y, NULL)){ - bcount = BN_num_bytes(x); - for(; bcount < fsize; bcount++) - *(px++) = 0; // add padding with zeros - BN_bn2bin(x, (unsigned char*)px); - - bcount = BN_num_bytes(y); - for(; bcount < fsize; bcount++) - *(py++) = 0; // add padding with zeros - BN_bn2bin(y, (unsigned char*)py); - if (psign) * psign = BN_is_odd(y); + if(ecgroup && ecpoint){ + return ecc_fill_point(ecgroup, ecpoint, px, py, psign); } - BN_clear_free(x); BN_clear_free(y); } - return fsize; + return -1; } static int _pass_cb(char *buf, int size, int rwflag, void *u) @@ -440,6 +482,15 @@ int sha384_calculate(char* hash, const char * ptr, size_t len) return 0; } +int sm3_calculate(char* hash, const char * ptr, size_t len) +{ + SHA256_CTX ctx; + SHA256_Init(&ctx); + SHA256_Update(&ctx, ptr, len); + SHA256_Final((unsigned char*)hash, &ctx); + return 0; +} + int ecc_sign(void * key, const char * hash, int hlength, char *r, char *s) { EC_KEY * eckey; @@ -502,6 +553,84 @@ int ecc_verify(void * key, const char * hash, int hlength, const char *r, con return rc; } +/** + * @brief Calculate Reconstruction Value for implicit certificate + * Create public and private key at the same time + * + * @param req_key [in] EC_KEY containing request key + * @param ca_key [in] EC_KEY containing CA private key + * @param px [in] X coordinate of reconstruction value + * @param py [in] Y coordinate of reconstruction value + * @param psign [in] 0/1 sign of the Y coordinate + * @return EC_KEY - end entity private/public key pair + */ +void * ecc_recvalue(void * req, char * px, char * py, int * psign) +{ + const EC_GROUP * g = EC_KEY_get0_group(req); + if( !g ){ + return NULL; + } + + // generate eph key + EC_KEY * eph = EC_KEY_generate_with_group(g); + if (!eph){ + return NULL; + } + + // generate public reconstruction value + EC_POINT * Q = EC_POINT_new(g); + EC_POINT_add(g, Q, EC_KEY_get0_public_key(eph), EC_KEY_get0_public_key(req), NULL); + ecc_fill_point(g, Q, px, py, psign); + EC_POINT_free(Q); + + return eph; +} + +void * ecc_reconstruct(void * req, void * eph, void * ca, unsigned char * H) +{ + const EC_GROUP * g = EC_KEY_get0_group(req); + if( !g ){ + return NULL; + } + const BIGNUM * order = EC_GROUP_get0_order(g); + BN_CTX * ctx = BN_CTX_new(); + BN_CTX_start(ctx); + + + int fsize = (EC_GROUP_get_degree(g) + 7) / 8; + BIGNUM * h = BN_CTX_get(ctx); + BN_bin2bn(H, fsize, h); + BN_rshift1(h, h); + + // Private reconstruction value + // r = (H * kEph + dCA) % order + BIGNUM * r = BN_CTX_get(ctx); + BIGNUM * b1 = BN_CTX_get(ctx); + BN_mul(b1, EC_KEY_get0_private_key(eph), h, ctx); + BN_mod_add(r, b1, EC_KEY_get0_private_key(ca), order, ctx); + + // Private key reconstruction + // dU = (H * kReq + r) % order + BIGNUM * dU = BN_CTX_get(ctx); + BN_mul(b1, h, EC_KEY_get0_private_key(req), ctx); + BN_mod_add(dU, b1, r, order, ctx); + + // Public key reconstruction + // QU = H * Prv + QCA + EC_POINT * p = EC_POINT_new(g); + EC_POINT_mul(g, p, dU, NULL, NULL, ctx); + + EC_KEY * ukey = EC_KEY_new_with_group(g); + EC_KEY_set_private_key(ukey, dU); + EC_KEY_set_public_key(ukey, p); + EC_POINT_free(p); + + BN_CTX_end(ctx); + BN_CTX_free(ctx); + + return ukey; +} + static const char* _hexDigits = "0123456789ABCDEF"; char * _bin2hex(char * hex, size_t hlen, const char * bin, size_t blen) { @@ -521,3 +650,4 @@ char * _bin2hex(char * hex, size_t hlen, const char * bin, size_t blen) } return hex + blen * 2; } + -- GitLab From f682a91267f21ec94bb8d31579db349c07b6ad5c Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Tue, 11 Apr 2023 15:04:52 +0200 Subject: [PATCH 2/9] fix file attributes --- certgen/asncodec.vcxproj | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn | 0 .../asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn | 0 .../ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn | 0 .../asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn | 0 .../asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn | 0 .../asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn | 0 certgen/cert_utils.c | 0 certgen/certidx.c | 0 certgen/certidx.vcxproj | 0 itscertgen.sln | 13 ------------- 21 files changed, 13 deletions(-) mode change 100755 => 100644 certgen/asncodec.vcxproj mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn mode change 100755 => 100644 certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn mode change 100755 => 100644 certgen/cert_utils.c mode change 100755 => 100644 certgen/certidx.c mode change 100755 => 100644 certgen/certidx.vcxproj diff --git a/certgen/asncodec.vcxproj b/certgen/asncodec.vcxproj old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaEeInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaLaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaMaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1AcaRaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Acpc.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CamRaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1CertManagement.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EcaEeInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeMaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1EeRaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaMaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1LaRaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1MaRaInterface.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn b/certgen/asncodec/asn1/ieee1609.2.1/Ieee1609Dot2Dot1Protocol.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2Crl.asn old mode 100755 new mode 100644 diff --git a/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn b/certgen/asncodec/asn1/ieee1609.2/Ieee1609Dot2CrlBaseTypes.asn old mode 100755 new mode 100644 diff --git a/certgen/cert_utils.c b/certgen/cert_utils.c old mode 100755 new mode 100644 diff --git a/certgen/certidx.c b/certgen/certidx.c old mode 100755 new mode 100644 diff --git a/certgen/certidx.vcxproj b/certgen/certidx.vcxproj old mode 100755 new mode 100644 diff --git a/itscertgen.sln b/itscertgen.sln index 8b1497b..8f5ba94 100644 --- a/itscertgen.sln +++ b/itscertgen.sln @@ -10,11 +10,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keygen", "certgen\keygen.vcxproj", "{6F0ADC20-E8C3-4996-9E46-F7D5D4FA4BF3}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "certidx", "certgen\certidx.vcxproj", "{6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}" - ProjectSection(ProjectDependencies) = postProject - {D5918B85-FA45-4F75-9B50-C2D39FA45A17} = {D5918B85-FA45-4F75-9B50-C2D39FA45A17} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asncodec", "certgen\asncodec.vcxproj", "{D5918B85-FA45-4F75-9B50-C2D39FA45A17}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -56,14 +51,6 @@ Global {6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}.Release|Win32.Build.0 = Release|Win32 {6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}.Release|x64.ActiveCfg = Release|x64 {6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}.Release|x64.Build.0 = Release|x64 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|Win32.Build.0 = Debug|Win32 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|x64.ActiveCfg = Debug|x64 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|x64.Build.0 = Debug|x64 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|Win32.ActiveCfg = Release|Win32 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|Win32.Build.0 = Release|Win32 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|x64.ActiveCfg = Release|x64 - {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- GitLab From 4a913aecd15c4b045243fd27d928a109ee6f1442 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Wed, 12 Apr 2023 12:58:19 +0200 Subject: [PATCH 3/9] fix case issue in ASN.1 files in asncodec Makefile --- certgen/CERT_IUT_C1_AT.xml | 36 ------------------------------------ certgen/asncodec/Makefile | 8 ++++---- 2 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 certgen/CERT_IUT_C1_AT.xml diff --git a/certgen/CERT_IUT_C1_AT.xml b/certgen/CERT_IUT_C1_AT.xml deleted file mode 100644 index b568a19..0000000 --- a/certgen/CERT_IUT_C1_AT.xml +++ /dev/null @@ -1,36 +0,0 @@ - - 3 - - - - - - - - - - - - > - - - - - - - - - 01 FF FC - 01 FF FF FF - - - - - - - - - - - - diff --git a/certgen/asncodec/Makefile b/certgen/asncodec/Makefile index 8f06d5d..f687a6a 100644 --- a/certgen/asncodec/Makefile +++ b/certgen/asncodec/Makefile @@ -23,7 +23,7 @@ ASN1CDIR ?= ../../../../asn1c-fillabs2 ifeq (,$(ASN1C)) ifneq (,$(ASN1CDIR)) - ASN1C := $(ASN1CDIR)/asn1c/.libs/asn1c -S $(ASN1CDIR)/skeletons + ASN1C := $(ASN1CDIR)/asn1c/asn1c -S $(ASN1CDIR)/skeletons else ASN1C := asn1c endif @@ -32,7 +32,7 @@ endif ASN1C_ARGS := -no-gen-BER -no-gen-JER -no-gen-UPER -no-gen-APER -no-gen-random-fill -no-gen-example ASN1_SRC := \ - $(TS102941_DIR)/EtsiTs102941MessagesCA.asn \ + $(TS102941_DIR)/EtsiTs102941MessagesCa.asn \ $(TS102941_DIR)/EtsiTs102941TrustLists.asn \ $(TS102941_DIR)/EtsiTs102941TypesAuthorization.asn \ $(TS102941_DIR)/EtsiTs102941TypesAuthorizationValidation.asn \ @@ -42,8 +42,8 @@ ASN1_SRC := \ $(TS102941_DIR)/EtsiTs102941TypesLinkCertificate.asn \ $(TS103097_DIR)/EtsiTs103097Module.asn \ $(TS103097_DIR)/EtsiTs103097ExtensionModule.asn \ - $(IEEE1609_2_DIR)/IEEE1609dot2.asn \ - $(IEEE1609_2_DIR)/IEEE1609dot2BaseTypes.asn \ + $(IEEE1609_2_DIR)/Ieee1609Dot2.asn \ + $(IEEE1609_2_DIR)/Ieee1609Dot2BaseTypes.asn \ $(IEEE1609_2_DIR)/Ieee1609Dot2Crl.asn \ $(IEEE1609_2_DIR)/Ieee1609Dot2CrlBaseTypes.asn \ $(IEEE1609_2_1_DIR)/Ieee1609Dot2Dot1AcaEeInterface.asn \ -- GitLab From b9f9327e4eafc90407e74ed482c479a8cb09f857 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Thu, 4 Jul 2024 19:47:51 +0200 Subject: [PATCH 4/9] (+) add VRU and CPS services (*) use app_aid_list and issuing_aid_list as aliases (*) fix some minor issues --- certgen/asn1certgen.xslt | 82 ++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 16 deletions(-) diff --git a/certgen/asn1certgen.xslt b/certgen/asn1certgen.xslt index cbd6e49..d205618 100644 --- a/certgen/asn1certgen.xslt +++ b/certgen/asn1certgen.xslt @@ -11,10 +11,10 @@ xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date" > - - - - + + + + @@ -238,6 +276,8 @@ 02 FF FF E0 01 01 + 01 + 01 01 FE @@ -267,6 +307,8 @@ FF 00 00 1F FF FF + FF + FF FF 01 @@ -279,6 +321,10 @@ + + + + @@ -306,7 +355,7 @@ - + @@ -325,6 +374,8 @@ + + @@ -749,7 +800,6 @@ - -- GitLab From 8792d511be9fec487832e2632d447a4555d54a2f Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Thu, 4 Jul 2024 20:21:34 +0200 Subject: [PATCH 5/9] bulk AT cert generation --- certgen/CERT_IUT_C1_AT.xml | 36 -- certgen/asncodec.vcxproj | 465 ++++++++++++++++++- certgen/cert_utils.c | 4 +- certgen/certgen.c | 237 +++++----- certgen/certgen.vcxproj | 909 +++---------------------------------- certgen/certidx.c | 2 +- certgen/certidx.vcxproj | 8 +- certgen/ecc_api.h | 2 +- certgen/ecc_openssl.c | 9 +- certgen/keygen.c | 33 +- certgen/keygen.vcxproj | 8 +- cshared | 2 +- itscertgen.sln | 16 + 13 files changed, 684 insertions(+), 1047 deletions(-) delete mode 100644 certgen/CERT_IUT_C1_AT.xml diff --git a/certgen/CERT_IUT_C1_AT.xml b/certgen/CERT_IUT_C1_AT.xml deleted file mode 100644 index b568a19..0000000 --- a/certgen/CERT_IUT_C1_AT.xml +++ /dev/null @@ -1,36 +0,0 @@ - - 3 - - - - - - - - - - - - > - - - - - - - - - 01 FF FC - 01 FF FF FF - - - - - - - - - - - - diff --git a/certgen/asncodec.vcxproj b/certgen/asncodec.vcxproj index 2d4e2c9..bd385ea 100644 --- a/certgen/asncodec.vcxproj +++ b/certgen/asncodec.vcxproj @@ -19,13 +19,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - @@ -38,7 +268,6 @@ - @@ -79,7 +308,6 @@ - @@ -89,7 +317,6 @@ - @@ -156,10 +383,6 @@ - - - - @@ -194,7 +417,6 @@ - @@ -231,14 +453,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -252,63 +497,123 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - + + + + + + @@ -316,23 +621,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -341,32 +677,48 @@ + + + + + + + + + + + + + + + + - - - - + + + + @@ -375,14 +727,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -393,13 +785,20 @@ + + + + + - + + + @@ -407,32 +806,50 @@ + + + + + + + + + + + + + + + + + + {D5918B85-FA45-4F75-9B50-C2D39FA45A17} @@ -444,26 +861,26 @@ StaticLibrary true - v142 + v143 MultiByte StaticLibrary true - v142 + v143 MultiByte StaticLibrary false - v142 + v143 true MultiByte StaticLibrary false - v142 + v143 true MultiByte diff --git a/certgen/cert_utils.c b/certgen/cert_utils.c index 5656220..24833c3 100644 --- a/certgen/cert_utils.c +++ b/certgen/cert_utils.c @@ -29,11 +29,11 @@ HashAlgorithm_t CertificateWholeHashAlgorithm(const EtsiTs103097Certificate_t * alg = HashAlgorithm_sha384; break; default: - if(name) fprintf(stderr, "%s: ERROR: Unknow verification key algorithm\n", name); + if(name) fprintf(stderr, "%s: ERROR: Unknow verification key algorithm %d\n", name, cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.present); return -1; } } else { - if(name) fprintf(stderr, "%s: ERROR: Unknow certificate type\n", name); + if(name) fprintf(stderr, "%s: ERROR: Unknow certificate type %d\n", name, (int)cert->type); return -1; } return alg; diff --git a/certgen/certgen.c b/certgen/certgen.c index c176f44..df23fab 100644 --- a/certgen/certgen.c +++ b/certgen/certgen.c @@ -29,6 +29,7 @@ static const char * _cfgFile = NULL; static int _debug = 0; static int _xer = 0; static int _view = 0; +int _genCount = 1; EtsiTs103097Certificate_t * _cert = NULL; EtsiTs103097Certificate_t * _issuer = NULL; @@ -59,16 +60,17 @@ typedef struct { #define EXT_PUB "_pub" static copt_t _options [] = { - { "h?", "help", COPT_HELP, NULL, "Print this help page" }, - { "C", "config", COPT_CFGFILE, (void*)&_cfgFile, "Config file path [no cfg file]" }, + { "h?", "help", COPT_HELP, NULL, "Print this help page" }, + { "C", "config", COPT_CFGFILE, (void*)&_cfgFile, "Config file path [no cfg file]" }, { "o", "out", COPT_STR, (void*)&_outPath, "Output path [current dir by default]" }, { "k", "key-format", COPT_STRENUM, (void*)_key_formats, "Keys output format (bin|hex|pem)[binary by default]" }, - { "S", "certs", COPT_STR, (void*)&_searchPath, "Certificates search path [Output path by default]" }, - { "K", "keys", COPT_STR, (void*)&_keyPath, "Private key storage path [Output path by default]" }, - { "f", "force", COPT_BOOL, (void*)&_force, "Force regenerate existing certificate and keys. [use existing by default]" }, + { "S", "certs", COPT_STR, (void*)&_searchPath, "Certificates search path [Output path by default]" }, + { "K", "keys", COPT_STR, (void*)&_keyPath, "Private key storage path [Output path by default]" }, + { "f", "force", COPT_BOOL, (void*)&_force, "Force regenerate existing certificate and keys. [use existing by default]" }, { "e", "no-generate", COPT_BOOL, (void*)&_no_gen, "Do not generate keys. [generate if necessary by default]" }, { "n", "name", COPT_STR, (void*)&_certName, "Certificate name (take from profile by default)" }, { "s", "signer", COPT_STR, (void*)&_signerName, "Signer certificate name [take from profile by default]" }, + { "g", "count", COPT_INT, (void*)&_genCount, "Generate multiple certificates [generate 1 certificate by default]" }, { "D", "debug", COPT_BOOL, (void*)&_debug, "Dump hashes and other values [false]" }, { "v", "view", COPT_BOOL, (void*)&_view, "View OER certificate [false]" }, { "x", "oxer", COPT_BOOL, (void*)&_xer, "Decode OER certificate to XER [false]" }, @@ -307,7 +309,7 @@ int main(int argc, char ** argv) } const char * a = strrchr(argv[0], '/'); if (a == NULL) a = argv[0]; - coptions_help(stdout, a, COPT_HELP_NOVALUES, _options, " [signer]"); + coptions_help(stdout, a, COPT_HELP_NOVALUES, _options, " [signer] [count]"); return -1; } @@ -317,7 +319,7 @@ int main(int argc, char ** argv) _outKeyFormat = copts_enum_value(_options, 3, _key_formats); - if(argc > 2){ + if (argc > 2) { // set signer certificate file name _signerName = argv[2]; } @@ -529,130 +531,135 @@ int main(int argc, char ** argv) } } - // generate keys if necessary - // buf = name of private key file - int rc = -1; - cvstrncpy(buf, CERT_MAX_SIZE, _keyPath, "/", _certName, EXT_VKEY, NULL); - switch (cert->toBeSigned.verifyKeyIndicator.present){ - case VerificationKeyIndicator_PR_verificationKey: - switch (cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.present){ - case PublicVerificationKey_PR_ecdsaNistP256: - rc = fill_curve_point_eccP256(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaNistP256, ecies_nistp256, buf); - break; - case PublicVerificationKey_PR_ecdsaBrainpoolP256r1: - rc = fill_curve_point_eccP256(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaBrainpoolP256r1, ecies_brainpoolp256r, buf); - break; - case PublicVerificationKey_PR_ecdsaBrainpoolP384r1: - rc = fill_curve_point_eccP384(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaBrainpoolP384r1, ecies_brainpoolp384r, buf); + char gSuffix[8] = { 0x00 }; + for (int gi = 1; gi <= _genCount; gi++) { + if (_genCount > 1) { + sprintf(gSuffix, ".%03d", gi); + } + // generate keys if necessary + // buf = name of private key file + int rc = -1; + cvstrncpy(buf, CERT_MAX_SIZE, _keyPath, "/", _certName, gSuffix, EXT_VKEY, NULL); + switch (cert->toBeSigned.verifyKeyIndicator.present) { + case VerificationKeyIndicator_PR_verificationKey: + switch (cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.present) { + case PublicVerificationKey_PR_ecdsaNistP256: + rc = fill_curve_point_eccP256(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaNistP256, ecies_nistp256, buf); + break; + case PublicVerificationKey_PR_ecdsaBrainpoolP256r1: + rc = fill_curve_point_eccP256(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaBrainpoolP256r1, ecies_brainpoolp256r, buf); + break; + case PublicVerificationKey_PR_ecdsaBrainpoolP384r1: + rc = fill_curve_point_eccP384(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaBrainpoolP384r1, ecies_brainpoolp384r, buf); + break; + case PublicVerificationKey_PR_ecdsaNistP384: + rc = fill_curve_point_eccP384(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaNistP384, ecies_nistp384, buf); + break; + default: + fprintf(stderr, "Unknown verification key curve type\n"); + return -1; + } + if (rc < 0) { + fprintf(stderr, "%s: Cannot prepare verification key of type %s\n", buf, + asn_MBR_PublicVerificationKey_1[cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.present - 1].name + ); + return -1; + } break; - case PublicVerificationKey_PR_ecdsaNistP384: - rc = fill_curve_point_eccP384(&cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.choice.ecdsaNistP384, ecies_nistp384, buf); + case VerificationKeyIndicator_PR_reconstructionValue: + rv_req_key = ecc_key_gen(ecies_nistp256); + // look for CA key + rv_eph_key = fill_reconstruction_value(&cert->toBeSigned.verifyKeyIndicator.choice.reconstructionValue, rv_req_key); + if (rv_eph_key == NULL) { + fprintf(stderr, "%s: Cannot calculate reconstruction value \n", buf); + ecc_key_free(rv_req_key); + rv_req_key = NULL; + return -1; + } + rc = 0; break; + case VerificationKeyIndicator_PR_NOTHING: default: - fprintf(stderr, "Unknown verification key curve type\n"); - return -1; + fprintf(stderr, "%s: Unknown verification key indicator type %d\n", buf, cert->toBeSigned.verifyKeyIndicator.present - 1); + break; } if (rc < 0) { - fprintf(stderr, "%s: Cannot prepare verification key of type %s\n", buf, - asn_MBR_PublicVerificationKey_1[cert->toBeSigned.verifyKeyIndicator.choice.verificationKey.present - 1].name - ); return -1; } - break; - case VerificationKeyIndicator_PR_reconstructionValue: - rv_req_key = ecc_key_gen(ecies_nistp256); - // look for CA key - rv_eph_key = fill_reconstruction_value(&cert->toBeSigned.verifyKeyIndicator.choice.reconstructionValue, rv_req_key); - if (rv_eph_key == NULL) { - fprintf(stderr, "%s: Cannot calculate reconstruction value \n", buf); - ecc_key_free(rv_req_key); - rv_req_key = NULL; - return -1; - } - rc = 0; - break; - case VerificationKeyIndicator_PR_NOTHING: - default: - fprintf(stderr, "%s: Unknown verification key indicator type %d\n", buf, cert->toBeSigned.verifyKeyIndicator.present-1); - break; - } - if (rc < 0){ - return -1; - } - if (cert->toBeSigned.encryptionKey){ - rc = -1; - cvstrncpy(buf, CERT_MAX_SIZE, _keyPath, "/", _certName, EXT_EKEY, NULL); - switch (cert->toBeSigned.encryptionKey->publicKey.present){ - case BasePublicEncryptionKey_PR_NOTHING: - cert->toBeSigned.encryptionKey->publicKey.present = BasePublicEncryptionKey_PR_eciesNistP256; - case BasePublicEncryptionKey_PR_eciesNistP256: - rc = fill_curve_point_eccP256(&cert->toBeSigned.encryptionKey->publicKey.choice.eciesNistP256, ecies_nistp256, buf); - break; - case BasePublicEncryptionKey_PR_eciesBrainpoolP256r1: - rc = fill_curve_point_eccP256(&cert->toBeSigned.encryptionKey->publicKey.choice.eciesBrainpoolP256r1, ecies_brainpoolp256r, buf); - break; - default: - fprintf(stderr, "Unknown encryption key curve type %d\n", cert->toBeSigned.encryptionKey->publicKey.present); - break; + if (cert->toBeSigned.encryptionKey) { + rc = -1; + cvstrncpy(buf, CERT_MAX_SIZE, _keyPath, "/", _certName, gSuffix, EXT_EKEY, NULL); + switch (cert->toBeSigned.encryptionKey->publicKey.present) { + case BasePublicEncryptionKey_PR_NOTHING: + cert->toBeSigned.encryptionKey->publicKey.present = BasePublicEncryptionKey_PR_eciesNistP256; + case BasePublicEncryptionKey_PR_eciesNistP256: + rc = fill_curve_point_eccP256(&cert->toBeSigned.encryptionKey->publicKey.choice.eciesNistP256, ecies_nistp256, buf); + break; + case BasePublicEncryptionKey_PR_eciesBrainpoolP256r1: + rc = fill_curve_point_eccP256(&cert->toBeSigned.encryptionKey->publicKey.choice.eciesBrainpoolP256r1, ecies_brainpoolp256r, buf); + break; + default: + fprintf(stderr, "Unknown encryption key curve type %d\n", cert->toBeSigned.encryptionKey->publicKey.present); + break; + } + if (rc < 0) { + fprintf(stderr, "%s: Cannot prepare encryption key\n", buf); + return -1; + } } - if (rc < 0){ - fprintf(stderr, "%s: Cannot prepare encryption key\n", buf); + + cvstrncpy(buf, CERT_MAX_SIZE, _outPath, "/", _certName, gSuffix, EXT_CERT, NULL); + f = fopen(buf, "wb"); + if (f == NULL) { + perror(buf); return -1; } - } - cvstrncpy(buf, CERT_MAX_SIZE, _outPath, "/", _certName, EXT_CERT, NULL); - f = fopen(buf, "wb"); - if (f == NULL){ - perror(buf); - return -1; - } + _cert = cert; + // Encode as OER + rc_e = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_EtsiTs103097Certificate, cert, buf, CERT_MAX_SIZE); + if (rc_e.encoded < 0) { + fprintf(stderr, "%s: OER encoding failed for %s\n", _certName, rc_e.failed_type->name); + return -1; + } + fwrite(buf, 1, rc_e.encoded, f); + fclose(f); - _cert = cert; - // Encode as OER - rc_e = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_EtsiTs103097Certificate, cert, buf, CERT_MAX_SIZE); - if (rc_e.encoded <0){ - fprintf(stderr, "%s: OER encoding failed for %s\n", _certName, rc_e.failed_type->name); - return -1; - } - fwrite(buf, 1, rc_e.encoded, f); - fclose(f); + if (rv_eph_key) { + const char* sName = _signerName; + if (sName == NULL && _cert->issuer.present == IssuerIdentifier_PR_self) + sName = _certName; - if(rv_eph_key){ - const char * sName = _signerName; - if (sName == NULL && _cert->issuer.present == IssuerIdentifier_PR_self) - sName = _certName; + void* ca = search_private_key(sName, ecies_nistp256); + if (ca == NULL) { + fprintf(stderr, "FATAL: Private key for %s not found\n", sName); + } - void * ca = search_private_key(sName, ecies_nistp256); - if(ca == NULL){ - fprintf(stderr, "FATAL: Private key for %s not found\n", sName); - } + char h[48]; + int hl = 0; + // calculate joint hash + memcpy(_tbsHash + _tbsHashLength, _signerHash, _signerHashLength); + sha256_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); + hl = sha256_hash_size; - char h[48]; - int hl = 0; - // calculate joint hash - memcpy(_tbsHash+_tbsHashLength, _signerHash, _signerHashLength); - sha256_calculate(h, _tbsHash, _tbsHashLength + _signerHashLength); - hl = sha256_hash_size; + if (_debug) { + char hex[48 * 3 + 1]; + *_bin2hex(hex, sizeof(hex), _tbsHash, _tbsHashLength) = 0; + fprintf(stderr, "DEBUG: ToBeSignedHash[%d]=%s\n", _tbsHashLength, hex); + *_bin2hex(hex, sizeof(hex), _signerHash, _signerHashLength) = 0; + fprintf(stderr, "DEBUG: SignerHash[%d]=%s\n", _signerHashLength, hex); + *_bin2hex(hex, sizeof(hex), h, hl) = 0; + fprintf(stderr, "DEBUG: JoinedHash[%d]=%s\n", hl, hex); + } - if (_debug){ - char hex[48*3+1]; - *_bin2hex(hex, sizeof(hex), _tbsHash, _tbsHashLength) = 0; - fprintf(stderr, "DEBUG: ToBeSignedHash[%d]=%s\n", _tbsHashLength, hex); - *_bin2hex(hex, sizeof(hex), _signerHash, _signerHashLength) = 0; - fprintf(stderr, "DEBUG: SignerHash[%d]=%s\n", _signerHashLength, hex); - *_bin2hex(hex, sizeof(hex), h, hl) = 0; - fprintf(stderr, "DEBUG: JoinedHash[%d]=%s\n",hl, hex); + cvstrncpy(buf, CERT_MAX_SIZE, _keyPath, "/", _certName, NULL); + process_reconstruction_value(rv_req_key, rv_eph_key, ca, h, buf); + ecc_key_free(ca); + ecc_key_free(rv_eph_key); + ecc_key_free(rv_req_key); } - - cvstrncpy(buf, CERT_MAX_SIZE, _keyPath, "/", _certName, NULL); - process_reconstruction_value(rv_req_key, rv_eph_key, ca, h, buf); - ecc_key_free(ca); - ecc_key_free(rv_eph_key); - ecc_key_free(rv_req_key); } - - if(cert){ + if (cert) { ASN_STRUCT_FREE(asn_DEF_EtsiTs103097Certificate, cert); } return 0; @@ -705,7 +712,7 @@ static void * gen_or_load_public_key(ecc_curve_id curveType, char * keyPath) } ecc_key_private_save(key, keyPath, _outKeyFormat); strcpy(e_pub, EXT_PUB); - ecc_key_public_save(key, keyPath, _outKeyFormat); + ecc_key_public_save(key, keyPath, _outKeyFormat, 0); } else { if (_debug){ fprintf(stderr, "DEBUG: use pre-generated key %s\n", keyPath); @@ -780,7 +787,7 @@ static void process_reconstruction_value(void * r_key, void * eph, void * ca, un e = cstrcpy(e, EXT_VKEY); ecc_key_private_save(u_key, keyPath, _outKeyFormat); strcpy(e, EXT_PUB); - ecc_key_public_save(u_key, keyPath, _outKeyFormat); + ecc_key_public_save(u_key, keyPath, _outKeyFormat, 0); ecc_key_free(u_key); } } diff --git a/certgen/certgen.vcxproj b/certgen/certgen.vcxproj index 1c4c4af..909aaa5 100644 --- a/certgen/certgen.vcxproj +++ b/certgen/certgen.vcxproj @@ -20,842 +20,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -874,26 +43,26 @@ Application true - v142 + v143 MultiByte Application true - v142 + v143 MultiByte Application false - v142 + v143 true MultiByte Application false - v142 + v143 true MultiByte @@ -945,9 +114,22 @@ Console true - C:\OpenSSL\Win32\lib\VC\static - libcrypto32MTd.lib;libssl32MTd.lib;%(AdditionalDependencies) + $(OutDir);C:\OpenSSL\Win32\lib\VC\static + asncodec.lib;libcrypto32MTd.lib;libssl32MTd.lib;%(AdditionalDependencies) + + Compile ASN.1 + + + + + + + false + + + ClCompile + @@ -961,9 +143,22 @@ Console true - C:\Tools\OpenSSL\Win64\lib\VC - ws2_32.lib;libcrypto64MTd.lib;libssl64MTd.lib;%(AdditionalDependencies) + $(OutDir);C:\Tools\OpenSSL\Win64\lib\VC + asncodec.lib;ws2_32.lib;libcrypto64MTd.lib;libssl64MTd.lib;%(AdditionalDependencies) + + Compile ASN.1 + + + + + + + false + + + ClCompile + @@ -981,9 +176,22 @@ true true true - libcrypto32MT.lib;libssl32MT.lib;%(AdditionalDependencies) - C:\OpenSSL\Win32\lib\VC\static + asncodec.lib;libcrypto32MT.lib;libssl32MT.lib;%(AdditionalDependencies) + $(OutDir);C:\OpenSSL\Win32\lib\VC\static + + Compile ASN.1 + + + + + + + false + + + ClCompile + @@ -1001,9 +209,22 @@ true true true - ws2_32.lib;libcrypto64MT.lib;libssl64MT.lib;%(AdditionalDependencies) - C:\Tools\OpenSSL\Win64\lib\VC + asncodec.lib;ws2_32.lib;libcrypto64MT.lib;libssl64MT.lib;%(AdditionalDependencies) + $(OutDir);C:\Tools\OpenSSL\Win64\lib\VC + + Compile ASN.1 + + + + + + + false + + + ClCompile + diff --git a/certgen/certidx.c b/certgen/certidx.c index b7449d0..baccbea 100644 --- a/certgen/certidx.c +++ b/certgen/certidx.c @@ -116,7 +116,7 @@ int main(int argc, char ** argv) size_t len = cstrlen(argv[argi]); pchar_t * path = cstralloc(len + MAX_PATH); cstrcpy(path, argv[argi]); - pchar_t * fname = cstrlastpathelement(path); + pchar_t * fname = (pchar_t*) cstrlastpathelement(path); HANDLE h = FindFirstFile(path, &fd); if(INVALID_HANDLE_VALUE != h) do { cstrcpy(fname, fd.cFileName); diff --git a/certgen/certidx.vcxproj b/certgen/certidx.vcxproj index be42b05..addd9a9 100644 --- a/certgen/certidx.vcxproj +++ b/certgen/certidx.vcxproj @@ -47,26 +47,26 @@ Application true - v142 + v143 MultiByte Application true - v142 + v143 MultiByte Application false - v142 + v143 true MultiByte Application false - v142 + v143 true MultiByte diff --git a/certgen/ecc_api.h b/certgen/ecc_api.h index 7b7fa0d..e3f1723 100644 --- a/certgen/ecc_api.h +++ b/certgen/ecc_api.h @@ -63,7 +63,7 @@ int ecc_key_private(void*, char* buf); int ecc_key_public(void*, char* x, char* y, int * psign); int ecc_key_private_save(void*, const char* path, ecc_format format); void * ecc_key_private_load(const char* path, ecc_curve_id pk_alg); -int ecc_key_public_save(void*, const char* path, ecc_format format); +int ecc_key_public_save(void*, const char* path, ecc_format format, int compressed); void * ecc_key_public_load(const char* path, ecc_curve_id pk_alg); void * ecc_key_public_set(ecc_curve_id pk_alg, ecc_point_type ptype, const char * px, const char * py); diff --git a/certgen/ecc_openssl.c b/certgen/ecc_openssl.c index 73083ee..cd6482e 100644 --- a/certgen/ecc_openssl.c +++ b/certgen/ecc_openssl.c @@ -337,7 +337,7 @@ void * ecc_key_private_load(const char* path, ecc_curve_id pk_alg) return eckey; } -int ecc_key_public_save(void* key, const char* path, ecc_format format) +int ecc_key_public_save(void* key, const char* path, ecc_format format, int compressed) { EC_KEY * eckey = (EC_KEY *)key; int rc = -1; @@ -352,16 +352,17 @@ int ecc_key_public_save(void* key, const char* path, ecc_format format) char * buf = NULL; const EC_POINT * point = EC_KEY_get0_public_key(eckey); const EC_GROUP * group = EC_KEY_get0_group(eckey); + point_conversion_form_t form = compressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED; if (format == ecc_hex){ - buf = EC_POINT_point2hex(group, point, POINT_CONVERSION_UNCOMPRESSED, NULL); + buf = EC_POINT_point2hex(group, point, form, NULL); len = strlen(buf); } else if (format == ecc_bin){ - len = EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, NULL, 0, NULL); + len = EC_POINT_point2oct(group, point, form, NULL, 0, NULL); if (len > 0){ buf = OPENSSL_malloc(len + 1); - if (len != EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, (unsigned char*)buf, len, NULL)){ + if (len != EC_POINT_point2oct(group, point, form, (unsigned char*)buf, len, NULL)){ OPENSSL_free(buf); buf = NULL; } } diff --git a/certgen/keygen.c b/certgen/keygen.c index e3a8c5a..39de50e 100644 --- a/certgen/keygen.c +++ b/certgen/keygen.c @@ -14,15 +14,17 @@ static const char *_outPath = "."; static int _certCount = 1; -static ecc_format _outFormat = 0; +static ecc_format _outFormat_public = 0; +static ecc_format _outFormat_private = 0; static ecc_curve_id _curve = 0; +static int _compressed = 1; static const char * _o_formats[] = { "bin", "hex", "pem", NULL }; static const char * _o_curves[] = { - "nist256", "bpool256", "bpool384", NULL + "nist256", "bpool256", "bpool384", "nist384", "sm2", NULL }; static char * _keyname = "key"; @@ -30,9 +32,12 @@ static char * _keyname = "key"; static copt_t options [] = { { "h?", "help", COPT_HELP, NULL, "Print this help page" }, { "o", "out", COPT_STR, (void*)&_outPath, "Output path [current dir by default]" }, - { "O", "format", COPT_STRENUM, (void*)_o_formats, "Output format (bin|hex|pem)[binary by default]" }, - { "c", "curve", COPT_STRENUM, (void*)_o_curves, "Curve to be used (nist256|bpool256|bpool384)[nist256 by default]" }, - { "n", "count", COPT_INT, (void*)&_certCount, "Key pair count (1 by default)" }, + { NULL, "format-private", COPT_STRENUM, (void*)_o_formats, "Private key output format (bin|hex|pem)[binary by default]" }, + { NULL, "format-public", COPT_STRENUM, (void*)_o_formats, "Public key output format (bin|hex|pem)[binary by default]" }, + { "O", "format", COPT_STRENUM, (void*)_o_formats, "Output format (bin|hex|pem)[binary by default]" }, + { "a", "curve", COPT_STRENUM, (void*)_o_curves, "Curve to be used (nist256|bpool256|bpool384|nist384|sm2)[nist256 by default]" }, + { "u", "uncompressed", COPT_IBOOL, &_compressed, "Write public key in uncompressed form" }, + { "n", "count", COPT_INT, (void*)&_certCount, "Key pair count (1 by default)" }, { NULL, NULL, COPT_END, NULL, NULL } }; @@ -49,8 +54,14 @@ int main(int argc, char** argv) coptions_help(stdout, a, COPT_HELP_NOVALUES, options, ""); return -1; } - _outFormat = copts_enum_value(options, 2, _o_formats); - _curve = copts_enum_value(options, 3, _o_curves); + int n = copts_enum_value(options, 4, _o_formats); + _outFormat_private = _outFormat_public = n; + n = copts_enum_value(options, 2, _o_formats); + if(n != 0) _outFormat_private = n; + n = copts_enum_value(options, 3, _o_formats); + if(n != 0) _outFormat_public = n; + + _curve = copts_enum_value(options, 5, _o_curves); if (argc == 1){ argc = 2; argv[1] = _keyname; @@ -72,10 +83,10 @@ int main(int argc, char** argv) e = cstrncpy(path, len, keyname); else e = path + sprintf(path, "%s_%03d", keyname, count + 1); - cstrncpy(e, len - (e - path), ".vkey"); - ecc_key_private_save(key, s, _outFormat); - cstrncpy(e, len - (e - path), "_pub.vkey"); - ecc_key_public_save(key, s, _outFormat); + cvstrncpy(e, len - (e - path), ".", _o_curves[_curve], NULL); + ecc_key_private_save(key, s, _outFormat_private); + cvstrncpy(e, len - (e - path), "_pub.", _o_curves[_curve], NULL); + ecc_key_public_save(key, s, _outFormat_public, _compressed); ecc_key_free(key); } } diff --git a/certgen/keygen.vcxproj b/certgen/keygen.vcxproj index 38930cc..e16fcb7 100644 --- a/certgen/keygen.vcxproj +++ b/certgen/keygen.vcxproj @@ -44,26 +44,26 @@ Application true - v142 + v143 MultiByte Application true - v142 + v143 MultiByte Application false - v142 + v143 true MultiByte Application false - v142 + v143 true MultiByte diff --git a/cshared b/cshared index cdee201..faf28d9 160000 --- a/cshared +++ b/cshared @@ -1 +1 @@ -Subproject commit cdee201f299e09635149cc82833031fc14d3dd2d +Subproject commit faf28d921e06602226b0db3a306b07070fa5cdf1 diff --git a/itscertgen.sln b/itscertgen.sln index 8f5ba94..abaa8c3 100644 --- a/itscertgen.sln +++ b/itscertgen.sln @@ -6,10 +6,18 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cshared", "cshared\cshared.vcxproj", "{D5918B85-FA45-4F75-9B50-C2D3E34ABA17}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "certgen", "certgen\certgen.vcxproj", "{B51474B6-2547-4AAF-A038-791AB09D0329}" + ProjectSection(ProjectDependencies) = postProject + {D5918B85-FA45-4F75-9B50-C2D39FA45A17} = {D5918B85-FA45-4F75-9B50-C2D39FA45A17} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keygen", "certgen\keygen.vcxproj", "{6F0ADC20-E8C3-4996-9E46-F7D5D4FA4BF3}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "certidx", "certgen\certidx.vcxproj", "{6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}" + ProjectSection(ProjectDependencies) = postProject + {D5918B85-FA45-4F75-9B50-C2D39FA45A17} = {D5918B85-FA45-4F75-9B50-C2D39FA45A17} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asncodec", "certgen\asncodec.vcxproj", "{D5918B85-FA45-4F75-9B50-C2D39FA45A17}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -51,6 +59,14 @@ Global {6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}.Release|Win32.Build.0 = Release|Win32 {6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}.Release|x64.ActiveCfg = Release|x64 {6F0ADC20-E8C3-4996-9E46-F77210FA4BF3}.Release|x64.Build.0 = Release|x64 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|Win32.ActiveCfg = Debug|Win32 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|Win32.Build.0 = Debug|Win32 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|x64.ActiveCfg = Debug|x64 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Debug|x64.Build.0 = Debug|x64 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|Win32.ActiveCfg = Release|Win32 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|Win32.Build.0 = Release|Win32 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|x64.ActiveCfg = Release|x64 + {D5918B85-FA45-4F75-9B50-C2D39FA45A17}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- GitLab From d7e83ce8d1ad49dc06c6c009ba8400f254fb7e29 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Fri, 12 Jul 2024 12:43:43 +0200 Subject: [PATCH 6/9] add MA cert type; fix unneeded help page --- certgen/asn1certgen.xslt | 2 ++ certgen/certgen.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/certgen/asn1certgen.xslt b/certgen/asn1certgen.xslt index d205618..7f4da6f 100644 --- a/certgen/asn1certgen.xslt +++ b/certgen/asn1certgen.xslt @@ -137,6 +137,7 @@ 0 00110010 + 00110010 0 00001110 11000000 @@ -149,6 +150,7 @@ 11111110 0 + 0 0 11000000 0 diff --git a/certgen/certgen.c b/certgen/certgen.c index df23fab..7eca951 100644 --- a/certgen/certgen.c +++ b/certgen/certgen.c @@ -302,15 +302,18 @@ int main(int argc, char ** argv) //_setup_default_time(); //parse options - argc = coptions(argc, argv, COPT_HELP_NOVALUES , _options); + argc = coptions(argc, argv, COPT_NOAUTOHELP , _options); if(argc < 2){ if(argc<0 && (((int)0)-argc)<((sizeof(_options)/sizeof(_options[0]))-1)){ printf("Unknown option %s\n", argv[0-argc]); } - const char * a = strrchr(argv[0], '/'); - if (a == NULL) a = argv[0]; - coptions_help(stdout, a, COPT_HELP_NOVALUES, _options, " [signer] [count]"); - return -1; + + if(COPT_EHELP != argc){ + const char * a = strrchr(argv[0], '/'); + if (a == NULL) a = argv[0]; + coptions_help(stdout, a, COPT_HELP_NOVALUES, _options, " [signer] [count]"); + return -1; + } } if (_searchPath == NULL) _searchPath = _outPath; -- GitLab From 6d5e355400e10b28ff156008561c6865a02cfc5a Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Tue, 23 Jul 2024 16:36:42 +0200 Subject: [PATCH 7/9] fix eeType default generation --- certgen/asn1certgen.xslt | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/certgen/asn1certgen.xslt b/certgen/asn1certgen.xslt index d205618..8dd4867 100644 --- a/certgen/asn1certgen.xslt +++ b/certgen/asn1certgen.xslt @@ -238,19 +238,16 @@ 0 - - - - 01000000 - - - 10000000 - - - 11000000 - - - + + + 01000000 + + + + + 11000000 + + -- GitLab From b64a51d79daa6f308d28e0e116f5478fd96fe295 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Tue, 23 Jul 2024 17:32:20 +0200 Subject: [PATCH 8/9] fix other default fields --- certgen/asn1certgen.xslt | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/certgen/asn1certgen.xslt b/certgen/asn1certgen.xslt index 95f3542..8bfb615 100644 --- a/certgen/asn1certgen.xslt +++ b/certgen/asn1certgen.xslt @@ -224,22 +224,22 @@ - - - - - 2 - 1 - - - - - - - 0 - 0 - - + + + + + + + + + + + + + + + + 01000000 -- GitLab From f1500e9d24e69d57f71939ac811553561b9e3925 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Wed, 24 Jul 2024 12:45:19 +0200 Subject: [PATCH 9/9] fix minchainlength for root certs --- certgen/asn1certgen.xslt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/certgen/asn1certgen.xslt b/certgen/asn1certgen.xslt index 8bfb615..c18b333 100644 --- a/certgen/asn1certgen.xslt +++ b/certgen/asn1certgen.xslt @@ -231,6 +231,9 @@ + 2 + 2 + -- GitLab