|
|
@ -272,6 +272,13 @@ func (m *MsgPackHandler) parseCommand(frame []byte, command *protocol.Command) e
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
command.Command = signCertificateCommand
|
|
|
|
command.Command = signCertificateCommand
|
|
|
|
|
|
|
|
case messages.CmdRevokeCertificate:
|
|
|
|
|
|
|
|
revokeCertificateCommand, err := m.parseRevokeCertificateCommand(frame)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
command.Command = revokeCertificateCommand
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("unhandled command code %s", command.Announce.Code)
|
|
|
|
return fmt.Errorf("unhandled command code %s", command.Announce.Code)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -382,6 +389,18 @@ func (m *MsgPackHandler) handleSignCertificateCommand(
|
|
|
|
return &messages.SignCertificateResponse{CertificateData: res.Certificate.Raw}, nil
|
|
|
|
return &messages.SignCertificateResponse{CertificateData: res.Certificate.Raw}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgPackHandler) parseRevokeCertificateCommand(frame []byte) (*messages.RevokeCertificateCommand, error) {
|
|
|
|
|
|
|
|
var command messages.RevokeCertificateCommand
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err := msgpack.Unmarshal(frame, &command); err != nil {
|
|
|
|
|
|
|
|
m.logger.WithError(err).Errorf("unmarshal failed")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return nil, errors.New("could not unmarshal revoke certificate command")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return &command, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func New(logger *logrus.Logger, handlers ...RegisterHandler) (protocol.ServerHandler, error) {
|
|
|
|
func New(logger *logrus.Logger, handlers ...RegisterHandler) (protocol.ServerHandler, error) {
|
|
|
|
messages.RegisterGeneratedResolver()
|
|
|
|
messages.RegisterGeneratedResolver()
|
|
|
|
|
|
|
|
|
|
|
|