mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-27 12:46:18 +08:00
smx509: add t.Helper calls to test helpers
This commit is contained in:
parent
6926113a10
commit
2f0f4745d7
@ -1264,6 +1264,7 @@ func TestCreateCertificateRequest(t *testing.T) {
|
||||
}
|
||||
|
||||
func marshalAndParseCSR(t *testing.T, template *x509.CertificateRequest) *CertificateRequest {
|
||||
t.Helper()
|
||||
derBytes, err := CreateCertificateRequest(rand.Reader, template, testPrivateKey)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -1428,6 +1429,7 @@ func TestCriticalFlagInCSRRequestedExtensions(t *testing.T) {
|
||||
// serialiseAndParse generates a self-signed certificate from template and
|
||||
// returns a parsed version of it.
|
||||
func serialiseAndParse(t *testing.T, template *x509.Certificate) *Certificate {
|
||||
t.Helper()
|
||||
derBytes, err := CreateCertificate(rand.Reader, template, template, &testPrivateKey.PublicKey, testPrivateKey)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create certificate: %s", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user