mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 00:59:20 +00:00
Fix zrtp b256 patch for C89 compliance
This commit is contained in:
parent
90ba818cbf
commit
07849de23e
1 changed files with 41 additions and 31 deletions
|
|
@ -1601,13 +1601,15 @@ static char * seperate_string_list(char **str) {
|
|||
|
||||
MsZrtpCryptoTypesCount linphone_core_get_zrtp_key_agreement_suites(LinphoneCore *lc, MSZrtpKeyAgreement keyAgreements[MS_MAX_ZRTP_CRYPTO_TYPES]){
|
||||
char * zrtpConfig = (char*)lp_config_get_string(lc->config, "sip", "zrtp_key_agreements_suites", NULL);
|
||||
if (zrtpConfig == NULL)
|
||||
return 0;
|
||||
MsZrtpCryptoTypesCount key_agreements_count = 0;
|
||||
char * entry, * origPtr;
|
||||
if (zrtpConfig == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
MsZrtpCryptoTypesCount key_agreements_count = 0;
|
||||
char * entry, * origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
while ((entry = seperate_string_list(&zrtpConfig))) {
|
||||
origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
while ((entry = seperate_string_list(&zrtpConfig))) {
|
||||
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));
|
||||
|
|
@ -1615,18 +1617,20 @@ MsZrtpCryptoTypesCount linphone_core_get_zrtp_key_agreement_suites(LinphoneCore
|
|||
}
|
||||
}
|
||||
|
||||
free(origPtr);
|
||||
free(origPtr);
|
||||
return key_agreements_count;
|
||||
}
|
||||
|
||||
MsZrtpCryptoTypesCount linphone_core_get_zrtp_cipher_suites(LinphoneCore *lc, MSZrtpCipher ciphers[MS_MAX_ZRTP_CRYPTO_TYPES]){
|
||||
char * zrtpConfig = (char*)lp_config_get_string(lc->config, "sip", "zrtp_cipher_suites", NULL);
|
||||
if (zrtpConfig == NULL)
|
||||
return 0;
|
||||
MsZrtpCryptoTypesCount cipher_count = 0;
|
||||
char * entry, * origPtr;
|
||||
if (zrtpConfig == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
MsZrtpCryptoTypesCount cipher_count = 0;
|
||||
char * entry, * origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
while ((entry = seperate_string_list(&zrtpConfig))) {
|
||||
const MSZrtpCipher cipher = ms_zrtp_cipher_from_string(entry);
|
||||
if (cipher != MS_ZRTP_CIPHER_INVALID) {
|
||||
|
|
@ -1635,18 +1639,20 @@ MsZrtpCryptoTypesCount linphone_core_get_zrtp_cipher_suites(LinphoneCore *lc, MS
|
|||
}
|
||||
}
|
||||
|
||||
free(origPtr);
|
||||
free(origPtr);
|
||||
return cipher_count;
|
||||
}
|
||||
|
||||
MsZrtpCryptoTypesCount linphone_core_get_zrtp_hash_suites(LinphoneCore *lc, MSZrtpHash hashes[MS_MAX_ZRTP_CRYPTO_TYPES]){
|
||||
char * zrtpConfig = (char*)lp_config_get_string(lc->config, "sip", "zrtp_hash_suites", NULL);
|
||||
if (zrtpConfig == NULL)
|
||||
return 0;
|
||||
|
||||
MsZrtpCryptoTypesCount hash_count = 0;
|
||||
char * entry, * origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
char * entry, * origPtr;
|
||||
if (zrtpConfig == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
while ((entry = seperate_string_list(&zrtpConfig))) {
|
||||
const MSZrtpHash hash = ms_zrtp_hash_from_string(entry);
|
||||
if (hash != MS_ZRTP_HASH_INVALID) {
|
||||
|
|
@ -1655,18 +1661,20 @@ MsZrtpCryptoTypesCount linphone_core_get_zrtp_hash_suites(LinphoneCore *lc, MSZr
|
|||
}
|
||||
}
|
||||
|
||||
free(origPtr);
|
||||
free(origPtr);
|
||||
return hash_count;
|
||||
}
|
||||
|
||||
MsZrtpCryptoTypesCount linphone_core_get_zrtp_auth_suites(LinphoneCore *lc, MSZrtpAuthTag authTags[MS_MAX_ZRTP_CRYPTO_TYPES]){
|
||||
char * zrtpConfig = (char*)lp_config_get_string(lc->config, "sip", "zrtp_auth_suites", NULL);
|
||||
if (zrtpConfig == NULL)
|
||||
return 0;
|
||||
|
||||
MsZrtpCryptoTypesCount auth_tag_count = 0;
|
||||
char * entry, * origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
char * entry, * origPtr;
|
||||
if (zrtpConfig == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
while ((entry = seperate_string_list(&zrtpConfig))) {
|
||||
const MSZrtpAuthTag authTag = ms_zrtp_auth_tag_from_string(entry);
|
||||
if (authTag != MS_ZRTP_AUTHTAG_INVALID) {
|
||||
|
|
@ -1675,18 +1683,20 @@ MsZrtpCryptoTypesCount linphone_core_get_zrtp_auth_suites(LinphoneCore *lc, MSZr
|
|||
}
|
||||
}
|
||||
|
||||
free(origPtr);
|
||||
free(origPtr);
|
||||
return auth_tag_count;
|
||||
}
|
||||
|
||||
MsZrtpCryptoTypesCount linphone_core_get_zrtp_sas_suites(LinphoneCore *lc, MSZrtpSasType sasTypes[MS_MAX_ZRTP_CRYPTO_TYPES]){
|
||||
char * zrtpConfig = (char*)lp_config_get_string(lc->config, "sip", "zrtp_sas_suites", NULL);
|
||||
if (zrtpConfig == NULL)
|
||||
return 0;
|
||||
|
||||
MsZrtpCryptoTypesCount sas_count = 0;
|
||||
char * entry, * origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
char * entry, * origPtr;
|
||||
if (zrtpConfig == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
origPtr = strdup(zrtpConfig);
|
||||
zrtpConfig = origPtr;
|
||||
while ((entry = seperate_string_list(&zrtpConfig))) {
|
||||
const MSZrtpSasType type = ms_zrtp_sas_type_from_string(entry);
|
||||
if (type != MS_ZRTP_SAS_INVALID) {
|
||||
|
|
@ -1695,7 +1705,7 @@ MsZrtpCryptoTypesCount linphone_core_get_zrtp_sas_suites(LinphoneCore *lc, MSZrt
|
|||
}
|
||||
}
|
||||
|
||||
free(origPtr);
|
||||
free(origPtr);
|
||||
return sas_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue