From 566d432f54b4692b20a09317293e80e41d9bd3da Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Sat, 5 Feb 2011 13:55:37 -0500 Subject: [PATCH] asn1: marshal true as 255, not 1. OS X, at least, appears to test |byte == 255|, not |byte != 0| to establish if a bool is true or false. R=golang-dev, r CC=golang-dev https://golang.org/cl/4128064 --- src/pkg/asn1/marshal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/asn1/marshal.go b/src/pkg/asn1/marshal.go index 24548714b21..57b8f20ba7f 100644 --- a/src/pkg/asn1/marshal.go +++ b/src/pkg/asn1/marshal.go @@ -317,7 +317,7 @@ func marshalBody(out *forkableWriter, value reflect.Value, params fieldParameter switch v := value.(type) { case *reflect.BoolValue: if v.Get() { - return out.WriteByte(1) + return out.WriteByte(255) } else { return out.WriteByte(0) }