Loading ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ module LibItsHttp_BinaryMessageBodyTypes { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; type union BinaryBody { Loading ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ module LibItsHttp_BinaryTemplates { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; template (value) BinaryBody m_binary_body_raw( Loading ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +3 −3 Original line number Diff line number Diff line Loading @@ -5,16 +5,16 @@ module LibItsPki_EncdecDeclarations { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from LibItsSecurity_TypesAndValues all; external function fx_enc_EtsiTs102941Data(in EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data) return bitstring external function fx_enc_EtsiTs102941Data(in EtsiTs102941MessagesCa.EtsiTs102941Data p_etsi_ts_102941_data) return bitstring with {extension "prototype(convert) encode(PER)"} external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data)return integer external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesCa.EtsiTs102941Data p_etsi_ts_102941_data)return integer with {extension "prototype(sliding) decode(PER)"} /** Loading ttcn/Pki/LibItsPki_Functions.ttcn +4 −7 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ module LibItsPki_Functions { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; Loading Loading @@ -323,7 +323,6 @@ module LibItsPki_Functions { ) runs on ItsPkiHttp { var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; var bitstring v_inner_ec_request_signed_for_pop_msg; if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); Loading @@ -335,10 +334,9 @@ module LibItsPki_Functions { f_selfOrClientSyncAndVerdict("error", e_error); } // Secure InnerEcRequestSignedForPoP message v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(int2oct(12345, 32)); // Invalid InnseEcRequestSignedForPop if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } Loading @@ -364,15 +362,14 @@ module LibItsPki_Functions { ) runs on ItsPkiHttp { // Local variables var AuthorizationValidationRequest v_authorization_validation_request; var bitstring v_authorization_validation_request_msg; if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } // FIXME Encapsulate v_authorization_validation_request into EtsiTs102941Data structure if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(v_authorization_validation_request)), p_ieee1609dot2_signed_and_encrypted_data) == false) { if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } Loading ttcn/Pki/LibItsPki_Templates.ttcn +27 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ module LibItsPki_Templates { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsSecurity Loading Loading @@ -56,11 +56,11 @@ module LibItsPki_Templates { } // End of template m_etsiTs102941Data_inner_ec_response template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_request( in template (value) InnerAtRequest p_inner_at_response in template (value) InnerAtRequest p_inner_at_request ) := { version := PkiProtocolVersion, content := { authorizationRequest := p_inner_at_response authorizationRequest := p_inner_at_request } } // End of template m_etsiTs102941Data_inner_at_request Loading @@ -73,6 +73,24 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_at_response template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request( in template (value) AuthorizationValidationRequest p_authorization_validation_request ) := { version := PkiProtocolVersion, content := { authorizationValidationRequest := p_authorization_validation_request } } // End of template m_etsiTs102941Data_authorization_validation_request template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response( in template (value) AuthorizationValidationResponse p_authorization_validation_response ) := { version := PkiProtocolVersion, content := { authorizationValidationResponse := p_authorization_validation_response } } // End of template m_etsiTs102941Data_authorization_validation_response template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { Loading Loading @@ -148,6 +166,12 @@ module LibItsPki_Templates { authorizationResponse := p_authorizationResponse } // End of template mw_authorizationResponse template (present) EtsiTs102941DataContent mw_authorizationValidationResponse( template (present) AuthorizationValidationResponse p_authorization_alidation_response := ? ) := { authorizationValidationResponse := p_authorization_alidation_response } // End of template mw_authorizationValidationResponse template (value) InnerEcRequest m_innerEcRequest( in template (value) charstring p_itsId, in template (value) PublicKeys p_publicKeys, Loading Loading
ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ module LibItsHttp_BinaryMessageBodyTypes { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; type union BinaryBody { Loading
ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ module LibItsHttp_BinaryTemplates { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; template (value) BinaryBody m_binary_body_raw( Loading
ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +3 −3 Original line number Diff line number Diff line Loading @@ -5,16 +5,16 @@ module LibItsPki_EncdecDeclarations { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from LibItsSecurity_TypesAndValues all; external function fx_enc_EtsiTs102941Data(in EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data) return bitstring external function fx_enc_EtsiTs102941Data(in EtsiTs102941MessagesCa.EtsiTs102941Data p_etsi_ts_102941_data) return bitstring with {extension "prototype(convert) encode(PER)"} external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data)return integer external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesCa.EtsiTs102941Data p_etsi_ts_102941_data)return integer with {extension "prototype(sliding) decode(PER)"} /** Loading
ttcn/Pki/LibItsPki_Functions.ttcn +4 −7 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ module LibItsPki_Functions { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; Loading Loading @@ -323,7 +323,6 @@ module LibItsPki_Functions { ) runs on ItsPkiHttp { var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; var bitstring v_inner_ec_request_signed_for_pop_msg; if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); Loading @@ -335,10 +334,9 @@ module LibItsPki_Functions { f_selfOrClientSyncAndVerdict("error", e_error); } // Secure InnerEcRequestSignedForPoP message v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(int2oct(12345, 32)); // Invalid InnseEcRequestSignedForPop if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } Loading @@ -364,15 +362,14 @@ module LibItsPki_Functions { ) runs on ItsPkiHttp { // Local variables var AuthorizationValidationRequest v_authorization_validation_request; var bitstring v_authorization_validation_request_msg; if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } // FIXME Encapsulate v_authorization_validation_request into EtsiTs102941Data structure if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(v_authorization_validation_request)), p_ieee1609dot2_signed_and_encrypted_data) == false) { if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } Loading
ttcn/Pki/LibItsPki_Templates.ttcn +27 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ module LibItsPki_Templates { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsSecurity Loading Loading @@ -56,11 +56,11 @@ module LibItsPki_Templates { } // End of template m_etsiTs102941Data_inner_ec_response template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_request( in template (value) InnerAtRequest p_inner_at_response in template (value) InnerAtRequest p_inner_at_request ) := { version := PkiProtocolVersion, content := { authorizationRequest := p_inner_at_response authorizationRequest := p_inner_at_request } } // End of template m_etsiTs102941Data_inner_at_request Loading @@ -73,6 +73,24 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_at_response template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request( in template (value) AuthorizationValidationRequest p_authorization_validation_request ) := { version := PkiProtocolVersion, content := { authorizationValidationRequest := p_authorization_validation_request } } // End of template m_etsiTs102941Data_authorization_validation_request template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response( in template (value) AuthorizationValidationResponse p_authorization_validation_response ) := { version := PkiProtocolVersion, content := { authorizationValidationResponse := p_authorization_validation_response } } // End of template m_etsiTs102941Data_authorization_validation_response template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { Loading Loading @@ -148,6 +166,12 @@ module LibItsPki_Templates { authorizationResponse := p_authorizationResponse } // End of template mw_authorizationResponse template (present) EtsiTs102941DataContent mw_authorizationValidationResponse( template (present) AuthorizationValidationResponse p_authorization_alidation_response := ? ) := { authorizationValidationResponse := p_authorization_alidation_response } // End of template mw_authorizationValidationResponse template (value) InnerEcRequest m_innerEcRequest( in template (value) charstring p_itsId, in template (value) PublicKeys p_publicKeys, Loading