From: Francis Dupont Date: Fri, 16 Jan 2026 21:36:03 +0000 (+0100) Subject: [#4282] Addressed first comments X-Git-Tag: Kea-3.1.5~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cde74349e47243f455ad3ad4c3992a206c00a99f;p=thirdparty%2Fkea.git [#4282] Addressed first comments --- diff --git a/src/hooks/dhcp/radius/client_attribute.h b/src/hooks/dhcp/radius/client_attribute.h index 33006d3071..5da4576c46 100644 --- a/src/hooks/dhcp/radius/client_attribute.h +++ b/src/hooks/dhcp/radius/client_attribute.h @@ -862,7 +862,7 @@ public: /// @brief Adds instance of the attribute to the collection. /// /// @param attr Pointer to the attribute being added (can be null). - /// @param back Insert bsk (vs front). + /// @param back Insert back (vs front). void add(const ConstAttributePtr& attr, bool back = true); /// @brief Deletes an attribute from the collection. diff --git a/src/hooks/dhcp/radius/client_message.cc b/src/hooks/dhcp/radius/client_message.cc index e388f450b3..0977f46535 100644 --- a/src/hooks/dhcp/radius/client_message.cc +++ b/src/hooks/dhcp/radius/client_message.cc @@ -448,7 +448,7 @@ Message::verifyMessageAuthenticator(size_t ptr) { if ((ptr < AUTH_HDR_LEN) || (ptr > buffer_.size() - 2 - AUTH_VECTOR_LEN) || (buffer_[ptr + 1] != 2 + AUTH_VECTOR_LEN) || (auth_.size() != AUTH_VECTOR_LEN)) { - isc_throw(BadValue, "can't verify Message-Authenticator"); + isc_throw(BadValue, "Can't verify Message-Authenticator"); } vector sign; @@ -459,7 +459,6 @@ Message::verifyMessageAuthenticator(size_t ptr) { CryptoLink::getCryptoLink().createHMAC(&secret_[0], secret_.size(), MD5)); // Build to_verify buffer. - size_t length = buffer_.size(); std::vector to_verify = buffer_; memmove(&to_verify[4], &auth_[0], auth_.size()); memset(&to_verify[ptr + 2], 0, AUTH_VECTOR_LEN); diff --git a/src/hooks/dhcp/radius/tests/message_unittests.cc b/src/hooks/dhcp/radius/tests/message_unittests.cc index 5894ab700b..e3b8f81c8c 100644 --- a/src/hooks/dhcp/radius/tests/message_unittests.cc +++ b/src/hooks/dhcp/radius/tests/message_unittests.cc @@ -956,7 +956,7 @@ TEST_F(MessageTest, badDecode) { MessagePtr message(new Message(buffer, auth, "foo")); ASSERT_TRUE(message); EXPECT_THROW_MSG(message->decode(), BadValue, - "can't verify Message-Authenticator"); + "Can't verify Message-Authenticator"); } { SCOPED_TRACE("too long Message-Authenticator"); @@ -976,7 +976,7 @@ TEST_F(MessageTest, badDecode) { MessagePtr message(new Message(buffer, auth, "foo")); ASSERT_TRUE(message); EXPECT_THROW_MSG(message->decode(), BadValue, - "can't verify Message-Authenticator"); + "Can't verify Message-Authenticator"); } { SCOPED_TRACE("bad Message-Authenticator"); diff --git a/src/lib/tcp/tests/common_client_unittests.h b/src/lib/tcp/tests/common_client_unittests.h index da469e13d9..094144d3a5 100644 --- a/src/lib/tcp/tests/common_client_unittests.h +++ b/src/lib/tcp/tests/common_client_unittests.h @@ -518,7 +518,7 @@ public: request, response, true, TestCompleteCheck, [this](const boost::system::error_code& ec, - const WireDataPtr& response, + const WireDataPtr& resp, const std::string& parsing_error) { io_service_->stop(); // There should be no IO error (answer from the server is received). @@ -526,7 +526,7 @@ public: ADD_FAILURE() << "asyncSendRequest failed: " << ec.message(); } // The response object is null. - EXPECT_FALSE(response); + EXPECT_FALSE(resp); // The message parsing error should be returned. EXPECT_FALSE(parsing_error.empty()); })); @@ -560,7 +560,7 @@ public: request1, response1, true, TestCompleteCheck, [this, &cb_num](const boost::system::error_code& ec, - const WireDataPtr& response, + const WireDataPtr& resp, const std::string&) { if (++cb_num > 1) { io_service_->stop(); @@ -570,7 +570,7 @@ public: // error code. EXPECT_TRUE(ec.value() == boost::asio::error::timed_out); // There should be no response returned. - EXPECT_FALSE(response); + EXPECT_FALSE(resp); }, TcpClient::RequestTimeout(100), TcpClient::ConnectHandler(), @@ -624,7 +624,7 @@ public: request, response, true, TestCompleteCheck, [this, &cb_num](const boost::system::error_code& ec, - const WireDataPtr& response, + const WireDataPtr& resp, const std::string&) { if (++cb_num > 1) { io_service_->stop(); @@ -634,7 +634,7 @@ public: // error code. EXPECT_TRUE(ec.value() == boost::asio::error::timed_out); // There should be no response returned. - EXPECT_FALSE(response); + EXPECT_FALSE(resp); }, TcpClient::RequestTimeout(100),