Send crypto tokens after handshake is completely finished

Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
This commit is contained in:
Marcel Jordense 2020-03-26 18:51:01 +01:00 committed by eboasson
parent a77fe10a04
commit 9175f44273
6 changed files with 86 additions and 21 deletions

View file

@ -1998,3 +1998,27 @@ invalid_handle:
CRYPTO_OBJECT_RELEASE(obj);
return result;
}
master_key_material *
crypto_factory_get_master_key_material_for_test(
const dds_security_crypto_key_factory *factory,
DDS_Security_ParticipantCryptoHandle local_id,
DDS_Security_ParticipantCryptoHandle remote_id)
{
dds_security_crypto_key_factory_impl *impl = (dds_security_crypto_key_factory_impl *)factory;
remote_participant_crypto *rmt_cr = (remote_participant_crypto *)crypto_object_table_find(impl->crypto_objects, remote_id);
participant_key_material *keymat;
master_key_material *master_keymat = NULL;
if (rmt_cr)
{
keymat = crypto_remote_participant_lookup_keymat(rmt_cr, local_id);
if (keymat)
{
master_keymat = keymat->local_P2P_key_material;
CRYPTO_OBJECT_RELEASE(keymat);
}
}
return master_keymat;
}

View file

@ -14,6 +14,7 @@
#include "dds/security/dds_security_api.h"
#include "crypto_objects.h"
#include "dds/security/export.h"
/**
* @brief Allocation function for implementer structure (with internal variables) transparently.
@ -158,4 +159,10 @@ crypto_factory_get_specific_keymat(
uint32_t *index,
master_key_material **key_mat);
SECURITY_EXPORT master_key_material *
crypto_factory_get_master_key_material_for_test(
const dds_security_crypto_key_factory *factory,
DDS_Security_ParticipantCryptoHandle local_id,
DDS_Security_ParticipantCryptoHandle remote_id);
#endif /* CRYPTO_KEY_FACTORY_H */