From 1babae43ba1c8478a634bb02f9c78d7c6d48921e Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 22 Nov 2024 11:57:35 +0100 Subject: [PATCH] Refs #22280. Use `DH` alias instead of `RSA`. Signed-off-by: Miguel Company --- src/cpp/security/authentication/PKIDH.cpp | 2 +- test/blackbox/common/BlackboxTestsSecurity.cpp | 14 +++++++------- .../security/authentication/BuiltinPKIDHTests.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cpp/security/authentication/PKIDH.cpp b/src/cpp/security/authentication/PKIDH.cpp index 6bb806ad27d..ea238934849 100644 --- a/src/cpp/security/authentication/PKIDH.cpp +++ b/src/cpp/security/authentication/PKIDH.cpp @@ -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 = ""; diff --git a/test/blackbox/common/BlackboxTestsSecurity.cpp b/test/blackbox/common/BlackboxTestsSecurity.cpp index 064dde4d360..9f251a545aa 100644 --- a/test/blackbox/common/BlackboxTestsSecurity.cpp +++ b/test/blackbox/common/BlackboxTestsSecurity.cpp @@ -51,7 +51,7 @@ enum communication_type enum class key_agree_alg { - RSA, + DH, ECDH }; @@ -125,8 +125,8 @@ class Security : public testing::TestWithParam(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: @@ -142,8 +142,8 @@ class Security : public testing::TestWithParam(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: @@ -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& 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)) { diff --git a/test/unittest/security/authentication/BuiltinPKIDHTests.cpp b/test/unittest/security/authentication/BuiltinPKIDHTests.cpp index 4f2a5c7626e..5ce715ae0cd 100644 --- a/test/unittest/security/authentication/BuiltinPKIDHTests.cpp +++ b/test/unittest/security/authentication/BuiltinPKIDHTests.cpp @@ -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" @@ -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", ""