chore(openvpn/extract): simplify PEM extract

This commit is contained in:
Quentin McGaw
2023-04-01 16:57:09 +00:00
parent 4ba159e483
commit c7a841f4b4
2 changed files with 14 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
package extract
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
@@ -24,6 +25,14 @@ func Test_PEM(t *testing.T) {
errWrapped: errPEMDecode,
errMessage: "cannot decode PEM encoded block",
},
"valid data with extras": {
b: bytes.Join([][]byte{
{1, 2, 3},
[]byte(validCertPEM),
{4, 5, 6},
}, []byte("\n")),
encodedData: validCertData,
},
"valid data": {
b: []byte(validCertPEM),
encodedData: validCertData,