summaryrefslogtreecommitdiff
path: root/src/encoding/asn1/asn1.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-03 12:22:19 -0400
committerRuss Cox <rsc@golang.org>2014-10-03 12:22:19 -0400
commitc5aca6fedbdd83d9153f6a00dc656aaabb0774c5 (patch)
tree26952b971b307783cde4b126c0a133f62ac3c893 /src/encoding/asn1/asn1.go
parent4eb6792aa572c7e6d3448d4cf22223b61b65724f (diff)
parent338c7ea5df93e25ac4dc143970603a1e88b26124 (diff)
downloadgo-c5aca6fedbdd83d9153f6a00dc656aaabb0774c5.tar.gz
[dev.garbage] merge default into dev.garbage
Diffstat (limited to 'src/encoding/asn1/asn1.go')
-rw-r--r--src/encoding/asn1/asn1.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/encoding/asn1/asn1.go b/src/encoding/asn1/asn1.go
index b06aec3e4..3aeb3dcc4 100644
--- a/src/encoding/asn1/asn1.go
+++ b/src/encoding/asn1/asn1.go
@@ -640,15 +640,19 @@ func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParam
// when it sees a string, so if we see a different string type on the
// wire, we change the universal type to match.
if universalTag == tagPrintableString {
- switch t.tag {
- case tagIA5String, tagGeneralString, tagT61String, tagUTF8String:
- universalTag = t.tag
+ if params.tag == nil {
+ switch t.tag {
+ case tagIA5String, tagGeneralString, tagT61String, tagUTF8String:
+ universalTag = t.tag
+ }
+ } else if params.stringType != 0 {
+ universalTag = params.stringType
}
}
// Special case for time: UTCTime and GeneralizedTime both map to the
// Go type time.Time.
- if universalTag == tagUTCTime && t.tag == tagGeneralizedTime {
+ if universalTag == tagUTCTime && params.tag == nil && t.tag == tagGeneralizedTime {
universalTag = tagGeneralizedTime
}