]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] encoding/gob: make x509.Certificate marshalable again
authorRuss Cox <rsc@golang.org>
Tue, 12 Mar 2024 16:51:44 +0000 (12:51 -0400)
committerThan McIntosh <thanm@google.com>
Wed, 27 Mar 2024 18:46:56 +0000 (18:46 +0000)
commit0a5b33a8839431a3959273b5ed4a5f3aa77fddfa
treeafcc7a7ef578dfc843cb50d0033c9720a4d52dbc
parent0c53f93faa04ba12bc6c2075cae4ae6608782d62
[release-branch.go1.22] encoding/gob: make x509.Certificate marshalable again

The OID type is not exported data like most of the other x509 structs.
Using it in x509.Certificate made Certificate not gob-compatible anymore,
which breaks real-world code. As a temporary fix, make gob ignore
that field, making it work as well as it did in Go 1.21.

For Go 1.23, we anticipate adding a proper fix and removing the gob
workaround. See #65633 and #66249 for more details.

For #66249.
For #65633.
Fixes #66273.

Change-Id: Idd1431d15063b3009e15d0565cd3120b9fa13f61
Reviewed-on: https://go-review.googlesource.com/c/go/+/571095
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/571715
Reviewed-by: David Chase <drchase@google.com>
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go
src/encoding/gob/encode.go
src/encoding/gob/type.go