File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
1919 "context"
2020 "crypto/sha256"
2121 "crypto/x509"
22+ "encoding/base64"
2223 "encoding/hex"
2324 "encoding/pem"
2425 "fmt"
@@ -114,9 +115,12 @@ func NewAPI() (*API, error) {
114115 }
115116
116117 var certChain []* x509.Certificate
117- certChainStr := viper .GetString ("rekor_server.timestamp_chain" )
118- if certChainStr != "" {
119- var err error
118+ b64CertChainStr := viper .GetString ("rekor_server.timestamp_chain" )
119+ if b64CertChainStr != "" {
120+ certChainStr , err := base64 .StdEncoding .DecodeString (b64CertChainStr )
121+ if err != nil {
122+ return nil , errors .Wrap (err , "decoding timestamping cert" )
123+ }
120124 if certChain , err = pki .ParseTimestampCertChain ([]byte (certChainStr )); err != nil {
121125 return nil , errors .Wrap (err , "parsing timestamp cert chain" )
122126 }
You can’t perform that action at this time.
0 commit comments