diff --git a/go.mod b/go.mod index 3042bba..4555b68 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.cacert.org/cacert-gosignerclient go 1.19 require ( - git.cacert.org/cacert-gosigner v0.0.0-20221130191226-de7e716a8274 + git.cacert.org/cacert-gosigner v0.0.0-20221201103407-51afebf2c12f github.com/balacode/go-delta v0.1.0 github.com/shamaton/msgpackgen v0.3.0 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index 0d1cd23..d3ce837 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ git.cacert.org/cacert-gosigner v0.0.0-20221130191226-de7e716a8274 h1:lGaIVUyXCtmDZ3ZhCYE44rpbvDF/JMDA/zrPgCZKMvc= git.cacert.org/cacert-gosigner v0.0.0-20221130191226-de7e716a8274/go.mod h1:mb8oBdxQ26GI3xT4b8B7hXYWGED9vvjPGxehmbicyc4= +git.cacert.org/cacert-gosigner v0.0.0-20221201103407-51afebf2c12f h1:OLe/r/dK4WtQXjLCP3Naq/MUkkVkClvw2JIzLxNR2sI= +git.cacert.org/cacert-gosigner v0.0.0-20221201103407-51afebf2c12f/go.mod h1:mb8oBdxQ26GI3xT4b8B7hXYWGED9vvjPGxehmbicyc4= github.com/balacode/go-delta v0.1.0 h1:pwz4CMn06P2bIaIfAx3GSabMPwJp/Ww4if+7SgPYa3I= github.com/balacode/go-delta v0.1.0/go.mod h1:wLNrwTI3lHbPBvnLzqbHmA7HVVlm1u22XLvhbeA6t3o= github.com/balacode/zr v1.0.0 h1:MCupkEoXvrnCljc4KddiDOhR04ZLUAACgtKuo3o+9vc= diff --git a/internal/client/client.go b/internal/client/client.go index dafc527..1ac3d9d 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -168,11 +168,6 @@ func (c *Client) commandLoop(ctx context.Context) { } case <-fetchCRLTimer.C: for _, crlInfo := range c.buildCRLInfo() { - announce, err := messages.BuildCommandAnnounce(messages.CmdFetchCRL) - if err != nil { - c.logger.WithError(err).Error("could not build fetch CRL command announce") - } - var lastKnown []byte if crlInfo.LastKnown != nil { @@ -180,7 +175,7 @@ func (c *Client) commandLoop(ctx context.Context) { } c.commands <- &protocol.Command{ - Announce: announce, + Announce: messages.BuildCommandAnnounce(messages.CmdFetchCRL), Command: &messages.FetchCRLCommand{ IssuerID: crlInfo.Name, LastKnownID: lastKnown, @@ -190,13 +185,8 @@ func (c *Client) commandLoop(ctx context.Context) { fetchCRLTimer.Reset(c.config.FetchCRLInterval) case <-healthTimer.C: - announce, err := messages.BuildCommandAnnounce(messages.CmdHealth) - if err != nil { - c.logger.WithError(err).Error("could not build health command announce") - } - c.commands <- &protocol.Command{ - Announce: announce, + Announce: messages.BuildCommandAnnounce(messages.CmdHealth), Command: &messages.HealthCommand{}, } diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 4ca1a24..df82a5d 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -164,7 +164,7 @@ func (s *SignerClientHandler) handleHealthResponse(r *messages.HealthResponse) { signerInfo.UsableProfiles = make(map[string][]client.Profile) for certName, value := range item.MoreInfo { - certInfo, err := item.ParseCertificateInfo(value) + certInfo, err := messages.ParseCertificateInfo(value) if err != nil { s.logger.WithError(err).Error("could not parse certificate information")