@@ -601,6 +601,8 @@ bool SecurityManager::discovered_participant(
601
601
// Create or find information
602
602
bool undiscovered = false ;
603
603
DiscoveredParticipantInfo::AuthUniquePtr remote_participant_info;
604
+ // Use the information from the collection
605
+ const ParticipantProxyData* remote_participant_data = nullptr ;
604
606
{
605
607
std::lock_guard<shared_mutex> _ (mutex_);
606
608
@@ -614,13 +616,14 @@ bool SecurityManager::discovered_participant(
614
616
615
617
undiscovered = map_ret.second ;
616
618
remote_participant_info = map_ret.first ->second ->get_auth ();
619
+ remote_participant_data = &map_ret.first ->second ->participant_data ();
617
620
}
618
621
619
622
bool notify_part_authorized = false ;
620
- if (undiscovered && remote_participant_info)
623
+ if (undiscovered && remote_participant_info && remote_participant_data != nullptr )
621
624
{
622
625
// Configure the timed event but do not start it
623
- const GUID_t guid = participant_data. m_guid ;
626
+ const GUID_t guid = remote_participant_data-> m_guid ;
624
627
remote_participant_info->event_ .reset (new TimedEvent (participant_->getEventResource (),
625
628
[&, guid]() -> bool
626
629
{
@@ -634,8 +637,8 @@ bool SecurityManager::discovered_participant(
634
637
// Validate remote participant.
635
638
ValidationResult_t validation_ret = authentication_plugin_->validate_remote_identity (&remote_identity_handle,
636
639
*local_identity_handle_,
637
- participant_data. identity_token_ ,
638
- participant_data. m_guid , exception );
640
+ remote_participant_data-> identity_token_ ,
641
+ remote_participant_data-> m_guid , exception );
639
642
640
643
switch (validation_ret)
641
644
{
@@ -655,21 +658,21 @@ bool SecurityManager::discovered_participant(
655
658
// TODO(Ricardo) Send event.
656
659
default :
657
660
658
- on_validation_failed (participant_data , exception );
661
+ on_validation_failed (*remote_participant_data , exception );
659
662
660
663
std::lock_guard<shared_mutex> _ (mutex_);
661
664
662
665
// Remove created element, because authentication failed.
663
- discovered_participants_.erase (participant_data. m_guid );
666
+ discovered_participants_.erase (remote_participant_data-> m_guid );
664
667
665
668
// TODO(Ricardo) cryptograhy registration in AUTHENTICAITON_OK
666
669
return false ;
667
670
}
668
671
669
- EPROSIMA_LOG_INFO (SECURITY, " Discovered participant " << participant_data. m_guid );
672
+ EPROSIMA_LOG_INFO (SECURITY, " Discovered participant " << remote_participant_data-> m_guid );
670
673
671
674
// Match entities
672
- match_builtin_endpoints (participant_data );
675
+ match_builtin_endpoints (*remote_participant_data );
673
676
674
677
// Store new remote handle.
675
678
remote_participant_info->auth_status_ = auth_status;
@@ -681,7 +684,7 @@ bool SecurityManager::discovered_participant(
681
684
{
682
685
// TODO(Ricardo) Shared secret on this case?
683
686
std::shared_ptr<SecretHandle> ss;
684
- notify_part_authorized = participant_authorized (participant_data , remote_participant_info, ss);
687
+ notify_part_authorized = participant_authorized (*remote_participant_data , remote_participant_info, ss);
685
688
}
686
689
}
687
690
else
@@ -704,15 +707,15 @@ bool SecurityManager::discovered_participant(
704
707
if (remote_participant_info->auth_status_ == AUTHENTICATION_REQUEST_NOT_SEND)
705
708
{
706
709
// Maybe send request.
707
- returnedValue = on_process_handshake (participant_data , remote_participant_info,
710
+ returnedValue = on_process_handshake (*remote_participant_data , remote_participant_info,
708
711
MessageIdentity (), HandshakeMessageToken (), notify_part_authorized);
709
712
}
710
713
711
- restore_discovered_participant_info (participant_data. m_guid , remote_participant_info);
714
+ restore_discovered_participant_info (remote_participant_data-> m_guid , remote_participant_info);
712
715
713
716
if (notify_part_authorized)
714
717
{
715
- notify_participant_authorized (participant_data );
718
+ notify_participant_authorized (*remote_participant_data );
716
719
}
717
720
718
721
return returnedValue;
0 commit comments