]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: populate Number and AKI of parsed CRLs
authorAaron Gable <aaron@letsencrypt.org>
Wed, 6 Jul 2022 23:59:03 +0000 (16:59 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 7 Jul 2022 19:06:45 +0000 (19:06 +0000)
commit8ac58de1857637f372a00ea16ab5497193b784a6
tree6a0f5dbf94fdfbbc88529a257c3dc2f58b2f6e46
parent0c7fcf6bd1fd8df2bfae3a482f1261886f6313c1
crypto/x509: populate Number and AKI of parsed CRLs

The x509.RevocationList type has two fields which correspond to
extensions, rather than native fields, of the underlying ASN.1 CRL:
the .Number field corresponds to the crlNumber extension, and
the .AuthorityKeyId field corresponds to the authorityKeyIdentifier
extension.

The x509.CreateRevocationList() function uses these fields to populate
their respective extensions in the resulting CRL. However, the
x509.ParseRevocationList() function does not perform the reverse
operation: the fields retain their zero-values even after parsing a CRL
which contains the relevant extensions.

Add code which populates these fields when parsing their extensions.
Add assertions to the existing tests to confirm that the values are
populated appropriately.

Fixes #53726

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