mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
configfile now supports setting zrtps key agreements
Signed-off-by: Johan Pascal <johan.pascal@belledonne-communications.com>
This commit is contained in:
parent
cc8a3a9f7c
commit
e2dbfd5477
3 changed files with 38 additions and 0 deletions
|
|
@ -2702,6 +2702,8 @@ static void setZrtpCryptoTypesParameters(MSZrtpParams *params, LinphoneCore *lc)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
params->keyAgreementsCount = linphone_core_get_zrtp_key_agreements(lc, params->keyAgreements);
|
||||
}
|
||||
|
||||
void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_muted, bool_t send_ringbacktone){
|
||||
|
|
|
|||
|
|
@ -1581,6 +1581,41 @@ const MSCryptoSuite * linphone_core_get_srtp_crypto_suites(LinphoneCore *lc){
|
|||
return result;
|
||||
}
|
||||
|
||||
static char * seperate_string_list(char **str) {
|
||||
char *ret;
|
||||
|
||||
if (str == NULL) return NULL;
|
||||
if (*str == NULL) return NULL;
|
||||
if (**str == '\0') return NULL;
|
||||
|
||||
ret = *str;
|
||||
for ( ; **str!='\0' && **str!=' ' && **str!=','; (*str)++);
|
||||
if (**str == '\0') {
|
||||
return ret;
|
||||
} else {
|
||||
**str = '\0';
|
||||
do { (*str)++; } while (**str!='\0' && (**str==' ' || **str==','));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
MsZrtpCryptoTypesCount linphone_core_get_zrtp_key_agreements(LinphoneCore *lc, MSZrtpKeyAgreement keyAgreements[MS_MAX_ZRTP_CRYPTO_TYPES]){
|
||||
char *config=strdup(lp_config_get_string(lc->config, "sip", "zrtp_key_agreements_suites", "MS_ZRTP_KEY_AGREEMENT_DH3K, MS_ZRTP_KEY_AGREEMENT_DH2K"));
|
||||
char *entry;
|
||||
MsZrtpCryptoTypesCount key_agreements_count = 0;
|
||||
|
||||
if (config == NULL) return 0;
|
||||
|
||||
while ((entry = seperate_string_list(&config))) {
|
||||
const MSZrtpKeyAgreement agreement = ms_zrtp_key_agreement_from_string(entry);
|
||||
if (agreement != MS_ZRTP_KEY_AGREEMENT_INVALID) {
|
||||
ms_message("Configured zrtp key agreement: '%s'", ms_zrtp_key_agreement_to_string(agreement));
|
||||
keyAgreements[key_agreements_count++] = agreement;
|
||||
}
|
||||
}
|
||||
|
||||
return key_agreements_count;
|
||||
}
|
||||
|
||||
|
||||
const char ** linphone_core_get_supported_file_formats(LinphoneCore *core){
|
||||
|
|
|
|||
|
|
@ -1048,6 +1048,7 @@ static MS2_INLINE bool_t payload_type_enabled(const PayloadType *pt) {
|
|||
bool_t is_payload_type_number_available(const MSList *l, int number, const PayloadType *ignore);
|
||||
|
||||
const MSCryptoSuite * linphone_core_get_srtp_crypto_suites(LinphoneCore *lc);
|
||||
MsZrtpCryptoTypesCount linphone_core_get_zrtp_key_agreements(LinphoneCore *lc, MSZrtpKeyAgreement keyAgreements[MS_MAX_ZRTP_CRYPTO_TYPES]);
|
||||
|
||||
/** Belle Sip-based objects need unique ids
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue