[sr-dev] [kamailio/kamailio] tls_domain subdomain matching broken (#2049)

Laszlo notifications at github.com
Wed Aug 28 13:11:00 CEST 2019


Concerns the following code: https://github.com/kamailio/kamailio/blob/master/src/modules/tls/tls_domain.c#L1567

Let's say `sname = sip.example.com` and `p->server_name = example.com`.

```
dotpos = sname->len - p->server_name.len;
> dotpos = len("sip.example.com") - len("example.com")
> dotpos = 15 - 11 = 4

if (sname->s[dotpos] == '.')
> if ("sip.example.com"[4] == '.')
```

`sip.example.com"[4]` is "e", not "." so the if clause will always fail and subdomains will never be matched.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2049
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190828/73673775/attachment.html>


More information about the sr-dev mailing list