-
Notifications
You must be signed in to change notification settings - Fork 136
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
x509-cert/der regression #978
Comments
git bisect is probably the easiest way to narrow down what change caused this. Offhand I'm not sure what it would've been. The only major changes to decoding I can think of were related to integer/serial number handling. |
Seems I guessed it then! cc @baloo |
And going patch-by-patch (ugh), 62bbe0a is the problem. |
And, I think I know the cause: +const SERIAL_NUMBER_MAX_LEN: Length = Length::new(20); |
Yeah, looks like a 21-byte serial number:
I don't think it meets the criteria for 21-byte serial numbers to be allowed, which would be adding a leading zero so the resulting number is positive. |
Well, quoting RFC 5280:
I think we should drop the SERIAL_NUMBER_MAX_LEN check from |
In the end, rfc2459 did not contain such requirement. So we should be liberal in what we accept. |
I thought we relaxed the check when parsing from DER (to allow any length) and enforced the 20bytes limitation on |
@baloo you even quoted the exact same excerpt of RFC 5280: #823 (comment) |
Looks like it fixed parsing of negative serials, but this one is just overlength? |
Yeah I think you're right. And RFC5280 doesn't seem to provide specific guidance for this case. |
That was the comment I was thinking about: #826 (comment) |
also regardless, this seems like the wrong error, despite the name:
That error is intended for TLV framing bugs which made this somewhat confusing. A better one might be |
This intends to allow user to relax checks when parsing certificate and cover for non rfc5280 compliant x509 certificates. Fixes RustCrypto#978 Fixes RustCrypto#984
This allow the user to relax checks when parsing certificate and cover for non rfc5280 compliant x509 certificates. Fixes RustCrypto#978 Fixes RustCrypto#984
This allow the user to relax checks when parsing certificate and cover for non rfc5280 compliant x509 certificates. Fixes RustCrypto#978 Fixes RustCrypto#984
I found a regression after upgrading to
x509-cert
0.2.1 /der
0.7.1. The attached certificatetest.txt can be parsed prefectly with
x509-cert
0.1 /der
0.6.1, but fails after upgrade with the following error:I could not spot any obvious issue and the position seems lame (parsing
TbsCertificate
starting from byte 4 returns an error at position 29.Reproducer (convert cert to DER for it to work):
The text was updated successfully, but these errors were encountered: