Skip to content
Snippets Groups Projects
Commit b78f22e5 authored by Malte Bauch's avatar Malte Bauch
Browse files

Linter pleasing

parent fe160663
No related branches found
No related tags found
3 merge requests!11Big boom integration,!10Add linting,!6Draft: Akms ckms api implementation
Pipeline #180873 passed
......@@ -61,7 +61,11 @@ func (s *kmsTalkerServer) KeyIdNotification(ctx context.Context, in *pb.KeyIdNot
return nil, err
}
defer resp.Body.Close()
defer func() {
if closeError := resp.Body.Close(); closeError != nil {
log.Errorf("KeyIdNotification: response closing failure: %s", err)
}
}()
// TODO: add proper status code handling
if resp.StatusCode != 200 {
......@@ -226,8 +230,12 @@ func (s *kmsTalkerServer) KeyForwarding(ctx context.Context, in *pb.KeyForwardin
log.Infof("%s received a payload: %s, from %s", s.eKMS.kmsName, decryptedPayload, route.Previous.tcpSocketStr)
if route.Next != nil {
log.Infof("%s forwards payload to : %s", s.eKMS.kmsName, route.Next.tcpSocketStr)
go route.Next.SendPayload(decryptedPayload, pathId)
log.Infof("%s is trying to forward payload to : %s", s.eKMS.kmsName, route.Next.tcpSocketStr)
err := route.Next.SendPayload(decryptedPayload, pathId)
if err != nil {
return nil, status.Errorf(codes.Internal, "%s", err)
}
log.Infof("%s forwarded the payload to : %s successfully", s.eKMS.kmsName, route.Next.tcpSocketStr)
} else {
log.Infof("%s received the final payload: %s", s.eKMS.kmsName, string(decryptedPayload))
}
......
......@@ -22,7 +22,8 @@ func SetupETSI14RestServer(etsi14RESTService *ETSI14RESTService) {
etsi14APIController := restserver.NewDefaultAPIController(etsi14RESTService)
router := restserver.NewRouter(etsi14APIController)
go http.ListenAndServe(etsi14RESTService.serviceAddress, router)
// NOTE check again, currently ignoring
go http.ListenAndServe(etsi14RESTService.serviceAddress, router) //nolint:errcheck
logrus.Info("Server started")
}
......
......@@ -52,7 +52,7 @@ func main() {
return
}
stopChan := make(chan os.Signal)
stopChan := make(chan os.Signal, 1)
signal.Notify(stopChan, os.Interrupt, syscall.SIGTERM)
ql := quantumlayer.NewQuantumlayerEmuPRNG(kmsClient, os.Stdout, logrus.GetLevel(), false)
......
......@@ -134,7 +134,11 @@ func (qlemuprng *QuantumlayerEmuPRNG) PowerOn() {
log.Fatalf("QuantumlayerEmuPRNG: UDP failure: %s", err)
return
}
defer qlemuprng.udpSrvConn.Close()
defer func() {
if closeError := qlemuprng.udpSrvConn.Close(); closeError != nil {
log.Errorf("QuantumlayerEmuPRNG: udpSrvConn closing failure: %s", err)
}
}()
// Retrieve local UDP address and store it for further actions.
tempPort, ok := qlemuprng.udpSrvConn.LocalAddr().(*net.UDPAddr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment