]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: expose arbitary X.509 extensions.
authorAdam Langley <agl@golang.org>
Fri, 30 Aug 2013 14:14:45 +0000 (10:14 -0400)
committerAdam Langley <agl@golang.org>
Fri, 30 Aug 2013 14:14:45 +0000 (10:14 -0400)
commit87404c98871a1b912aaae93aea34561952fde0b8
tree0b90e9d29054f896199e280693bc7dce259672f8
parent79dca0327ed8a7f65f3680e72cb1dcf4caaed457
crypto/x509: expose arbitary X.509 extensions.

This change allows people who want to parse or set odd X.509 extensions
to do so without having to add support for them all to the package.

I tried to make it so that only a single member: Extensions would be
needed. However, that would mean detecting when the caller had altered
the contents of it so that parsing and marshaling a certificate
wouldn't ignore all changes to the other members. This ended up being
messy, thus the current design where there are two members: one for
reading and another for writing.

As crypto/x509 adds support for more extensions in the future, the raw
extensions will still be in Extensions for older code that expects it
there. Also, future extensions will be overridden by any raw extensions
added to ExtraExtensions by code that was written before support was
added.

R=golang-dev, r
CC=golang-dev, jpsugar
https://golang.org/cl/12056043
src/pkg/crypto/x509/x509.go
src/pkg/crypto/x509/x509_test.go