diff --git a/src/xmldsig/xmldsigEXIDatatypes.c b/src/xmldsig/xmldsigEXIDatatypes.c index 7ee50d0..06d983e 100644 --- a/src/xmldsig/xmldsigEXIDatatypes.c +++ b/src/xmldsig/xmldsigEXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2017 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 2017-09-04 + * @contact Richard.Kuntschke@siemens.com * *
Code generated by EXIdizer
*Schema: xmldsig-core-schema.xsd
@@ -68,60 +68,150 @@ void init_xmldsigEXIDocument(struct xmldsigEXIDocument* exiDoc) { exiDoc->Object_isUsed = 0u; } + #if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES void init_xmldsigEXIFragment(struct xmldsigEXIFragment* exiFrag) { - exiFrag->RSAKeyValue_isUsed = 0u; - exiFrag->PGPKeyPacket_isUsed = 0u; - exiFrag->PGPKeyPacket_isUsed = 0u; - exiFrag->X509Data_isUsed = 0u; - exiFrag->PgenCounter_isUsed = 0u; - exiFrag->X509Certificate_isUsed = 0u; - exiFrag->Seed_isUsed = 0u; - exiFrag->Modulus_isUsed = 0u; - exiFrag->X509SKI_isUsed = 0u; - exiFrag->SPKISexp_isUsed = 0u; - exiFrag->CanonicalizationMethod_isUsed = 0u; - exiFrag->X509SerialNumber_isUsed = 0u; - exiFrag->SignatureProperties_isUsed = 0u; - exiFrag->Reference_isUsed = 0u; - exiFrag->KeyName_isUsed = 0u; - exiFrag->P_isUsed = 0u; - exiFrag->SignatureValue_isUsed = 0u; - exiFrag->SignedInfo_isUsed = 0u; - exiFrag->KeyInfo_isUsed = 0u; - exiFrag->DigestMethod_isUsed = 0u; - exiFrag->SPKIData_isUsed = 0u; - exiFrag->Object_isUsed = 0u; - exiFrag->Exponent_isUsed = 0u; - exiFrag->X509IssuerName_isUsed = 0u; - exiFrag->X509SubjectName_isUsed = 0u; - exiFrag->PGPData_isUsed = 0u; - exiFrag->HMACOutputLength_isUsed = 0u; exiFrag->DigestValue_isUsed = 0u; - exiFrag->MgmtData_isUsed = 0u; + exiFrag->X509Data_isUsed = 0u; exiFrag->KeyValue_isUsed = 0u; - exiFrag->SignatureProperty_isUsed = 0u; - exiFrag->DSAKeyValue_isUsed = 0u; - exiFrag->X509IssuerSerial_isUsed = 0u; - exiFrag->Y_isUsed = 0u; - exiFrag->J_isUsed = 0u; - exiFrag->Signature_isUsed = 0u; - exiFrag->Transform_isUsed = 0u; - exiFrag->PGPKeyID_isUsed = 0u; + exiFrag->DigestMethod_isUsed = 0u; + exiFrag->SPKISexp_isUsed = 0u; exiFrag->Transforms_isUsed = 0u; - exiFrag->G_isUsed = 0u; - exiFrag->X509CRL_isUsed = 0u; - exiFrag->Q_isUsed = 0u; - exiFrag->XPath_isUsed = 0u; - exiFrag->SignatureMethod_isUsed = 0u; - exiFrag->RetrievalMethod_isUsed = 0u; + exiFrag->KeyName_isUsed = 0u; + exiFrag->X509IssuerName_isUsed = 0u; + exiFrag->MgmtData_isUsed = 0u; + exiFrag->Reference_isUsed = 0u; + exiFrag->SignatureProperties_isUsed = 0u; + exiFrag->PGPKeyID_isUsed = 0u; + exiFrag->PGPData_isUsed = 0u; + exiFrag->DSAKeyValue_isUsed = 0u; + exiFrag->SignatureValue_isUsed = 0u; + exiFrag->KeyInfo_isUsed = 0u; + exiFrag->SignatureProperty_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->HMACOutputLength_isUsed = 0u; + exiFrag->Exponent_isUsed = 0u; exiFrag->Manifest_isUsed = 0u; + exiFrag->P_isUsed = 0u; + exiFrag->CanonicalizationMethod_isUsed = 0u; + exiFrag->Q_isUsed = 0u; + exiFrag->Seed_isUsed = 0u; + exiFrag->X509SubjectName_isUsed = 0u; + exiFrag->X509Certificate_isUsed = 0u; + exiFrag->RSAKeyValue_isUsed = 0u; + exiFrag->X509IssuerSerial_isUsed = 0u; + exiFrag->SPKIData_isUsed = 0u; + exiFrag->G_isUsed = 0u; + exiFrag->J_isUsed = 0u; + exiFrag->SignedInfo_isUsed = 0u; + exiFrag->X509SKI_isUsed = 0u; + exiFrag->Transform_isUsed = 0u; + exiFrag->XPath_isUsed = 0u; + exiFrag->Object_isUsed = 0u; + exiFrag->X509SerialNumber_isUsed = 0u; + exiFrag->RetrievalMethod_isUsed = 0u; + exiFrag->Modulus_isUsed = 0u; + exiFrag->X509CRL_isUsed = 0u; + exiFrag->Signature_isUsed = 0u; + exiFrag->Y_isUsed = 0u; + exiFrag->SignatureMethod_isUsed = 0u; + exiFrag->PgenCounter_isUsed = 0u; } #endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ +void init_xmldsigCanonicalizationMethodType(struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { + xmldsigCanonicalizationMethodType->ANY_isUsed = 0u; +} + +void init_xmldsigManifestType(struct xmldsigManifestType* xmldsigManifestType) { + xmldsigManifestType->Id_isUsed = 0u; + xmldsigManifestType->Reference.arrayLen = 0u; +} + +void init_xmldsigObjectType(struct xmldsigObjectType* xmldsigObjectType) { + xmldsigObjectType->Id_isUsed = 0u; + xmldsigObjectType->MimeType_isUsed = 0u; + xmldsigObjectType->Encoding_isUsed = 0u; + xmldsigObjectType->ANY_isUsed = 0u; +} + +void init_xmldsigTransformType(struct xmldsigTransformType* xmldsigTransformType) { + xmldsigTransformType->ANY_isUsed = 0u; + xmldsigTransformType->XPath.arrayLen = 0u; +} + +void init_xmldsigSignatureMethodType(struct xmldsigSignatureMethodType* xmldsigSignatureMethodType) { + xmldsigSignatureMethodType->HMACOutputLength_isUsed = 0u; + xmldsigSignatureMethodType->ANY_isUsed = 0u; +} + +void init_xmldsigDigestMethodType(struct xmldsigDigestMethodType* xmldsigDigestMethodType) { + xmldsigDigestMethodType->ANY_isUsed = 0u; +} + +void init_xmldsigRetrievalMethodType(struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType) { + xmldsigRetrievalMethodType->URI_isUsed = 0u; + xmldsigRetrievalMethodType->Type_isUsed = 0u; + xmldsigRetrievalMethodType->Transforms_isUsed = 0u; +} + +void init_xmldsigSignatureValueType(struct xmldsigSignatureValueType* xmldsigSignatureValueType) { + xmldsigSignatureValueType->Id_isUsed = 0u; +} + +void init_xmldsigX509IssuerSerialType(struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType) { + (void)xmldsigX509IssuerSerialType; /* avoid unused warning */ +} + +void init_xmldsigSignedInfoType(struct xmldsigSignedInfoType* xmldsigSignedInfoType) { + xmldsigSignedInfoType->Id_isUsed = 0u; + xmldsigSignedInfoType->Reference.arrayLen = 0u; +} + +void init_xmldsigSignaturePropertiesType(struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType) { + xmldsigSignaturePropertiesType->Id_isUsed = 0u; + xmldsigSignaturePropertiesType->SignatureProperty.arrayLen = 0u; +} + +void init_xmldsigSignaturePropertyType(struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType) { + xmldsigSignaturePropertyType->Id_isUsed = 0u; + xmldsigSignaturePropertyType->ANY_isUsed = 0u; +} + void init_xmldsigKeyValueType(struct xmldsigKeyValueType* xmldsigKeyValueType) { xmldsigKeyValueType->DSAKeyValue_isUsed = 0u; xmldsigKeyValueType->RSAKeyValue_isUsed = 0u; + xmldsigKeyValueType->ANY_isUsed = 0u; +} + +void init_xmldsigRSAKeyValueType(struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType) { + (void)xmldsigRSAKeyValueType; /* avoid unused warning */ +} + +void init_xmldsigPGPDataType(struct xmldsigPGPDataType* xmldsigPGPDataType) { + xmldsigPGPDataType->PGPKeyID_isUsed = 0u; + xmldsigPGPDataType->PGPKeyPacket_isUsed = 0u; + xmldsigPGPDataType->ANY_isUsed = 0u; +} + +void init_xmldsigTransformsType(struct xmldsigTransformsType* xmldsigTransformsType) { + xmldsigTransformsType->Transform.arrayLen = 0u; +} + +void init_xmldsigX509DataType(struct xmldsigX509DataType* xmldsigX509DataType) { + xmldsigX509DataType->X509IssuerSerial.arrayLen = 0u; + xmldsigX509DataType->X509SKI.arrayLen = 0u; + xmldsigX509DataType->X509SubjectName.arrayLen = 0u; + xmldsigX509DataType->X509Certificate.arrayLen = 0u; + xmldsigX509DataType->X509CRL.arrayLen = 0u; + xmldsigX509DataType->ANY_isUsed = 0u; +} + +void init_xmldsigSignatureType(struct xmldsigSignatureType* xmldsigSignatureType) { + xmldsigSignatureType->Id_isUsed = 0u; + xmldsigSignatureType->KeyInfo_isUsed = 0u; + xmldsigSignatureType->Object.arrayLen = 0u; } void init_xmldsigDSAKeyValueType(struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType) { @@ -133,40 +223,6 @@ void init_xmldsigDSAKeyValueType(struct xmldsigDSAKeyValueType* xmldsigDSAKeyVal xmldsigDSAKeyValueType->PgenCounter_isUsed = 0u; } -void init_xmldsigRSAKeyValueType(struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType) { -} - -void init_xmldsigSignaturePropertiesType(struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType) { - xmldsigSignaturePropertiesType->Id_isUsed = 0u; - xmldsigSignaturePropertiesType->SignatureProperty.arrayLen = 0u; -} - -void init_xmldsigCanonicalizationMethodType(struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { -} - -void init_xmldsigObjectType(struct xmldsigObjectType* xmldsigObjectType) { - xmldsigObjectType->Id_isUsed = 0u; - xmldsigObjectType->MimeType_isUsed = 0u; - xmldsigObjectType->Encoding_isUsed = 0u; -} - -void init_xmldsigTransformsType(struct xmldsigTransformsType* xmldsigTransformsType) { - xmldsigTransformsType->Transform.arrayLen = 0u; -} - -void init_xmldsigTransformType(struct xmldsigTransformType* xmldsigTransformType) { - xmldsigTransformType->XPath.arrayLen = 0u; -} - -void init_xmldsigDigestMethodType(struct xmldsigDigestMethodType* xmldsigDigestMethodType) { -} - -void init_xmldsigSignatureType(struct xmldsigSignatureType* xmldsigSignatureType) { - xmldsigSignatureType->Id_isUsed = 0u; - xmldsigSignatureType->KeyInfo_isUsed = 0u; - xmldsigSignatureType->Object.arrayLen = 0u; -} - void init_xmldsigReferenceType(struct xmldsigReferenceType* xmldsigReferenceType) { xmldsigReferenceType->Id_isUsed = 0u; xmldsigReferenceType->URI_isUsed = 0u; @@ -176,33 +232,7 @@ void init_xmldsigReferenceType(struct xmldsigReferenceType* xmldsigReferenceType void init_xmldsigSPKIDataType(struct xmldsigSPKIDataType* xmldsigSPKIDataType) { xmldsigSPKIDataType->SPKISexp.arrayLen = 0u; -} - -void init_xmldsigPGPDataType(struct xmldsigPGPDataType* xmldsigPGPDataType) { - xmldsigPGPDataType->PGPKeyID_isUsed = 0u; - xmldsigPGPDataType->PGPKeyPacket_isUsed = 0u; -} - -void init_xmldsigX509IssuerSerialType(struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType) { -} - -void init_xmldsigSignatureMethodType(struct xmldsigSignatureMethodType* xmldsigSignatureMethodType) { - xmldsigSignatureMethodType->HMACOutputLength_isUsed = 0u; -} - -void init_xmldsigRetrievalMethodType(struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType) { - xmldsigRetrievalMethodType->URI_isUsed = 0u; - xmldsigRetrievalMethodType->Type_isUsed = 0u; - xmldsigRetrievalMethodType->Transforms_isUsed = 0u; -} - -void init_xmldsigSignaturePropertyType(struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType) { - xmldsigSignaturePropertyType->Id_isUsed = 0u; -} - -void init_xmldsigSignedInfoType(struct xmldsigSignedInfoType* xmldsigSignedInfoType) { - xmldsigSignedInfoType->Id_isUsed = 0u; - xmldsigSignedInfoType->Reference.arrayLen = 0u; + xmldsigSPKIDataType->ANY_isUsed = 0u; } void init_xmldsigKeyInfoType(struct xmldsigKeyInfoType* xmldsigKeyInfoType) { @@ -214,23 +244,7 @@ void init_xmldsigKeyInfoType(struct xmldsigKeyInfoType* xmldsigKeyInfoType) { xmldsigKeyInfoType->PGPData.arrayLen = 0u; xmldsigKeyInfoType->SPKIData.arrayLen = 0u; xmldsigKeyInfoType->MgmtData.arrayLen = 0u; -} - -void init_xmldsigManifestType(struct xmldsigManifestType* xmldsigManifestType) { - xmldsigManifestType->Id_isUsed = 0u; - xmldsigManifestType->Reference.arrayLen = 0u; -} - -void init_xmldsigSignatureValueType(struct xmldsigSignatureValueType* xmldsigSignatureValueType) { - xmldsigSignatureValueType->Id_isUsed = 0u; -} - -void init_xmldsigX509DataType(struct xmldsigX509DataType* xmldsigX509DataType) { - xmldsigX509DataType->X509IssuerSerial.arrayLen = 0u; - xmldsigX509DataType->X509SKI.arrayLen = 0u; - xmldsigX509DataType->X509SubjectName.arrayLen = 0u; - xmldsigX509DataType->X509Certificate.arrayLen = 0u; - xmldsigX509DataType->X509CRL.arrayLen = 0u; + xmldsigKeyInfoType->ANY_isUsed = 0u; } diff --git a/src/xmldsig/xmldsigEXIDatatypes.h b/src/xmldsig/xmldsigEXIDatatypes.h index 93f41fe..ff902fe 100644 --- a/src/xmldsig/xmldsigEXIDatatypes.h +++ b/src/xmldsig/xmldsigEXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2017 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 2017-09-04 + * @contact Richard.Kuntschke@siemens.com * *Code generated by EXIdizer
*Schema: xmldsig-core-schema.xsd
@@ -60,10 +60,28 @@ extern "C" { #define UNION_NO 2 #define SAVE_MEMORY_WITH_UNNAMED_UNION UNION_YES +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 65 + EXTRA_CHAR +#define xmldsigCanonicalizationMethodType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigCanonicalizationMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: WC[##any] */ + struct { + exi_string_character_t characters[xmldsigCanonicalizationMethodType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; +}; + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define xmldsigObjectType_Id_CHARACTERS_SIZE 50 -#define xmldsigObjectType_MimeType_CHARACTERS_SIZE 50 -#define xmldsigObjectType_Encoding_CHARACTERS_SIZE 50 +#define xmldsigObjectType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigObjectType_MimeType_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigObjectType_Encoding_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigObjectType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR struct xmldsigObjectType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { @@ -83,11 +101,18 @@ struct xmldsigObjectType { uint16_t charactersLen; } Encoding ; unsigned int Encoding_isUsed:1; + /* element: WC[##any] */ + struct { + exi_string_character_t characters[xmldsigObjectType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define xmldsigTransformType_Algorithm_CHARACTERS_SIZE 65 -#define xmldsigTransformType_XPath_CHARACTERS_SIZE 50 +#define xmldsigTransformType_Algorithm_CHARACTERS_SIZE 65 + EXTRA_CHAR +#define xmldsigTransformType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigTransformType_XPath_CHARACTERS_SIZE 50 + EXTRA_CHAR #define xmldsigTransformType_XPath_ARRAY_SIZE 1 struct xmldsigTransformType { /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ @@ -95,6 +120,12 @@ struct xmldsigTransformType { exi_string_character_t characters[xmldsigTransformType_Algorithm_CHARACTERS_SIZE]; uint16_t charactersLen; } Algorithm ; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigTransformType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; /* element: "http://www.w3.org/2000/09/xmldsig#":XPath, http://www.w3.org/2001/XMLSchema,string */ struct { struct { @@ -105,19 +136,116 @@ struct xmldsigTransformType { } XPath; }; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigSignatureMethodType_Algorithm_CHARACTERS_SIZE 65 + EXTRA_CHAR +#define xmldsigSignatureMethodType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigSignatureMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigSignatureMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ + int64_t HMACOutputLength ; + unsigned int HMACOutputLength_isUsed:1; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigSignatureMethodType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; +}; + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigDigestMethodType_Algorithm_CHARACTERS_SIZE 65 +#define xmldsigDigestMethodType_Algorithm_CHARACTERS_SIZE 65 + EXTRA_CHAR +#define xmldsigDigestMethodType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR struct xmldsigDigestMethodType { /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { exi_string_character_t characters[xmldsigDigestMethodType_Algorithm_CHARACTERS_SIZE]; uint16_t charactersLen; } Algorithm ; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigDigestMethodType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define xmldsigSignatureValueType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigSignatureValueType_CONTENT_BYTES_SIZE 350 +struct xmldsigSignatureValueType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignatureValueType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[xmldsigSignatureValueType_CONTENT_BYTES_SIZE]; + uint16_t bytesLen; + } CONTENT ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +#define xmldsigX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigX509IssuerSerialType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[xmldsigX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ + int64_t X509SerialNumber ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigSignaturePropertyType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigSignaturePropertyType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigSignaturePropertyType { + /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Target ; + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignaturePropertyType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigSignaturePropertyType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +#define xmldsigRSAKeyValueType_Modulus_BYTES_SIZE 350 +#define xmldsigRSAKeyValueType_Exponent_BYTES_SIZE 350 +struct xmldsigRSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigRSAKeyValueType_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigRSAKeyValueType_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ #define xmldsigPGPDataType_PGPKeyID_BYTES_SIZE 350 #define xmldsigPGPDataType_PGPKeyPacket_BYTES_SIZE 350 +#define xmldsigPGPDataType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR struct xmldsigPGPDataType { /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ struct { @@ -131,6 +259,79 @@ struct xmldsigPGPDataType { uint16_t bytesLen; } PGPKeyPacket ; unsigned int PGPKeyPacket_isUsed:1; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigPGPDataType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigTransformsType_Transform_ARRAY_SIZE 1 +struct xmldsigTransformsType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigTransformType array[xmldsigTransformsType_Transform_ARRAY_SIZE]; + uint16_t arrayLen; + } Transform; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509SKI_BYTES_SIZE 350 +#define xmldsigX509DataType_X509SKI_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigX509DataType_X509SubjectName_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509Certificate_BYTES_SIZE 350 +#define xmldsigX509DataType_X509Certificate_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509CRL_BYTES_SIZE 350 +#define xmldsigX509DataType_X509CRL_ARRAY_SIZE 1 +#define xmldsigX509DataType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigX509DataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigX509IssuerSerialType array[xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE]; + uint16_t arrayLen; + } X509IssuerSerial; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SKI, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigX509DataType_X509SKI_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigX509DataType_X509SKI_ARRAY_SIZE]; + uint16_t arrayLen; + } X509SKI; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SubjectName, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[xmldsigX509DataType_X509SubjectName_ARRAY_SIZE]; + uint16_t arrayLen; + } X509SubjectName; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509Certificate, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigX509DataType_X509Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigX509DataType_X509Certificate_ARRAY_SIZE]; + uint16_t arrayLen; + } X509Certificate; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509CRL, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigX509DataType_X509CRL_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigX509DataType_X509CRL_ARRAY_SIZE]; + uint16_t arrayLen; + } X509CRL; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigX509DataType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ @@ -185,217 +386,10 @@ struct xmldsigDSAKeyValueType { unsigned int PgenCounter_isUsed:1; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define xmldsigSignatureValueType_Id_CHARACTERS_SIZE 50 -#define xmldsigSignatureValueType_CONTENT_BYTES_SIZE 350 -struct xmldsigSignatureValueType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[xmldsigSignatureValueType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[xmldsigSignatureValueType_CONTENT_BYTES_SIZE]; - uint16_t bytesLen; - } CONTENT ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -#define xmldsigX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 -struct xmldsigX509IssuerSerialType { - /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ - struct { - exi_string_character_t characters[xmldsigX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } X509IssuerName ; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ - int64_t X509SerialNumber ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -#define xmldsigRSAKeyValueType_Modulus_BYTES_SIZE 350 -#define xmldsigRSAKeyValueType_Exponent_BYTES_SIZE 350 -struct xmldsigRSAKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[xmldsigRSAKeyValueType_Modulus_BYTES_SIZE]; - uint16_t bytesLen; - } Modulus ; - /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[xmldsigRSAKeyValueType_Exponent_BYTES_SIZE]; - uint16_t bytesLen; - } Exponent ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE 1 -#define xmldsigX509DataType_X509SKI_BYTES_SIZE 350 -#define xmldsigX509DataType_X509SKI_ARRAY_SIZE 1 -#define xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE 50 -#define xmldsigX509DataType_X509SubjectName_ARRAY_SIZE 1 -#define xmldsigX509DataType_X509Certificate_BYTES_SIZE 350 -#define xmldsigX509DataType_X509Certificate_ARRAY_SIZE 1 -#define xmldsigX509DataType_X509CRL_BYTES_SIZE 350 -#define xmldsigX509DataType_X509CRL_ARRAY_SIZE 1 -struct xmldsigX509DataType { - /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ - struct { - struct xmldsigX509IssuerSerialType array[xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE]; - uint16_t arrayLen; - } X509IssuerSerial; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509SKI, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - struct { - uint8_t bytes[xmldsigX509DataType_X509SKI_BYTES_SIZE]; - uint16_t bytesLen; - } array[xmldsigX509DataType_X509SKI_ARRAY_SIZE]; - uint16_t arrayLen; - } X509SKI; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509SubjectName, http://www.w3.org/2001/XMLSchema,string */ - struct { - struct { - exi_string_character_t characters[xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } array[xmldsigX509DataType_X509SubjectName_ARRAY_SIZE]; - uint16_t arrayLen; - } X509SubjectName; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509Certificate, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - struct { - uint8_t bytes[xmldsigX509DataType_X509Certificate_BYTES_SIZE]; - uint16_t bytesLen; - } array[xmldsigX509DataType_X509Certificate_ARRAY_SIZE]; - uint16_t arrayLen; - } X509Certificate; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509CRL, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - struct { - uint8_t bytes[xmldsigX509DataType_X509CRL_BYTES_SIZE]; - uint16_t bytesLen; - } array[xmldsigX509DataType_X509CRL_ARRAY_SIZE]; - uint16_t arrayLen; - } X509CRL; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigSignatureMethodType_Algorithm_CHARACTERS_SIZE 65 -struct xmldsigSignatureMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[xmldsigSignatureMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; - /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ - int64_t HMACOutputLength ; - unsigned int HMACOutputLength_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define xmldsigSPKIDataType_SPKISexp_BYTES_SIZE 350 -#define xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE 1 -struct xmldsigSPKIDataType { - /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - struct { - uint8_t bytes[xmldsigSPKIDataType_SPKISexp_BYTES_SIZE]; - uint16_t bytesLen; - } array[xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE]; - uint16_t arrayLen; - } SPKISexp; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE 50 -#define xmldsigSignaturePropertyType_Id_CHARACTERS_SIZE 50 -struct xmldsigSignaturePropertyType { - /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Target ; - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[xmldsigSignaturePropertyType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 65 -struct xmldsigCanonicalizationMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[xmldsigCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigTransformsType_Transform_ARRAY_SIZE 1 -struct xmldsigTransformsType { - /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct xmldsigTransformType array[xmldsigTransformsType_Transform_ARRAY_SIZE]; - uint16_t arrayLen; - } Transform; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -struct xmldsigKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ - struct xmldsigDSAKeyValueType DSAKeyValue ; - unsigned int DSAKeyValue_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ - struct xmldsigRSAKeyValueType RSAKeyValue ; - unsigned int RSAKeyValue_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -#define xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE 50 -#define xmldsigRetrievalMethodType_Type_CHARACTERS_SIZE 50 -struct xmldsigRetrievalMethodType { - /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE]; - uint16_t charactersLen; - } URI ; - unsigned int URI_isUsed:1; - /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[xmldsigRetrievalMethodType_Type_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Type ; - unsigned int Type_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct xmldsigTransformsType Transforms ; - unsigned int Transforms_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigSignaturePropertiesType_Id_CHARACTERS_SIZE 50 -#define xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 1 -struct xmldsigSignaturePropertiesType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[xmldsigSignaturePropertiesType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct xmldsigSignaturePropertyType array[xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; - uint16_t arrayLen; - } SignatureProperty; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -#define xmldsigReferenceType_Id_CHARACTERS_SIZE 50 -#define xmldsigReferenceType_URI_CHARACTERS_SIZE 50 -#define xmldsigReferenceType_Type_CHARACTERS_SIZE 50 +#define xmldsigReferenceType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigReferenceType_URI_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigReferenceType_Type_CHARACTERS_SIZE 50 + EXTRA_CHAR #define xmldsigReferenceType_DigestValue_BYTES_SIZE 350 struct xmldsigReferenceType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ @@ -428,8 +422,67 @@ struct xmldsigReferenceType { } DigestValue ; }; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigSPKIDataType_SPKISexp_BYTES_SIZE 350 +#define xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE 1 +#define xmldsigSPKIDataType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigSPKIDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigSPKIDataType_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE]; + uint16_t arrayLen; + } SPKISexp; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigSPKIDataType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigManifestType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigManifestType_Reference_ARRAY_SIZE 1 +struct xmldsigManifestType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigManifestType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigReferenceType array[xmldsigManifestType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +#define xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigRetrievalMethodType_Type_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigRetrievalMethodType { + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigRetrievalMethodType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct xmldsigTransformsType Transforms ; + unsigned int Transforms_isUsed:1; +}; + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigSignedInfoType_Id_CHARACTERS_SIZE 50 +#define xmldsigSignedInfoType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR #define xmldsigSignedInfoType_Reference_ARRAY_SIZE 1 struct xmldsigSignedInfoType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ @@ -449,17 +502,52 @@ struct xmldsigSignedInfoType { } Reference; }; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigSignaturePropertiesType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 1 +struct xmldsigSignaturePropertiesType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignaturePropertiesType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigSignaturePropertyType array[xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; + uint16_t arrayLen; + } SignatureProperty; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +#define xmldsigKeyValueType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR +struct xmldsigKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ + struct xmldsigDSAKeyValueType DSAKeyValue ; + unsigned int DSAKeyValue_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ + struct xmldsigRSAKeyValueType RSAKeyValue ; + unsigned int RSAKeyValue_isUsed:1; + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ + struct { + exi_string_character_t characters[xmldsigKeyValueType_ANY_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ANY ; + unsigned int ANY_isUsed:1; +}; + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define xmldsigKeyInfoType_Id_CHARACTERS_SIZE 50 -#define xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE 50 +#define xmldsigKeyInfoType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE 50 + EXTRA_CHAR #define xmldsigKeyInfoType_KeyName_ARRAY_SIZE 1 #define xmldsigKeyInfoType_KeyValue_ARRAY_SIZE 1 #define xmldsigKeyInfoType_RetrievalMethod_ARRAY_SIZE 1 #define xmldsigKeyInfoType_X509Data_ARRAY_SIZE 1 #define xmldsigKeyInfoType_PGPData_ARRAY_SIZE 1 #define xmldsigKeyInfoType_SPKIData_ARRAY_SIZE 1 -#define xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE 50 +#define xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE 50 + EXTRA_CHAR #define xmldsigKeyInfoType_MgmtData_ARRAY_SIZE 1 +#define xmldsigKeyInfoType_ANY_CHARACTERS_SIZE 50 + EXTRA_CHAR struct xmldsigKeyInfoType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { @@ -508,27 +596,16 @@ struct xmldsigKeyInfoType { } array[xmldsigKeyInfoType_MgmtData_ARRAY_SIZE]; uint16_t arrayLen; } MgmtData; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigManifestType_Id_CHARACTERS_SIZE 50 -#define xmldsigManifestType_Reference_ARRAY_SIZE 1 -struct xmldsigManifestType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + /* element: WC[##other:"http://www.w3.org/2000/09/xmldsig#"] */ struct { - exi_string_character_t characters[xmldsigManifestType_Id_CHARACTERS_SIZE]; + exi_string_character_t characters[xmldsigKeyInfoType_ANY_CHARACTERS_SIZE]; uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ - struct { - struct xmldsigReferenceType array[xmldsigManifestType_Reference_ARRAY_SIZE]; - uint16_t arrayLen; - } Reference; + } ANY ; + unsigned int ANY_isUsed:1; }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define xmldsigSignatureType_Id_CHARACTERS_SIZE 50 +#define xmldsigSignatureType_Id_CHARACTERS_SIZE 50 + EXTRA_CHAR #define xmldsigSignatureType_Object_ARRAY_SIZE 1 struct xmldsigSignatureType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ @@ -553,30 +630,30 @@ struct xmldsigSignatureType { -#define EXIDocument_MgmtData_CHARACTERS_SIZE 50 -#define EXIDocument_KeyName_CHARACTERS_SIZE 50 +#define EXIDocument_MgmtData_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define EXIDocument_KeyName_CHARACTERS_SIZE 50 + EXTRA_CHAR #define EXIDocument_DigestValue_BYTES_SIZE 350 -#define EXIFragment_PGPKeyPacket_BYTES_SIZE 350 -#define EXIFragment_PgenCounter_BYTES_SIZE 350 -#define EXIFragment_X509Certificate_BYTES_SIZE 350 -#define EXIFragment_Seed_BYTES_SIZE 350 -#define EXIFragment_Modulus_BYTES_SIZE 350 -#define EXIFragment_X509SKI_BYTES_SIZE 350 -#define EXIFragment_SPKISexp_BYTES_SIZE 350 -#define EXIFragment_KeyName_CHARACTERS_SIZE 50 -#define EXIFragment_P_BYTES_SIZE 350 -#define EXIFragment_Exponent_BYTES_SIZE 350 -#define EXIFragment_X509IssuerName_CHARACTERS_SIZE 50 -#define EXIFragment_X509SubjectName_CHARACTERS_SIZE 50 #define EXIFragment_DigestValue_BYTES_SIZE 350 -#define EXIFragment_MgmtData_CHARACTERS_SIZE 50 -#define EXIFragment_Y_BYTES_SIZE 350 -#define EXIFragment_J_BYTES_SIZE 350 +#define EXIFragment_SPKISexp_BYTES_SIZE 350 +#define EXIFragment_KeyName_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define EXIFragment_X509IssuerName_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define EXIFragment_MgmtData_CHARACTERS_SIZE 50 + EXTRA_CHAR #define EXIFragment_PGPKeyID_BYTES_SIZE 350 -#define EXIFragment_G_BYTES_SIZE 350 -#define EXIFragment_X509CRL_BYTES_SIZE 350 +#define EXIFragment_PGPKeyPacket_BYTES_SIZE 350 +#define EXIFragment_Exponent_BYTES_SIZE 350 +#define EXIFragment_P_BYTES_SIZE 350 #define EXIFragment_Q_BYTES_SIZE 350 -#define EXIFragment_XPath_CHARACTERS_SIZE 50 +#define EXIFragment_Seed_BYTES_SIZE 350 +#define EXIFragment_X509SubjectName_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define EXIFragment_X509Certificate_BYTES_SIZE 350 +#define EXIFragment_G_BYTES_SIZE 350 +#define EXIFragment_J_BYTES_SIZE 350 +#define EXIFragment_X509SKI_BYTES_SIZE 350 +#define EXIFragment_XPath_CHARACTERS_SIZE 50 + EXTRA_CHAR +#define EXIFragment_Modulus_BYTES_SIZE 350 +#define EXIFragment_X509CRL_BYTES_SIZE 350 +#define EXIFragment_Y_BYTES_SIZE 350 +#define EXIFragment_PgenCounter_BYTES_SIZE 350 /* Global elements of EXI Document */ @@ -648,203 +725,205 @@ struct xmldsigEXIDocument { int _warning_; }; - + + #if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES /* Possible elements of EXI Fragment */ struct xmldsigEXIFragment { #if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES union { #endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ - struct xmldsigRSAKeyValueType RSAKeyValue ; struct { - uint8_t bytes[EXIFragment_PGPKeyPacket_BYTES_SIZE]; + uint8_t bytes[EXIFragment_DigestValue_BYTES_SIZE]; uint16_t bytesLen; - } PGPKeyPacket ; + } DigestValue ; struct xmldsigX509DataType X509Data ; - struct { - uint8_t bytes[EXIFragment_PgenCounter_BYTES_SIZE]; - uint16_t bytesLen; - } PgenCounter ; - struct { - uint8_t bytes[EXIFragment_X509Certificate_BYTES_SIZE]; - uint16_t bytesLen; - } X509Certificate ; - struct { - uint8_t bytes[EXIFragment_Seed_BYTES_SIZE]; - uint16_t bytesLen; - } Seed ; - struct { - uint8_t bytes[EXIFragment_Modulus_BYTES_SIZE]; - uint16_t bytesLen; - } Modulus ; - struct { - uint8_t bytes[EXIFragment_X509SKI_BYTES_SIZE]; - uint16_t bytesLen; - } X509SKI ; + struct xmldsigKeyValueType KeyValue ; + struct xmldsigDigestMethodType DigestMethod ; struct { uint8_t bytes[EXIFragment_SPKISexp_BYTES_SIZE]; uint16_t bytesLen; } SPKISexp ; - struct xmldsigCanonicalizationMethodType CanonicalizationMethod ; - int64_t X509SerialNumber ; - struct xmldsigSignaturePropertiesType SignatureProperties ; - struct xmldsigReferenceType Reference ; + struct xmldsigTransformsType Transforms ; struct { exi_string_character_t characters[EXIFragment_KeyName_CHARACTERS_SIZE]; uint16_t charactersLen; } KeyName ; - struct { - uint8_t bytes[EXIFragment_P_BYTES_SIZE]; - uint16_t bytesLen; - } P ; - struct xmldsigSignatureValueType SignatureValue ; - struct xmldsigSignedInfoType SignedInfo ; - struct xmldsigKeyInfoType KeyInfo ; - struct xmldsigDigestMethodType DigestMethod ; - struct xmldsigSPKIDataType SPKIData ; - struct xmldsigObjectType Object ; - struct { - uint8_t bytes[EXIFragment_Exponent_BYTES_SIZE]; - uint16_t bytesLen; - } Exponent ; struct { exi_string_character_t characters[EXIFragment_X509IssuerName_CHARACTERS_SIZE]; uint16_t charactersLen; } X509IssuerName ; - struct { - exi_string_character_t characters[EXIFragment_X509SubjectName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } X509SubjectName ; - struct xmldsigPGPDataType PGPData ; - int64_t HMACOutputLength ; - struct { - uint8_t bytes[EXIFragment_DigestValue_BYTES_SIZE]; - uint16_t bytesLen; - } DigestValue ; struct { exi_string_character_t characters[EXIFragment_MgmtData_CHARACTERS_SIZE]; uint16_t charactersLen; } MgmtData ; - struct xmldsigKeyValueType KeyValue ; - struct xmldsigSignaturePropertyType SignatureProperty ; - struct xmldsigDSAKeyValueType DSAKeyValue ; - struct xmldsigX509IssuerSerialType X509IssuerSerial ; - struct { - uint8_t bytes[EXIFragment_Y_BYTES_SIZE]; - uint16_t bytesLen; - } Y ; - struct { - uint8_t bytes[EXIFragment_J_BYTES_SIZE]; - uint16_t bytesLen; - } J ; - struct xmldsigSignatureType Signature ; - struct xmldsigTransformType Transform ; + struct xmldsigReferenceType Reference ; + struct xmldsigSignaturePropertiesType SignatureProperties ; struct { uint8_t bytes[EXIFragment_PGPKeyID_BYTES_SIZE]; uint16_t bytesLen; } PGPKeyID ; - struct xmldsigTransformsType Transforms ; + struct xmldsigPGPDataType PGPData ; + struct xmldsigDSAKeyValueType DSAKeyValue ; + struct xmldsigSignatureValueType SignatureValue ; + struct xmldsigKeyInfoType KeyInfo ; + struct xmldsigSignaturePropertyType SignatureProperty ; struct { - uint8_t bytes[EXIFragment_G_BYTES_SIZE]; + uint8_t bytes[EXIFragment_PGPKeyPacket_BYTES_SIZE]; uint16_t bytesLen; - } G ; + } PGPKeyPacket ; + int64_t HMACOutputLength ; struct { - uint8_t bytes[EXIFragment_X509CRL_BYTES_SIZE]; + uint8_t bytes[EXIFragment_Exponent_BYTES_SIZE]; uint16_t bytesLen; - } X509CRL ; + } Exponent ; + struct xmldsigManifestType Manifest ; + struct { + uint8_t bytes[EXIFragment_P_BYTES_SIZE]; + uint16_t bytesLen; + } P ; + struct xmldsigCanonicalizationMethodType CanonicalizationMethod ; struct { uint8_t bytes[EXIFragment_Q_BYTES_SIZE]; uint16_t bytesLen; } Q ; + struct { + uint8_t bytes[EXIFragment_Seed_BYTES_SIZE]; + uint16_t bytesLen; + } Seed ; + struct { + exi_string_character_t characters[EXIFragment_X509SubjectName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509SubjectName ; + struct { + uint8_t bytes[EXIFragment_X509Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } X509Certificate ; + struct xmldsigRSAKeyValueType RSAKeyValue ; + struct xmldsigX509IssuerSerialType X509IssuerSerial ; + struct xmldsigSPKIDataType SPKIData ; + struct { + uint8_t bytes[EXIFragment_G_BYTES_SIZE]; + uint16_t bytesLen; + } G ; + struct { + uint8_t bytes[EXIFragment_J_BYTES_SIZE]; + uint16_t bytesLen; + } J ; + struct xmldsigSignedInfoType SignedInfo ; + struct { + uint8_t bytes[EXIFragment_X509SKI_BYTES_SIZE]; + uint16_t bytesLen; + } X509SKI ; + struct xmldsigTransformType Transform ; struct { exi_string_character_t characters[EXIFragment_XPath_CHARACTERS_SIZE]; uint16_t charactersLen; } XPath ; - struct xmldsigSignatureMethodType SignatureMethod ; + struct xmldsigObjectType Object ; + int64_t X509SerialNumber ; struct xmldsigRetrievalMethodType RetrievalMethod ; - struct xmldsigManifestType Manifest ; + struct { + uint8_t bytes[EXIFragment_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + struct { + uint8_t bytes[EXIFragment_X509CRL_BYTES_SIZE]; + uint16_t bytesLen; + } X509CRL ; + struct xmldsigSignatureType Signature ; + struct { + uint8_t bytes[EXIFragment_Y_BYTES_SIZE]; + uint16_t bytesLen; + } Y ; + struct xmldsigSignatureMethodType SignatureMethod ; + struct { + uint8_t bytes[EXIFragment_PgenCounter_BYTES_SIZE]; + uint16_t bytesLen; + } PgenCounter ; #if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES }; #endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ - unsigned int RSAKeyValue_isUsed:1; - unsigned int PGPKeyPacket_isUsed:1; - unsigned int X509Data_isUsed:1; - unsigned int PgenCounter_isUsed:1; - unsigned int X509Certificate_isUsed:1; - unsigned int Seed_isUsed:1; - unsigned int Modulus_isUsed:1; - unsigned int X509SKI_isUsed:1; - unsigned int SPKISexp_isUsed:1; - unsigned int CanonicalizationMethod_isUsed:1; - unsigned int X509SerialNumber_isUsed:1; - unsigned int SignatureProperties_isUsed:1; - unsigned int Reference_isUsed:1; - unsigned int KeyName_isUsed:1; - unsigned int P_isUsed:1; - unsigned int SignatureValue_isUsed:1; - unsigned int SignedInfo_isUsed:1; - unsigned int KeyInfo_isUsed:1; - unsigned int DigestMethod_isUsed:1; - unsigned int SPKIData_isUsed:1; - unsigned int Object_isUsed:1; - unsigned int Exponent_isUsed:1; - unsigned int X509IssuerName_isUsed:1; - unsigned int X509SubjectName_isUsed:1; - unsigned int PGPData_isUsed:1; - unsigned int HMACOutputLength_isUsed:1; unsigned int DigestValue_isUsed:1; - unsigned int MgmtData_isUsed:1; + unsigned int X509Data_isUsed:1; unsigned int KeyValue_isUsed:1; - unsigned int SignatureProperty_isUsed:1; - unsigned int DSAKeyValue_isUsed:1; - unsigned int X509IssuerSerial_isUsed:1; - unsigned int Y_isUsed:1; - unsigned int J_isUsed:1; - unsigned int Signature_isUsed:1; - unsigned int Transform_isUsed:1; - unsigned int PGPKeyID_isUsed:1; + unsigned int DigestMethod_isUsed:1; + unsigned int SPKISexp_isUsed:1; unsigned int Transforms_isUsed:1; - unsigned int G_isUsed:1; - unsigned int X509CRL_isUsed:1; - unsigned int Q_isUsed:1; - unsigned int XPath_isUsed:1; - unsigned int SignatureMethod_isUsed:1; - unsigned int RetrievalMethod_isUsed:1; + unsigned int KeyName_isUsed:1; + unsigned int X509IssuerName_isUsed:1; + unsigned int MgmtData_isUsed:1; + unsigned int Reference_isUsed:1; + unsigned int SignatureProperties_isUsed:1; + unsigned int PGPKeyID_isUsed:1; + unsigned int PGPData_isUsed:1; + unsigned int DSAKeyValue_isUsed:1; + unsigned int SignatureValue_isUsed:1; + unsigned int KeyInfo_isUsed:1; + unsigned int SignatureProperty_isUsed:1; + unsigned int PGPKeyPacket_isUsed:1; + unsigned int HMACOutputLength_isUsed:1; + unsigned int Exponent_isUsed:1; unsigned int Manifest_isUsed:1; + unsigned int P_isUsed:1; + unsigned int CanonicalizationMethod_isUsed:1; + unsigned int Q_isUsed:1; + unsigned int Seed_isUsed:1; + unsigned int X509SubjectName_isUsed:1; + unsigned int X509Certificate_isUsed:1; + unsigned int RSAKeyValue_isUsed:1; + unsigned int X509IssuerSerial_isUsed:1; + unsigned int SPKIData_isUsed:1; + unsigned int G_isUsed:1; + unsigned int J_isUsed:1; + unsigned int SignedInfo_isUsed:1; + unsigned int X509SKI_isUsed:1; + unsigned int Transform_isUsed:1; + unsigned int XPath_isUsed:1; + unsigned int Object_isUsed:1; + unsigned int X509SerialNumber_isUsed:1; + unsigned int RetrievalMethod_isUsed:1; + unsigned int Modulus_isUsed:1; + unsigned int X509CRL_isUsed:1; + unsigned int Signature_isUsed:1; + unsigned int Y_isUsed:1; + unsigned int SignatureMethod_isUsed:1; + unsigned int PgenCounter_isUsed:1; int _warning_; }; #endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + /* Initialization methods for structs */ void init_xmldsigEXIDocument(struct xmldsigEXIDocument* exiDoc); #if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES void init_xmldsigEXIFragment(struct xmldsigEXIFragment* exiFrag); #endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ -void init_xmldsigKeyValueType(struct xmldsigKeyValueType* xmldsigKeyValueType); -void init_xmldsigDSAKeyValueType(struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); -void init_xmldsigRSAKeyValueType(struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); -void init_xmldsigSignaturePropertiesType(struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); void init_xmldsigCanonicalizationMethodType(struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType); +void init_xmldsigManifestType(struct xmldsigManifestType* xmldsigManifestType); void init_xmldsigObjectType(struct xmldsigObjectType* xmldsigObjectType); -void init_xmldsigTransformsType(struct xmldsigTransformsType* xmldsigTransformsType); void init_xmldsigTransformType(struct xmldsigTransformType* xmldsigTransformType); +void init_xmldsigSignatureMethodType(struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); void init_xmldsigDigestMethodType(struct xmldsigDigestMethodType* xmldsigDigestMethodType); +void init_xmldsigRetrievalMethodType(struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); +void init_xmldsigSignatureValueType(struct xmldsigSignatureValueType* xmldsigSignatureValueType); +void init_xmldsigX509IssuerSerialType(struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); +void init_xmldsigSignedInfoType(struct xmldsigSignedInfoType* xmldsigSignedInfoType); +void init_xmldsigSignaturePropertiesType(struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); +void init_xmldsigSignaturePropertyType(struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); +void init_xmldsigKeyValueType(struct xmldsigKeyValueType* xmldsigKeyValueType); +void init_xmldsigRSAKeyValueType(struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); +void init_xmldsigPGPDataType(struct xmldsigPGPDataType* xmldsigPGPDataType); +void init_xmldsigTransformsType(struct xmldsigTransformsType* xmldsigTransformsType); +void init_xmldsigX509DataType(struct xmldsigX509DataType* xmldsigX509DataType); void init_xmldsigSignatureType(struct xmldsigSignatureType* xmldsigSignatureType); +void init_xmldsigDSAKeyValueType(struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); void init_xmldsigReferenceType(struct xmldsigReferenceType* xmldsigReferenceType); void init_xmldsigSPKIDataType(struct xmldsigSPKIDataType* xmldsigSPKIDataType); -void init_xmldsigPGPDataType(struct xmldsigPGPDataType* xmldsigPGPDataType); -void init_xmldsigX509IssuerSerialType(struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); -void init_xmldsigSignatureMethodType(struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); -void init_xmldsigRetrievalMethodType(struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); -void init_xmldsigSignaturePropertyType(struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); -void init_xmldsigSignedInfoType(struct xmldsigSignedInfoType* xmldsigSignedInfoType); void init_xmldsigKeyInfoType(struct xmldsigKeyInfoType* xmldsigKeyInfoType); -void init_xmldsigManifestType(struct xmldsigManifestType* xmldsigManifestType); -void init_xmldsigSignatureValueType(struct xmldsigSignatureValueType* xmldsigSignatureValueType); -void init_xmldsigX509DataType(struct xmldsigX509DataType* xmldsigX509DataType); #endif /* DEPLOY_XMLDSIG_CODEC */ diff --git a/src/xmldsig/xmldsigEXIDatatypesDecoder.c b/src/xmldsig/xmldsigEXIDatatypesDecoder.c index a66ee00..fd61f25 100644 --- a/src/xmldsig/xmldsigEXIDatatypesDecoder.c +++ b/src/xmldsig/xmldsigEXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2017 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 2017-09-04 + * @contact Richard.Kuntschke@siemens.com * *Code generated by EXIdizer
*Schema: xmldsig-core-schema.xsd
@@ -48,78 +48,427 @@ static uint32_t eventCode; static int errn; static uint32_t uint32; - /* Forward Declarations */ -static int decode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType); -static int decode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); -static int decode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); -static int decode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); static int decode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType); +static int decode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType); static int decode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType); -static int decode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType); static int decode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType); +static int decode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); static int decode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType); +static int decode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); +static int decode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType); +static int decode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); +static int decode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType); +static int decode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); +static int decode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); +static int decode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType); +static int decode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); +static int decode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType); +static int decode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType); +static int decode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType); static int decode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignatureType* xmldsigSignatureType); +static int decode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); static int decode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigReferenceType* xmldsigReferenceType); static int decode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDataType* xmldsigSPKIDataType); -static int decode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType); -static int decode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); -static int decode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); -static int decode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); -static int decode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); -static int decode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType); static int decode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoType* xmldsigKeyInfoType); -static int decode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType); -static int decode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType); -static int decode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType); /* Deviant data decoding (skip functions) */ -static int decodeDeviationsCH(bitstream_t* stream) { - int i=0; - uint16_t uint16; - errn = 0; + + + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { + int grammarID = 0; + int done = 0; - errn = decodeUnsignedInteger16(stream, &uint16); - if (errn == 0) { - for(i=0; iCode generated by EXIdizer
*Schema: xmldsig-core-schema.xsd
@@ -50,10 +50,10 @@ extern "C" { #include "xmldsigEXIDatatypes.h" int decode_xmldsigExiDocument(bitstream_t* stream, struct xmldsigEXIDocument* exiDoc); - + #if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES int decode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* exiFrag); -#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ #endif /* DEPLOY_XMLDSIG_CODEC */ diff --git a/src/xmldsig/xmldsigEXIDatatypesEncoder.c b/src/xmldsig/xmldsigEXIDatatypesEncoder.c index fef80c6..2e4f236 100644 --- a/src/xmldsig/xmldsigEXIDatatypesEncoder.c +++ b/src/xmldsig/xmldsigEXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2017 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 2017-09-04 + * @contact Richard.Kuntschke@siemens.com * *Code generated by EXIdizer
*Schema: xmldsig-core-schema.xsd
@@ -46,97 +46,385 @@ static int errn; /* Forward Declarations */ -static int encode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType); -static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); -static int encode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); -static int encode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); static int encode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType); +static int encode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType); static int encode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType); -static int encode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType); static int encode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType); +static int encode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); static int encode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType); +static int encode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); +static int encode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType); +static int encode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); +static int encode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType); +static int encode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); +static int encode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); +static int encode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType); +static int encode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); +static int encode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType); +static int encode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType); +static int encode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType); static int encode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignatureType* xmldsigSignatureType); +static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigReferenceType* xmldsigReferenceType); static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDataType* xmldsigSPKIDataType); -static int encode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType); -static int encode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); -static int encode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); -static int encode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); -static int encode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); -static int encode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType); static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoType* xmldsigKeyInfoType); -static int encode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType); -static int encode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType); -static int encode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType); - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int encode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType) { + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { int grammarID = 0; int done = 0; + int wcDone = 0; while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( xmldsigKeyValueType->DSAKeyValue_isUsed == 1u ) { + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigCanonicalizationMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigCanonicalizationMethodType->Algorithm.characters, xmldsigCanonicalizationMethodType->Algorithm.charactersLen); + } + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 1: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigCanonicalizationMethodType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigCanonicalizationMethodType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigCanonicalizationMethodType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigCanonicalizationMethodType->ANY.characters, xmldsigCanonicalizationMethodType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 2: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigCanonicalizationMethodType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigCanonicalizationMethodType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigCanonicalizationMethodType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigCanonicalizationMethodType->ANY.characters, xmldsigCanonicalizationMethodType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType) { + int grammarID = 4; + int done = 0; + + unsigned int xmldsigManifestType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 4: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if ( xmldsigManifestType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigManifestType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigManifestType->Id.characters, xmldsigManifestType->Id.charactersLen); + } + } + grammarID = 5; + } else if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); + } + grammarID = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); + } + grammarID = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 6: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); + } + grammarID = 6; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType) { + int grammarID = 7; + int done = 0; + int wcDone = 0; + + + while(!done) { + switch(grammarID) { + case 7: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigObjectType->Encoding_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { - errn = encode_xmldsigDSAKeyValueType(stream, &xmldsigKeyValueType->DSAKeyValue ); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Encoding.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->Encoding.characters, xmldsigObjectType->Encoding.charactersLen); + } } - grammarID = 1; - } else if ( xmldsigKeyValueType->RSAKeyValue_isUsed == 1u ) { + grammarID = 8; + } else if ( xmldsigObjectType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { - errn = encode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue ); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->Id.characters, xmldsigObjectType->Id.charactersLen); + } + } + grammarID = 9; + } else if ( xmldsigObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); + } } grammarID = 1; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigObjectType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigObjectType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 5); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->ANY.characters, xmldsigObjectType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 8: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->Id.characters, xmldsigObjectType->Id.charactersLen); + } + } + grammarID = 9; + } else if ( xmldsigObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); + } + } grammarID = 1; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; grammarID = 2; + } else if ( xmldsigObjectType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigObjectType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->ANY.characters, xmldsigObjectType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 9: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); + } + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigObjectType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigObjectType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->ANY.characters, xmldsigObjectType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 1: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigObjectType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 1; + } else if ( xmldsigObjectType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->ANY.characters, xmldsigObjectType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 2: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( xmldsigKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_xmldsigDSAKeyValueType(stream, &xmldsigKeyValueType->DSAKeyValue ); - } - grammarID = 1; - } else if ( xmldsigKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue ); - } - grammarID = 1; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 1; - } else if (1==0) { + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; grammarID = 2; + } else if ( xmldsigObjectType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigObjectType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->ANY.characters, xmldsigObjectType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -152,226 +440,25 @@ static int encode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValu return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType) { - int grammarID = 4; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType) { + int grammarID = 10; int done = 0; + int wcDone = 0; + unsigned int xmldsigTransformType_XPath_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 4: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( xmldsigDSAKeyValueType->P_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->P.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->P.bytes, xmldsigDSAKeyValueType->P.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 5; - } else if ( xmldsigDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->G.bytes, xmldsigDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 6; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 7; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 5: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - if ( xmldsigDSAKeyValueType->Q_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Q.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->Q.bytes, xmldsigDSAKeyValueType->Q.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 8; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 8: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( xmldsigDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->G.bytes, xmldsigDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 6; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 7; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 6: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 7; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 7: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( xmldsigDSAKeyValueType->J_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->J.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->J.bytes, xmldsigDSAKeyValueType->J.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 9; - } else if ( xmldsigDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytes, xmldsigDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 10; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 9: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( xmldsigDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytes, xmldsigDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 10; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; case 10: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - if ( xmldsigDSAKeyValueType->PgenCounter_isUsed == 1u ) { + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->PgenCounter.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigDSAKeyValueType->PgenCounter.bytes, xmldsigDSAKeyValueType->PgenCounter.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->Algorithm.characters, xmldsigTransformType->Algorithm.charactersLen); } } grammarID = 11; @@ -380,6 +467,421 @@ static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAK } break; case 11: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (xmldsigTransformType_XPath_currArrayIndex < xmldsigTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].characters, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen); + xmldsigTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 12; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 12; + } else if ( xmldsigTransformType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigTransformType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->ANY.characters, xmldsigTransformType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 12; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 12: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (xmldsigTransformType_XPath_currArrayIndex < xmldsigTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].characters, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen); + xmldsigTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 12; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 12; + } else if ( xmldsigTransformType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigTransformType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->ANY.characters, xmldsigTransformType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 12; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType) { + int grammarID = 13; + int done = 0; + int wcDone = 0; + + + while(!done) { + switch(grammarID) { + case 13: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureMethodType->Algorithm.characters, xmldsigSignatureMethodType->Algorithm.charactersLen); + } + } + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 14: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, xmldsigSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 2; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigSignatureMethodType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigSignatureMethodType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureMethodType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureMethodType->ANY.characters, xmldsigSignatureMethodType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 15; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 2: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigSignatureMethodType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigSignatureMethodType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureMethodType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureMethodType->ANY.characters, xmldsigSignatureMethodType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 15: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, xmldsigSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 2; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigSignatureMethodType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigSignatureMethodType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureMethodType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureMethodType->ANY.characters, xmldsigSignatureMethodType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 15; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType) { + int grammarID = 0; + int done = 0; + int wcDone = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDigestMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigDigestMethodType->Algorithm.characters, xmldsigDigestMethodType->Algorithm.charactersLen); + } + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 1: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigDigestMethodType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigDigestMethodType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDigestMethodType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigDigestMethodType->ANY.characters, xmldsigDigestMethodType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 2: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else if ( xmldsigDigestMethodType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigDigestMethodType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDigestMethodType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigDigestMethodType->ANY.characters, xmldsigDigestMethodType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType) { + int grammarID = 16; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 16: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( xmldsigRetrievalMethodType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigRetrievalMethodType->Type.characters, xmldsigRetrievalMethodType->Type.charactersLen); + } + } + grammarID = 17; + } else if ( xmldsigRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigRetrievalMethodType->URI.characters, xmldsigRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 18; + } else if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); + } + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 17: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( xmldsigRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigRetrievalMethodType->URI.characters, xmldsigRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 18; + } else if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); + } + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); + } + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -402,57 +904,55 @@ static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAK return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int encode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType) { - int grammarID = 12; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType) { + int grammarID = 20; int done = 0; while(!done) { switch(grammarID) { - case 12: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); + case 20: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + if ( xmldsigSignatureValueType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRSAKeyValueType->Modulus.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigRSAKeyValueType->Modulus.bytes, xmldsigRSAKeyValueType->Modulus.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureValueType->Id.characters, xmldsigSignatureValueType->Id.charactersLen); } } - grammarID = 13; + grammarID = 21; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytes, xmldsigSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 19; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 13: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ - if ( 1 == 1 ) { + case 21: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRSAKeyValueType->Exponent.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigRSAKeyValueType->Exponent.bytes, xmldsigRSAKeyValueType->Exponent.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytes, xmldsigSignatureValueType->CONTENT.bytesLen); } } - grammarID = 11; + grammarID = 19; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 11: + case 19: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -475,16 +975,183 @@ static int encode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAK return errn; } +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int encode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType) { + int grammarID = 22; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 22: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509IssuerSerialType->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigX509IssuerSerialType->X509IssuerName.characters, xmldsigX509IssuerSerialType->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 23; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 23: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, xmldsigX509IssuerSerialType->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType) { + int grammarID = 24; + int done = 0; + + unsigned int xmldsigSignedInfoType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 24: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( xmldsigSignedInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignedInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignedInfoType->Id.characters, xmldsigSignedInfoType->Id.charactersLen); + } + } + grammarID = 25; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod ); + } + grammarID = 26; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 25: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod ); + } + grammarID = 26; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 26: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigSignatureMethodType(stream, &xmldsigSignedInfoType->SignatureMethod ); + } + grammarID = 27; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 27: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (xmldsigSignedInfoType_Reference_currArrayIndex < xmldsigSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array [xmldsigSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 6: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (xmldsigSignedInfoType_Reference_currArrayIndex < xmldsigSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array [xmldsigSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 6; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType) { - int grammarID = 14; + int grammarID = 28; int done = 0; unsigned int xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 14: + case 28: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ if ( xmldsigSignaturePropertiesType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -495,37 +1162,37 @@ static int encode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xml errn = encodeCharacters(stream, xmldsigSignaturePropertiesType->Id.characters, xmldsigSignaturePropertiesType->Id.charactersLen); } } - grammarID = 15; + grammarID = 29; } else if (xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex < xmldsigSignaturePropertiesType->SignatureProperty.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array [xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex++]); } - grammarID = 16; + grammarID = 30; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 15: + case 29: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ if (xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex < xmldsigSignaturePropertiesType->SignatureProperty.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array [xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex++]); } - grammarID = 16; + grammarID = 30; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 16: + case 30: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ if (xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex < xmldsigSignaturePropertiesType->SignatureProperty.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array [xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex++]); } - grammarID = 16; + grammarID = 30; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -547,62 +1214,119 @@ static int encode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xml return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { - int grammarID = 17; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType) { + int grammarID = 31; int done = 0; + int wcDone = 0; while(!done) { switch(grammarID) { - case 17: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + case 31: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + if ( xmldsigSignaturePropertyType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Id.characters, xmldsigSignaturePropertyType->Id.charactersLen); + } + } + grammarID = 32; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Target.characters, xmldsigSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 33; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 32: + /* StartTag[ATTRIBUTE[STRING](Target)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigCanonicalizationMethodType->Algorithm.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, xmldsigCanonicalizationMethodType->Algorithm.characters, xmldsigCanonicalizationMethodType->Algorithm.charactersLen); + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Target.characters, xmldsigSignaturePropertyType->Target.charactersLen); } } - grammarID = 18; + grammarID = 33; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 18: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + case 33: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { + grammarID = 2; + } else if ( xmldsigSignaturePropertyType->ANY_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - done = 1; + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->ANY.characters, xmldsigSignaturePropertyType->ANY.charactersLen); + } } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; + wcDone = 1; + grammarID = 34; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 19: + case 2: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { + grammarID = 2; + } else if ( xmldsigSignaturePropertyType->ANY_isUsed == 0u || wcDone ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } grammarID = 3; - } else if (1==0) { + } else if ( xmldsigSignaturePropertyType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->ANY.characters, xmldsigSignaturePropertyType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 34: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; + grammarID = 2; + } else if ( xmldsigSignaturePropertyType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->ANY.characters, xmldsigSignaturePropertyType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 34; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -618,160 +1342,272 @@ static int encode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType) { - int grammarID = 20; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int encode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType) { + int grammarID = 35; + int done = 0; + int wcDone = 0; + + + while(!done) { + switch(grammarID) { + case 35: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_xmldsigDSAKeyValueType(stream, &xmldsigKeyValueType->DSAKeyValue ); + } + grammarID = 36; + } else if ( xmldsigKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue ); + } + grammarID = 36; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 36; + } else if ( xmldsigKeyValueType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyValueType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyValueType->ANY.characters, xmldsigKeyValueType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 37; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 36: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigKeyValueType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if ( xmldsigKeyValueType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyValueType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyValueType->ANY.characters, xmldsigKeyValueType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 36; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 37: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_xmldsigDSAKeyValueType(stream, &xmldsigKeyValueType->DSAKeyValue ); + } + grammarID = 36; + } else if ( xmldsigKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue ); + } + grammarID = 36; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 36; + } else if ( xmldsigKeyValueType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyValueType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyValueType->ANY.characters, xmldsigKeyValueType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 37; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int encode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType) { + int grammarID = 38; int done = 0; while(!done) { switch(grammarID) { - case 20: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( xmldsigObjectType->Encoding_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + case 38: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Encoding.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigObjectType->Encoding.characters, xmldsigObjectType->Encoding.charactersLen); + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRSAKeyValueType->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigRSAKeyValueType->Modulus.bytes, xmldsigRSAKeyValueType->Modulus.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 21; - } else if ( xmldsigObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigObjectType->Id.characters, xmldsigObjectType->Id.charactersLen); - } - } - grammarID = 22; - } else if ( xmldsigObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); - } - } - grammarID = 18; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; + grammarID = 39; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 21: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( xmldsigObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + case 39: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigObjectType->Id.characters, xmldsigObjectType->Id.charactersLen); + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRSAKeyValueType->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigRSAKeyValueType->Exponent.bytes, xmldsigRSAKeyValueType->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 22; - } else if ( xmldsigObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); - } - } - grammarID = 18; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 22: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( xmldsigObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); - } - } - grammarID = 18; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 18: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; grammarID = 19; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 19: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int encode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType) { + int grammarID = 40; + int done = 0; + int wcDone = 0; + + + while(!done) { + switch(grammarID) { + case 40: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + if ( xmldsigPGPDataType->PGPKeyID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyID.bytes, xmldsigPGPDataType->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 41; + } else if ( xmldsigPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytes, xmldsigPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 42; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 41: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + if ( xmldsigPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytes, xmldsigPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 42; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 42; + } else if ( xmldsigPGPDataType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 42: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { + grammarID = 42; + } else if ( xmldsigPGPDataType->ANY_isUsed == 0u || wcDone ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -789,33 +1625,33 @@ static int encode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectTyp /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType) { - int grammarID = 23; + int grammarID = 43; int done = 0; unsigned int xmldsigTransformsType_Transform_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 23: + case 43: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ if (xmldsigTransformsType_Transform_currArrayIndex < xmldsigTransformsType->Transform.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_xmldsigTransformType(stream, &xmldsigTransformsType->Transform.array [xmldsigTransformsType_Transform_currArrayIndex++]); } - grammarID = 24; + grammarID = 44; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 24: + case 44: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ if (xmldsigTransformsType_Transform_currArrayIndex < xmldsigTransformsType->Transform.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_xmldsigTransformType(stream, &xmldsigTransformsType->Transform.array [xmldsigTransformsType_Transform_currArrayIndex++]); } - grammarID = 24; + grammarID = 44; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -837,168 +1673,182 @@ static int encode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTrans return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType) { - int grammarID = 25; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType) { + int grammarID = 45; int done = 0; + int wcDone = 0; - unsigned int xmldsigTransformType_XPath_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509IssuerSerial_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509SKI_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509SubjectName_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509Certificate_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509CRL_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 25: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigTransformType->Algorithm.characters, xmldsigTransformType->Algorithm.charactersLen); - } - } - grammarID = 26; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 26: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (xmldsigTransformType_XPath_currArrayIndex < xmldsigTransformType->XPath.arrayLen ) { + case 45: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + if (xmldsigX509DataType_X509IssuerSerial_currArrayIndex < xmldsigX509DataType->X509IssuerSerial.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array [xmldsigX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 46; + } else if (xmldsigX509DataType_X509SKI_currArrayIndex < xmldsigX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen)); if (errn == 0) { - errn = encodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].characters, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen); - xmldsigTransformType_XPath_currArrayIndex++; + errn = encodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytes, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen); + xmldsigX509DataType_X509SKI_currArrayIndex++; } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 27; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 27; - } else if (1==1) { + grammarID = 46; + } else if (xmldsigX509DataType_X509SubjectName_currArrayIndex < xmldsigX509DataType->X509SubjectName.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 27; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 27: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (xmldsigTransformType_XPath_currArrayIndex < xmldsigTransformType->XPath.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].characters, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen); - xmldsigTransformType_XPath_currArrayIndex++; + errn = encodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].characters, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen); + xmldsigX509DataType_X509SubjectName_currArrayIndex++; } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 27; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 27; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); + grammarID = 46; + } else if (xmldsigX509DataType_X509Certificate_currArrayIndex < xmldsigX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 27; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType) { - int grammarID = 17; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 17: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDigestMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigDigestMethodType->Algorithm.characters, xmldsigDigestMethodType->Algorithm.charactersLen); + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytes, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen); + xmldsigX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 18; + grammarID = 46; + } else if (xmldsigX509DataType_X509CRL_currArrayIndex < xmldsigX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytes, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen); + xmldsigX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 46; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 46; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 18: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { + case 46: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (xmldsigX509DataType_X509IssuerSerial_currArrayIndex < xmldsigX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array [xmldsigX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 46; + } else if (xmldsigX509DataType_X509SKI_currArrayIndex < xmldsigX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytes, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen); + xmldsigX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 46; + } else if (xmldsigX509DataType_X509SubjectName_currArrayIndex < xmldsigX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].characters, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen); + xmldsigX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 46; + } else if (xmldsigX509DataType_X509Certificate_currArrayIndex < xmldsigX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytes, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen); + xmldsigX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 46; + } else if (xmldsigX509DataType_X509CRL_currArrayIndex < xmldsigX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytes, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen); + xmldsigX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 46; + } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); + grammarID = 46; + } else if ( xmldsigX509DataType->ANY_isUsed == 0u || wcDone ) { + errn = encodeNBitUnsignedInteger(stream, 3, 6); if(errn == 0) { done = 1; } grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 19: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -1016,14 +1866,14 @@ static int encode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDig /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignatureType* xmldsigSignatureType) { - int grammarID = 28; + int grammarID = 47; int done = 0; unsigned int xmldsigSignatureType_Object_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 28: + case 47: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ if ( xmldsigSignatureType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -1034,55 +1884,55 @@ static int encode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignat errn = encodeCharacters(stream, xmldsigSignatureType->Id.characters, xmldsigSignatureType->Id.charactersLen); } } - grammarID = 29; + grammarID = 48; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_xmldsigSignedInfoType(stream, &xmldsigSignatureType->SignedInfo ); } - grammarID = 30; + grammarID = 49; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 29: + case 48: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_xmldsigSignedInfoType(stream, &xmldsigSignatureType->SignedInfo ); } - grammarID = 30; + grammarID = 49; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 30: + case 49: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_xmldsigSignatureValueType(stream, &xmldsigSignatureType->SignatureValue ); } - grammarID = 31; + grammarID = 50; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 31: + case 50: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ if ( xmldsigSignatureType->KeyInfo_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_xmldsigKeyInfoType(stream, &xmldsigSignatureType->KeyInfo ); } - grammarID = 32; + grammarID = 51; } else if (xmldsigSignatureType_Object_currArrayIndex < xmldsigSignatureType->Object.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_xmldsigObjectType(stream, &xmldsigSignatureType->Object.array [xmldsigSignatureType_Object_currArrayIndex++]); } - grammarID = 32; + grammarID = 51; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { @@ -1093,14 +1943,14 @@ static int encode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignat errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 32: + case 51: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ if (xmldsigSignatureType_Object_currArrayIndex < xmldsigSignatureType->Object.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_xmldsigObjectType(stream, &xmldsigSignatureType->Object.array [xmldsigSignatureType_Object_currArrayIndex++]); } - grammarID = 32; + grammarID = 51; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -1122,15 +1972,265 @@ static int encode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignat return errn; } +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType) { + int grammarID = 52; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 52: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( xmldsigDSAKeyValueType->P_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->P.bytes, xmldsigDSAKeyValueType->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 53; + } else if ( xmldsigDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->G.bytes, xmldsigDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 54; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 55; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 53: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + if ( xmldsigDSAKeyValueType->Q_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Q.bytes, xmldsigDSAKeyValueType->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 56; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 56: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( xmldsigDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->G.bytes, xmldsigDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 54; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 55; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 54: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 55; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 55: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( xmldsigDSAKeyValueType->J_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->J.bytes, xmldsigDSAKeyValueType->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 57; + } else if ( xmldsigDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytes, xmldsigDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 58; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 57: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( xmldsigDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytes, xmldsigDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 58; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + if ( xmldsigDSAKeyValueType->PgenCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->PgenCounter.bytes, xmldsigDSAKeyValueType->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigReferenceType* xmldsigReferenceType) { - int grammarID = 33; + int grammarID = 59; int done = 0; while(!done) { switch(grammarID) { - case 33: + case 59: /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( xmldsigReferenceType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -1141,7 +2241,7 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere errn = encodeCharacters(stream, xmldsigReferenceType->Id.characters, xmldsigReferenceType->Id.charactersLen); } } - grammarID = 34; + grammarID = 60; } else if ( xmldsigReferenceType->Type_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { @@ -1151,7 +2251,7 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere errn = encodeCharacters(stream, xmldsigReferenceType->Type.characters, xmldsigReferenceType->Type.charactersLen); } } - grammarID = 35; + grammarID = 61; } else if ( xmldsigReferenceType->URI_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { @@ -1161,24 +2261,24 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere errn = encodeCharacters(stream, xmldsigReferenceType->URI.characters, xmldsigReferenceType->URI.charactersLen); } } - grammarID = 36; + grammarID = 62; } else if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); } - grammarID = 37; + grammarID = 63; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 3, 4); if(errn == 0) { errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); } - grammarID = 38; + grammarID = 64; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 34: + case 60: /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( xmldsigReferenceType->Type_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -1189,7 +2289,7 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere errn = encodeCharacters(stream, xmldsigReferenceType->Type.characters, xmldsigReferenceType->Type.charactersLen); } } - grammarID = 35; + grammarID = 61; } else if ( xmldsigReferenceType->URI_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { @@ -1199,24 +2299,24 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere errn = encodeCharacters(stream, xmldsigReferenceType->URI.characters, xmldsigReferenceType->URI.charactersLen); } } - grammarID = 36; + grammarID = 62; } else if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); } - grammarID = 37; + grammarID = 63; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); } - grammarID = 38; + grammarID = 64; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 35: + case 61: /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( xmldsigReferenceType->URI_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -1227,54 +2327,54 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere errn = encodeCharacters(stream, xmldsigReferenceType->URI.characters, xmldsigReferenceType->URI.charactersLen); } } - grammarID = 36; + grammarID = 62; } else if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); } - grammarID = 37; + grammarID = 63; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); } - grammarID = 38; + grammarID = 64; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 36: + case 62: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); } - grammarID = 37; + grammarID = 63; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); } - grammarID = 38; + grammarID = 64; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 37: + case 63: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); } - grammarID = 38; + grammarID = 64; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 38: + case 64: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -1290,12 +2390,12 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 11; + grammarID = 19; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 11: + case 19: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -1320,14 +2420,15 @@ static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigRefere /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDataType* xmldsigSPKIDataType) { - int grammarID = 39; + int grammarID = 65; int done = 0; + int wcDone = 0; unsigned int xmldsigSPKIDataType_SPKISexp_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 39: + case 65: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ if (xmldsigSPKIDataType_SPKISexp_currArrayIndex < xmldsigSPKIDataType->SPKISexp.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -1344,12 +2445,12 @@ static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDat errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 40; + grammarID = 66; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 40: + case 66: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ if (xmldsigSPKIDataType_SPKISexp_currArrayIndex < xmldsigSPKIDataType->SPKISexp.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -1366,11 +2467,11 @@ static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDat errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 40; + grammarID = 66; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 41; - } else if (1==1) { + grammarID = 67; + } else if ( xmldsigSPKIDataType->ANY_isUsed == 0u || wcDone ) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { done = 1; @@ -1380,7 +2481,7 @@ static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDat errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 41: + case 67: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ if (xmldsigSPKIDataType_SPKISexp_currArrayIndex < xmldsigSPKIDataType->SPKISexp.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -1397,606 +2498,8 @@ static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDat errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 40; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int encode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType) { - int grammarID = 42; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 42: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - if ( xmldsigPGPDataType->PGPKeyID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyID.bytes, xmldsigPGPDataType->PGPKeyID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 43; - } else if ( xmldsigPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytes, xmldsigPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 44; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 43: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - if ( xmldsigPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytes, xmldsigPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 44; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 44; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 44: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 44; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int encode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType) { - int grammarID = 45; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 45: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509IssuerSerialType->X509IssuerName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigX509IssuerSerialType->X509IssuerName.characters, xmldsigX509IssuerSerialType->X509IssuerName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 46; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 46: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, xmldsigX509IssuerSerialType->X509SerialNumber); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 11; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 11: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType) { - int grammarID = 47; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 47: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigSignatureMethodType->Algorithm.characters, xmldsigSignatureMethodType->Algorithm.charactersLen); - } - } - grammarID = 48; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 48: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( xmldsigSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, xmldsigSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 19; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 49; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 19: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 49: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( xmldsigSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, xmldsigSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 19; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 49; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int encode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType) { - int grammarID = 50; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 50: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( xmldsigRetrievalMethodType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigRetrievalMethodType->Type.characters, xmldsigRetrievalMethodType->Type.charactersLen); - } - } - grammarID = 51; - } else if ( xmldsigRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigRetrievalMethodType->URI.characters, xmldsigRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 52; - } else if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); - } - grammarID = 11; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 51: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( xmldsigRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigRetrievalMethodType->URI.characters, xmldsigRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 52; - } else if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); - } - grammarID = 11; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 52: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); - } - grammarID = 11; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 11: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType) { - int grammarID = 53; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 53: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - if ( xmldsigSignaturePropertyType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Id.characters, xmldsigSignaturePropertyType->Id.charactersLen); - } - } - grammarID = 54; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Target.characters, xmldsigSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 55; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 54: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Target.characters, xmldsigSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 55; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 55: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 56; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 19: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 56: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 19; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 56; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType) { - int grammarID = 57; - int done = 0; - - unsigned int xmldsigSignedInfoType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 57: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( xmldsigSignedInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignedInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigSignedInfoType->Id.characters, xmldsigSignedInfoType->Id.charactersLen); - } - } - grammarID = 58; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod ); - } - grammarID = 59; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 58: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod ); - } - grammarID = 59; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 59: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_xmldsigSignatureMethodType(stream, &xmldsigSignedInfoType->SignatureMethod ); - } - grammarID = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 60: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (xmldsigSignedInfoType_Reference_currArrayIndex < xmldsigSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array [xmldsigSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 61; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 61: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (xmldsigSignedInfoType_Reference_currArrayIndex < xmldsigSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array [xmldsigSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 61; - } else if (1==1) { + grammarID = 66; + } else if ( xmldsigSPKIDataType->ANY_isUsed == 0u || wcDone ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; @@ -2019,8 +2522,9 @@ static int encode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSigne /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoType* xmldsigKeyInfoType) { - int grammarID = 62; + int grammarID = 68; int done = 0; + int wcDone = 0; unsigned int xmldsigKeyInfoType_KeyName_currArrayIndex = 0; unsigned int xmldsigKeyInfoType_KeyValue_currArrayIndex = 0; @@ -2032,7 +2536,7 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT while(!done) { switch(grammarID) { - case 62: + case 68: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ if ( xmldsigKeyInfoType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 4, 0); @@ -2043,7 +2547,7 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeCharacters(stream, xmldsigKeyInfoType->Id.characters, xmldsigKeyInfoType->Id.charactersLen); } } - grammarID = 63; + grammarID = 69; } else if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 1); if(errn == 0) { @@ -2060,37 +2564,37 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 2); if(errn == 0) { errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 3); if(errn == 0) { errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 4); if(errn == 0) { errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 5); if(errn == 0) { errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 6); if(errn == 0) { errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 7); if(errn == 0) { @@ -2107,18 +2611,26 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 64; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 65; + grammarID = 70; + } else if ( xmldsigKeyInfoType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 9); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->ANY.characters, xmldsigKeyInfoType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 71; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 63: + case 69: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 0); @@ -2136,37 +2648,37 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 1); if(errn == 0) { errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 2); if(errn == 0) { errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 3); if(errn == 0) { errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 4); if(errn == 0) { errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 5); if(errn == 0) { errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 6); if(errn == 0) { @@ -2183,18 +2695,26 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 64; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 65; + grammarID = 70; + } else if ( xmldsigKeyInfoType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 8); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->ANY.characters, xmldsigKeyInfoType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 71; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 64: + case 70: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 0); @@ -2212,37 +2732,37 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 1); if(errn == 0) { errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 2); if(errn == 0) { errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 3); if(errn == 0) { errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 4); if(errn == 0) { errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 5); if(errn == 0) { errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 6); if(errn == 0) { @@ -2259,24 +2779,32 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 64; - } else if (1==1) { + grammarID = 70; + } else if ( xmldsigKeyInfoType->ANY_isUsed == 0u || wcDone ) { errn = encodeNBitUnsignedInteger(stream, 4, 8); if(errn == 0) { done = 1; } grammarID = 3; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 64; + } else if ( xmldsigKeyInfoType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 9); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->ANY.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->ANY.characters, xmldsigKeyInfoType->ANY.charactersLen); + } + } + wcDone = 1; + grammarID = 70; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 65: + case 71: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 0); @@ -2294,37 +2822,37 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 1); if(errn == 0) { errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 2); if(errn == 0) { errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 3); if(errn == 0) { errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 4); if(errn == 0) { errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 5); if(errn == 0) { errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); } - grammarID = 64; + grammarID = 70; } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 4, 6); if(errn == 0) { @@ -2341,346 +2869,21 @@ static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 64; + grammarID = 70; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 64; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 65; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType) { - int grammarID = 66; - int done = 0; - - unsigned int xmldsigManifestType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 66: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if ( xmldsigManifestType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + grammarID = 70; + } else if ( xmldsigKeyInfoType->ANY_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 8); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigManifestType->Id.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->ANY.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, xmldsigManifestType->Id.characters, xmldsigManifestType->Id.charactersLen); + errn = encodeCharacters(stream, xmldsigKeyInfoType->ANY.characters, xmldsigKeyInfoType->ANY.charactersLen); } } - grammarID = 67; - } else if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); - } - grammarID = 61; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 67: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); - } - grammarID = 61; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 61: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); - } - grammarID = 61; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType) { - int grammarID = 68; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 68: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - if ( xmldsigSignatureValueType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigSignatureValueType->Id.characters, xmldsigSignatureValueType->Id.charactersLen); - } - } - grammarID = 69; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytes, xmldsigSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 11; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 69: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytes, xmldsigSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 11; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 11: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType) { - int grammarID = 70; - int done = 0; - - unsigned int xmldsigX509DataType_X509IssuerSerial_currArrayIndex = 0; - unsigned int xmldsigX509DataType_X509SKI_currArrayIndex = 0; - unsigned int xmldsigX509DataType_X509SubjectName_currArrayIndex = 0; - unsigned int xmldsigX509DataType_X509Certificate_currArrayIndex = 0; - unsigned int xmldsigX509DataType_X509CRL_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 70: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - if (xmldsigX509DataType_X509IssuerSerial_currArrayIndex < xmldsigX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array [xmldsigX509DataType_X509IssuerSerial_currArrayIndex++]); - } + wcDone = 1; grammarID = 71; - } else if (xmldsigX509DataType_X509SKI_currArrayIndex < xmldsigX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytes, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen); - xmldsigX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (xmldsigX509DataType_X509SubjectName_currArrayIndex < xmldsigX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].characters, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen); - xmldsigX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (xmldsigX509DataType_X509Certificate_currArrayIndex < xmldsigX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytes, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen); - xmldsigX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (xmldsigX509DataType_X509CRL_currArrayIndex < xmldsigX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytes, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen); - xmldsigX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 71; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 71: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (xmldsigX509DataType_X509IssuerSerial_currArrayIndex < xmldsigX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array [xmldsigX509DataType_X509IssuerSerial_currArrayIndex++]); - } - grammarID = 71; - } else if (xmldsigX509DataType_X509SKI_currArrayIndex < xmldsigX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytes, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen); - xmldsigX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (xmldsigX509DataType_X509SubjectName_currArrayIndex < xmldsigX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].characters, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen); - xmldsigX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (xmldsigX509DataType_X509Certificate_currArrayIndex < xmldsigX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytes, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen); - xmldsigX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (xmldsigX509DataType_X509CRL_currArrayIndex < xmldsigX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytes, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen); - xmldsigX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 71; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 6); - if(errn == 0) { - done = 1; - } - grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -2889,12 +3092,12 @@ int encode_xmldsigExiDocument(bitstream_t* stream, struct xmldsigEXIDocument* ex return errn; } - + #if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES int encode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* exiFrag) { errn = writeEXIHeader(stream); - if(errn == 0) { + if(errn == 0) { /* FragmentContent[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT_GENERIC, END_DOCUMENT] */ if ( exiFrag->CanonicalizationMethod_isUsed == 1u ) { /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ @@ -3363,13 +3566,12 @@ int encode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* ex } else { errn = EXI_ERROR_UNKOWN_EVENT; } - } - if(errn == 0) { /* EndDocument */ errn = encodeNBitUnsignedInteger(stream, 6, 46); - } + } + if(errn == 0) { /* flush any pending bits */ @@ -3377,9 +3579,10 @@ int encode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* ex } return errn; -} +} #endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + #endif /* DEPLOY_XMLDSIG_CODEC */ #endif diff --git a/src/xmldsig/xmldsigEXIDatatypesEncoder.h b/src/xmldsig/xmldsigEXIDatatypesEncoder.h index 61d57a3..62a2c63 100644 --- a/src/xmldsig/xmldsigEXIDatatypesEncoder.h +++ b/src/xmldsig/xmldsigEXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2017 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 2017-09-04 + * @contact Richard.Kuntschke@siemens.com * *Code generated by EXIdizer
*Schema: xmldsig-core-schema.xsd
@@ -51,10 +51,11 @@ extern "C" { int encode_xmldsigExiDocument(bitstream_t* stream, struct xmldsigEXIDocument* exiDoc); - + #if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES int encode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* exiFrag); -#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + #endif /* DEPLOY_XMLDSIG_CODEC */