Commit cac3070f authored by garciay's avatar garciay
Browse files

Bug fixed in altstep a_securedMessageWithDigest

parent ea02f55c
Loading
Loading
Loading
Loading
+37 −25
Original line number Diff line number Diff line
@@ -2331,9 +2331,11 @@ module LibItsGeoNetworking_Functions {
         * @return  Unix-Epoch-Time mod 2^32
         */
        external function fx_computeGnTimestamp() return UInt32;
    }
        
    } // End of group externalFunctions
    
    group security {
        
        /**
         * @desc    Waiting for the GN message with Security
         * @param   p_InSecMsg  SecurityMessage template 
@@ -2367,7 +2369,6 @@ module LibItsGeoNetworking_Functions {
            ) {
                // Nothing to do
            }
            
        } // End of altstep a_securedMessageWithCertificate

        /**
@@ -2377,12 +2378,16 @@ module LibItsGeoNetworking_Functions {
        altstep a_securedMessageWithCertificateChain(
                                                     out SecuredMessage p_received
        ) runs on ItsGeoNetworking {
            var SecuredMessage v_secMsg;
            [] a_securedMessage (
                mw_securedMessage (superset(mw_header_field_signer_info_certificate_chain)),
                mw_securedMessage(
                    superset(
                        mw_header_field_signer_info_certificate_chain
                )),
                p_received
            ) {}
            ) {
                // Nothing to do
            }
        } // End of altstep a_securedMessageWithCertificateChain
        
        /**
         * @desc         Receive GN message with security containing digest as a signer info
@@ -2392,10 +2397,15 @@ module LibItsGeoNetworking_Functions {
                                           out SecuredMessage p_received
        ) runs on ItsGeoNetworking {
            [] a_securedMessage (
                mw_securedMessage (superset(mw_header_field_signer_info_certificate)), 
                mw_securedMessage (
                    superset(
                        mw_header_field_signer_info_digest
                )), 
                p_received
            ) {}
            ) {
                // Nothing to do
            }
        } // End of altstep a_securedMessageWithDigest
        
    } // End of group altSteps
    
@@ -2405,22 +2415,24 @@ module LibItsGeoNetworking_Functions {
         * @desc  Wait for GN message with security containing certificate as a signer info
         * @return the certificate used for sign received message
         */
        function f_waitForCertificate (out Certificate p_cert)
        runs on ItsGeoNetworking
        function f_waitForCertificate(
                                      out Certificate p_cert
        ) runs on ItsGeoNetworking
        return boolean {
            var SecuredMessage v_recv;
            var boolean v_ret := false;
            
            alt {
                [] a_securedMessageWithCertificate(v_recv) {
                    var SignerInfo v_si;
                    if (f_getMsgSignerInfo(v_recv, v_si)) { 
                    if (f_getMsgSignerInfo(v_recv, v_si) == true) { 
                        p_cert :=  v_si.signerInfo.certificate;
                        v_ret := true;
                    }
                }
            }
            return v_ret;
        }
        } // End of function f_waitForCertificate
        
        /**
         * @desc  Wait for GN message with security containing certificate chain as a signer info