Skip to content

Commit

Permalink
Refs #2713. Fixed encrypted discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
richiware committed May 2, 2018
1 parent a7f6d2c commit 15ea504
Show file tree
Hide file tree
Showing 11 changed files with 389 additions and 171 deletions.
6 changes: 6 additions & 0 deletions include/fastrtps/rtps/builtin/discovery/endpoint/EDP.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ class EDP

bool pairing_remote_writer_with_local_reader_after_security(const GUID_t& local_reader,
const WriterProxyData& remote_writer_data);

virtual bool pairing_remote_writer_with_local_builtin_reader_after_security(const GUID_t& /*local_reader*/,
const WriterProxyData& /*remote_writer_data*/) { return false; }

virtual bool pairing_remote_reader_with_local_builtin_writer_after_security(const GUID_t& /*local_writer*/,
const ReaderProxyData& /*remote_reader_data*/) { return false; }
#endif

//! Pointer to the PDPSimple object that contains the endpoint discovery protocol.
Expand Down
6 changes: 6 additions & 0 deletions include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ class EDPSimple : public EDP

#if HAVE_SECURITY
bool create_sedp_secure_endpoints();

bool pairing_remote_writer_with_local_builtin_reader_after_security(const GUID_t& local_reader,
const WriterProxyData& remote_writer_data);

bool pairing_remote_reader_with_local_builtin_writer_after_security(const GUID_t& local_writer,
const ReaderProxyData& remote_reader_data);
#endif

};
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/Endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace eprosima {
namespace fastrtps{
namespace rtps {

Endpoint::Endpoint(RTPSParticipantImpl* pimpl,GUID_t& guid,EndpointAttributes& att):
Endpoint::Endpoint(RTPSParticipantImpl* pimpl, GUID_t& guid, EndpointAttributes& att):
mp_RTPSParticipant(pimpl),
m_guid(guid),
m_att(att),
Expand Down
21 changes: 12 additions & 9 deletions src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ bool EDP::pairingReader(RTPSReader* R, const ParticipantProxyData& pdata, const
{
#if HAVE_SECURITY
if(!mp_RTPSParticipant->security_manager().discovered_writer(R->m_guid, (*pit)->m_guid,
**wdatait))
**wdatait, R->getAttributes()->security_attributes()))
{
logError(RTPS_EDP, "Security manager returns an error for reader " << R->getGuid());
}
Expand Down Expand Up @@ -485,7 +485,7 @@ bool EDP::pairingWriter(RTPSWriter* W, const ParticipantProxyData& pdata, const
{
#if HAVE_SECURITY
if(!mp_RTPSParticipant->security_manager().discovered_reader(W->getGuid(), (*pit)->m_guid,
**rdatait))
**rdatait, W->getAttributes()->security_attributes()))
{
logError(RTPS_EDP, "Security manager returns an error for writer " << W->getGuid());
}
Expand Down Expand Up @@ -551,7 +551,7 @@ bool EDP::pairing_reader_proxy_with_any_local_writer(ParticipantProxyData* pdata
{
#if HAVE_SECURITY
if(!mp_RTPSParticipant->security_manager().discovered_reader(writerGUID, pdata->m_guid,
*rdata))
*rdata, (*wit)->getAttributes()->security_attributes()))
{
logError(RTPS_EDP, "Security manager returns an error for writer " << writerGUID);
}
Expand Down Expand Up @@ -619,7 +619,7 @@ bool EDP::pairing_reader_proxy_with_local_writer(const GUID_t& local_writer, con
if(valid)
{
if(!mp_RTPSParticipant->security_manager().discovered_reader(writerGUID,
remote_participant_guid, rdata))
remote_participant_guid, rdata, (*wit)->getAttributes()->security_attributes()))
{
logError(RTPS_EDP, "Security manager returns an error for writer " << writerGUID);
}
Expand Down Expand Up @@ -676,10 +676,12 @@ bool EDP::pairing_remote_reader_with_local_writer_after_security(const GUID_t& l

return true;
}

return false;
}
}

return false;
return pairing_remote_reader_with_local_builtin_writer_after_security(local_writer, remote_reader_data);
}
#endif

Expand Down Expand Up @@ -707,7 +709,7 @@ bool EDP::pairing_writer_proxy_with_any_local_reader(ParticipantProxyData *pdata
{
#if HAVE_SECURITY
if(!mp_RTPSParticipant->security_manager().discovered_writer(readerGUID, pdata->m_guid,
*wdata))
*wdata, (*rit)->getAttributes()->security_attributes()))
{
logError(RTPS_EDP, "Security manager returns an error for reader " << readerGUID);
}
Expand Down Expand Up @@ -775,8 +777,7 @@ bool EDP::pairing_writer_proxy_with_local_reader(const GUID_t& local_reader, con
if(valid)
{
if(!mp_RTPSParticipant->security_manager().discovered_writer(readerGUID,
remote_participant_guid,
wdata))
remote_participant_guid, wdata, (*rit)->getAttributes()->security_attributes()))
{
logError(RTPS_EDP, "Security manager returns an error for reader " << readerGUID);
}
Expand Down Expand Up @@ -834,10 +835,12 @@ bool EDP::pairing_remote_writer_with_local_reader_after_security(const GUID_t& l

return true;
}

return false;
}
}

return false;
return pairing_remote_writer_with_local_builtin_reader_after_security(local_reader, remote_writer_data);
}
#endif

Expand Down
Loading

0 comments on commit 15ea504

Please sign in to comment.