From e79975cf142ede5138e5a239c61b1474a80c3874 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sat, 5 Jun 2021 13:47:39 +0200 Subject: [PATCH] csr: support NEW CERTIFICATE REQUEST as CSR type (#1423) --- certcrypto/crypto.go | 2 +- cmd/setup.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/certcrypto/crypto.go b/certcrypto/crypto.go index 80081ce5..44f6e4d4 100644 --- a/certcrypto/crypto.go +++ b/certcrypto/crypto.go @@ -179,7 +179,7 @@ func PemDecodeTox509CSR(data []byte) (*x509.CertificateRequest, error) { return nil, err } - if pemBlock.Type != "CERTIFICATE REQUEST" { + if pemBlock.Type != "CERTIFICATE REQUEST" && pemBlock.Type != "NEW CERTIFICATE REQUEST" { return nil, errors.New("PEM block is not a certificate request") } diff --git a/cmd/setup.go b/cmd/setup.go index e2a41a57..bb70da4a 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -117,7 +117,7 @@ func readCSRFile(filename string) (*x509.CertificateRequest, error) { } // did we get a CSR? - if p.Type == "CERTIFICATE REQUEST" { + if p.Type == "CERTIFICATE REQUEST" || p.Type == "NEW CERTIFICATE REQUEST" { raw = p.Bytes } }