Commit f9e72a66 authored by berge's avatar berge
Browse files

File Cleanup + T3Doc

parent 508fb749
Loading
Loading
Loading
Loading
+705 −656
Original line number Diff line number Diff line
/**
 *    @author     ETSI
 *  @version 	$URL: $
 *				$Id: $
 *  @version     $URL$
 *                $Id$
 *    @desc        This module contains alsteps for processing IS messages.
 *            
 *
@@ -22,6 +22,9 @@

    group configurationFunctions {
        
        /**
         * @desc    Setup the test configuration by mapping the ports and activating defaults
         */
        function f_cfUp() runs on MRTD {
                
            // map ports
@@ -37,6 +40,9 @@

    group upperTesterFunctions {
        
        /**
         * @desc    Wait for test operator to enter Inspection System's verdicts
         */
        function f_waitForManualVerdict() runs on MRTD {
            
            action("Please report IS results using provided interface.");
@@ -55,6 +61,12 @@
    
    group verdictFunctions {
        
        /**
         * @desc    Retrieve Inspection Systems's verdicts and set testcase verdict
         * @param   p_testcaseId            ID of the testcase (for printing logs)
         * @param   p_expectedFailResults   Expected Fail verdicts from IS
         * @param   p_expectedPassResults   Expected Pass verdicts from IS
         */
        function f_establishVerdict(
            in charstring p_testcaseId,
            in template IsVerdictList p_expectedFailResults,
@@ -69,7 +81,7 @@
            }
            
            if(PXT_VERDICT_MODE == e_verdictSimple) {
        		
                // Only check global failure/successs
                v_checkPassVerdicts := match(vc_simu.isPassVerdicts, superset(e_aisNoFailure));
                v_generalVerdict := (v_checkPassVerdicts and (sizeof(p_expectedFailResults) == 0)) 
                    or (not(v_checkPassVerdicts) and (sizeof(p_expectedFailResults) > 0))
@@ -135,6 +147,9 @@
    
    group defaults {
        
        /**
         * @desc    Default for handling AIS related commands
         */
        altstep a_aisDefault() runs on MRTD {
            
            [] a_aisConfiguration() {
@@ -155,6 +170,9 @@
            }
        }
        
        /**
         * @desc    Default for handling all 'Read Binary' commands
         */
        altstep a_fileDefault() runs on MRTD {
            
            // if passport is unprotected, then any file is accessible
@@ -175,6 +193,9 @@
            [] a_refuseAnyFileAccess();
        }
        
        /**
         * @desc    General default 
         */
        altstep a_default() runs on MRTD {
            [] t_guard.timeout {
                log("**** a_default: Error: Lifetime of testcase has expired. Sopping TC now. ****");
@@ -206,6 +227,9 @@
    
    group automaticInterfaceSpecificationAltsteps {
        
        /**
         * @desc    Handle AIS configuration commands (Optical MRZ and certificate IDs) 
         */
        altstep a_aisConfiguration() runs on MRTD {
            
            [] mgmtport.receive(mw_getData_mrz) {
@@ -220,6 +244,9 @@
            
        } // end a_aisConfiguration 
        
        /**
         * @desc    Handle transfert of certificates to IS (Automatic Test Interface) 
         */
        altstep a_aisReadCertificateData() runs on MRTD {
            
            var CommandSelect v_selectCommand;
@@ -296,6 +323,9 @@
            
        } // end a_aisReadCertificateData
        
        /**
         * @desc    Handle IS verdict retrieval
         */
        altstep a_aisReports() runs on MRTD {
            
            var CommandGeneric v_report;
@@ -320,7 +350,9 @@
    
    group inspectionProcedures {
        
		// Start the MRTD Test sequence :  Standard Inspection Procedure (SIP)
        /**
         * @desc    Handle Standard Inspection Procedure 
         */
        altstep a_standardInspectionProcedure() runs on MRTD {
        
            [] a_waitApplication();
@@ -333,7 +365,9 @@
        
        } // end a_standardInspectionProcedure
        
        // Start the MRTD Test sequence : Advanced Inspection Procedure (AIP) including EAC
        /**
         * @desc    Handle Advanced Inspection Procedure (includes EAC)
         */
        altstep a_advancedInspectionProcedure() runs on MRTD {
            
            [] a_waitApplication();
@@ -356,6 +390,9 @@
    
    group authenticationProcedures {
        
        /**
         * @desc    Handle Active Authentication messages
         */
        altstep a_activeAuthentication () runs on MRTD {
            
            var CommandInternalAuthenticate v_command;
@@ -373,6 +410,9 @@
            }
        } // end a_activeAuthentication
        
        /**
         * @desc    Handle Chip Authentication messages
         */
        altstep a_chipAuthentication () runs on MRTD {
            
            //var EFfile v_file:=valueof(p_file);
@@ -404,7 +444,9 @@
            }
        } // end a_chipAuthentication
        
    	// Terminal Authentication triggered by reading of EF.CVCA
        /**
         * @desc    Handle Terminal Authentication messages
         */
        altstep a_terminalAuthentication () runs on MRTD {

            var CommandManageSecurityEnvironment v_mseCommand;
@@ -415,7 +457,6 @@
            var octetstring v_certificate, v_signature, v_publicKey;
            var octetstring v_cleartextChallenge;
            
           	// reading of the certificate chain
            [] mrtdport.receive(mw_mseSetDST) -> value v_mseCommand {
                v_dstCAR := v_mseCommand.payload
                            .manageSecurityEnvironmentData.crtDST
@@ -433,15 +474,8 @@
                repeat;
            }
            
			// The MRTD is waiting for a PSO:Verify Certificate
            [] mrtdport.receive(mw_psoVerifyCertificate) -> value v_psoCommand {
                
				// if the Certificate Body and the Signature are OK then the certificate was successfully validated
				// and the public key has been imported
				// see TR-03110 EAC spec B.2.2
					
				// the correct Certificate must be passed as parameter in the external function
				// in order to verify IS and DV and link CAVA certificates.
                // FIXME : ifpresent, ifchosen
                v_certificate := bit2oct(encvalue(v_psoCommand.payload.performSecurityOperationData.psoVerifyCertificate
                                    .psoVerifyCertificateOverFullTemplate.cvCertificateBody));
@@ -455,7 +489,6 @@
                            .psoVerifyCertificateOverFullTemplate.cvCertificateBody.tlvValue.cvCertificateHolderReference.tlvValue);
                    f_addTrustedCertificate(v_chr, v_publicKey);
                    log("Adding trusted certificate: ", v_chr);
											
                    mrtdport.send(m_responseOK);
                 }
                 else {
@@ -465,7 +498,6 @@
                 repeat;
            }

			// The MRTD is waiting a MSE:SetAT message with a key reference
            [] mrtdport.receive(mw_mseSetAT) -> value v_mseCommand {
                v_atCAR := v_mseCommand.payload.manageSecurityEnvironmentData
                        .crtAT.crtReferenceOfSecretOrPublicKey.tlvValue;
@@ -475,7 +507,6 @@
                repeat;
            }

			// The MRTD is waiting a Get_Challenge message in order that the IS requests the RpIcc RND key
            [] mrtdport.receive(mw_getChallenge) {
                vc_simu.challenge := f_generateRandomOctetstring(c_atNonceSize); 
                mrtdport.send(m_responseRead(vc_simu.challenge));
@@ -483,7 +514,6 @@
                repeat;
            }

			// The MRTD is waiting an External Authenticate message including the signature of the IS
            [] mrtdport.receive(mw_extAuthenticate) -> value v_extAuthcommand { 
                v_signature := v_extAuthcommand.payload
                        .externalOrMutualAuthenticateData.challengeResponse;
@@ -508,11 +538,12 @@

    group commandProcessing {
        
		// First message to be received while reading the ePassport
        /**
         * @desc    Handle 'Select Application' message (First message to be received)
         */
        altstep a_waitApplication () runs on MRTD {
    
            [] mrtdport.receive(mw_selectApplication) {
    		
                if(vc_simu.securityStatus != e_noApplication) {
                    // Reset MRTD settings
                    f_initializeMRTD(vc_simu.ePassportProfile, vc_simu.passportProtection);
@@ -523,9 +554,11 @@
                t_ac.start;
                repeat;
            }
    		
        } //end a_waitApplication
        
        /**
         * @desc    Handle Basic Access Control messages
         */
        altstep a_bac() runs on MRTD {
            
            var CommandExternalOrMutualAuthenticate v_command;
@@ -556,7 +589,11 @@
                
        } // end a_bac
        
		
        /**
         * @desc    Handle all file reading related commands concerning a specific file
         * @param   p_file  Requested file
         * @see     a_readAnyFile
         */
        altstep a_readFile(in ElementFileInfo p_file) runs on MRTD {
            
            var CommandSelect v_selectCommand;
@@ -670,8 +707,10 @@
            
        } // end of a_readFile
        
		
		//FIXME: duplicated code
        /**
         * @desc    Handle all file reading related commands for any file
         * @see     a_readFile
         */
        altstep a_readAnyFile() runs on MRTD {
            
            var CommandSelect v_selectCommand;
@@ -796,6 +835,12 @@
            
        } // end of a_readAnyFile

        /**
         * @desc    Handle all file reading related commands concerning a specific file 
         *          in order to refuse access to the file
         * @param   p_file  Requested file
         * @see     a_refuseAnyFileAccess
         */
        altstep a_refuseFileAccess(in ElementFileInfo p_file) runs on MRTD {
            
            // SELECT Command
@@ -811,9 +856,12 @@
                t_ac.start;
                repeat;
            }

        } // end a_refuseFileAccess
        
        /**
         * @desc    Handle all file reading related commands in order to refuse access to any file
         * @see     a_refuseFileAccess
         */
        altstep a_refuseAnyFileAccess() runs on MRTD {
            
            // SELECT Command
@@ -847,3 +895,4 @@
    } // end commandProcessing

} // end ePassport_Altsteps
 
 No newline at end of file
+1229 −923

File changed.

Preview size limit exceeded, changes collapsed.

+84 −84
Original line number Diff line number Diff line
/**
 *	@author 	ETSI
 *  @author     ETSI / STF400
 *  @version    $URL$
 *              $Id$
 *	@desc		Main module for testing ePassport devices.
 *			
 *  @desc       Main module for testing ePassport inspection systems.
 *
 */

@@ -14,6 +13,7 @@ module ePassport_MainModule {
    import from ePassport_Testcases all; 

    control {
        
        // ISO7816_A
        execute(TC_ISO7816_A02());
        
+0 −24
Original line number Diff line number Diff line
/**
 *	@author 	ETSI
 *  @version 	$URL$
 *				$Id$
 *	@desc		This module contains PICS parameters related to the test cases for testing ePassport devices.
 *
 */
 


module ePassport_Pics {

	//Ats
	import from ePassport_Types all;

group CommonPics {


} // end group CommonPics



 
}
+87 −91
Original line number Diff line number Diff line
/**
 *	@author 	ETSI
 *  @author     ETSI / STF400
 *  @version    $URL$
 *              $Id$
 *	@desc		This module contains PIXIT parameters related to the test cases for testing ePassport devices
 *				When Testing a ePassport Reader device (Inspection System), the operator shall complete the PICS/PIXIT parameters contained in:
 *				- the Common_parameters group
 *		
 *  @desc       This module contains module parameters for ePassport test suite
 *  
 */

@@ -39,52 +36,47 @@ module ePassport_Pixits {

    } // end testAdapterPixits

	/** 
	@desc 	Definition of Pixits which apply to all ePassport devices
	*/
    group commonPixits {

		/** 
		@desc 	PIXITs related to timers
		*/
        group commonTimerPixits {

            /** 
			@desc 	Precision of timers in percentage (default is 5 percent).
             * @desc    Precision of timers in percentage (default is 5 percent).
             */
            modulepar float PXT_TIMER_PRECISION := 5.0;

            /** 
			@desc	Guard timer to control a reaction from the IUT to a stimulus sent by the tester (e.g. a message).
					On expiry of this timer, the IUT is considered not to be be able to send the expected response.
             * @desc    Guard timer to control a reaction from the IUT to a stimulus sent by the tester (e.g. a message).
             *          On expiry of this timer, the IUT is considered not to be be able to send the expected response.
             */
            modulepar float PXT_TAC := 2.0;

            /** 
			@desc	Guard timer to control a non-reaction from the IUT to a stimulus sent by the tester (e.g. a message).
					On expiry of this timer, it is considered that, as it is expected in the test purpose,
					the IUT has not responded to the stimulus.
             * @desc    Guard timer to control a non-reaction from the IUT to a stimulus sent by the tester (e.g. a message).
             *          On expiry of this timer, it is considered that, as it is expected in the test purpose,
             *          the IUT has not responded to the stimulus.
             */
            modulepar float PXT_TNOAC := 5.0;

            /** 
			@desc	Wait for an implicit send. This guard timer is used to limitated the time where the tester is waiting
		 		for the response of the IUT that is triggered by an action from the test operator.
				On expiry of this timer, it is considered that the action has not succeeded, and thus the test case will be terminated
				with the verdict inconclusive.
             * @desc    Wait for an implicit send. This guard timer is used to limitated the time where the tester is waiting
             *          for the response of the IUT that is triggered by an action from the test operator.
             *          On expiry of this timer, it is considered that the action has not succeeded, and thus the test case will be terminated
             *      with the verdict inconclusive.
             */
            modulepar float PXT_TWAIT := 60.0;

        
            /** 
			@desc	This guard timer is used to control the timeout of a test case.
			 		If , e.g. an external function does not return, then this timer will fire after PXT_TGUARD seconds.
					On expiry of this timer, it is considered that the test case did not finish within the given test cae life time,
					and will therefore be terminated.
             * @desc    This guard timer is used to control the timeout of a test case.
             *          If , e.g. an external function does not return, then this timer will fire after PXT_TGUARD seconds.
             *          On expiry of this timer, it is considered that the test case did not finish within the given test cae life time,
             *          and will therefore be terminated.
             */
            modulepar float PXT_TGUARD := 300.0;

        } // end commonTimerPixits
        
    } // end commonPixits
    
    group ePassportPixits {
@@ -98,6 +90,10 @@ module ePassport_Pixits {
    
    group iutPixits {
        
        /**
         * @desc    Determine whether IUT supports Automatic Test Interface
         * @see     PXT_IS_DRIVER_PROVIDER_CLASS_NAME
         */
        modulepar boolean PXT_AUTOMATIC_TEST_INTERFACE := false;
        
        /**
Loading