mirror of
https://github.com/google/go-attestation.git
synced 2025-02-06 02:39:11 +00:00
cc244b36f4
Context-specific fields in ASN.1 don't have explicit type tags in the ASN.1 stream, so encoding/asn1 infers the tag from the type of the struct field the stream is being unmarshalled to. By default string is assumed to be PrintableString, which is only permitted to contain a subset of possible characters. If a field is defined as UTF8String in the spec then it may contain characters that are not permitted in PrintableString, and in this case Unmarshal() will return an error. We can avoid this by explicitly tagging any context-specific UTF8Strings.