Commit b868ab81 authored by fetke's avatar fetke
Browse files

further codec work

parent 4f650f00
Loading
Loading
Loading
Loading
+119 −49
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ module ePassport_Types {
				LengthE lengthE optional
			} with {
				variant "isPdu"
				variant (lengthC) "intTag='lengthC'"
			}

			type record CommandManageSecurityEnvironment {
@@ -109,6 +110,7 @@ module ePassport_Types {
				LengthE lengthE optional
			} with {
				variant "isPdu;present=bytes(1,1,0x22);"
				variant (lengthC) "intTag='lengthC'"
				variant (payload)
				"fieldPresent="
				"getIntTag('crtTag')==0xa4||"
@@ -128,6 +130,7 @@ module ePassport_Types {
				LengthE lengthE optional
			} with {
				variant "isPdu;present=bytes(1,1,0x82);"
				variant (lengthC) "intTag='lengthC'"
			}

			type record CommandGetChallenge {
@@ -139,6 +142,7 @@ module ePassport_Types {
				LengthE lengthE optional
			} with {
				variant "isPdu;present=bytes(1,1,0x84);"
				variant (lengthC) "intTag='lengthC'"
			}

			type record CommandInternalAuthenticate {
@@ -150,6 +154,7 @@ module ePassport_Types {
				LengthE lengthE optional
			} with {
				variant "isPdu;present=bytes(1,1,0x88);"
				variant (lengthC) "intTag='lengthC'"
			};

			type record CommandSelect {
@@ -161,6 +166,7 @@ module ePassport_Types {
				LengthE lengthE optional
			} with {
				variant "isPdu;present=bytes(1,1,0xA4);"
				variant (lengthC) "intTag='lengthC'"
			};

			type record CommandReadBinary {
@@ -172,6 +178,7 @@ module ePassport_Types {
				LengthE lengthE optional
			} with {
				variant "isPdu;present=bytes(1,1,0xB0);"
				variant (lengthC) "intTag='lengthC'"
			};

			type record CommandReadBinaryWithOffsetDataObject {
@@ -1092,4 +1099,67 @@ module ePassport_Types {
			type Oct2 W1W2Status;
		} // end group commandTypesGroup
	}

	group auxiliary {
		type record PaddingContentIndicatorTLV {
			TlvType tlvType ('86'O, '87'O), // 0x86 or 0x87
			TlvLength tlvLength,
			octetstring tlvValue
		}
		with {
			variant "present=bytes(1,0x86)||bytes(1,0x87)"
			variant (tlvLength) "intTag='tlvLength'"
			variant (tlvValue) "length=getIntTag('tlvLength');unsigned;"
		}

		type record CryptogramTLV {
			TlvType tlvType ('82'O, '83'O, '84'O, '85'O), // 0x82 or 0x83 or 0x84 or 0x85
			TlvLength tlvLength,
			octetstring tlvValue
		}
		with {
			variant "present=bytesRange(0,1,0x82,0x85);"
					"use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
		            "encode=EPassportCodecHelper.encodeCryptogramTLV();"
        		    "decode=EPassportCodecHelper.decodeCryptogramTLV();"
			variant (tlvLength) "intTag='tlvLength'"
			variant (tlvValue) "length=getIntTag('tlvLength');unsigned;"
		}

        type record LengthETLV {
            TlvType tlvType ('96'O, '97'O), // 0x96 or ox97
            TlvLength tlvLength,
            TlvLengthE tlvValue
        }
        with {
            variant "present=bytes(1,0x96)||bytes(1,0x97)"
            variant (tlvLength) "intTag='tlvLength'"
            variant (tlvValue)	"length=getIntTag('tlvLength');unsigned;"
            					"intTag='lengthEFromSMData'"
        }

		type integer TlvLengthE with {
		    variant "use=com.testingtech.ttcn.tci.helper.EPassportCodecHelper;"
           			"encode=EPassportCodecHelper.encodeTlvLengthE();"
            		"decode=EPassportCodecHelper.decodeTlvLengthE();"
		}

		type record CCTLV {
			TlvType tlvType ('8E'O), // 0x8E
			TlvLength tlvLength,
			octetstring tlvValue
		}
		with {
			variant "present=bytes(1,0x8e)"
			variant (tlvLength) "intTag='tlvLength'"
			variant (tlvValue) "length=getIntTag('tlvLength');unsigned;"
		}
		
		type set SMData {
		    PaddingContentIndicatorTLV pci optional,
		    CryptogramTLV cryptogram optional,
		    LengthETLV lengthE optional,
            CCTLV cc optional
		}
	}
}