Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
encoding/asn1: add explicit support for ASN.1 NULL #19446
I've been working on cleaning this up but wanted to start a discussion here about the proper approach before I get too deep.
My thought was to consolidate these usages around two new funcs in the asn1 package that would return the desired explicit values, so signatures would be:
func Null() RawValue
func NullBytes() byte
I think this approach makes sense and I already have it written up with tests, but I'm interested in feedback. I was trying to figure a way to create an asn1.Null type as an alias of asn1.RawValue but it didn't seem to make much sense since the NULL type in practice can only ever have one value.
Are there other approaches that make more sense?
…NULL There were a number of places in crypto/x509 that used hardcoded representations of the ASN.1 NULL type, in both byte slice and RawValue struct forms. This change adds two new exported vars to the asn1 package for working with ASN.1 NULL in both its forms, and converts all usages from the x509 package. In addition, tests were added to exercise Marshal and Unmarshal on both vars. See #19446 for discussion. Change-Id: I63dbd0835841ccbc810bd6ec794360a84e933f1e Reviewed-on: https://go-review.googlesource.com/38660 Run-TryBot: Adam Langley <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Adam Langley <email@example.com>
My b, thanks for cleaning up. Will remember next time.…
On Mon, Jun 5, 2017 at 1:24 PM, Russ Cox ***@***.***> wrote: The commit seems to have forgotten the magic word Fixes. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#19446 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGIf1A1PEerBSmWMCBQAo2OlrZIEQpkks5sBGPogaJpZM4MWJxG> .