Module: kamailio Branch: master Commit: f27d15ba6e1116a9f47e654d2bd0f4d3b73168a3 URL: https://github.com/kamailio/kamailio/commit/f27d15ba6e1116a9f47e654d2bd0f4d3...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2023-04-28T09:19:31+02:00
auth_db: exported www_authenticate_method() to kemi
---
Modified: src/modules/auth_db/auth_db_mod.c Modified: src/modules/auth_db/authorize.c Modified: src/modules/auth_db/authorize.h
---
Diff: https://github.com/kamailio/kamailio/commit/f27d15ba6e1116a9f47e654d2bd0f4d3... Patch: https://github.com/kamailio/kamailio/commit/f27d15ba6e1116a9f47e654d2bd0f4d3...
---
diff --git a/src/modules/auth_db/auth_db_mod.c b/src/modules/auth_db/auth_db_mod.c index 5d54bdf4bd4..49556cd71de 100644 --- a/src/modules/auth_db/auth_db_mod.c +++ b/src/modules/auth_db/auth_db_mod.c @@ -452,6 +452,11 @@ static sr_kemi_t sr_kemi_auth_db_exports[] = { { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("auth_db"), str_init("www_authenticate_method"), + SR_KEMIP_INT, ki_www_authenticate_method, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } } }; diff --git a/src/modules/auth_db/authorize.c b/src/modules/auth_db/authorize.c index e433534284c..5fd7cce61ad 100644 --- a/src/modules/auth_db/authorize.c +++ b/src/modules/auth_db/authorize.c @@ -444,6 +444,11 @@ int www_authenticate2(struct sip_msg* _m, char* _realm, char* _table, char *_met &smethod); }
+int ki_www_authenticate_method(sip_msg_t *msg, str *realm, str *table, str *method) +{ + return digest_authenticate(msg, realm, table, HDR_AUTHORIZATION_T, method); +} + /** * */ diff --git a/src/modules/auth_db/authorize.h b/src/modules/auth_db/authorize.h index fd26f39e75e..b67ba7121f9 100644 --- a/src/modules/auth_db/authorize.h +++ b/src/modules/auth_db/authorize.h @@ -46,6 +46,8 @@ int proxy_authenticate(struct sip_msg* _msg, char* _realm, char* _table); int www_authenticate(struct sip_msg* _msg, char* _realm, char* _table); int www_authenticate2(struct sip_msg* _msg, char* _realm, char* _table, char *_method);
+int ki_www_authenticate_method(sip_msg_t *msg, str *realm, str *table, str *method); + /* * Authenticate using WWW/Proxy-Authorize header field */