-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: CreateCRL allows non-UTC times in revokedCerts list #16686
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
@agl, maybe asn1 should just convert all times to UTC? Is there really ever a need for a time zone offset in any asn1 encoding we care about? |
@rsc Why did you remove NeedsFix from this issue? |
Maybe editing error. Maybe I meant to make it NeedsDecision for @agl. |
ping @agl for decision about only ever encoding UTC. Otherwise can move any fix to Go 1.9. Thanks. |
CL https://golang.org/cl/34245 mentions this issue. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.7rc6 linux/amd64
go env
)?The CreateCRL function takes the given revoked certificate list and passes it straight to the asn1 package for marshaling. The asn1 package encodes
time.Time
values with offsets.However, per RFC 5280 section 5.1.2.6, revocation time values must be expressed as described in https://tools.ietf.org/html/rfc5280#section-5.1.2.4 which itself indicates that the time must be expressed as defined in https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1 -- and here, it specifies that all such times must be UTC.
Allowing CRLs to be created with non-UTC time values is not-RFC compliant. At worst, this is probably a documentation issue -- the docs should warn the caller that all times must be UTC. At best, the code would walk through the list of revoked certificates and ensure that the time values contained within are in UTC.
CRLs created with time zones that are disallowed per RFC.
CRLs created with time zones that are allowed per RFC.
The text was updated successfully, but these errors were encountered: