|
|
@ -96,18 +96,18 @@ static int auth_apply(const struct ast_sorcery *sorcery, void *obj)
|
|
|
|
switch (auth->type) {
|
|
|
|
switch (auth->type) {
|
|
|
|
case AST_SIP_AUTH_TYPE_USER_PASS:
|
|
|
|
case AST_SIP_AUTH_TYPE_USER_PASS:
|
|
|
|
if (ast_strlen_zero(auth->auth_pass)) {
|
|
|
|
if (ast_strlen_zero(auth->auth_pass)) {
|
|
|
|
ast_log(LOG_ERROR, "'userpass' authentication specified but no"
|
|
|
|
ast_log(LOG_ERROR, "'userpass' authentication specified but no "
|
|
|
|
"password specified for auth '%s'\n", ast_sorcery_object_get_id(auth));
|
|
|
|
"password specified for auth '%s'\n", ast_sorcery_object_get_id(auth));
|
|
|
|
res = -1;
|
|
|
|
res = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case AST_SIP_AUTH_TYPE_MD5:
|
|
|
|
case AST_SIP_AUTH_TYPE_MD5:
|
|
|
|
if (ast_strlen_zero(auth->md5_creds)) {
|
|
|
|
if (ast_strlen_zero(auth->md5_creds)) {
|
|
|
|
ast_log(LOG_ERROR, "'md5' authentication specified but no md5_cred"
|
|
|
|
ast_log(LOG_ERROR, "'md5' authentication specified but no md5_cred "
|
|
|
|
"specified for auth '%s'\n", ast_sorcery_object_get_id(auth));
|
|
|
|
"specified for auth '%s'\n", ast_sorcery_object_get_id(auth));
|
|
|
|
res = -1;
|
|
|
|
res = -1;
|
|
|
|
} else if (strlen(auth->md5_creds) != PJSIP_MD5STRLEN) {
|
|
|
|
} else if (strlen(auth->md5_creds) != PJSIP_MD5STRLEN) {
|
|
|
|
ast_log(LOG_ERROR, "'md5' authentication requires digest of size '%d', but"
|
|
|
|
ast_log(LOG_ERROR, "'md5' authentication requires digest of size '%d', but "
|
|
|
|
"digest is '%d' in size for auth '%s'\n", PJSIP_MD5STRLEN, (int)strlen(auth->md5_creds),
|
|
|
|
"digest is '%d' in size for auth '%s'\n", PJSIP_MD5STRLEN, (int)strlen(auth->md5_creds),
|
|
|
|
ast_sorcery_object_get_id(auth));
|
|
|
|
ast_sorcery_object_get_id(auth));
|
|
|
|
res = -1;
|
|
|
|
res = -1;
|
|
|
|