]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: parse CSRs with a critical flag in the requested extensions.
authorAdam Langley <agl@golang.org>
Mon, 27 Jul 2015 23:54:30 +0000 (16:54 -0700)
committerAdam Langley <agl@golang.org>
Wed, 30 Sep 2015 00:59:15 +0000 (00:59 +0000)
commite78e654c1de0a7bfe0314d6954d42b046f14f1bb
tree1a18cb41be03fcc1dd23b8adcf961faab534f577
parent8ee0261865bea69f1a39e04a539e1152b7ba578d
crypto/x509: parse CSRs with a critical flag in the requested extensions.

The format for a CSR is horribly underspecified and we had a mistake.
The code was parsing the attributes from the CSR as a
pkix.AttributeTypeAndValueSET, which is only almost correct: it works so
long as the requested extensions don't contain the optional “critical”
flag.

Unfortunately this mistake is exported somewhat in the API and the
Attributes field of a CSR actually has the wrong type. I've moved this
field to the bottom of the structure and updated the comment to reflect
this.

The Extensions and other fields of the CSR structure can be saved
however and this change does that.

Fixes #11897.

Change-Id: If8e2f5c21934800b72b041e38691efc3e897ecf1
Reviewed-on: https://go-review.googlesource.com/12717
Reviewed-by: Rob Pike <r@golang.org>
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go