Skip to content

Commit

Permalink
added check for pkcs type to request process
Browse files Browse the repository at this point in the history
  • Loading branch information
nhgs64 committed Jun 20, 2023
1 parent 4617c1e commit da169bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/issuer/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ func (o *hvcaSigner) Sign(csrBytes []byte) ([]byte, error) {
if vp.PublicKey.KeyType.String() != csr.PublicKeyAlgorithm.String() {
return nil, errors.New("CSR public key type doesn't match Atlas account pubic key type")
}
// Check PKCS type
if vp.PublicKey.KeyFormat != hvclient.PKCS10 {
return nil, errors.New("atlas account does not support pkcs10 key format, update atlas account")
}

// Request cert
if serial, err = clnt.CertificateRequest(ctx, &req); err != nil {
return nil, err
Expand Down

0 comments on commit da169bb

Please sign in to comment.