-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: the ParseRevocationList() doesn't seem to populate the AuthorityKeyId correctly #57461
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
Comments
cc @golang/security |
after some reading of RFC5280, the AKID is defined in section 4.2.1.1 as:
which means it is a sequence of 3 fields, RFC allows either of following two cases:
so it seems processExtensions() code only populate the AKID when it is case-1, while ParseRevocationList() simply uses the whole DER bytes. case1 is the common case, however RFC does also allow case2, I think it is ok to populate AuthorityKeyId with case1 and providing raw extensions access via Extensions field to cover case2. but I do think current ParseRevocationList() should use same method as processExtensions() |
Change https://go.dev/cl/587455 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Use x509.ParseRevocationList to parse a CRL file; the parse result of the CRL file using openssl is following
What did you expect to see?
the RevocationList.AuthorityKeyId == DA:E0:15:3C:4B:5D:BB:04:3E:D7:AE:75:DF:39:5A:D1:F6:B6:9A:CD
What did you see instead?
the RevocationList.AuthorityKeyId == 30168014DAE0153C4B5DBB043ED7AE75DF395AD1F6B69ACD
There are additional 4 bytes 30168014, I am no expert of ASN1 encoding, but I guess these 4 bytes are some sort of ASN1 encoding header/overhead.
after reading the parser.go, I found the ParseRevocationList() has following code to populate AKID
which is different from processExtensions() used by parseCertificate()
The text was updated successfully, but these errors were encountered: