Open Bug 1246117 Opened 5 years ago Updated 3 years ago
Return a more descriptive error code from mozilla::pkix for malformed DNS IDs in certificates, instead of ERROR
mozilla::pkix throws ERROR_BAD_DER in cases that have nothing to do with DER. A wrong dns id for example causes a DER error . To reproduce go to . While the certificate at  is fine it contains an invalid dns name. It thus fails IsValidDNSID and a DER error is thrown, which is unrelated to the actual problem.  https://dxr.mozilla.org/mozilla-central/rev/584870f1cbc5d060a57e147ce249f736956e2b62/security/pkix/lib/pkixnames.cpp#1052  https://ssl.lenaundniklas.de/
"ERROR_BAD_DER" really means "Failed to parse" generically. There is another bug on file that changes the parsing code to use a boolean-ish Input::Result type to make that clearer. (The "BAD_DER" part comes from origin of the parsing code only being for DER.) On the one hand, it isn't the worst idea in the world for mozilla::pkix to return some other error code. On the other hand, the CA shouldn't have issued such certificates in the first place, and any such certificates should be revoked. IMO, it's not worth adding extra code to mozilla::pkix just to deal with such certificates, which truly are malformed.
Summary: Refactor mozilla::pkix error codes → Return a more descriptive error code for malformed DNS IDs in certificates, instead of ERROR_BAD_DER
Agree, we shouldn't add code to allow malformed certs (though safari and chrome are fine with it). The problem on the CA has been fixed already . But a more descriptive error message would be really nice here.  https://github.com/letsencrypt/boulder/issues/1440
I mean, I'm not sure it's worthwhile to add extra code to return a better error code. Maybe if it is really, really simple.
The platform currently treats bad DER as a hostname mismatch in these cases.
Summary: Return a more descriptive error code for malformed DNS IDs in certificates, instead of ERROR_BAD_DER → Return a more descriptive error code from mozilla::pkix for malformed DNS IDs in certificates, instead of ERROR_BAD_DER
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.