Commit 2047f913 authored by garciay's avatar garciay
Browse files

ATS security review

parent 3965070c
Loading
Loading
Loading
Loading
+39 −9
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ module LibItsSecurity_Functions {
    import from LibItsSecurity_TypesAndValues all;
    import from LibItsSecurity_Templates all;
    import from LibItsSecurity_Pixits all;
    import from LibItsSecurity_Pics all;
    import from LibItsSecurity_TestSystem all;
    
    group helpersFunctions {
@@ -252,6 +253,26 @@ module LibItsSecurity_Functions {
          return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY);
        }
        
        /**
        * @desc    Calculate digest over the certificate
        * @param   p_cert The certificate
        * @return  the HashedId8 value
        * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13   HashedId8
        */
        function f_calculateDigestFromCertificate(
                                                  in Certificate p_cert
        ) return HashedId8 {
            var octetstring v_hash;
            
            if (PICS_HASH_ALGORITHM == sha256) {
                v_hash := f_calculateDigestSha256FromCertificate(p_cert);
            } if (PICS_HASH_ALGORITHM == sha384) {
                v_hash := f_calculateDigestSha384FromCertificate(p_cert);
            } 
            
            return substr(v_hash, lengthof(v_hash) - 8, 8);
        } // End of function f_calculateDigestFromCertificate
        
        /**
        * @desc    Calculate digest over the certificate
        * @param   p_cert The certificate
@@ -634,6 +655,8 @@ module LibItsSecurity_Functions {
                                                              );
                // Prepare mandatory headers
                if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate
                    log("*** " & testcasename() & ": TODO ***");
                    stop;
                    /* TODO
                     * v_signerInfo := valueof(
                        m_header_info_signer_info(
@@ -662,6 +685,9 @@ module LibItsSecurity_Functions {
                                                                                                f_calculateDigestSha384FromCertificate(v_atCertificate)
                                                                                               );
                    }
                } else {
                    log("*** " & testcasename() & ": TODO ***");
                    stop;
                }
                if (ispresent(v_atCertificate.signature_)) {
                    if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) {
@@ -1287,7 +1313,11 @@ module LibItsSecurity_Functions {
                                               in template(omit) Ieee1609Dot2Data p_securedMessage,
                                               out SignerIdentifier p_signerIdentifier
            ) return boolean {
                if (ispresent(p_securedMessage.content.signedData)) {
                if (not isvalue(p_securedMessage)) {
                    testcase.stop(__SCOPE__ & " can not handle omitted secured message values");
                }
                
                if (ischosen(p_securedMessage.content.signedData)) {
                    p_signerIdentifier := valueof(p_securedMessage.content.signedData.signer);
                    return true;
                }
+9 −0
Original line number Diff line number Diff line
@@ -16,11 +16,20 @@ module LibItsSecurity_Pics {
    import from IEEE1609dot2 language "ASN.1:1997" all;
    import from EtsiTs103097Module language "ASN.1:1997" all;
        
    // LibItsSecurity
    import from LibItsSecurity_TypesAndValues all;
    
    modulepar HashAlgorithm PICS_HASH_ALGORITHM := sha256;
    
    modulepar SignAlgorithm PICS_SIGN_ALGORITHM := e_nistp_256;
    
    /**
     * Is the IUT support Brainpool algorithm
     */
    modulepar boolean PICS_BRAINPOOL_SUPPORT := false;
    
    modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := false;
    
    /**
     * Is the IUT support certificates pushing
     */
+9 −6
Original line number Diff line number Diff line
@@ -760,7 +760,7 @@ module LibItsSecurity_Templates {
            p2pcdLearningRequest := omit,
            missingCrlIdentifier := omit,
            encryptionKey        := omit,
            inlineP2pcdRequest   := *,
            inlineP2pcdRequest   := omit,
            requestedCertificate := *
        } // End of template mw_ieee1609Dot2_headerInfo
        
@@ -772,11 +772,13 @@ module LibItsSecurity_Templates {
        template (omit) HeaderInfo m_headerInfo_cam(
                                                    in template (value) Psid p_psid := c_its_aid_CAM,
                                                    in template (value) Time64 p_generationTime,
                                                    in template (omit) Time64 p_expiryTime := omit
                                                    in template (omit) Time64 p_expiryTime := omit,
                                                    in template (omit) SequenceOfHashedId3 p_inlineP2pcdRequest := omit
        ) modifies m_ieee1609Dot2_headerInfo := {
            generationTime     := p_generationTime,
            expiryTime         := p_expiryTime,
            generationLocation := omit
            generationLocation := omit,
            inlineP2pcdRequest := p_inlineP2pcdRequest
        } // End of template m_headerInfo_cam
        
        /**
@@ -786,14 +788,15 @@ module LibItsSecurity_Templates {
         */
        template (present) HeaderInfo mw_headerInfo_cam(
                                                        template (present) Psid p_psid := c_its_aid_CAM,
                                                        template Time64 p_generationTime := omit,
                                                        template (present) Time64 p_generationTime := ?,
                                                        template Time64 p_expiryTime := omit,
                                                        template ThreeDLocation p_generationLocation := omit
                                                        template SequenceOfHashedId3 p_inlineP2pcdRequest := omit
        ) modifies mw_ieee1609Dot2_headerInfo := {
            psid               := c_its_aid_CAM,
            generationTime     := p_generationTime,
            expiryTime         := p_expiryTime,
            generationLocation := p_generationLocation
            generationLocation := omit,
            inlineP2pcdRequest := p_inlineP2pcdRequest
        } // End of template mw_headerInfo_cam
        
        /**
+121 −113
Original line number Diff line number Diff line
@@ -239,6 +239,14 @@ module LibItsSecurity_TypesAndValues {
        
    } // End of group profileCertificates 
    
    type enumerated SignAlgorithm {
        e_nistp_256,
        e_nistp_384,
        e_brainpool_256,
        e_brainpool_384
    }


    group taConfiguration {
        
        /**