]> Cypherpunks repositories - gostls13.git/commit
encoding/asn1: promote untyped strings to UTF8 as needed.
authorAdam Langley <agl@golang.org>
Tue, 10 Jul 2012 22:23:30 +0000 (18:23 -0400)
committerAdam Langley <agl@golang.org>
Tue, 10 Jul 2012 22:23:30 +0000 (18:23 -0400)
commiteeffa738a912a8c4d283c37d84628b64ecc1b98f
tree4d6977cde9c99ea6b49c70046b12c5f8eb97bd49
parent685a61df7ec3c559b1369576731b66d32a5790b8
encoding/asn1: promote untyped strings to UTF8 as needed.

Previously, strings that didn't have an explicit ASN.1 string type
were taken to be ASN.1 PrintableStrings. This resulted in an error if
a unrepresentable charactor was included.

For compatibility reasons, I'm too afraid to switch the default string
type to UTF8String, but this patch causes untyped strings to become
UTF8Strings if they contain a charactor that's not valid in a
PrintableString.

Fixes #3791.

R=golang-dev, bradfitz, r, r
CC=golang-dev
https://golang.org/cl/6348074
src/pkg/crypto/x509/x509_test.go
src/pkg/encoding/asn1/common.go
src/pkg/encoding/asn1/marshal.go
src/pkg/encoding/asn1/marshal_test.go