]> Cypherpunks repositories - gostls13.git/commit
encoding/asn1: don't encode strings with '*' as PrintableString.
authorAdam Langley <agl@golang.org>
Fri, 6 Oct 2017 17:48:01 +0000 (10:48 -0700)
committerAdam Langley <agl@golang.org>
Mon, 9 Oct 2017 19:28:47 +0000 (19:28 +0000)
commit3b186db7b4a5cc510e71f90682732eba3df72fd3
tree99f1aa9f339f8f173d8afd39855ba99cf94ed0c3
parentd4023430fd77cd6c3ee97aa4ba9f4153427c8a8f
encoding/asn1: don't encode strings with '*' as PrintableString.

The '*' character is not allowed in ASN.1 PrintableString. However, due
to wide-spread use, we permit it so that we can parse many certificates
with wildcards. However, that also meant that generic strings with
asterisks in would be encoded as PrintableString.

This change makes the default for such strings to be UTF8String. Thus,
while the code PrintableStrings containing '*', it will not generate
them unless the string type was specified in the struct field tag.

Change-Id: I2d458da36649427352eeaa50a1b6020108b2ccbd
Reviewed-on: https://go-review.googlesource.com/68990
Reviewed-by: Adam Langley <agl@golang.org>
src/encoding/asn1/asn1.go
src/encoding/asn1/marshal.go
src/encoding/asn1/marshal_test.go