encoding/asn1: Unmarshalling implicitly tagged GeneralizedTime unmarshalls as UTCTime #28897
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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?
Add an implicitly tagged field to a struct of type time.Time and tagged it with "generalized". Marshalled the struct and then unmarshalled it. Unmarshalling failed because it parses the time as a UTCTime.
https://play.golang.org/p/XOKSctdaYl5
What did you expect to see?
Unmarshalling observe the "generalized" attribute tag and parse the time as a Generalized Time
What did you see instead?
Unmarshalling parsed the time as a UTCTime which failed and produced the zero val for the time.
Looking at the current test suite, it appears that the implementation of the "generalized" attribute tag is incomplete:
But there IS a timeType set by the use of the "generalized" tag.
The text was updated successfully, but these errors were encountered: