]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: make x509.Certificate marshalable again
authorRuss Cox <rsc@golang.org>
Tue, 12 Mar 2024 16:51:44 +0000 (12:51 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 14 Mar 2024 16:06:11 +0000 (16:06 +0000)
commit376be64922f38a78c42c62db189be911160367f8
tree0e824935b1d9a7141a6dc7c7ac8a0c782cc784b2
parent4a1038fa52db57cee23a76fd2ea86247eff42f29
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.
Fixes #65633.

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>
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go
src/encoding/gob/encode.go
src/encoding/gob/type.go