lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2024

  • 1 participants
  • 1566 discussions
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: Validate Via port matches the ipsec port-c one
by pespin 07 Jun '24

07 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email ) Change subject: asterisk: IMS: Validate Via port matches the ipsec port-c one ...................................................................... asterisk: IMS: Validate Via port matches the ipsec port-c one Related: SYS#6964 Change-Id: I3f8b2112d40dd5f018abb8bc00b9e1be16586a9b --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 14 insertions(+), 4 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index f10e2aa..c06df15 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -595,7 +595,7 @@ ?, tr_From(), tr_To(), - tr_Via_from(?), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), authorization := authorization); SIP.receive(exp_req) -> value g_rx_sip_req; @@ -662,7 +662,7 @@ ?, tr_From(), tr_To(), - tr_Via_from(?), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), expires := tr_Expires(int2str(0)), require := tr_Require(superset("sec-agree")), security_client := tr_Security_client(superset(tr_Security_mechanism("ipsec-3gpp", @@ -759,7 +759,7 @@ ?, tr_From(tr_Addr_Union_from_val(g_pars.subscr.cp.calling.addr), *), tr_To(tr_Addr_Union_from_val(g_pars.subscr.cp.called.addr), *), - tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.remote_sip_port)), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), ?, ?); var charstring sip_expect_str := log2str(exp_req); @@ -815,7 +815,7 @@ g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, - tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.remote_sip_port)), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), exp_seq_nr); var charstring sip_expect_str := log2str(exp_req); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3f8b2112d40dd5f018abb8bc00b9e1be16586a9b Gerrit-Change-Number: 37117 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: Enable IMS port advanced mode
by pespin 07 Jun '24

07 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37112?usp=email ) Change subject: asterisk: Enable IMS port advanced mode ...................................................................... asterisk: Enable IMS port advanced mode This allows the SIPmsg_PT port module to be able to handle multiple client sockets concurrently. This allows workarounding for now a bug where Asterisk wrongly creates a TCP conn 2 times and sending the REGISTER over the 2nd one, while TTCN3 operates only on the 1st accepted socket. Change-Id: I287650a42c700c3959d0959620fb3f1e8e342c7d --- M asterisk/Asterisk_Tests.default 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/asterisk/Asterisk_Tests.default b/asterisk/Asterisk_Tests.default index 1de9def..503f767 100644 --- a/asterisk/Asterisk_Tests.default +++ b/asterisk/Asterisk_Tests.default @@ -12,6 +12,7 @@ Asterisk_Tests_LOCAL_SIP_EMU.SIP.default_dest_port := "5060" Asterisk_Tests_LOCAL_SIP_EMU.SIP.default_dest_address := "127.0.0.1" # IMS Core: +Asterisk_Tests_IMS_SIP_EMU.SIP.port_mode := "advanced"; # Allow concurrent client sockets Asterisk_Tests_IMS_SIP_EMU.SIP.default_sip_protocol := "TCP"; Asterisk_Tests_IMS_SIP_EMU.SIP.listen_enabled := "enabled"; Asterisk_Tests_IMS_SIP_EMU.SIP.local_sip_port := "5060" -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37112?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I287650a42c700c3959d0959620fb3f1e8e342c7d Gerrit-Change-Number: 37112 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: TC_ims_call_mo: unregister IMS during test teardown
by pespin 07 Jun '24

07 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37035?usp=email ) Change subject: asterisk: TC_ims_call_mo: unregister IMS during test teardown ...................................................................... asterisk: TC_ims_call_mo: unregister IMS during test teardown Change-Id: Ifaf9a2991d9edd5614a3fc048357da3d1e240714 --- M asterisk/Asterisk_Tests.ttcn 1 file changed, 15 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn index 20a9e6c..ba7cb38 100644 --- a/asterisk/Asterisk_Tests.ttcn +++ b/asterisk/Asterisk_Tests.ttcn @@ -446,6 +446,7 @@ COORD.send(COORD_CMD_CALL_ESTABLISHED); as_IMS_exp_call_hangup(g_pars.subscr.cp.sip_seq_nr + 1); setverdict(pass); + as_IMS_unregister(); } testcase TC_ims_call_mo() runs on test_CT { var SIPConnHdlrPars sip_pars; @@ -485,6 +486,11 @@ COORD.send(COORD_CMD_HANGUP) to vc_conn_sip; + /* Trigger unregistration: */ + f_sleep(1.0); + AMI_CLIENT.clear; + f_AMI_IMS_unregister(ims_pars); + vc_conn_sip.done; vc_conn_ims.done; f_shutdown(); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37035?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ifaf9a2991d9edd5614a3fc048357da3d1e240714 Gerrit-Change-Number: 37035 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: asterisk: Test sending PJSIPUnregister after registration
by pespin 07 Jun '24

07 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37033?usp=email ) Change subject: asterisk: Test sending PJSIPUnregister after registration ...................................................................... asterisk: Test sending PJSIPUnregister after registration Related: SYS#6960 Change-Id: I309732f934a6b4979367e4ce5e5475493818cdbd --- M asterisk/AMI_Functions.ttcn M asterisk/Asterisk_Tests.ttcn M asterisk/IMS_ConnectionHandler.ttcn M library/SIP_Templates.ttcn 4 files changed, 147 insertions(+), 12 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/AMI_Functions.ttcn b/asterisk/AMI_Functions.ttcn index 9c84d00..16cf71f 100644 --- a/asterisk/AMI_Functions.ttcn +++ b/asterisk/AMI_Functions.ttcn @@ -263,6 +263,25 @@ tr_AMI_Field_Registration(registration) }; +/* Action: PJSIPUnregister + * ActionID: <value> + * Registration: volte_ims + */ +template (value) AMI_Msg +ts_AMI_Action_PJSIPUnregister(template (value) charstring registration := "volte_ims", + template (value) charstring action_id := "0001") := { + ts_AMI_Field_Action("PJSIPUnregister"), + ts_AMI_Field_ActionId(action_id), + ts_AMI_Field_Registration(registration) +}; +template (present) AMI_Msg +tr_AMI_Action_PJSIPUnregister(template (present) charstring registration := ?, + template (present) charstring action_id := ?) := { + tr_AMI_Field_Action("PJSIPUnregister"), + tr_AMI_Field_ActionId(action_id), + tr_AMI_Field_Registration(registration) +}; + /* * RESPONSES */ @@ -661,6 +680,11 @@ f_ami_transceive_match_response_success(pt, ts_AMI_Action_PJSIPRegister(register, reg_action_id)); } +function f_ami_action_PJSIPUnregister(AMI_Msg_PT pt, charstring register) { + var charstring reg_action_id := f_gen_action_id(); + f_ami_transceive_match_response_success(pt, ts_AMI_Action_PJSIPUnregister(register, reg_action_id)); +} + function f_ami_action_AuthResponse_AUTS(AMI_Msg_PT pt, template (value) charstring registration, template (value) charstring auts) { diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn index 5a51d1d..20a9e6c 100644 --- a/asterisk/Asterisk_Tests.ttcn +++ b/asterisk/Asterisk_Tests.ttcn @@ -397,16 +397,21 @@ AMI_CLIENT.receive(tr_AMI_Event_Registry(f_sip_SipAddr_to_str(pars.subscr.local_sip_record), "sip:" & mp_ims_domain, "Registered")); +} - /* TODO: test "Action: PJSIPUnregister" */ - - /* TODO: in another test emulating a call, test "Action: DedicatedBearerStatus" */ +private function f_AMI_IMS_unregister(IMS_ConnHdlrPars pars) runs on test_CT +{ + f_ami_action_PJSIPUnregister(AMI_CLIENT, mp_volte_ims_outbound_registration); + AMI_CLIENT.receive(tr_AMI_Event_Registry(f_sip_SipAddr_to_str(pars.subscr.local_sip_record), + "sip:" & mp_ims_domain, + "Unregistered")); } /* Test SIP registration of local clients */ private function f_TC_ims_registration(charstring id) runs on IMS_ConnHdlr { f_create_sip_expect(valueof(ts_SipUrl_from_Addr_Union(g_pars.subscr.registrar_sip_record.addr))); as_IMS_register(); + as_IMS_unregister(); setverdict(pass); } testcase TC_ims_registration() runs on test_CT { @@ -418,6 +423,12 @@ f_AMI_IMS_register(pars); + /* Stay registered for one second */ + f_sleep(1.0); + + /* Trigger unregistration: */ + f_AMI_IMS_unregister(pars); + vc_conn.done; f_shutdown(); } @@ -467,6 +478,8 @@ COORD.receive(COORD_CMD_CALL_ESTABLISHED) from vc_conn_sip; IMS_COORD.receive(COORD_CMD_CALL_ESTABLISHED) from vc_conn_ims; + /* TODO: "Action: DedicatedBearerStatus" */ + /* Call on-going */ f_sleep(1.0); diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index f3e9839..9a37b05 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -80,6 +80,7 @@ SipUrl local_sip_url_ext, SipAddr local_sip_record, Contact local_contact, + P_Associated_Uri p_associated_uri, IMS_CallPars cp optional } type record of IMS_ConnHdlrSubscrPars IMS_ConnHdlrSubscrParsList; @@ -184,6 +185,7 @@ ts_UserInfo(imsi))), omit) })), + p_associated_uri := ts_P_Associated_Uri({}), cp := cp } @@ -448,9 +450,8 @@ return sdp; } -/* Peer is calling us, accept it: */ -altstep as_IMS_register(boolean exp_update_to_direct_rtp := true, - boolean fail_others := true) runs on IMS_ConnHdlr +/* Peer is issuing 1st register, accept it: */ +altstep as_IMS_register(boolean fail_others := true) runs on IMS_ConnHdlr { var template (present) PDU_SIP_Request exp_req := tr_SIP_REGISTER(g_pars.registrar_sip_req_uri, @@ -473,7 +474,6 @@ var template (value) To to_addr; var template (value) CommaParam_List digestCln ; var template (value) WwwAuthenticate wwwAuthenticate; - var template (value) P_Associated_Uri p_associated_uri := ts_P_Associated_Uri({}); var template (value) Security_server security_server; var template (value) Server server_name := ts_Server({c_sip_server_name}); var template (value) Require require := ts_Require({"sec-agree"}); @@ -561,7 +561,7 @@ wwwAuthenticate, sip_seq_nr, "REGISTER", - p_associated_uri := p_associated_uri, + p_associated_uri := g_pars.subscr.p_associated_uri, security_server := security_server, server := server_name, supported := supported, @@ -610,7 +610,7 @@ /* Validate P-Access-Network-Info: */ f_ims_validate_register_P_Access_Network_info(g_rx_sip_req, exp_present := true); - p_associated_uri := ts_P_Associated_Uri({ + g_pars.subscr.p_associated_uri := valueof(ts_P_Associated_Uri({ ts_P_Assoc_uri_spec(ts_NameAddr(ts_SipUrl(ts_HostPort(g_pars.realm), ts_UserInfo(g_pars.subscr.msisdn), scheme := "sip"))), @@ -618,7 +618,7 @@ omit, scheme := "tel"))), ts_P_Assoc_uri_spec(g_rx_sip_req.msgHeader.toField.addressField.nameAddr) - }); + })); /* Tx 200 OK */ to_addr.toParams := f_sip_param_set(to_addr.toParams, "tag", f_sip_rand_tag()); @@ -629,7 +629,7 @@ sip_seq_nr, "OK", via, - p_associated_uri := p_associated_uri, + p_associated_uri := g_pars.subscr.p_associated_uri, require := require, server := server_name, supported := supported, @@ -641,6 +641,89 @@ } +/* Peer wants to unregister, accept it: */ +altstep as_IMS_unregister(boolean fail_others := true) runs on IMS_ConnHdlr +{ + var template (present) PDU_SIP_Request exp_req := + tr_SIP_REGISTER(g_pars.registrar_sip_req_uri, + ?, + tr_From(), + tr_To(), + tr_Via_from(?), + expires := tr_Expires(int2str(0)), + require := tr_Require(superset("sec-agree")), + security_client := tr_Security_client(superset(tr_Security_mechanism("ipsec-3gpp", + superset(tr_Param("alg","hmac-sha-1-96"))))), + supported := tr_Supported(superset("path", "sec-agree"))); + var charstring sip_expect_str := log2str(exp_req); + + [] SIP.receive(exp_req) -> value g_rx_sip_req { + var template (value) PDU_SIP_Response tx_resp; + var Via via; + var CallidString sip_call_id; + var Contact contact; + var template (value) From from_addr; + var template (value) To to_addr; + var template (value) CommaParam_List digestCln ; + var template (value) WwwAuthenticate wwwAuthenticate; + var template (value) Security_server security_server; + var template (value) Server server_name := ts_Server({c_sip_server_name}); + var template (value) Require require := ts_Require({"sec-agree"}); + var template (value) Supported supported := ts_Supported({"sec-agree"}); + var template (present) Authorization authorization; + var integer sip_seq_nr; + var charstring tx_sdp; + + sip_call_id := g_rx_sip_req.msgHeader.callId.callid; + via := g_rx_sip_req.msgHeader.via; + via.viaBody[0].viaParams := f_sip_param_set(via.viaBody[0].viaParams, "rport", "1234"); /* TODO: set remote src port of the REGISTER */ + from_addr := g_rx_sip_req.msgHeader.fromField; + to_addr := g_rx_sip_req.msgHeader.toField; + sip_seq_nr := g_rx_sip_req.msgHeader.cSeq.seqNumber; + + contact := g_rx_sip_req.msgHeader.contact; + f_ims_validate_register_contact(contact); + + /* Validate P-Access-Network-Info: */ + f_ims_validate_register_P_Access_Network_info(g_rx_sip_req, exp_present := true); + + /* Tx 100 Tyring */ + tx_resp := ts_SIP_Response_Trying(sip_call_id, + from_addr, + to_addr, + via, + sip_seq_nr, + "REGISTER", + allow := omit, + server := server_name, + userAgent := omit); + SIP.send(tx_resp); + + /* Change all Contact parameters to expires=0: */ + for (var integer i := 0; i < lengthof(contact.contactBody.contactAddresses); i := i + 1) { + contact.contactBody.contactAddresses[i].contactParams := valueof({ ts_Param("expires", "0") }); + } + /* Tx 200 OK */ + to_addr.toParams := f_sip_param_set(to_addr.toParams, "tag", f_sip_rand_tag()); + tx_resp := ts_SIP_Response(sip_call_id, + from_addr, + to_addr, + "REGISTER", 200, + sip_seq_nr, + "OK", + via, + contact := contact, + p_associated_uri := g_pars.subscr.p_associated_uri, + require := require, + server := server_name, + supported := supported, + userAgent := omit); + SIP.send(tx_resp); + } + [fail_others] as_SIP_fail_resp(sip_expect_str); + [fail_others] as_SIP_fail_req(sip_expect_str); +} + private function f_ConnHdlr_parse_initial_SIP_INVITE(PDU_SIP_Request rx_sip_req) runs on IMS_ConnHdlr { f_SDP_decodeMessage(rx_sip_req.messageBody, g_pars.subscr.cp.peer_sdp); diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn index 9f45b9f..f251767 100644 --- a/library/SIP_Templates.ttcn +++ b/library/SIP_Templates.ttcn @@ -226,6 +226,10 @@ fieldName := EXPIRES_E, deltaSec := deltaSec } +template (present) Expires tr_Expires(template (present) DeltaSec deltaSec := ?) := { + fieldName := EXPIRES_E, + deltaSec := deltaSec +} // [20.20] template (value) From ts_From(template (value) Addr_Union addressField, @@ -911,6 +915,7 @@ charstring reason, Via via, template (omit) Allow allow := omit, + template (omit) Contact contact := omit, template (omit) P_Associated_Uri p_associated_uri := omit, template (omit) Require require := omit, template (omit) Server server := omit, @@ -918,7 +923,7 @@ template (omit) UserAgent userAgent := omit, template (omit) charstring body := omit) := { statusLine := ts_SIP_StatusLine(status_code, reason), - msgHeader := ts_SIP_msgh_std(call_id, from_addr, to_addr, omit, method, seq_nr, + msgHeader := ts_SIP_msgh_std(call_id, from_addr, to_addr, contact, method, seq_nr, via, content_length := f_ContentLength(body), content_type := f_ContentTypeOrOmit(ts_CT_SDP, body), -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37033?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I309732f934a6b4979367e4ce5e5475493818cdbd Gerrit-Change-Number: 37033 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ttcn3-asterisk: Validate Asterisk generates correct AKAv1-MD5 digest ...
by pespin 07 Jun '24

07 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37065?usp=email ) Change subject: ttcn3-asterisk: Validate Asterisk generates correct AKAv1-MD5 digest response ...................................................................... ttcn3-asterisk: Validate Asterisk generates correct AKAv1-MD5 digest response Values taken from pcap "register-unregister-example.pcapng" in SYS#6960 against testing Kamailio as IMS Core. Related: SYS#6960 Change-Id: I0c6a6ff86a8b32383f17487dc9eb46d0bf2bf7c2 --- M asterisk/Asterisk_Tests.ttcn M asterisk/IMS_ConnectionHandler.ttcn M asterisk/SIP_ConnectionHandler.ttcn M library/SIP_Templates.ttcn 4 files changed, 163 insertions(+), 53 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn index ba7cb38..a96e66a 100644 --- a/asterisk/Asterisk_Tests.ttcn +++ b/asterisk/Asterisk_Tests.ttcn @@ -66,13 +66,6 @@ const charstring broadcast_sip_extension := "0500"; -/* TODO: need to find correct RES, CK, IK, values for: - * Response: "a19de225d030e6e0ec20f6de5f9dd80d" - * CNonce Value: "9a6460bcc3c84a3eac69455a93b67a77" - */ -const charstring c_auth_res := "a19de225d030e6e0"; -const charstring c_auth_ck := "9a6460bcc3c84a3eac69455a93b67a77"; -const charstring c_auth_ik := "5238297dfcca759bd05d48ff49bc63fa"; function f_init_ConnHdlrPars(integer idx := 1) runs on test_CT return SIPConnHdlrPars { var template (value) CallPars cp := t_CallPars(mp_local_sip_host, 1234 + 2*idx); @@ -384,15 +377,17 @@ /* Trigger registration: */ f_ami_action_PJSIPRegister(AMI_CLIENT, mp_volte_ims_outbound_registration); - var charstring rand_str := oct2str(pars.subscr.rand); - var charstring autn_str := oct2str(pars.subscr.autn); + var charstring rand_str := oct2str(pars.subscr.auth.rand); + var charstring autn_str := oct2str(pars.subscr.auth.autn); AMI_CLIENT.receive(tr_AMI_Event_AuthRequest(mp_volte_ims_outbound_registration, rand := pattern @nocase rand_str, autn := pattern @nocase autn_str)); f_ami_action_AuthResponse_RES(AMI_CLIENT, mp_volte_ims_outbound_registration, - c_auth_res, c_auth_ck, c_auth_ik); + f_str_tolower(oct2str(pars.subscr.auth.res)), + f_str_tolower(oct2str(pars.subscr.auth.ck)), + f_str_tolower(oct2str(pars.subscr.auth.ik))); AMI_CLIENT.receive(tr_AMI_Event_Registry(f_sip_SipAddr_to_str(pars.subscr.local_sip_record), "sip:" & mp_ims_domain, diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 9a37b05..f10e2aa 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -56,6 +56,14 @@ } type record of IMS_ConnHdlr IMS_ConnHdlrList; +type record IMS_AuthVector { + OCT16 rand, + OCT16 autn, + OCT8 res, + OCT16 ck, + OCT16 ik +} + type record IMS_ConnHdlrSubscrPars { charstring remote_sip_host optional, uint16_t remote_sip_port optional, @@ -65,8 +73,7 @@ charstring msisdn, /* Expected User-Location-Info in P-Access-Network-Info */ charstring uli_str, - octetstring rand, - octetstring autn, + IMS_AuthVector auth, charstring ipsec_auth_key, integer ipsec_local_spi_c, integer ipsec_local_spi_s, @@ -158,10 +165,15 @@ password := password, msisdn := msisdn, uli_str := "2380100010000101", - /* The Nonce field is the Base64 encoded version of the RAND value and concatenated with the AUTN: */ - rand := '14987631f65f8e3788a0798b6ebcd08e'O, - autn := 'f6e19a7ccb028000a06b19c9544516e5'O, - ipsec_auth_key := "0x5238297dfcca759bd05d48ff49bc63fa00000000", + auth := { + /* The Nonce field is the Base64 encoded version of the RAND value and concatenated with the AUTN: */ + rand := 'd5d5de2bce418d7865ed7fa6956618a2'O, + autn := 'd42e61db5f15800067393a5b7691a227'O, + res := '6f2556bbe4366ab1'O, + ck := '0b389d08c833991734936bec55cac800'O, + ik := '17141862125bd30c81c4224391a0909a'O + }, + ipsec_auth_key := "0x17141862125bd30c81c4224391a0909a00000000", ipsec_local_spi_c := 4142, ipsec_local_spi_s := 4143, ipsec_remote_spi_c := omit, @@ -250,8 +262,7 @@ /* HTTP Digest Authentication Using AKA (AKAv1-MD5): RFC 3310 */ function f_tr_Authorization_AKAv1MD5(WwwAuthenticate www_authenticate, charstring username, - charstring uri, - integer nc_int := 1) + charstring uri) return template (present) Authorization { var CommaParam_List digestCln; var template (present) Authorization authorization; @@ -280,6 +291,12 @@ return authorization; } +private function f_ims_validate_Authorization_AKAv1MD5_Response(Authorization authorization, charstring method) +runs on IMS_ConnHdlr { + f_sip_digest_validate_Authorization_AKAv1MD5(authorization, method, g_pars.subscr.auth.res); +} + + private function f_ims_validate_register_contact(Contact rx_contact) { /* IMS contact shows up like this: @@ -532,7 +549,8 @@ ts_Param("realm", f_sip_str_quote(g_pars.realm)), ts_Param("qop", f_sip_str_quote("auth")), ts_Param("algorithm", "AKAv1-MD5"), - ts_Param("nonce", f_sip_str_quote(f_nonce_from_rand_autn(g_pars.subscr.rand, g_pars.subscr.autn))) + ts_Param("nonce", f_sip_str_quote(f_nonce_from_rand_autn(g_pars.subscr.auth.rand, + g_pars.subscr.auth.autn))) /* "opaque not needed in IMS "*/ }; wwwAuthenticate := ts_WwwAuthenticate( { ts_Challenge_digestCln(digestCln) } ) @@ -569,17 +587,9 @@ SIP.send(tx_resp); /* Now we should receive a new REGISTER over ipsec: */ - - /* TODO: Generate expected Authoritzation based on AKAv1-MD5: */ - /*authorization := f_sip_digest_gen_Authorization(valueof(wwwAuthenticate), - g_pars.user, g_pars.subscr.password, - "REGISTER", - f_sip_SipUrl_to_str(g_pars.subscr.registrar_sip_record.addr.nameAddr.addrSpec)) - */ authorization := f_tr_Authorization_AKAv1MD5(valueof(wwwAuthenticate), g_pars.subscr.imsi & "@" & g_pars.realm, f_sip_SipUrl_to_str(g_pars.registrar_sip_req_uri)); - /* TODO: match Authorization from above: */ exp_req := tr_SIP_REGISTER(g_pars.registrar_sip_req_uri, ?, @@ -607,6 +617,9 @@ userAgent := omit); SIP.send(tx_resp); + /* Validate Digest Response: */ + f_ims_validate_Authorization_AKAv1MD5_Response(g_rx_sip_req.msgHeader.authorization, "REGISTER"); + /* Validate P-Access-Network-Info: */ f_ims_validate_register_P_Access_Network_info(g_rx_sip_req, exp_present := true); diff --git a/asterisk/SIP_ConnectionHandler.ttcn b/asterisk/SIP_ConnectionHandler.ttcn index a14dd03..cd50be6 100644 --- a/asterisk/SIP_ConnectionHandler.ttcn +++ b/asterisk/SIP_ConnectionHandler.ttcn @@ -296,10 +296,10 @@ as_SIP_expect_resp(exp); /* Digest Auth: RFC 2617 */ - authorization := f_sip_digest_gen_Authorization(g_rx_sip_resp.msgHeader.wwwAuthenticate, - g_pars.user, g_pars.password, - "REGISTER", - f_sip_SipUrl_to_str(g_pars.registrar_sip_req_uri)) + authorization := f_sip_digest_gen_Authorization_MD5(g_rx_sip_resp.msgHeader.wwwAuthenticate, + g_pars.user, g_pars.password, + "REGISTER", + f_sip_SipUrl_to_str(g_pars.registrar_sip_req_uri)) /* New transaction: */ g_pars.registrar_sip_seq_nr := g_pars.registrar_sip_seq_nr + 1; @@ -381,7 +381,7 @@ as_SIP_expect_resp(exp); /* Digest Auth: RFC 2617 */ - req.msgHeader.authorization := f_sip_digest_gen_Authorization( + req.msgHeader.authorization := f_sip_digest_gen_Authorization_MD5( g_rx_sip_resp.msgHeader.wwwAuthenticate, g_pars.user, g_pars.password, "INVITE", diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn index f251767..77d4ee0 100644 --- a/library/SIP_Templates.ttcn +++ b/library/SIP_Templates.ttcn @@ -1275,7 +1275,17 @@ f_sip_str_unquote(realm) & ":" & password; var charstring digestA1 := f_str_tolower(f_calculateMD5(A1)); - log("A1: md5('", A1, "') = ", digestA1); + log("A1: md5(", A1, ") = ", digestA1); + return digestA1; +} + +/* RFC 3310: Same as f_sip_digest_A1(), but using an octet buffer as password (AKAv1-MD5, pwd=RES) */ +function f_sip_digest_A1_octpwd(charstring user, charstring realm, octetstring password) return charstring { + var charstring A1pre := f_sip_str_unquote(user) & ":" & + f_sip_str_unquote(realm) & ":"; + var octetstring A1 := char2oct(A1pre) & password; + var charstring digestA1 := f_str_tolower(oct2str(f_calculateMD5_oct(A1))); + log("A1-octpwd: md5(", A1, ") = ", digestA1); return digestA1; } @@ -1284,7 +1294,7 @@ var charstring A2 := method & ":" & uri var charstring digestA2 := f_str_tolower(f_calculateMD5(A2)); - log("A2: md5('", A2, "') = ", digestA2); + log("A2: md5(", A2, ") = ", digestA2); return digestA2; } @@ -1298,7 +1308,7 @@ f_sip_str_unquote(qop) & ":" & digestA2; var charstring req_digest := f_sip_digest_KD(digestA1, digest_data); - log("Request-Digest: md5('", digestA1, ":", digest_data ,"') = ", req_digest); + log("Request-Digest: md5(\"" & digestA1 & ":" & digest_data & "\") = " & "\"" & req_digest & "\""); return req_digest; } @@ -1310,7 +1320,41 @@ } /* Digest Auth: RFC 2617 */ -function f_sip_digest_gen_Authorization(WwwAuthenticate www_authenticate, +function f_sip_digest_gen_Authorization_Response_MD5(charstring user, charstring realm, charstring password, + charstring method, charstring uri, charstring qop, + charstring nonce, charstring cnonce, charstring nc) +return charstring { + /* RFC 2617 3.2.2.2 A1 */ + var charstring digestA1 := f_sip_digest_A1(user, realm, password); + + /* RFC 2617 3.2.2.3 A2 */ + var charstring digestA2 := f_sip_digest_A2(method, uri); + + /* RFC 2617 3.2.2.1 Request-Digest */ + var charstring req_digest := f_sip_digest_RequestDigest(digestA1, nonce, + nc, cnonce, + qop, digestA2); + return req_digest; +} + +/* Digest Auth: RFC 2617 */ +function f_sip_digest_gen_Authorization_Response_AKAv1MD5(charstring user, charstring realm, octetstring password, + charstring method, charstring uri, charstring qop, + charstring nonce, charstring cnonce, charstring nc) +return charstring { + /* RFC 2617 3.2.2.2 A1 */ + var charstring digestA1 := f_sip_digest_A1_octpwd(user, realm, password); + /* RFC 2617 3.2.2.3 A2 */ + var charstring digestA2 := f_sip_digest_A2(method, uri); + + /* RFC 2617 3.2.2.1 Request-Digest */ + var charstring req_digest := f_sip_digest_RequestDigest(digestA1, nonce, + nc, cnonce, + qop, digestA2); + return req_digest; +} + +function f_sip_digest_gen_Authorization_MD5(WwwAuthenticate www_authenticate, charstring user, charstring password, charstring method, charstring uri, charstring cnonce := "0a4f113b", integer nc_int := 1) return Authorization { @@ -1343,17 +1387,13 @@ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected qop: ", qop)); } var charstring selected_qop := "auth"; - - /* RFC 2617 3.2.2.2 A1 */ - var charstring digestA1 := f_sip_digest_A1(user, realm, password); - /* RFC 2617 3.2.2.3 A2 */ - var charstring digestA2 := f_sip_digest_A2(method, uri); - - /* RFC 2617 3.2.2.1 Request-Digest */ var charstring nc := f_str_tolower(hex2str(int2hex(nc_int, 8))); - var charstring req_digest := f_sip_digest_RequestDigest(digestA1, nonce, - nc, cnonce, - selected_qop, digestA2); + + var charstring req_digest; + req_digest := + f_sip_digest_gen_Authorization_Response_MD5(user, realm, password, + method, uri, selected_qop, + nonce, cnonce, nc); cred := ts_Credentials_DigestResponseMD5(user, realm, nonce, uri, req_digest, @@ -1363,6 +1403,55 @@ return valueof(authorization); } +/* RFC 3310: Same as f_sip_digest_validate_Authorization_MD5(), but using an octet buffer as password (AKAv1-MD5, pwd=RES) */ +function f_sip_digest_validate_Authorization_AKAv1MD5(Authorization authorization, charstring method, octetstring password) { + var CommaParam_List auth_pars := authorization.body.digestResponse; + var template (omit) GenericParam rx_param; + + rx_param := f_sip_param_find(auth_pars, "algorithm"); + if (istemplatekind(rx_param, "omit")) { + /* Assume MD5 if not set */ + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Algorithm param not present"); + } else { + var charstring algorithm := valueof(rx_param.paramValue); + if (f_strstr(algorithm, "AKAv1-MD5") == -1) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Unexpected algorithm: ", algorithm)); + } + } + + var charstring user := f_sip_param_get_value_present_or_fail(auth_pars, "username"); + var charstring realm := f_sip_param_get_value_present_or_fail(auth_pars, "realm"); + var charstring uri := f_sip_param_get_value_present_or_fail(auth_pars, "uri"); + var charstring nonce := f_sip_param_get_value_present_or_fail(auth_pars, "nonce"); + var charstring qop := f_sip_param_get_value_present_or_fail(auth_pars, "qop"); + var charstring response := f_sip_param_get_value_present_or_fail(auth_pars, "response"); + var charstring cnonce := f_sip_param_get_value_present_or_fail(auth_pars, "cnonce"); + var charstring nc := f_sip_param_get_value_present_or_fail(auth_pars, "nc"); + + if (f_strstr(qop, "auth") == -1) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected qop: ", qop)); + } + + var charstring exp_response := + f_sip_digest_gen_Authorization_Response_AKAv1MD5(f_sip_str_unquote(user), + f_sip_str_unquote(realm), + password, + method, + f_sip_str_unquote(uri), + qop, + f_sip_str_unquote(nonce), + f_sip_str_unquote(cnonce), + nc); + + response := f_sip_str_unquote(response); + if (response != exp_response) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Wrong digest response: ", response, + " vs exp: ", exp_response, ". Params: ", auth_pars)); + } +} + /* RFC 2617 3.5 Example */ function f_sip_digest_selftest() { /* @@ -1400,13 +1489,13 @@ ts_WwwAuthenticate( { ts_Challenge_digestCln(digestCln) } ) var Authorization authorization := - f_sip_digest_gen_Authorization(valueof(www_authenticate), - "Mufasa", - "Circle Of Life", - "GET", - "/dir/index.html", - cnonce := "0a4f113b", - nc_int := 1); + f_sip_digest_gen_Authorization_MD5(valueof(www_authenticate), + "Mufasa", + "Circle Of Life", + "GET", + "/dir/index.html", + cnonce := "0a4f113b", + nc_int := 1); var CommaParam_List digestResp := authorization.body.digestResponse; f_sip_param_match_value_or_fail(digestResp, "realm", f_sip_str_quote("testrealm(a)host.com")); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37065?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I0c6a6ff86a8b32383f17487dc9eb46d0bf2bf7c2 Gerrit-Change-Number: 37065 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: Validate Via port matches the ipsec port-c one
by pespin 07 Jun '24

07 Jun '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email ) Change subject: asterisk: IMS: Validate Via port matches the ipsec port-c one ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3f8b2112d40dd5f018abb8bc00b9e1be16586a9b Gerrit-Change-Number: 37117 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Jun 2024 12:40:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: Enable IMS port advanced mode
by pespin 07 Jun '24

07 Jun '24
Attention is currently required from: jolly. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37112?usp=email ) Change subject: asterisk: Enable IMS port advanced mode ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37112?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I287650a42c700c3959d0959620fb3f1e8e342c7d Gerrit-Change-Number: 37112 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Fri, 07 Jun 2024 12:40:34 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ttcn3-asterisk: Validate Asterisk generates correct AKAv1-MD5 digest ...
by pespin 07 Jun '24

07 Jun '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37065?usp=email ) Change subject: ttcn3-asterisk: Validate Asterisk generates correct AKAv1-MD5 digest response ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37065?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I0c6a6ff86a8b32383f17487dc9eb46d0bf2bf7c2 Gerrit-Change-Number: 37065 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Jun 2024 12:40:32 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: TC_ims_call_mo: unregister IMS during test teardown
by pespin 07 Jun '24

07 Jun '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37035?usp=email ) Change subject: asterisk: TC_ims_call_mo: unregister IMS during test teardown ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37035?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ifaf9a2991d9edd5614a3fc048357da3d1e240714 Gerrit-Change-Number: 37035 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Jun 2024 12:40:30 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: asterisk: Test sending PJSIPUnregister after registration
by pespin 07 Jun '24

07 Jun '24
Attention is currently required from: Hoernchen, jolly. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37033?usp=email ) Change subject: asterisk: Test sending PJSIPUnregister after registration ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37033?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I309732f934a6b4979367e4ce5e5475493818cdbd Gerrit-Change-Number: 37033 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Fri, 07 Jun 2024 12:40:27 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.