Loading ttcn/Security/LibItsSecurity_Functions.ttcn3 +27 −21 Original line number Diff line number Diff line Loading @@ -225,12 +225,12 @@ module LibItsSecurity_Functions { } // Prepare payload to be signed if ( (valueof(p_payloadField.type_) == e_signed) or (valueof(p_payloadField.type_) == e_signed_and_encrypted )) { // if ( // (valueof(p_payloadField.type_) == e_signed) or // (valueof(p_payloadField.type_) == e_signed_and_encrypted // )) { v_toBeSignedPayload := valueof(p_payloadField); } // TODO else, check draft // } // TODO else, check draft v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage( v_headerFields, Loading @@ -244,9 +244,15 @@ module LibItsSecurity_Functions { // FIXME BUG Framework already compute the hash v_hash := f_hashWithSha256(v_secPayload); // Signed payload if(not f_readSigningKey(p_certificateName, v_privateKey)){ if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ return false; } } else { if(not f_readSigningKey(valueof(cc_taCert_A), v_privateKey)){ return false; } } v_signature := f_signWithEcdsaNistp256WithSha256( v_secPayload, v_privateKey // FIXME BUG Framework already compute the hash v_hash ); Loading ttcn/Security/LibItsSecurity_Templates.ttcn3 +5 −3 Original line number Diff line number Diff line Loading @@ -1008,7 +1008,7 @@ module LibItsSecurity_Templates { ) := { type_ := e_unsecured, data := p_data } // End of template m_payload_signed } // End of template m_payload_unsecured /** * @desc Send template for 'signed' Payload Loading @@ -1025,9 +1025,11 @@ module LibItsSecurity_Templates { * @desc Send template for 'signed_external' Payload * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload */ template (value) SecPayload m_payload_signed_external := { template (value) SecPayload m_payload_signed_external( in template (omit) octetstring p_data := omit ) := { type_ := e_signed_external, data := omit data := p_data } // End of template m_payload_signed_external /** Loading Loading
ttcn/Security/LibItsSecurity_Functions.ttcn3 +27 −21 Original line number Diff line number Diff line Loading @@ -225,12 +225,12 @@ module LibItsSecurity_Functions { } // Prepare payload to be signed if ( (valueof(p_payloadField.type_) == e_signed) or (valueof(p_payloadField.type_) == e_signed_and_encrypted )) { // if ( // (valueof(p_payloadField.type_) == e_signed) or // (valueof(p_payloadField.type_) == e_signed_and_encrypted // )) { v_toBeSignedPayload := valueof(p_payloadField); } // TODO else, check draft // } // TODO else, check draft v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage( v_headerFields, Loading @@ -244,9 +244,15 @@ module LibItsSecurity_Functions { // FIXME BUG Framework already compute the hash v_hash := f_hashWithSha256(v_secPayload); // Signed payload if(not f_readSigningKey(p_certificateName, v_privateKey)){ if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ return false; } } else { if(not f_readSigningKey(valueof(cc_taCert_A), v_privateKey)){ return false; } } v_signature := f_signWithEcdsaNistp256WithSha256( v_secPayload, v_privateKey // FIXME BUG Framework already compute the hash v_hash ); Loading
ttcn/Security/LibItsSecurity_Templates.ttcn3 +5 −3 Original line number Diff line number Diff line Loading @@ -1008,7 +1008,7 @@ module LibItsSecurity_Templates { ) := { type_ := e_unsecured, data := p_data } // End of template m_payload_signed } // End of template m_payload_unsecured /** * @desc Send template for 'signed' Payload Loading @@ -1025,9 +1025,11 @@ module LibItsSecurity_Templates { * @desc Send template for 'signed_external' Payload * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload */ template (value) SecPayload m_payload_signed_external := { template (value) SecPayload m_payload_signed_external( in template (omit) octetstring p_data := omit ) := { type_ := e_signed_external, data := omit data := p_data } // End of template m_payload_signed_external /** Loading