Skip to content

Commit

Permalink
Add number of certs to return and fix CR LF in CACaps
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman authored and dopey committed May 26, 2021
1 parent b905d5f commit 393be5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scep/api/api.go
Expand Up @@ -222,6 +222,7 @@ func (h *Handler) GetCACert(w http.ResponseWriter, r *http.Request, scepResponse
scepResponse.CACertNum = 1
} else {
data, err := microscep.DegenerateCertificates(certs)
scepResponse.CACertNum = len(certs)
scepResponse.Data = data
scepResponse.Err = err
}
Expand Down Expand Up @@ -335,7 +336,7 @@ func createKeyIdentifier(pub crypto.PublicKey) ([]byte, error) {
}

func formatCapabilities(caps []string) []byte {
return []byte(strings.Join(caps, "\n"))
return []byte(strings.Join(caps, "\r\n"))
}

// writeSCEPResponse writes a SCEP response back to the SCEP client.
Expand All @@ -350,7 +351,7 @@ func writeSCEPResponse(w http.ResponseWriter, response SCEPResponse) error {
}

var (
// TODO: check the default capabilities
// TODO: check the default capabilities; https://tools.ietf.org/html/rfc8894#section-3.5.2
defaultCapabilities = []string{
"Renewal",
"SHA-1",
Expand Down

0 comments on commit 393be5b

Please sign in to comment.