Skip to content

Commit

Permalink
Keep pending security messages directed for each local endpoint (#1490)
Browse files Browse the repository at this point in the history
* Refs 9621. pending security messages keyed by local and remote GUID

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* Refs 9621. uncrustify

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* Refs 9621. Avoid Topic name clashes on PubSubParticipant

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* Refs 9621. PubSubParticipant to accept property policies

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* Refs 9621. Wait for partial matching on PubSubParticipant

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* Refs 9621. Test multiple endopoints in participant with security

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* Refs 9621. Uncrustify

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* Refs 9621. Avoid uncrustify to mess with test definitions

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
  • Loading branch information
IkerLuengo authored Oct 19, 2020
1 parent 8044a68 commit a7af89a
Show file tree
Hide file tree
Showing 5 changed files with 773 additions and 395 deletions.
23 changes: 14 additions & 9 deletions src/cpp/rtps/security/SecurityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ bool SecurityManager::init(
}

if (!( logging_plugin_->set_log_options(log_options, exception) &&
logging_plugin_->enable_logging(exception) ))
logging_plugin_->enable_logging(exception)))
{
return init_logging_fail(exception);
}
Expand Down Expand Up @@ -1680,7 +1680,8 @@ void SecurityManager::process_participant_volatile_message_secure(
}
else
{
remote_reader_pending_messages_.emplace(message.source_endpoint_key(),
remote_reader_pending_messages_.emplace(std::make_pair(message.source_endpoint_key(),
message.destination_endpoint_key()),
std::move(message.message_data()));
}
}
Expand Down Expand Up @@ -1752,7 +1753,8 @@ void SecurityManager::process_participant_volatile_message_secure(
}
else
{
remote_writer_pending_messages_.emplace(message.source_endpoint_key(),
remote_writer_pending_messages_.emplace(std::make_pair(message.source_endpoint_key(),
message.destination_endpoint_key()),
std::move(message.message_data()));
}
}
Expand Down Expand Up @@ -2691,7 +2693,8 @@ bool SecurityManager::discovered_reader(
else
{
// Check pending reader crypto messages.
auto pending = remote_reader_pending_messages_.find(remote_reader_data.guid());
auto pending = remote_reader_pending_messages_.find(
std::make_pair(remote_reader_data.guid(), writer_guid));
bool pairing_cause_pending_message = false;

if (pending != remote_reader_pending_messages_.end())
Expand Down Expand Up @@ -2759,7 +2762,7 @@ bool SecurityManager::discovered_reader(
{
// Store in pendings.
remote_writer_pending_messages_.emplace(
writer_guid,
std::make_pair(writer_guid, local_reader->first),
std::move(local_writer_crypto_tokens));
}
}
Expand Down Expand Up @@ -3028,7 +3031,8 @@ bool SecurityManager::discovered_writer(
else
{
// Check pending writer crypto messages.
auto pending = remote_writer_pending_messages_.find(remote_writer_data.guid());
auto pending = remote_writer_pending_messages_.find(
std::make_pair(remote_writer_data.guid(), reader_guid));
bool pairing_cause_pending_message = false;

if (pending != remote_writer_pending_messages_.end())
Expand Down Expand Up @@ -3097,7 +3101,8 @@ bool SecurityManager::discovered_writer(
{
// Store in pendings.
remote_reader_pending_messages_.emplace(
reader_guid, std::move(local_reader_crypto_tokens));
std::make_pair(reader_guid, local_writer->first),
std::move(local_reader_crypto_tokens));
}
}
else
Expand Down Expand Up @@ -3648,8 +3653,8 @@ bool SecurityManager::participant_authorized(
if (access_plugin_ == nullptr || remote_permissions != nullptr)
{

std::list<std::pair<ReaderProxyData, GUID_t> > temp_readers;
std::list<std::pair<WriterProxyData, GUID_t> > temp_writers;
std::list<std::pair<ReaderProxyData, GUID_t>> temp_readers;
std::list<std::pair<WriterProxyData, GUID_t>> temp_writers;

if (crypto_plugin_ != nullptr)
{
Expand Down
Loading

0 comments on commit a7af89a

Please sign in to comment.