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

STF538: Finalize GN, DENM & CAM TP implementation

parent 764fb649
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -324,7 +324,7 @@ module LibItsCam_Functions {
            
            
        } // End of function f_cfDown
        } // End of function f_cfDown
        
        
    } // end of camConfigurationFunctions
    } // End of camConfigurationFunctions
    
    
    group defaults {
    group defaults {
    
    
@@ -370,7 +370,7 @@ module LibItsCam_Functions {
            }
            }
        }
        }
         
         
    } // end of defaults  
    } // End of defaults  
    
    
    group preambles {
    group preambles {
        
        
@@ -421,7 +421,7 @@ module LibItsCam_Functions {
        
        
        } // End of function f_prInitialState
        } // End of function f_prInitialState
    
    
    } // end of preambles
    } // End of preambles


    group postambles {
    group postambles {
        
        
@@ -432,7 +432,7 @@ module LibItsCam_Functions {
            f_acStopScenario();
            f_acStopScenario();
        }
        }
        
        
    } // end group postambles
    } // End group postambles
    
    
    group camPositionFunctions {
    group camPositionFunctions {
        
        
@@ -460,7 +460,7 @@ module LibItsCam_Functions {
            return v_referencePosition;
            return v_referencePosition;
        }
        }
        
        
    } // end group camPositionFunctions
    } // End group camPositionFunctions


    group camAuxilaryFunctions {
    group camAuxilaryFunctions {
        
        
@@ -482,7 +482,7 @@ module LibItsCam_Functions {
            }
            }
        }
        }
        
        
    } // end group camAuxilaryFunctions
    } // End group camAuxilaryFunctions
    
    
    group camGenerators {
    group camGenerators {
        function f_generateDefaultCam() 
        function f_generateDefaultCam() 
@@ -499,6 +499,6 @@ module LibItsCam_Functions {
                        )
                        )
                    );
                    );
        }
        }
    } // end of group camGenerators  
    } // End of group camGenerators  


} // end LibItsCam_Functions
} // End of LibItsCam_Functions
+57 −47
Original line number Original line Diff line number Diff line
@@ -2543,7 +2543,7 @@ module LibItsGeoNetworking_Functions {
     * @param   p_InSecMsg  SecurityMessage template 
     * @param   p_InSecMsg  SecurityMessage template 
     * @param   p_received  returns received SecurityMessage 
     * @param   p_received  returns received SecurityMessage 
     */
     */
    /* FIXME To be reviewed altstep a_securedMessage (
    altstep a_securedMessage (
                              in template (present) EtsiTs103097Data p_InSecMsg,
                              in template (present) EtsiTs103097Data p_InSecMsg,
                              out EtsiTs103097Data p_received
                              out EtsiTs103097Data p_received
                              ) runs on ItsGeoNetworking {
                              ) runs on ItsGeoNetworking {
@@ -2552,28 +2552,34 @@ module LibItsGeoNetworking_Functions {
                                               mw_geoNwSecPdu(
                                               mw_geoNwSecPdu(
                                                              p_InSecMsg,
                                                              p_InSecMsg,
                                                              mw_geoNwAnyPacket_withPayload(?)
                                                              mw_geoNwAnyPacket_withPayload(?)
                                                              //FIXME RGY Titan doesn't support storing list at the moment
                                                              //                                        ))) -> value (v_geoNw) {
                                                              ))) -> value v_geoNw {
                                                              ))) -> value v_geoNw {
      p_received := f_getSecuredMessage(v_geoNw.msgIn);
      p_received := f_getSecuredMessage(v_geoNw.msgIn);
      }
      }
    }*/
    } // End of 'altstep' statement
        
        
    /**
    /**
     * @desc         Receive GN message with security containing certificate as a signer info
     * @desc         Receive GN message with security containing certificate as a signer info
     * @param p_cert returns the certificate used for sign received message
     * @param p_cert returns the certificate used for sign received message
     */
     */
    /* FIXME To be reviewed altstep a_securedMessageWithCertificate(
    altstep a_securedMessageWithCertificate(
                                            out EtsiTs103097Data p_received
                                            out EtsiTs103097Data p_received
                                            ) runs on ItsGeoNetworking {
                                            ) runs on ItsGeoNetworking {
            
            
      [] a_securedMessage (
      [] a_securedMessage (
                           mw_securedMessage (superset(mw_header_field_signer_info_certificate)),
                            mw_etsiTs103097Data_signed(
                                mw_signedData(
                                    -, 
                                    mw_toBeSignedData(
                                        mw_signedDataPayload
                                    ),
                                    mw_signerIdentifier_certificate // containing certificate
                                )
                            ), 
                            p_received
                            p_received
                           ) {
                           ) {
        // Nothing to do
        // Nothing to do
      }
      }
    }*/ // End of altstep a_securedMessageWithCertificate
    } // End of altstep a_securedMessageWithCertificate


    /**
    /**
     * @desc         Receive GN message with security containing certificate chain as a signer info
     * @desc         Receive GN message with security containing certificate chain as a signer info
@@ -2597,19 +2603,24 @@ module LibItsGeoNetworking_Functions {
     * @desc         Receive GN message with security containing digest as a signer info
     * @desc         Receive GN message with security containing digest as a signer info
     * @param p_cert returns the certificate used for sign received message
     * @param p_cert returns the certificate used for sign received message
     */
     */
    /* FIXME To be reviewed altstep a_securedMessageWithDigest(
    altstep a_securedMessageWithDigest(
                                       out EtsiTs103097Data p_received
                                       out EtsiTs103097Data p_received
                                       ) runs on ItsGeoNetworking {
                                       ) runs on ItsGeoNetworking {
      [] a_securedMessage (
      [] a_securedMessage (
                           mw_securedMessage (
                            mw_etsiTs103097Data_signed(
                                               superset(
                                mw_signedData(
                                                        mw_header_field_signer_info_digest
                                    -, 
                                                        )), 
                                    mw_toBeSignedData(
                                        mw_signedDataPayload
                                    ),
                                    mw_signerIdentifier_digest // containing digest
                                )
                            ), 
                            p_received
                            p_received
                           ) {
                           ) {
        // Nothing to do
        // Nothing to do
      }
      }
    }*/ // End of altstep a_securedMessageWithDigest
    } // End of altstep a_securedMessageWithDigest
        
        
  } // End of group altSteps
  } // End of group altSteps
    
    
@@ -2625,18 +2636,17 @@ module LibItsGeoNetworking_Functions {
      var EtsiTs103097Data v_recv;
      var EtsiTs103097Data v_recv;
      var boolean v_ret := false;
      var boolean v_ret := false;
            
            
      /* FIXME To be reviewed alt {
      alt {
        [] a_securedMessageWithCertificate(v_recv) {
        [] a_securedMessageWithCertificate(v_recv) {
          var SignerIdentifier v_si;
          var SignerIdentifier v_signerIdentifier;
                    
          if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { 
          if (f_getMsgSignerInfo(v_recv, v_si) == true) { 
            if (ischosen(v_signerIdentifier.certificate)) {
            if (ischosen(v_si.signerInfo.certificate)) {
            p_cert :=  v_signerIdentifier.certificate[0];
            p_cert :=  v_si.signerInfo.certificate;
            v_ret := true;
            v_ret := true;
            }
            }
          }
          }
        }
        }
      }*/ // End of 'alt' statement
      } // End of 'alt' statement
            
            
      return v_ret;
      return v_ret;
    } // End of function f_waitForCertificate
    } // End of function f_waitForCertificate
@@ -2671,14 +2681,14 @@ module LibItsGeoNetworking_Functions {
    runs on ItsGeoNetworking
    runs on ItsGeoNetworking
    return boolean {
    return boolean {
      var EtsiTs103097Data v_recv;
      var EtsiTs103097Data v_recv;
      var SignerIdentifier v_si;
      var boolean v_ret := false;
      var boolean v_ret := false;
      /* FIXME To be reviewed alt {
        
      alt {
        [] a_securedMessageWithCertificate(v_recv) {
        [] a_securedMessageWithCertificate(v_recv) {
          if(f_getMsgSignerInfo(v_recv, v_si)) {
          var SignerIdentifier v_signerIdentifier;
            if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) {
          if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { 
              if(v_si.type_ == e_certificate_digest_with_sha256) {
            if(ischosen(v_signerIdentifier.digest)) {
                f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload);
              f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload);
              if(tc_ac.running) {
              if(tc_ac.running) {
                tc_ac.stop;tc_ac.start;
                tc_ac.stop;tc_ac.start;
              }
              }
@@ -2687,9 +2697,9 @@ module LibItsGeoNetworking_Functions {
          }
          }
        }
        }
      }
      }
      }*/
      return v_ret;
      return v_ret;
    }
    } // End of function f_askForCertificateChain
      
    /**
    /**
     * @desc  Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info
     * @desc  Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info
     * @return the certificate chain used for sign received message
     * @return the certificate chain used for sign received message
@@ -2700,30 +2710,30 @@ module LibItsGeoNetworking_Functions {
                                             ) runs on ItsGeoNetworking return boolean {
                                             ) runs on ItsGeoNetworking return boolean {
      // Local variables
      // Local variables
      var EtsiTs103097Data v_recv;
      var EtsiTs103097Data v_recv;
      var SignerIdentifier v_si;
      var SignerIdentifier v_signerIdentifier;
      var boolean v_ret := false;
      var boolean v_ret := false;
            
            
      /* FIXME To be reviewed alt {
      alt {
        [] a_securedMessageWithCertificate(v_recv) {
        [] a_securedMessageWithCertificate(v_recv) {
          tc_ac.stop;
          tc_ac.stop;
          if(f_getMsgSignerInfo(v_recv, v_si)) {
          
            if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) {
          if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { 
              if(v_si.type_ == e_certificate_digest_with_sha256) {
            if(ischosen(v_signerIdentifier.digest)) {
                f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload);
              f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload);
                f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload);
                tc_ac.start;
                tc_ac.start;
                repeat;
                repeat;
              }
              }
          }
          }
        }
        }
        }
        /* FIXME To be done [] a_securedMessageWithCertificateChain(v_recv) {
        [] a_securedMessageWithCertificateChain(v_recv) {
          tc_ac.stop;
          tc_ac.stop;
          if(f_getMsgSignerInfo(v_recv, v_si) == true) {
          if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // FIXME How to receive chain of certificate
          p_chain := v_si.signerInfo.certificates;
            p_chain := v_signerIdentifier.certificate;
            v_ret := true;
            v_ret := true;
          } 
          } 
        }
          }*/
      }*/ // End of 'alt' statement
      } // End of 'alt' statement
            
            
      return v_ret;
      return v_ret;
    } // End of function f_askAndWaitForCertificateChain
    } // End of function f_askAndWaitForCertificateChain
+32 −17
Original line number Original line Diff line number Diff line
@@ -784,6 +784,24 @@ module LibItsSecurity_Templates {
            requestedCertificate := omit
            requestedCertificate := omit
        } // End of template mw_ieee1609Dot2_headerInfo
        } // End of template mw_ieee1609Dot2_headerInfo
        
        
        /**
         * @desc Basic receive HeaderInfo template with ETSI ITS restrction
         */
        template (present) HeaderInfo mw_ieee1609Dot2_headerInfo_request_certificate(
                                                                                     template (present) Psid p_psid := ?,
                                                                                     template (present) Certificate p_requestedCertificate := ?
        ) modifies mw_ieee1609Dot2_headerInfo := { 
            psid                 := p_psid,
            generationTime       := *,
            expiryTime           := *,
            generationLocation   := *,
            p2pcdLearningRequest := omit,
            missingCrlIdentifier := omit,
            encryptionKey        := omit,
            inlineP2pcdRequest   := omit,
            requestedCertificate := p_requestedCertificate
        } // End of template mw_ieee1609Dot2_headerInfo
        
        /**
        /**
         * @desc CAM specific send HeaderInfo template with ETSI ITS restrction
         * @desc CAM specific send HeaderInfo template with ETSI ITS restrction
         * 
         * 
@@ -857,13 +875,9 @@ module LibItsSecurity_Templates {
         */
         */
        template (omit) HeaderInfo m_headerInfo_gn(
        template (omit) HeaderInfo m_headerInfo_gn(
                                                   in template (value) Psid p_psid := c_its_aid_GN,
                                                   in template (value) Psid p_psid := c_its_aid_GN,
                                                   in template (value) Time64 p_generationTime,
                                                   in template (value) Time64 p_generationTime
                                                   in template (value) Time64 p_expiryTime,
                                                   in template (omit) ThreeDLocation p_generationLocation := omit
        ) modifies m_ieee1609Dot2_headerInfo := {
        ) modifies m_ieee1609Dot2_headerInfo := {
            generationTime     := p_generationTime,
            generationTime     := p_generationTime
            expiryTime         := p_expiryTime,
            generationLocation := p_generationLocation
        } // End of template m_headerInfo_gn
        } // End of template m_headerInfo_gn
        
        
        /**
        /**
@@ -872,13 +886,14 @@ module LibItsSecurity_Templates {
         */
         */
        template (present) HeaderInfo mw_headerInfo_gn(
        template (present) HeaderInfo mw_headerInfo_gn(
                                                       template (present) Psid p_psid := c_its_aid_GN,
                                                       template (present) Psid p_psid := c_its_aid_GN,
                                                       template (present) Time64 p_generationTime := ?,
                                                       template (present) Time64 p_generationTime := ?
                                                       template (present) Time64 p_expiryTime := ?,
                                                       template ThreeDLocation p_generationLocation := omit
        ) modifies mw_ieee1609Dot2_headerInfo := {
        ) modifies mw_ieee1609Dot2_headerInfo := {
            generationTime       := p_generationTime,
            generationTime       := p_generationTime,
            expiryTime         := p_expiryTime,
            expiryTime           := *,
            generationLocation := p_generationLocation
            generationLocation   := *,
            encryptionKey        := *,
            inlineP2pcdRequest   := *,
            requestedCertificate := *
        } // End of template mw_headerInfo_gn
        } // End of template mw_headerInfo_gn
        
        
    } // End of group headerFields
    } // End of group headerFields
@@ -1224,7 +1239,7 @@ module LibItsSecurity_Templates {
                                                                         in template (value) CertificateId p_id,
                                                                         in template (value) CertificateId p_id,
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                         in template (value) ValidityPeriod p_validityPeriod,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                         in template (omit) PublicEncryptionKey p_encryptionKey := omit
                                                                         in template (omit) PublicEncryptionKey p_encryptionKey := omit
@@ -1251,7 +1266,7 @@ module LibItsSecurity_Templates {
                                                                   template (present) CertificateId p_id := ?,
                                                                   template (present) CertificateId p_id := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template ValidityPeriod p_validityPeriod := *,
                                                                   template (present) ValidityPeriod p_validityPeriod := ?,
                                                                   template GeographicRegion p_region := *,
                                                                   template GeographicRegion p_region := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template PublicEncryptionKey p_encryptionKey := *
                                                                   template PublicEncryptionKey p_encryptionKey := *
@@ -1278,7 +1293,7 @@ module LibItsSecurity_Templates {
                                                                         in template (value) CertificateId p_id,
                                                                         in template (value) CertificateId p_id,
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                         in template (value) ValidityPeriod p_validityPeriod,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                         in template (omit) PublicEncryptionKey p_encryptionKey := omit
                                                                         in template (omit) PublicEncryptionKey p_encryptionKey := omit
@@ -1305,7 +1320,7 @@ module LibItsSecurity_Templates {
                                                                   template (present) CertificateId p_id := ?,
                                                                   template (present) CertificateId p_id := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template ValidityPeriod p_validityPeriod := *,
                                                                   template (present) ValidityPeriod p_validityPeriod := ?,
                                                                   template GeographicRegion p_region := *,
                                                                   template GeographicRegion p_region := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template PublicEncryptionKey p_encryptionKey := *
                                                                   template PublicEncryptionKey p_encryptionKey := *
@@ -1357,7 +1372,7 @@ module LibItsSecurity_Templates {
        template ToBeSignedCertificate mw_toBeSignedCertificate_at(
        template ToBeSignedCertificate mw_toBeSignedCertificate_at(
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template ValidityPeriod p_validityPeriod := ?,
                                                                   template (present) ValidityPeriod p_validityPeriod := ?,
                                                                   template GeographicRegion p_region := *,
                                                                   template GeographicRegion p_region := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template PublicEncryptionKey p_encryptionKey := *
                                                                   template PublicEncryptionKey p_encryptionKey := *