Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mmlb committed Jan 27, 2023
1 parent c5e40da commit 063bfd2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 7 additions & 4 deletions csr/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"net/url"
"strconv"
"strings"
"time"

cferr "github.com/cloudflare/cfssl/errors"
"github.com/cloudflare/cfssl/helpers"
Expand Down Expand Up @@ -127,10 +128,12 @@ func (kr *KeyRequest) SigAlgo() x509.SignatureAlgorithm {

// CAConfig is a section used in the requests initialising a new CA.
type CAConfig struct {
PathLength int `json:"pathlen" yaml:"pathlen"`
PathLenZero bool `json:"pathlenzero" yaml:"pathlenzero"`
Expiry string `json:"expiry" yaml:"expiry"`
Backdate string `json:"backdate" yaml:"backdate"`
PathLength int `json:"pathlen" yaml:"pathlen"`
PathLenZero bool `json:"pathlenzero" yaml:"pathlenzero"`
Expiry string `json:"expiry" yaml:"expiry"`
Backdate string `json:"backdate" yaml:"backdate"`
NotBefore time.Time `json:"not_before" yaml:"not_before"`
NotAfter time.Time `json:"not_after" yaml:"not_after"`
}

// A CertificateRequest encapsulates the API interface to the
Expand Down
7 changes: 6 additions & 1 deletion initca/initca.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ func New(req *csr.CertificateRequest) (cert, csrPEM, key []byte, err error) {
return
}

signReq := signer.SignRequest{Hosts: req.Hosts, Request: string(csrPEM)}
signReq := signer.SignRequest{
Hosts: req.Hosts,
Request: string(csrPEM),
NotBefore: req.CA.NotBefore,
NotAfter: req.CA.NotAfter,
}
cert, err = s.Sign(signReq)

return
Expand Down

0 comments on commit 063bfd2

Please sign in to comment.