Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls_domain subdomain matching broken #2049

Closed
laszlovl opened this issue Aug 28, 2019 · 1 comment
Closed

tls_domain subdomain matching broken #2049

laszlovl opened this issue Aug 28, 2019 · 1 comment
Labels

Comments

@laszlovl
Copy link

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.

@henningw henningw added the bug label Aug 28, 2019
miconda added a commit that referenced this issue Aug 29, 2019
@miconda
Copy link
Member

miconda commented Aug 29, 2019

Thanks @laszlovl for report and pointers to the issue. I pushed a fix to master (commit references above) and I will backport soon.

@miconda miconda closed this as completed Aug 29, 2019
miconda added a commit that referenced this issue Sep 24, 2019
- reported by GH #2049

(cherry picked from commit 16beec2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants