add name constraints test

This commit is contained in:
Sun Yimin 2022-11-15 14:48:49 +08:00 committed by GitHub
parent 68e297f49b
commit c4540b0c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2187 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2731,6 +2731,22 @@ func TestCreateCertificateLegacy(t *testing.T) {
}
}
func (s *CertPool) mustCert(t *testing.T, n int) *Certificate {
c, err := s.lazyCerts[n].getCert()
if err != nil {
t.Fatalf("failed to load cert %d: %v", n, err)
}
return c
}
func allCerts(t *testing.T, p *CertPool) []*Certificate {
all := make([]*Certificate, p.len())
for i := range all {
all[i] = p.mustCert(t, i)
}
return all
}
// certPoolEqual reports whether a and b are equal, except for the
// function pointers.
func certPoolEqual(a, b *CertPool) bool {