diff --git a/coreapi/authentication.c b/coreapi/authentication.c index b1bfc09cc..56bb1ebf2 100644 --- a/coreapi/authentication.c +++ b/coreapi/authentication.c @@ -165,13 +165,11 @@ void linphone_auth_info_write_config(LpConfig *config, LinphoneAuthInfo *obj, in lp_config_set_string(config,key,"ha1",obj->ha1); } if (obj->passwd != NULL){ - if (store_ha1_passwd){ - if (obj->ha1){ - /*if we have our ha1 and store_ha1_passwd set to TRUE, then drop the clear text password for security*/ - linphone_auth_info_set_passwd(obj, NULL); - } + if (store_ha1_passwd && obj->ha1){ + /*if we have our ha1 and store_ha1_passwd set to TRUE, then drop the clear text password for security*/ + linphone_auth_info_set_passwd(obj, NULL); }else{ - /*we store clear text password only if store_ha1_passwd is FALSE*/ + /*we store clear text password only if store_ha1_passwd is FALSE AND we have an ha1 to store. Otherwise, passwd would simply be removed, which might bring major auth issue*/ lp_config_set_string(config,key,"passwd",obj->passwd); } } diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index d6dcb3ef0..8e94cc012 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -1076,6 +1076,7 @@ static void test_list_subscribe (void) { "\n" "\t\n" "\t\n" + "\t\n" "\n" "\n";