]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: omit empty extensions SEQUENCE
authorRoland Shoemaker <roland@golang.org>
Wed, 13 Apr 2022 04:22:22 +0000 (21:22 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 13 Apr 2022 18:05:20 +0000 (18:05 +0000)
commita78db879b31b072c37c6d46cc404d8e131d54349
tree26b7a902ec6122a9588788c919106fc0c591c501
parent66f03f79dadc6005d30a6edf4419b8f6c0fa6398
crypto/x509: omit empty extensions SEQUENCE

In CreateCertificate, if there are no extensions, don't include the
extensions SEQUENCE in the encoded certificate.

Why, you might ask, does the encoding/asn1 tag 'optional' not do
the same thing as 'omitempty'? Good question, no clue, fixing that
would probably break things in horrific ways.

Fixes #52319

Change-Id: I84fdd5ff3e4e0b0a59e3bf86e7439753b1e1477b
Reviewed-on: https://go-review.googlesource.com/c/go/+/399827
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go