Skip to content

fix Compile Error #19

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

Closed
wants to merge 1 commit into from
Closed

Conversation

koba-ninkigumi
Copy link

composite struct literal encoding/asn1.ObjectIdentifier with unkeyed fields

composite struct literal encoding/asn1.ObjectIdentifier with unkeyed fields
@gopherbot
Copy link
Contributor

Hi! Thanks for the PR!

Unfortunately, the Go project doesn't use GitHub's Pull Requests,
so we can't accept your contribution this way.
We instead use a code review system called Gerrit.

The good news is, I'm here to help.

From here, you have two options:

  1. Read our Contribution Guidelines to learn how to send a change with Gerrit.
  2. Or, create an issue about the issue this PR addresses, so that someone else can fix it.

I'm going to close this Pull Request now.
Please don't be offended! :-)

Thanks again,

GopherBot (on behalf of the Go Team)

@gopherbot gopherbot closed this Nov 27, 2016
@bradfitz
Copy link
Contributor

I'm confused. According to https://build.golang.org/ , the crypto subrepo is building fine.

@koba-ninkigumi
Copy link
Author

@bradfitz

I fixed this issue.
labstack/echo#746

disccussion:
https://groups.google.com/d/msg/google-appengine-stackoverflow/CrMv4g11RiY/HrQx1CQ5BAAJ

The fix for the composite error involved changing from this:

oidData = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 1}

to this:

oidData = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 7, 1})

@bradfitz
Copy link
Contributor

Sounds like a bug elsewhere, not in the crypto repo.

@koba-ninkigumi
Copy link
Author

@bradfitz Please tell me the reason why only the code from line 140 to 151 is different from the codes of other places. If you think that you do not need to specify []int, why do not you remove all? You will get errors.

crypto/ocsp/ocsp.go: 140-151

oidSignatureMD2WithRSA      = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 2}
oidSignatureMD5WithRSA      = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 4}
oidSignatureSHA1WithRSA     = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}
oidSignatureSHA256WithRSA   = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 11}
oidSignatureSHA384WithRSA   = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 12}
oidSignatureSHA512WithRSA   = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 13}
oidSignatureDSAWithSHA1     = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 3}
oidSignatureDSAWithSHA256   = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 3, 2}
oidSignatureECDSAWithSHA1   = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 1}
oidSignatureECDSAWithSHA256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 2}
oidSignatureECDSAWithSHA384 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 3}
oidSignatureECDSAWithSHA512 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 4}

crypto/ocsp/ocsp.go: 26

var idPKIXOCSPBasic = asn1.ObjectIdentifier([]int{1, 3, 6, 1, 5, 5, 7, 48, 1, 1})

crypto/ocsp/ocsp.go: 155-158

crypto.SHA1:   asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}),
crypto.SHA256: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 1}),
crypto.SHA384: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 2}),
crypto.SHA512: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 3}),

@bradfitz
Copy link
Contributor

Both ways are valid ways to write it in Go.

The bug is that App Engine uses cmd/vet, and cmd/vet shouldn't complain about "composite struct literal encoding/asn1.ObjectIdentifier with unkeyed fields" for that type.

/cc @josharian @zombiezen

@bradfitz
Copy link
Contributor

Oh, this is a dup of golang/go#9171

This was already fixed. App Engine just needs an update.

@poweroftrue
Copy link

thanks alot @koba-ninkigumi @bradfitz 😄
as app engine sdk release notes says:

Go runtime notes

App Engine Go runtime updated to Go 1.6.2.

and in the latest version of app engine is 1.9.46:

Go runtime notes

This release does not include a new Go SDK

it turns out to be issue in go1.6 but it's as @bradfitz says it already fixed but we should wait until go app engine sdk upgrade to go1.7 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants