+10
-4
lines changedFilter options
+10
-4
lines changed Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import (
7
7
"crypto/x509"
8
8
"encoding/pem"
9
9
"errors"
10
+
"fmt"
10
11
"time"
11
12
12
13
"github.com/cloudflare/cfssl/config"
@@ -15,7 +16,6 @@ import (
15
16
"github.com/cloudflare/cfssl/initca"
16
17
"github.com/cloudflare/cfssl/signer"
17
18
"github.com/cloudflare/cfssl/signer/local"
18
-
"github.com/kisom/goutils/assert"
19
19
)
20
20
21
21
// CA is a local transport CertificateAuthority that is useful for
@@ -146,13 +146,19 @@ func New(req *csr.CertificateRequest, profiles *config.Signing) (*CA, error) {
146
146
// CFSSL has become inconsistent, and it can't be trusted.
147
147
148
148
priv, err := helpers.ParsePrivateKeyPEM(keyPEM)
149
-
assert.NoError(err, "CFSSL-generated private key can't be parsed")
149
+
if err != nil {
150
+
return nil, fmt.Errorf("CFSSL-generated private key can't be parsed: %w", err)
151
+
}
150
152
151
153
cert, err := helpers.ParseCertificatePEM(certPEM)
152
-
assert.NoError(err, "CFSSL-generated certificate can't be parsed")
154
+
if err != nil {
155
+
return nil, fmt.Errorf("CFSSL-generated private key can't be parsed: %w", err)
156
+
}
153
157
154
158
s, err := local.NewSigner(priv, cert, helpers.SignerAlgo(priv), profiles)
155
-
assert.NoError(err, "a signer could not be constructed")
159
+
if err != nil {
160
+
return nil, fmt.Errorf("a signer could not be constructed: %w", err)
161
+
}
156
162
157
163
return NewFromSigner(s), nil
158
164
}
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4