mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-22 10:16:18 +08:00
add name constraints test
This commit is contained in:
parent
68e297f49b
commit
c4540b0c31
2171
smx509/name_constraints_test.go
Normal file
2171
smx509/name_constraints_test.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user