Commit 1b8d4cad authored by Adam Langley's avatar Adam Langley

crypto/x509: correct default X.509 version.

The default version of an X.509 certificate is v1, which is encoded on
the wire as a zero.

Fixes #13382.

Change-Id: I5fd725c3fc8b08fd978ab694a3e2d6d2a495918b
Reviewed-on: https://go-review.googlesource.com/20548Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 1c2bdfb7
...@@ -126,7 +126,7 @@ type certificate struct { ...@@ -126,7 +126,7 @@ type certificate struct {
type tbsCertificate struct { type tbsCertificate struct {
Raw asn1.RawContent Raw asn1.RawContent
Version int `asn1:"optional,explicit,default:1,tag:0"` Version int `asn1:"optional,explicit,default:0,tag:0"`
SerialNumber *big.Int SerialNumber *big.Int
SignatureAlgorithm pkix.AlgorithmIdentifier SignatureAlgorithm pkix.AlgorithmIdentifier
Issuer asn1.RawValue Issuer asn1.RawValue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment