Commit 22a80cd7 authored by berge's avatar berge
Browse files

Adjust types (added LengthC - refined LengthE)

parent 734e7279
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ module ePassport_Templates {
				p1 := '00000001'B,   		// values for Certificate reference ID
	  			p2 := '11110001'B
    		},
    		lengthC := ?,
  			payload := {
  				genericData := {
  					data := omit,
@@ -51,6 +52,7 @@ module ePassport_Templates {
	  			p1 := '00000001'B,   		
	  			p2 := '11110010'B
            },
  			lengthC := ?,
  			payload := {
  				genericData := {
  					data := omit,
@@ -113,6 +115,7 @@ module ePassport_Templates {
				p1 := '00001111'B,    		
	  			p2 := ?
	  		},
  			lengthC := ?,
  			payload := {
  				genericData := {
  					data := v_failCode,
@@ -135,6 +138,7 @@ module ePassport_Templates {
				fileControlInformation := e_noResponseOrProprietary,
				fileOccurrence := e_firstOrOnlyOccurrence
   			},
  			lengthC := ?,
			payload := { 
				selectData := {
					fileId := 'a0000002471001'O, // FIXME
@@ -154,6 +158,7 @@ module ePassport_Templates {
				fileControlInformation := e_noResponseOrProprietary,
				fileOccurrence := e_firstOrOnlyOccurrence
			},
  			lengthC := ?,
			payload := { 
				selectData := {
					fileId := v_fileID,
@@ -172,6 +177,7 @@ module ePassport_Templates {
				fileControlInformation := e_noResponseOrProprietary,
				fileOccurrence := e_firstOrOnlyOccurrence
			},
  			lengthC := ?,
			payload := { 
				selectData := {
					fileId := ?,
@@ -191,6 +197,7 @@ module ePassport_Templates {
					offset := ?
    			}
			},
  			lengthC := ?,
			payload := {
				readBinaryData := {
					lengthE := ?
@@ -209,6 +216,7 @@ module ePassport_Templates {
					offset := ?
    			}
			},
  			lengthC := ?,
			payload := {
				readBinaryData := {
					lengthE := ?
@@ -225,6 +233,7 @@ module ePassport_Templates {
					offset := ?
    			}
			},
  			lengthC := ?,
			payload := {
				readBinaryData := {
					lengthE := ?
@@ -239,6 +248,7 @@ module ePassport_Templates {
	  			algorithm := ?,
				reserved := c_1ZeroByte
	  		},
  			lengthC := ?,
			payload := {
				getChallengeData := {
					lengthE := ?	
@@ -253,6 +263,7 @@ module ePassport_Templates {
				algorithm := ?,
				referenceData := ?
			},
  			lengthC := ?,
			payload := ?
        }
        
@@ -263,6 +274,7 @@ module ePassport_Templates {
				algorithm := ?,
				referenceData := ?
			},
  			lengthC := ?,
			payload := ?
        }

@@ -277,6 +289,7 @@ module ePassport_Templates {
				 mseFunction := e_mseFunctionSet,
  				crtTag := e_crtDST
  			},
  			lengthC := ?,
  			payload := {
  				manageSecurityEnvironmentData := {
  					crtDST := {
@@ -304,6 +317,7 @@ module ePassport_Templates {
				 mseFunction := e_mseFunctionSet,
				 crtTag := e_crtKAT
  			},	
  			lengthC := ?,	  			
  			payload := {
  				manageSecurityEnvironmentData := {
  					crtKAT := {
@@ -338,6 +352,7 @@ module ePassport_Templates {
				 mseFunction := e_mseFunctionSet,
  				 crtTag := e_crtAT
  			},
  			lengthC := ?,
  			payload := {
  				manageSecurityEnvironmentData := {
  					crtAT := {
@@ -361,6 +376,7 @@ module ePassport_Templates {
				p1 := '00000000'B,  // FIXME
	  			p2 := '10111110'B  // FIXME
	  		},
  			lengthC := ?,
  			payload := {
  				genericData := {
  					data := ?,
+11 −2
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ module ePassport_Types {
				Class class,
				Instruction ins,
				GenericParams params,
				LengthC lengthC optional, 
				GenericPayload payload
			} with {variant "isPdu;"};

@@ -74,6 +75,7 @@ module ePassport_Types {
				Class class,
				Instruction ins(e_manageSecurityEnvironment),
				ManageSecurityEnvironmentParams params,
				LengthC lengthC optional, 
				ManageSecurityEnvironmentPayload payload optional // presence depends on crtTag (present if 0xa4, 0xa6, 0xaa, 0xb4, 0xb6, 0xb8)
			} with {
				variant "isPdu;present=bits(5,8,0x22);"
@@ -84,6 +86,7 @@ module ePassport_Types {
				Class class,
				Instruction ins(e_externalOrMutualAuthenticate),
				ExternalOrMutualAuthenticateParams params,
				LengthC lengthC optional, 
				ExternalOrMutualAuthenticatePayload payload
			} with {variant "isPdu;present=bits(5,8,0x82);"};

@@ -91,6 +94,7 @@ module ePassport_Types {
				Class class,
				Instruction ins(e_getChallenge),
				GetChallengeParams params,
				LengthC lengthC optional, 
				GetChallengePayload payload
			} with {variant "isPdu;present=bits(5,8,0x84);"};

@@ -98,6 +102,7 @@ module ePassport_Types {
				Class class,
				Instruction ins(e_internalAuthenticate),
				InternalAuthenticateParams params,
				LengthC lengthC optional, 
				InternalAuthenticatePayload payload
			} with {variant "isPdu;present=bits(5,8,0x88);"};

@@ -105,6 +110,7 @@ module ePassport_Types {
				Class class,
				Instruction ins(e_select),
				SelectParams params,
				LengthC lengthC optional, 
				SelectPayload payload
			} with {variant "isPdu;present=bits(5,8,0xA4);"};

@@ -112,6 +118,7 @@ module ePassport_Types {
				Class class,
				Instruction	ins(e_readBinary),
				ReadBinaryParams params,
				LengthC lengthC optional, 
				ReadBinaryPayload payload
			} with {variant "isPdu;present=bits(5,8,0xB0);"};

@@ -119,6 +126,7 @@ module ePassport_Types {
				Class class,
				Instruction	ins(e_readBinaryWithOffsetDataObject),
				ReadBinaryWithOffsetDataObjectParams params,
				LengthC lengthC optional, 
				ReadBinaryWithOffsetDataObjectPayload payload
			} with {variant "isPdu;present=bits(5,8,0xB1);"};

@@ -256,7 +264,8 @@ module ePassport_Types {

				type Bit8 P1Status;
				type Bit8 P2Status;
				type UInt3 LengthE;
				type integer LengthE; // TODO: variable-length encoding (ISO/IEC 7816-4 5.1)
				type integer LengthC; // TODO: variable-length encoding (ISO/IEC 7816-4 5.1)

			} // end Header

@@ -642,7 +651,7 @@ module ePassport_Types {
				} // end TlvConstants

				type Oct1 TlvType;
				type integer TlvLength with variant "length=32";
				type integer TlvLength with variant "length=32";  // TODO: variable-length encoding (ISO/IEC 7816-4 5.2.2.2 Table 8)
				// ^^^ TODO: find out length of TlvLength

				type record CrtCryptographicMechanismReference {