Commit 297d0e42 authored by fetke's avatar fetke
Browse files

further changes for codec

parent 86429aa5
Loading
Loading
Loading
Loading
+114 −50
Original line number Diff line number Diff line
@@ -86,7 +86,13 @@ module ePassport_Types {
			} with {
				variant "isPdu;present=bits(5,8,0x22);"
				variant (payload)
				"fieldPresent=getIntTag('crtTag')==0xa4||getIntTag('crtTag')==0xa6||getIntTag('crtTag')==0xaa||getIntTag('crtTag')==0xb4||getIntTag('crtTag')==0xb6||getIntTag('crtTag')==0xb8"
				"fieldPresent="
				"getIntTag('crtTag')==0xa4||"
				"getIntTag('crtTag')==0xa6||"
				"getIntTag('crtTag')==0xaa||"
				"getIntTag('crtTag')==0xb4||"
				"getIntTag('crtTag')==0xb6||"
				"getIntTag('crtTag')==0xb8"
			}

			type record CommandExternalOrMutualAuthenticate {
@@ -140,38 +146,70 @@ module ePassport_Types {
				variant (lengthC) "intTag='lengthC'"
			}

			type CommandGeneric CommandDeactivateFile with {variant "isPdu;present=bits(5,8,0x04);"};
			type CommandGeneric CommandEraseRecords with {variant "isPdu;present=bits(5,8,0x0C);"};
			type CommandGeneric CommandEraseBinary with {variant "isPdu;present=bits(5,8,0x0E)||bits(5,8,0x0F);"};
			type CommandGeneric CommandPerformScqlOperation with {variant "isPdu;present=bits(5,8,0x10);"};
			type CommandGeneric CommandPerformTransactionOperation with {variant "isPdu;present=bits(5,8,0x12);"};
			type CommandGeneric CommandPerformUserOperation with {variant "isPdu;present=bits(5,8,0x14);"};
			type CommandGeneric CommandVerify with {variant "isPdu;present=bits(5,8,0x20)||bits(5,8,0x21);"};
			type CommandGeneric CommandChangeReferenceData with {variant "isPdu;present=bits(5,8,0x24);"};
			type CommandGeneric CommandDisableVerificationRequirement with {variant "isPdu;present=bits(5,8,0x26);"};
			type CommandGeneric CommandEnableVerificationRequirement with {variant "isPdu;present=bits(5,8,0x28);"};
			type CommandGeneric CommandPerformSecurityOperation with {variant "isPdu;present=bits(5,8,0x2A);"};
			type CommandGeneric CommandResetRetryCounter with {variant "isPdu;present=bits(5,8,0x2C);"};
			type CommandGeneric CommandActivateFile with {variant "isPdu;present=bits(5,8,0x44);"};
			type CommandGeneric CommandGenerateAsymmetricKeyPair with {variant "isPdu;present=bits(5,8,0x46);"};
			type CommandGeneric CommandManageChannel with {variant "isPdu;present=bits(5,8,0x70);"};
			type CommandGeneric CommandGeneralAuthenticate with {variant "isPdu;present=bits(5,8,0x87);"};
			type CommandGeneric CommandSearchBinary with {variant "isPdu;present=bits(5,8,0xA0)||bits(5,8,0xA1);"};
			type CommandGeneric CommandSearchRecord with {variant "isPdu;present=bits(5,8,0xA2);"};
			type CommandGeneric CommandReadRecords with {variant "isPdu;present=bits(5,8,0xB2)||bits(5,8,0xB3);"};
			type CommandGeneric CommandGetResponse with {variant "isPdu;present=bits(5,8,0xC0);"};
			type CommandGeneric CommandEnvelope with {variant "isPdu;present=bits(5,8,0xC2)||bits(5,8,0xC3);"};
			type CommandGeneric CommandGetData with {variant "isPdu;present=bits(5,8,0xCA);"};
			type CommandGeneric CommandWriteBinary with {variant "isPdu;present=bits(5,8,0xD0)||bits(5,8,0xD1);"};
			type CommandGeneric CommandWriteRecord with {variant "isPdu;present=bits(5,8,0xD2);"};
			type CommandGeneric CommandUpdateBinary with {variant "isPdu;present=bits(5,8,0xD6)||bits(5,8,0xD7);"};
			type CommandGeneric CommandPutDataWith with {variant "isPdu;present=bits(5,8,0xDA)||bits(5,8,0xDB);"};
			type CommandGeneric CommandUpdateRecord with {variant "isPdu;present=bits(5,8,0xDC)||bits(5,8,0xDD);"};
			type CommandGeneric CommandCreateFile with {variant "isPdu;present=bits(5,8,0xE0);"};
			type CommandGeneric CommandAppendRecord with {variant "isPdu;present=bits(5,8,0xE2);"};
			type CommandGeneric CommandDeleteFile with {variant "isPdu;present=bits(5,8,0xE4);"};
			type CommandGeneric CommandTerminateDF with {variant "isPdu;present=bits(5,8,0xE6)||bits(5,8,0xE8);"};
			type CommandGeneric CommandTerminateCardUsage with {variant "isPdu;present=bits(5,8,0xFE);"};
			type CommandGeneric CommandDeactivateFile
				with {variant "isPdu;present=bits(5,8,0x04);"};
			type CommandGeneric CommandEraseRecords
				with {variant "isPdu;present=bits(5,8,0x0C);"};
			type CommandGeneric CommandEraseBinary
				with {variant "isPdu;present=bits(5,8,0x0E)||bits(5,8,0x0F);"};
			type CommandGeneric CommandPerformScqlOperation
				with {variant "isPdu;present=bits(5,8,0x10);"};
			type CommandGeneric CommandPerformTransactionOperation
				with {variant "isPdu;present=bits(5,8,0x12);"};
			type CommandGeneric CommandPerformUserOperation
				with {variant "isPdu;present=bits(5,8,0x14);"};
			type CommandGeneric CommandVerify
				with {variant "isPdu;present=bits(5,8,0x20)||bits(5,8,0x21);"};
			type CommandGeneric CommandChangeReferenceData
				with {variant "isPdu;present=bits(5,8,0x24);"};
			type CommandGeneric CommandDisableVerificationRequirement
				with {variant "isPdu;present=bits(5,8,0x26);"};
			type CommandGeneric CommandEnableVerificationRequirement
				with {variant "isPdu;present=bits(5,8,0x28);"};
			type CommandGeneric CommandPerformSecurityOperation
				with {variant "isPdu;present=bits(5,8,0x2A);"};
			type CommandGeneric CommandResetRetryCounter
				with {variant "isPdu;present=bits(5,8,0x2C);"};
			type CommandGeneric CommandActivateFile
				with {variant "isPdu;present=bits(5,8,0x44);"};
			type CommandGeneric CommandGenerateAsymmetricKeyPair
				with {variant "isPdu;present=bits(5,8,0x46);"};
			type CommandGeneric CommandManageChannel
				with {variant "isPdu;present=bits(5,8,0x70);"};
			type CommandGeneric CommandGeneralAuthenticate
				with {variant "isPdu;present=bits(5,8,0x87);"};
			type CommandGeneric CommandSearchBinary
				with {variant "isPdu;present=bits(5,8,0xA0)||bits(5,8,0xA1);"};
			type CommandGeneric CommandSearchRecord
				with {variant "isPdu;present=bits(5,8,0xA2);"};
			type CommandGeneric CommandReadRecords
				with {variant "isPdu;present=bits(5,8,0xB2)||bits(5,8,0xB3);"};
			type CommandGeneric CommandGetResponse
				with {variant "isPdu;present=bits(5,8,0xC0);"};
			type CommandGeneric CommandEnvelope
				with {variant "isPdu;present=bits(5,8,0xC2)||bits(5,8,0xC3);"};
			type CommandGeneric CommandGetData
				with {variant "isPdu;present=bits(5,8,0xCA);"};
			type CommandGeneric CommandWriteBinary
				with {variant "isPdu;present=bits(5,8,0xD0)||bits(5,8,0xD1);"};
			type CommandGeneric CommandWriteRecord
				with {variant "isPdu;present=bits(5,8,0xD2);"};
			type CommandGeneric CommandUpdateBinary
				with {variant "isPdu;present=bits(5,8,0xD6)||bits(5,8,0xD7);"};
			type CommandGeneric CommandPutDataWith
				with {variant "isPdu;present=bits(5,8,0xDA)||bits(5,8,0xDB);"};
			type CommandGeneric CommandUpdateRecord
				with {variant "isPdu;present=bits(5,8,0xDC)||bits(5,8,0xDD);"};
			type CommandGeneric CommandCreateFile
				with {variant "isPdu;present=bits(5,8,0xE0);"};
			type CommandGeneric CommandAppendRecord
				with {variant "isPdu;present=bits(5,8,0xE2);"};
			type CommandGeneric CommandDeleteFile
				with {variant "isPdu;present=bits(5,8,0xE4);"};
			type CommandGeneric CommandTerminateDF
				with {variant "isPdu;present=bits(5,8,0xE6)||bits(5,8,0xE8);"};
			type CommandGeneric CommandTerminateCardUsage
				with {variant "isPdu;present=bits(5,8,0xFE);"};

			group Header {

@@ -200,7 +238,9 @@ module ePassport_Types {
				type integer FurtherLogicalChannelNumber (4..19)
				with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeFurtherLogicalChannelNumber();decode=EPassportCodecHelper.decodeFurtherLogicalChannelNumber();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeFurtherLogicalChannelNumber();"
					"decode=EPassportCodecHelper.decodeFurtherLogicalChannelNumber();"
				}

				type enumerated ChainingControl {
@@ -278,12 +318,16 @@ module ePassport_Types {
				type integer LengthE // variable-length encoding (ISO/IEC 7816-4 5.1)
				with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeLengthE();decode=EPassportCodecHelper.decodeLengthE();" 
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeLengthE();"
					"decode=EPassportCodecHelper.decodeLengthE();" 
				}
				type integer LengthC // variable-length encoding (ISO/IEC 7816-4 5.1)
				with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeLengthC();decode=EPassportCodecHelper.decodeLengthC();" 
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeLengthC();"
					"decode=EPassportCodecHelper.decodeLengthC();" 
				}

			} // end Header
@@ -316,7 +360,9 @@ module ePassport_Types {
					RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeGenericPayload();decode=EPassportCodecHelper.decodeGenericPayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeGenericPayload();"
					"decode=EPassportCodecHelper.decodeGenericPayload();"
				}

				type record GenericData {
@@ -364,7 +410,9 @@ module ePassport_Types {
					SelectData selectData, RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeSelectPayload();decode=EPassportCodecHelper.decodeSelectPayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeSelectPayload();"
					"decode=EPassportCodecHelper.decodeSelectPayload();"
				}

				type record SelectData {
@@ -406,7 +454,9 @@ module ePassport_Types {
					RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeReadBinaryPayload();decode=EPassportCodecHelper.decodeReadBinaryPayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeReadBinaryPayload();"
					"decode=EPassportCodecHelper.decodeReadBinaryPayload();"
				}

				type record ReadBinaryData {
@@ -426,7 +476,9 @@ module ePassport_Types {
					RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeReadBinaryWithOffsetDataObjectPayload();decode=EPassportCodecHelper.decodeReadBinaryWithOffsetDataObjectPayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeReadBinaryWithOffsetDataObjectPayload();"
					"decode=EPassportCodecHelper.decodeReadBinaryWithOffsetDataObjectPayload();"
				}

				type record ReadBinaryWithOffsetDataObjectData {
@@ -450,7 +502,9 @@ module ePassport_Types {
					RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeGetChallengePayload();decode=EPassportCodecHelper.decodeGetChallengePayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeGetChallengePayload();"
					"decode=EPassportCodecHelper.decodeGetChallengePayload();"
				}

				type record GetChallengeData {
@@ -482,7 +536,9 @@ module ePassport_Types {
					RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeExternalOrMutualAuthenticatePayload();decode=EPassportCodecHelper.decodeExternalOrMutualAuthenticatePayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeExternalOrMutualAuthenticatePayload();"
					"decode=EPassportCodecHelper.decodeExternalOrMutualAuthenticatePayload();"
				}

				type record ExternalOrMutualAuthenticateData {
@@ -504,7 +560,9 @@ module ePassport_Types {
					RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeInternalAuthenticatePayload();decode=EPassportCodecHelper.decodeInternalAuthenticatePayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeInternalAuthenticatePayload();"
					"decode=EPassportCodecHelper.decodeInternalAuthenticatePayload();"
				}

				type record InternalAuthenticateData {
@@ -568,7 +626,9 @@ module ePassport_Types {
					RawPayload rawPayload
				} with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeManageSecurityEnvironmentPayload();decode=EPassportCodecHelper.decodeManageSecurityEnvironmentPayload();"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeManageSecurityEnvironmentPayload();"
					"decode=EPassportCodecHelper.decodeManageSecurityEnvironmentPayload();"
				}

				type union ManageSecurityEnvironmentData {
@@ -710,7 +770,9 @@ module ePassport_Types {
				type integer TlvLength  // variable-length encoding (ISO/IEC 7816-4 5.2.2.2 Table 8)
				with {
					variant
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeTlvLength();decode=EPassportCodecHelper.decodeTlvLength();" 
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
					"encode=EPassportCodecHelper.encodeTlvLength();"
					"decode=EPassportCodecHelper.decodeTlvLength();" 
				}

				type record CrtCryptographicMechanismReference {
@@ -976,7 +1038,9 @@ module ePassport_Types {
				RawPayload rawPayload
			} with {
				variant
				"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;encode=EPassportCodecHelper.encodeResponseData();decode=EPassportCodecHelper.decodeResponseData();"
				"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
				"encode=EPassportCodecHelper.encodeResponseData();"
				"decode=EPassportCodecHelper.decodeResponseData();"
			}

			type octetstring PlainTextResponseData with { variant "noCodec" };