Skip to content

Commit

Permalink
Refs #22280. Use DH alias instead of RSA.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany committed Nov 22, 2024
1 parent f1458ca commit 1babae4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/cpp/security/authentication/PKIDH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ ValidationResult_t PKIDH::validate_local_identity(
{DH_2048_256, DH_2048_256},
{ECDH_prime256v1, ECDH_prime256v1},
{"ECDH", ECDH_prime256v1},
{"RSA", DH_2048_256}
{"DH", DH_2048_256}
};

key_agreement_algorithm = "";
Expand Down
14 changes: 7 additions & 7 deletions test/blackbox/common/BlackboxTestsSecurity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ enum communication_type

enum class key_agree_alg
{
RSA,
DH,
ECDH
};

Expand Down Expand Up @@ -125,8 +125,8 @@ class Security : public testing::TestWithParam<std::tuple<communication_type, ke
fill_basic_pub_auth(policy);
switch (std::get<1>(GetParam()))
{
case key_agree_alg::RSA:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "RSA");
case key_agree_alg::DH:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "DH");
break;

case key_agree_alg::ECDH:
Expand All @@ -142,8 +142,8 @@ class Security : public testing::TestWithParam<std::tuple<communication_type, ke
fill_basic_sub_auth(policy);
switch (std::get<1>(GetParam()))
{
case key_agree_alg::RSA:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "RSA");
case key_agree_alg::DH:
policy.properties().emplace_back("dds.sec.auth.builtin.PKI-DH.preferred_key_agreement", "DH");
break;
case key_agree_alg::ECDH:
default:
Expand Down Expand Up @@ -4568,11 +4568,11 @@ GTEST_INSTANTIATE_TEST_MACRO(Security,
Security,
testing::Combine(
testing::Values(TRANSPORT, INTRAPROCESS, DATASHARING),
testing::Values(key_agree_alg::RSA, key_agree_alg::ECDH)),
testing::Values(key_agree_alg::DH, key_agree_alg::ECDH)),
[](const testing::TestParamInfo<Security::ParamType>& info)
{
std::string alg;
alg = std::get<1>(info.param) == key_agree_alg::RSA ? "RSA_" : "ECDH_";
alg = (std::get<1>(info.param) == key_agree_alg::DH) ? "DH_" : "ECDH_";

switch (std::get<0>(info.param))
{
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/security/authentication/BuiltinPKIDHTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ TEST_F(AuthenticationPluginTest, validate_local_identity_kagree_algo)
{
const std::string correct_values[] =
{
"RSA",
"DH",
"ECDH",
"DH+MODP-2048-256",
"ECDH+prime256v1-CEUM"
Expand All @@ -416,7 +416,7 @@ TEST_F(AuthenticationPluginTest, validate_local_identity_kagree_algo)
{
"RSA+MODP-2048-256",
"ECDH+MODP-2048-256",
"DH",
"RSA",
"ECDH+prime256v1",
"unknown",
""
Expand Down

0 comments on commit 1babae4

Please sign in to comment.