Commit 1fd25870 authored by garciay's avatar garciay
Browse files

STF507: Week #6

.  Reviewed of existing Send TPs for Certificate profiles
.  Reviewed of existing  RECV CAM TCs
.  Review of new RECV DENM TCs
.  Implementation of RECV DENM TCs
.  Development of TCs for RECV GENMSG done
·  TTCN-3 Source codes are committed
parent ef6ccc0f
Loading
Loading
Loading
Loading
+34 −22
Original line number Diff line number Diff line
@@ -546,6 +546,8 @@ module LibItsSecurity_Functions {
            * @param p_headerFields                 HeaderFields to be inserted in the message
            * @param p_certificateName              The certificate identifier to be used. Default: TA_CERT_A
            * @param p_addMissingHeaders            Whether to add mandatory headers not present in p_headerFields
            * @param p_alterATCertificateSignature  Set to true to alter the AT certificate signature
            * @param p_alterAACertificateSignature  Set to true to alter the AA certificate signature
            * @return true on success, false otherwise
            * 
            * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1  Security profile for CAMs
@@ -558,7 +560,9 @@ module LibItsSecurity_Functions {
                                            in template (omit) SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256,
                                            in template (omit) HeaderFields p_headerFields := omit,
                                            in template (omit) charstring p_certificateName := omit,
                                            in boolean p_addMissingHeaders := true
                                            in boolean p_addMissingHeaders := true,
                                            in boolean p_alterATCertificateSignature := false,
                                            in boolean p_alterAACertificateSignature := false
            ) runs on ItsSecurityBaseComponent return boolean {
                
                // Local variables
@@ -571,6 +575,14 @@ module LibItsSecurity_Functions {
                    return false;
                }
                
                if (p_alterATCertificateSignature == true) {
                    v_atCertificate.signature_.signature_.ecdsa_signature.s := not4b(v_atCertificate.signature_.signature_.ecdsa_signature.s);
                }
                
                if (p_alterAACertificateSignature == true) {
                    v_aaCertificate.signature_.signature_.ecdsa_signature.s := not4b(v_aaCertificate.signature_.signature_.ecdsa_signature.s);
                }
                
                if (p_addMissingHeaders == true) {
                    // Prepare mandatory headers
                    if (valueof(p_signerInfoType) == e_certificate) { // Add the AT certificate
+2 −0
Original line number Diff line number Diff line
@@ -47,4 +47,6 @@ module LibItsSecurity_Pics {
     */
    modulepar boolean PICS_ITS_AID_OTHER_PROFILE := true;
    
    modulepar boolean PICS_ITS_C2C_MODE := false; // FIXME To be merge with C2C ATS, see Dirk T.
    
} // End of module LibItsSecurity_Pics
 No newline at end of file
+10 −4
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ module LibItsSecurity_Pixits {
    
    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    
    // LibItsSecurity
    import from LibItsSecurity_TypesAndValues all;
@@ -40,18 +41,23 @@ module LibItsSecurity_Pixits {
    modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 1;
    
    /**
     * @desc Invalid protocol version. Default: 1
     * @desc Invalid WGS longitude
     */
    modulepar WGSLongitude PX_WGSLONGITUDE := 0;
    
    /**
     * @desc Invalid protocol version. Default: 1
     * @desc Invalid WGS latitude. Default: 1
     */
    modulepar WGSLatitude PX_WGSLATITUDE := 0;
    
    /**
     * @desc Invalid protocol version. Default: 1
     * @desc Invalid digest. Default: 1
     */
    modulepar HashedId8 PX_OTHER_CERT_DIGEST := '0000000000000000'O;
    
    /**
     * @desc AES-128-CCM nonce public key
     */
    modulepar Oct12 PX_ENCRYPTIONPARAMETERS_AES_128_CCM_NONCE := 'C0FFEEDECAC0FFEEDECA0000'O;
    
} // End of module LibItsSecurity_Pixits
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
@@ -1282,6 +1282,17 @@ module LibItsSecurity_Templates {
                    }
                } // End of template m_header_field_enc_params
                
                /**
                 * @desc Send template for HeaderField with unspecify header field value
                 * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4    HeaderField
                 */
                template (value) HeaderField m_header_field_unspecify := {
                    type_       := e_other_header_200,
                    headerField := {
                        other_header := 'C0FFEEDECA'O
                    }
                } // End of template m_header_field_unspecify
                
            } // End of group headerFieldsSend
        
            /**
+17 −4
Original line number Diff line number Diff line
@@ -51,10 +51,23 @@ module LibItsSecurity_TestSystem {
            const charstring cc_taCert_C_BO  := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */
            const charstring cc_taCert_D_BO  := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */
            const charstring cc_taCert_E_BO  := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */
            const charstring cc_taCert0101BO := "CERT_TS_01_01_BO_AT"; /**  */
            const charstring cc_taCert0102BO := "CERT_TS_01_02_BO_AT"; /**  */
            const charstring cc_taCert0103BO := "CERT_TS_01_03_BO_AT"; /**  */
            const charstring cc_taCert0104BO := "CERT_TS_01_04_BO_AT"; /**  */
            const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */
            const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */
            const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */
            const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */
            const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */
            const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */
            const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */
            const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */
            const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */
            const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */
            const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */
            const charstring cc_taCertMsg1301_BO := "(CERT_TS_MSG_13_01_BO_AT)"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */
            const charstring cc_taCertMsg1302_BO := "(CERT_TS_MSG_13_02_BO_AT)"; /** Check that IUT discards secured CAM signed with the expired certificate */
            const charstring cc_taCertMsg1303_BO := "(CERT_TS_MSG_13_03_BO_AT)"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */
            const charstring cc_taCertMsg1304_BO := "(CERT_TS_MSG_13_04_BO_AT)"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */
            const charstring cc_taCertMsg1305_BO := "(CERT_TS_MSG_13_05_BO_AT)"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */
            const charstring cc_taCertMsg1306_BO := "(CERT_TS_MSG_13_06_BO_AT)"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */
            
            // IUT certificates & private keys
            const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */
Loading