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

Question about BadDer(DNS name) #265

Open
3pointer opened this issue Nov 13, 2022 · 2 comments
Open

Question about BadDer(DNS name) #265

3pointer opened this issue Nov 13, 2022 · 2 comments

Comments

@3pointer
Copy link

Hi, I got an BadDER error when use rust-tls to build non-web tls application.
After investigation. I found the cause of BadDER is the DNS name *.b is not valid.

I've tried some format.

a.b -> legal
*.b  -> BadDER
*b -> BadDER
*.b.b -> legal

After check the code, I found it's was intentional.

webpki/src/name/dns_name.rs

Lines 568 to 572 in b481381

// Like NSS, require at least two labels to follow the wildcard label.
// TODO: Allow the TrustDomain to control this on a per-eTLD+1 basis,
// similar to Chromium. Even then, it might be better to still enforce
// that there are at least two labels after the wildcard.
if label_count < 3 {

May I know why it had this check or based on what specification?

Because I'm not the one who generate this certificate. if the DNS name is illegal or it has security issue, I think I need some evidence to convince others.

Thks

@3pointer
Copy link
Author

3pointer commented Nov 14, 2022

And it seems a little strange.
When I put the illegal DNS name after the legal DNS name in my test env. it works. but it doesn't work if I change the order.

For example
It works:

[alt_names]
DNS.1 = localhost
DNS.2 = *.b
IP.1 = 127.0.0.1

Doesn't work:

[alt_names]
DNS.1 = *.b
DNS.2 = localhost
IP.1 = 127.0.0.1

@3pointer
Copy link
Author

3pointer commented Nov 14, 2022

So I guess maybe return Some(false) is better than return None? @briansmith could you help confirm this?

return None;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant