Skip to content

Commit

Permalink
Refs #19921. Add AUTO value to blackbox test.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany committed Nov 27, 2024
1 parent b9731f0 commit 587ee3b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions test/blackbox/common/BlackboxTestsSecurity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ static void fill_pub_auth(
"file://" + std::string(certs_path) + "/mainpubkey.pem");

// Select the key agreement algorithm based on process id
switch (static_cast<uint32_t>(GET_PID()) % 3u)
switch (static_cast<uint32_t>(GET_PID()) % 4u)
{
// Force DH
// Automatic selection
case 1u:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "AUTO");
break;
// Force DH
case 2u:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "DH");
break;
// Force ECDH
case 2u:
case 3u:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "ECDH");
break;
// Leave default
Expand All @@ -89,14 +93,18 @@ static void fill_sub_auth(
"file://" + std::string(certs_path) + "/mainsubkey.pem");

// Select the key agreement algorithm based on process id
switch (static_cast<uint32_t>(GET_PID()) % 3u)
switch (static_cast<uint32_t>(GET_PID()) % 4u)
{
// Force DH
// Automatic selection
case 1u:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "AUTO");
break;
// Force DH
case 2u:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "DH");
break;
// Force ECDH
case 2u:
case 3u:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "ECDH");
break;
// Leave default
Expand Down

0 comments on commit 587ee3b

Please sign in to comment.