New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding/asn1: add explicit support for ASN.1 NULL #19446
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Comments
bradfitz
added
the
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
label
Mar 21, 2017
This seems like a reasonable cleanup. I'm not too keen on adding more to |
I'll submit the very simple patch I have and reference this discussion. EDIT: Patch submitted here: https://go-review.googlesource.com/38660 |
CL https://golang.org/cl/38660 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
Apr 24, 2017
…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 <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
The commit seems to have forgotten the magic word Fixes. |
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>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
I've been working on cleaning this up but wanted to start a discussion here about the proper approach before I get too deep.
There are a couple of places in crypto/x509/x509.go that use hardcoded byte slices representing the DER-encoding of ASN.1 NULL. See x509.go#L421 and x509.go#L932.
Additionally, there are four places in crypto/x509/x509.go where identical asn1.RawValue structs representing the unmarshaled ASN.1 NULL type are used. See x509.go#L72 and x509.go#L359 for instance.
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:
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?
The text was updated successfully, but these errors were encountered: