diff --git a/util/cert/csr.go b/util/cert/csr.go index 280d249f..39a6751f 100644 --- a/util/cert/csr.go +++ b/util/cert/csr.go @@ -51,7 +51,7 @@ func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateReque } csrPemBlock := &pem.Block{ - Type: "CERTIFICATE REQUEST", + Type: CertificateRequestBlockType, Bytes: csrDER, } diff --git a/util/cert/csr_test.go b/util/cert/csr_test.go index c2a0bbb3..ed28f021 100644 --- a/util/cert/csr_test.go +++ b/util/cert/csr_test.go @@ -52,7 +52,7 @@ func TestMakeCSR(t *testing.T) { if len(rest) != 0 { t.Error("Found more than one PEM encoded block in the result.") } - if csrBlock.Type != "CERTIFICATE REQUEST" { + if csrBlock.Type != CertificateRequestBlockType { t.Errorf("Found block type %q, wanted 'CERTIFICATE REQUEST'", csrBlock.Type) } csr, err := x509.ParseCertificateRequest(csrBlock.Bytes)