]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4282] Addressed first comments
authorFrancis Dupont <fdupont@isc.org>
Fri, 16 Jan 2026 21:36:03 +0000 (22:36 +0100)
committerFrancis Dupont <fdupont@isc.org>
Tue, 20 Jan 2026 09:31:10 +0000 (10:31 +0100)
src/hooks/dhcp/radius/client_attribute.h
src/hooks/dhcp/radius/client_message.cc
src/hooks/dhcp/radius/tests/message_unittests.cc
src/lib/tcp/tests/common_client_unittests.h

index 33006d3071f9e78a1e9c41225fcbe6515bb8ebcc..5da4576c46d7d82b9ebad47842757f84a67908de 100644 (file)
@@ -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.
index e388f450b3df7624a9b1df54650b7fd53c286ad6..0977f465359d79344ce6b6cb66b5bae7b83be54c 100644 (file)
@@ -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<uint8_t> 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<uint8_t> to_verify = buffer_;
     memmove(&to_verify[4], &auth_[0], auth_.size());
     memset(&to_verify[ptr + 2], 0, AUTH_VECTOR_LEN);
index 5894ab700bd80e6b3929f228adab75a898cac0f4..e3b8f81c8c7b7548a219490ebaa0c6bbbb27acc8 100644 (file)
@@ -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");
index da469e13d94c534194fed14ec1d4f4d8688edc1a..094144d3a5435075c9277bfefa57ef1930ac54bf 100644 (file)
@@ -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),