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

Function tokens_to_keys

dds/DCPS/security/CryptoBuiltInImpl.cpp:771–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769 }
770
771 KeyMaterial_AES_GCM_GMAC_Seq tokens_to_keys(const ParticipantCryptoTokenSeq& tokens)
772 {
773 KeyMaterial_AES_GCM_GMAC_Seq keys;
774 for (unsigned int i = 0; i < tokens.length(); ++i) {
775 const CryptoToken& t = tokens[i];
776 if (Crypto_Token_Class_Id == t.class_id) {
777 for (unsigned int j = 0; j < t.binary_properties.length(); ++j) {
778 const DDS::BinaryProperty_t& p = t.binary_properties[j];
779 if (Token_KeyMat_Name == p.name) {
780 ACE_Message_Block mb(to_mb(p.value.get_buffer()), p.value.length());
781 mb.wr_ptr(p.value.length());
782 Serializer ser(&mb, common_encoding);
783 KeyMaterial_AES_GCM_GMAC key;
784 if (ser >> key) {
785 DCPS::push_back(keys, key);
786 } else {
787 ACE_ERROR((LM_ERROR,
788 "(%P|%t) ERROR: tokens_to_keys: Failed to deserialize\n"));
789 }
790 break;
791 }
792 }
793 }
794 }
795 return keys;
796 }
797}
798
799bool CryptoBuiltInImpl::create_local_participant_crypto_tokens(

Calls 4

to_mbFunction · 0.85
push_backFunction · 0.50
lengthMethod · 0.45
get_bufferMethod · 0.45

Tested by

no test coverage detected