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

TS-4459 - Force domain names in cert to lower on insert into lookup tree #647

Closed
wants to merge 0 commits into from

Conversation

reveller
Copy link
Contributor

This commit resolves domain names in a cert which need to be lower cased before being inserted into the lookup table.

This was patched by Michael Janiszewski at GoDaddy.

@zwoop zwoop added the TLS label May 19, 2016
@zwoop zwoop added this to the 7.0.0 milestone May 19, 2016
@jpeach
Copy link
Contributor

jpeach commented May 20, 2016

I don't think that we should do the malloc and lowercasing on every lookup.

How about this ... when the caller indexes the certificate, check whether the name is lowercased. If not, insert 2 entries; one lowercased and one with the case provided. Then on the lookup you ought to hit one of the entries but you don't care which one.

@mjaniszewski-godaddy
Copy link

The point regarding malloc/lowercase on each lookup is a good one, but indexing two separate versions of the cert won't cover all cases.

Let's say a cert has a common name of EXAMPLE.COM, and we index said cert under both EXAMPLE.COM and example.com. In this model, requests coming in for EXAMPLE.com/Example.COM/etc. won't match. According to the relevant RFC (http://tools.ietf.org/html/rfc6125#section-6.4.1), we should be matching in a case insensitive manner, regardless of the case present in the cert CN/SubjectAltName.

Would you be ok with a check on lookup to determine if the hostname needs to be modified, along with a conditional malloc/lowercase/free based on that? That should avoid the hit in the vast majority of cases.

@jpeach
Copy link
Contributor

jpeach commented Jun 2, 2016

Yep. We use TS_MAX_HOST_NAME_LEN in various places, so we already have a fixed upper limit on host names. So how about we always lowercase when inserting, and lower case on lookup if the presented case fails? We don't need to malloc, just use a stack temporary to do the lowercasing.

@zwoop
Copy link
Contributor

zwoop commented Jun 27, 2016

Adding @shinrich for review too please.

@shinrich
Copy link
Member

I'd been watching this, but @jpeach had already made the relevant comments. I like using a stack buffer of size TS_MAX_HOST_NAME_LEN. Avoids allocation pain. Keeps things simple. Otherwise, this looks like a good change.

@zwoop
Copy link
Contributor

zwoop commented Jul 21, 2016

@reveller Any update? :)

@reveller
Copy link
Contributor Author

I just spoke to the developer about this yesterday and told him he either needs to update it or I am going to close this for now. He has indicated he will update it soon and remove the allocations.

@reveller reveller closed this Aug 26, 2016
@zwoop zwoop modified the milestone: 7.0.0 May 4, 2017
@zwoop zwoop unassigned jpeach May 4, 2017
shinrich added a commit to shinrich/trafficserver that referenced this pull request Jan 9, 2018
YTSATS-1689: Don't drop core on shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants