]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: add new CRL parser, deprecate old one
authorRoland Shoemaker <roland@golang.org>
Tue, 8 Mar 2022 19:18:44 +0000 (11:18 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 5 Apr 2022 23:32:55 +0000 (23:32 +0000)
commit2de2f6df64a8fff36fe9752f893a7cfff4590762
treef384cb31b3704595a55ff79e6a03797167f1c8c6
parentdbb52cc9f3e83a3040f46c2ae7650c15ab342179
crypto/x509: add new CRL parser, deprecate old one

Adds a new, cryptobyte based, CRL parser, which returns a
x509.RevocaitonList, rather than a pkix.CertificateList. This allows us
to return much more detailed information, as well as leaving open the
option of adding further information since RevocationList is not a
direct ASN.1 representation like pkix.CertificateList. Additionally
a new method is added to RevocationList, CheckSignatureFrom, which is
analogous to the method with the same name on Certificate, which
properly checks that the signature is from an issuing certiifcate.

This change also deprecates a number of older CRL related functions and
types, which have been replaced with the new functionality introduced
in this change:
  * crypto/x509.ParseCRL
  * crypto/x509.ParseDERCRL
  * crypto/x509.CheckCRLSignature
  * crypto/x509/pkix.CertificateList
  * crypto/x509/pkix.TBSCertificateList

Fixes #50674

Change-Id: I27dc219e39bef09a396e666b4fccaa32578fd913
Reviewed-on: https://go-review.googlesource.com/c/go/+/390834
Reviewed-by: Damien Neil <dneil@google.com>
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
api/next/50674.txt [new file with mode: 0644]
src/crypto/x509/parser.go
src/crypto/x509/pkix/pkix.go
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go