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

Remove receiver channel after a successful key exchange

parent 487bec7e
No related branches found
No related tags found
1 merge request!227Resolve "Receiver map is not updated correctly for key exchange"
Pipeline #227711 failed
This commit is part of merge request !227. Comments created here will be created in the context of that merge request.
...@@ -97,6 +97,9 @@ func ksaReqHandler(eventBus *event.EventBus, receiver *receiver.Receiver, genera ...@@ -97,6 +97,9 @@ func ksaReqHandler(eventBus *event.EventBus, receiver *receiver.Receiver, genera
select { select {
case <-receiverChan: case <-receiverChan:
if err := receiver.RemoveReceiver(pathId); err != nil {
logrus.Errorf("Failed removing receiver for pathId: %s ; err: %v", pathId, err)
}
case <-time.After(20 * time.Second): case <-time.After(20 * time.Second):
if err := receiver.RemoveReceiver(pathId); err != nil { if err := receiver.RemoveReceiver(pathId); err != nil {
logrus.Errorf("Failed removing receiver for pathId: %s ; err: %v", pathId, err) logrus.Errorf("Failed removing receiver for pathId: %s ; err: %v", pathId, err)
......
...@@ -712,6 +712,9 @@ func (kms *KMS) exchangeKeyAfterETSI14GetKeyRequest(receivingCKMSID uuid.UUID, n ...@@ -712,6 +712,9 @@ func (kms *KMS) exchangeKeyAfterETSI14GetKeyRequest(receivingCKMSID uuid.UUID, n
select { select {
case <-receiverChan: case <-receiverChan:
if err := kms.receiver.RemoveReceiver(pathID); err != nil {
log.Errorf("Failed removing receiver for pathId: %s ; err: %v", pathID, err)
}
case <-time.After(20 * time.Second): case <-time.After(20 * time.Second):
if err := kms.receiver.RemoveReceiver(pathID); err != nil { if err := kms.receiver.RemoveReceiver(pathID); err != nil {
log.Errorf("Failed removing receiver for pathId: %s ; err: %v", pathID, err) log.Errorf("Failed removing receiver for pathId: %s ; err: %v", pathID, err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment