Add number of certs to return and fix CR LF in CACaps
This commit is contained in:
parent
165f6a1ccd
commit
702032f2b7
1 changed files with 3 additions and 2 deletions
|
@ -222,6 +222,7 @@ func (h *Handler) GetCACert(w http.ResponseWriter, r *http.Request, scepResponse
|
||||||
scepResponse.CACertNum = 1
|
scepResponse.CACertNum = 1
|
||||||
} else {
|
} else {
|
||||||
data, err := microscep.DegenerateCertificates(certs)
|
data, err := microscep.DegenerateCertificates(certs)
|
||||||
|
scepResponse.CACertNum = len(certs)
|
||||||
scepResponse.Data = data
|
scepResponse.Data = data
|
||||||
scepResponse.Err = err
|
scepResponse.Err = err
|
||||||
}
|
}
|
||||||
|
@ -335,7 +336,7 @@ func createKeyIdentifier(pub crypto.PublicKey) ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func formatCapabilities(caps []string) []byte {
|
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.
|
// writeSCEPResponse writes a SCEP response back to the SCEP client.
|
||||||
|
@ -350,7 +351,7 @@ func writeSCEPResponse(w http.ResponseWriter, response SCEPResponse) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// TODO: check the default capabilities
|
// TODO: check the default capabilities; https://tools.ietf.org/html/rfc8894#section-3.5.2
|
||||||
defaultCapabilities = []string{
|
defaultCapabilities = []string{
|
||||||
"Renewal",
|
"Renewal",
|
||||||
"SHA-1",
|
"SHA-1",
|
||||||
|
|
Loading…
Reference in a new issue