[sr-dev] git:master:16beec2b: tls: proper dot position for matching subdomains

Daniel-Constantin Mierla miconda at gmail.com
Thu Aug 29 18:58:39 CEST 2019


Module: kamailio
Branch: master
Commit: 16beec2b7660d416a05f069695b4ce18e8b4e795
URL: https://github.com/kamailio/kamailio/commit/16beec2b7660d416a05f069695b4ce18e8b4e795

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-08-29T18:51:17+02:00

tls: proper dot position for matching subdomains

- reported by GH #2049

---

Modified: src/modules/tls/tls_domain.c

---

Diff:  https://github.com/kamailio/kamailio/commit/16beec2b7660d416a05f069695b4ce18e8b4e795.diff
Patch: https://github.com/kamailio/kamailio/commit/16beec2b7660d416a05f069695b4ce18e8b4e795.patch

---

diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c
index fff4603eba..1ca62ff200 100644
--- a/src/modules/tls/tls_domain.c
+++ b/src/modules/tls/tls_domain.c
@@ -1563,7 +1563,7 @@ tls_domain_t* tls_lookup_cfg(tls_domains_cfg_t* cfg, int type,
 				if ((p->server_name_mode==KSR_TLS_SNM_INCDOM
 							|| p->server_name_mode==KSR_TLS_SNM_SUBDOM)
 						&& (p->server_name.len<sname->len)) {
-					dotpos = sname->len - p->server_name.len;
+					dotpos = sname->len - p->server_name.len - 1;
 					if(sname->s[dotpos] == '.'
 							&& strncasecmp(p->server_name.s,
 									sname->s + dotpos + 1,




More information about the sr-dev mailing list