-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
encoding/asn1: valid GeneralizedTime with UTC offset of +0000 not parsed #33192
Comments
Issue appears to be a duplicate of #15842 . The patch appears to have been ready during the 1.11 time frame but hasn't made the cut since. I replied to the associated CL to see if someone can make a call. |
Yeah, the patch for #15842 just makes it so The problem here is that when |
My patch for #15842 has the purpose of enabling the parsing of fractional digits in GeneralizedTime (From my understanding of X.690, p. 20, fractional digits are allowed in GeneralizedTime, but not in UTCTime). This issue (33192), though, is related to UTCTime, not GeneralizedTime. (So the patch for #15842 won't fix this issue already for the reason that a different function is called for parsing).
the output will contain the line
I wonder if the One approach would be to make asn1.go:parseUTCTime conservatively accept a
Since parseUTCTime already accepts non-standard time differentials like +0200, fixing the equality-test for For completeness, please also see the fix for #19890, which could complement a fix for this issue, addressing the marshaling side. |
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
)?macOS 10.14.5
go env
OutputWhat did you do?
Attempted to upgrade to TLS on a server I don't control.
It appears that the time format is valid, according to the documentation I've found (here, among other places).
Public cert from that server included in this failing test:
What did you expect to see?
The certificate would get parsed.
What did you see instead?
asn1: time did not serialize back to the original value and may be invalid: given "360329021729+0000", but serialized as "360329021729Z"
The problem looks like it may be in the same area as #15842.
The text was updated successfully, but these errors were encountered: