summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-07-08 21:26:37 +0000
committerJoshua Colp <jcolp@digium.com>2013-07-08 21:26:37 +0000
commit0f7d4d308e383d9f52e4db66ae619413bda344da (patch)
tree54c6e207059de61b0bda4a96331f34fb50bddb8f /res
parenta0684d97f59931a058f89bc7dc54c7d89e92bd95 (diff)
Treat the authentication object as invalid if digest configuration is chosen and the digest is not of the correct length.
(closes issue ASTERISK-22003) Reported by: Rusty Newton git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_sip/config_auth.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_sip/config_auth.c b/res/res_sip/config_auth.c
index bffb96c39..5f9e8d0b7 100644
--- a/res/res_sip/config_auth.c
+++ b/res/res_sip/config_auth.c
@@ -85,6 +85,11 @@ static int auth_apply(const struct ast_sorcery *sorcery, void *obj)
ast_log(LOG_ERROR, "'md5' authentication specified but no md5_cred"
"specified for auth '%s'\n", ast_sorcery_object_get_id(auth));
res = -1;
+ } else if (strlen(auth->md5_creds) != PJSIP_MD5STRLEN) {
+ ast_log(LOG_ERROR, "'md5' authentication requires digest of '%d', but"
+ "digest is of '%d' for auth '%s'\n", PJSIP_MD5STRLEN, (int)strlen(auth->md5_creds),
+ ast_sorcery_object_get_id(auth));
+ res = -1;
}
break;
case AST_SIP_AUTH_TYPE_ARTIFICIAL: