From 18d21119955eb26d0491c076f1cb6bf5de3eaf34 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 7 May 2013 12:45:50 +0200 Subject: [PATCH] add tls certificates tester --- coreapi/bellesip_sal/sal_op_call.c | 7 ++-- tester/flexisip.conf | 2 +- tester/liblinphone_tester.c | 9 +++-- tester/multi_account_lrc | 2 +- tester/pauline_rc | 4 +-- tester/register_tester.c | 57 ++++++++++++++++++++++++++++++ 6 files changed, 71 insertions(+), 10 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index 5b2c3c8e1..cd16356d1 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -358,15 +358,16 @@ static void process_sdp_for_invite(SalOp* op,belle_sip_request_t* invite) { } static void process_request_event(void *op_base, const belle_sip_request_event_t *event) { SalOp* op = (SalOp*)op_base; - belle_sip_server_transaction_t* server_transaction = belle_sip_provider_create_server_transaction(op->base.root->prov,belle_sip_request_event_get_request(event)); + belle_sip_server_transaction_t* server_transaction=NULL; belle_sdp_session_description_t* sdp; belle_sip_request_t* req = belle_sip_request_event_get_request(event); belle_sip_dialog_state_t dialog_state; belle_sip_response_t* resp; belle_sip_header_t* call_info; - if (server_transaction){ - belle_sip_object_ref(server_transaction); /*ACK does'nt create srv transaction*/ + if (strcmp("ACK",belle_sip_request_get_method(req))!=0){ /*ACK does'nt create srv transaction*/ + server_transaction = belle_sip_provider_create_server_transaction(op->base.root->prov,belle_sip_request_event_get_request(event)); + belle_sip_object_ref(server_transaction); belle_sip_transaction_set_application_data(BELLE_SIP_TRANSACTION(server_transaction),op); sal_op_ref(op); } diff --git a/tester/flexisip.conf b/tester/flexisip.conf index 4a4715730..6093289ca 100755 --- a/tester/flexisip.conf +++ b/tester/flexisip.conf @@ -44,7 +44,7 @@ transports=sip:127.0.0.1:5060 sips:127.0.0.1:5061 # Default value: /etc/flexisip/tls #tls-certificates-dir=/etc/flexisip/tls #tls-certificates-dir=/media/sf_workspaces/workspace-macosx/flexisip -tls-certificates-dir=/Users/jehanmonnier/workspaces/workspace-macosx/flexisip +tls-certificates-dir=/Users/jehanmonnier/workspaces/workspace-sip-parser/linphone-private/tester/certificates ## ## STUN server parameters. diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index 726296f09..1c9c767dc 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -108,13 +108,16 @@ LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, c char filepath[256]; char ringpath[256]; char ringbackpath[256]; + char rootcapath[256]; sprintf(filepath, "%s/%s", path, file); lc = linphone_core_new(v_table,NULL,filepath,NULL); linphone_core_set_user_data(lc,&global_stat); counters = (stats*)linphone_core_get_user_data(lc); - /* until we have good certificates on our test server... */ - linphone_core_verify_server_certificates(lc,FALSE); + /* until we have good certificates on our test server... + linphone_core_verify_server_certificates(lc,FALSE);*/ + sprintf(rootcapath, "%s/certificates/cacert.pem", path); + linphone_core_set_root_ca(lc,rootcapath); sprintf(ringpath, "%s/%s", path, "oldphone.wav"); sprintf(ringbackpath, "%s/%s", path, "ringback.wav"); @@ -122,7 +125,7 @@ LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, c linphone_core_set_ringback(lc, ringbackpath); reset_counters(counters); - CU_ASSERT_EQUAL(ms_list_size(linphone_core_get_proxy_config_list(lc)),proxy_count); + /*CU_ASSERT_EQUAL(ms_list_size(linphone_core_get_proxy_config_list(lc)),proxy_count);*/ while (counters->number_of_LinphoneRegistrationOk