MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / encode_datareader_submessage

Method encode_datareader_submessage

dds/DCPS/security/CryptoBuiltInImpl.cpp:1547–1578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1545}
1546
1547bool CryptoBuiltInImpl::encode_datareader_submessage(
1548 DDS::OctetSeq& encoded_rtps_submessage,
1549 const DDS::OctetSeq& plain_rtps_submessage,
1550 DatareaderCryptoHandle sending_datareader_crypto,
1551 const DatawriterCryptoHandleSeq& receiving_datawriter_crypto_list,
1552 SecurityException& ex)
1553{
1554 if (DDS::HANDLE_NIL == sending_datareader_crypto) {
1555 return CommonUtilities::set_security_error(ex, -1, 0, "Invalid DataReader handle");
1556 }
1557
1558 for (unsigned int i = 0; i < receiving_datawriter_crypto_list.length(); ++i) {
1559 if (receiving_datawriter_crypto_list[i] == DDS::HANDLE_NIL) {
1560 return CommonUtilities::set_security_error(ex, -1, 0, "Invalid DataWriter handle in list");
1561 }
1562 }
1563
1564 NativeCryptoHandle encode_handle = sending_datareader_crypto;
1565 ACE_Guard<ACE_Thread_Mutex> guard(mutex_);
1566 if (receiving_datawriter_crypto_list.length() == 1) {
1567 const KeyTable_t::const_iterator iter = keys_.find(encode_handle);
1568 if (iter != keys_.end()) {
1569 const KeySeq& dr_keys = iter->second;
1570 if (dr_keys.length() == 1 && is_volatile_placeholder(dr_keys[0])) {
1571 encode_handle = receiving_datawriter_crypto_list[0];
1572 }
1573 }
1574 }
1575
1576 return encode_submessage(encoded_rtps_submessage, plain_rtps_submessage,
1577 encode_handle, ex);
1578}
1579
1580bool CryptoBuiltInImpl::encode_rtps_message(
1581 DDS::OctetSeq& encoded_rtps_message,

Callers 2

TEST_FFunction · 0.80

Calls 5

set_security_errorFunction · 0.85
is_volatile_placeholderFunction · 0.85
lengthMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected