smx509: add t.Helper calls to test helpers

This commit is contained in:
Sun Yimin 2024-08-16 09:23:25 +08:00 committed by GitHub
parent 6926113a10
commit 2f0f4745d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)