Repository: randombit/botan
Pull request #3102 (2022-12-03 13:12:54)

Remove uses of ';;' to terminate statements.


Patch:
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 3f8838969..af6b97331 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -2160,7 +2160,7 @@ class Speed final : public Command
             std::unique_ptr<Botan::Private_Key> key = keygen_timer->run([&]
                {
                return std::make_unique<Botan::McEliece_PrivateKey>(rng(), n, t);
-               });;
+               });
 
             record_result(keygen_timer);
             bench_pk_kem(*key, nm, provider, "KDF2(SHA-256)", msec);
diff --git a/src/lib/hash/sha2_32/sha2_32_x86/sha2_32_x86.cpp b/src/lib/hash/sha2_32/sha2_32_x86/sha2_32_x86.cpp
index ba12a1610..bf384ee55 100644
--- a/src/lib/hash/sha2_32/sha2_32_x86/sha2_32_x86.cpp
+++ b/src/lib/hash/sha2_32/sha2_32_x86/sha2_32_x86.cpp
@@ -61,7 +61,7 @@ void SHA_256::compress_digest_x86(secure_vector<uint32_t>& digest, const uint8_t
 
       __m128i MSG;
 
-      __m128i TMSG0 = _mm_shuffle_epi8(_mm_loadu_si128(input_mm), MASK);;
+      __m128i TMSG0 = _mm_shuffle_epi8(_mm_loadu_si128(input_mm), MASK);
       __m128i TMSG1 = _mm_shuffle_epi8(_mm_loadu_si128(input_mm + 1), MASK);
       __m128i TMSG2 = _mm_shuffle_epi8(_mm_loadu_si128(input_mm + 2), MASK);
       __m128i TMSG3 = _mm_shuffle_epi8(_mm_loadu_si128(input_mm + 3), MASK);
diff --git a/src/lib/passhash/bcrypt/bcrypt.cpp b/src/lib/passhash/bcrypt/bcrypt.cpp
index 9c2ca3f81..0615a04fa 100644
--- a/src/lib/passhash/bcrypt/bcrypt.cpp
+++ b/src/lib/passhash/bcrypt/bcrypt.cpp
@@ -81,7 +81,7 @@ std::string bcrypt_base64_encode(const uint8_t input[], size_t length)
       b64 = b64.substr(0, b64.size() - 1);
 
    for(size_t i = 0; i != b64.size(); ++i)
-      b64[i] = static_cast<char>(base64_to_bcrypt_encoding(static_cast<uint8_t>(b64[i])));;
+      b64[i] = static_cast<char>(base64_to_bcrypt_encoding(static_cast<uint8_t>(b64[i])));
 
    return b64;
    }
diff --git a/src/lib/tls/tls_extensions.cpp b/src/lib/tls/tls_extensions.cpp
index 18f99defb..6a8c48d9c 100644
--- a/src/lib/tls/tls_extensions.cpp
+++ b/src/lib/tls/tls_extensions.cpp
@@ -92,7 +92,7 @@ std::unique_ptr<Extension> make_extension(TLS_Data_Reader& reader,
       }
 
    return std::make_unique<Unknown_Extension>(static_cast<Handshake_Extension_Type>(code),
-                                              reader, size);;
+                                              reader, size);
    }
 
 }
diff --git a/src/lib/utils/socket/socket.cpp b/src/lib/utils/socket/socket.cpp
index 664a08b80..7c2abb484 100644
--- a/src/lib/utils/socket/socket.cpp
+++ b/src/lib/utils/socket/socket.cpp
@@ -341,7 +341,7 @@ class BSD_Socket final : public OS::Socket
          {
          struct timeval tv;
          tv.tv_sec = static_cast<decltype(timeval::tv_sec)>(m_timeout.count() / 1000000);
-         tv.tv_usec = static_cast<decltype(timeval::tv_usec)>(m_timeout.count() % 1000000);;
+         tv.tv_usec = static_cast<decltype(timeval::tv_usec)>(m_timeout.count() % 1000000);
          return tv;
          }
 
diff --git a/src/lib/utils/socket/socket_udp.cpp b/src/lib/utils/socket/socket_udp.cpp
index 0635cbb50..1fa29ddf4 100644
--- a/src/lib/utils/socket/socket_udp.cpp
+++ b/src/lib/utils/socket/socket_udp.cpp
@@ -309,7 +309,7 @@ class BSD_SocketUDP final : public OS::SocketUDP
          {
          struct timeval tv;
          tv.tv_sec = static_cast<decltype(timeval::tv_sec)>(m_timeout.count() / 1000000);
-         tv.tv_usec = static_cast<decltype(timeval::tv_usec)>(m_timeout.count() % 1000000);;
+         tv.tv_usec = static_cast<decltype(timeval::tv_usec)>(m_timeout.count() % 1000000);
          return tv;
          }
 


Test patch:
diff --git a/src/tests/test_roughtime.cpp b/src/tests/test_roughtime.cpp
index 2c4e38d5e..063b59529 100644
--- a/src/tests/test_roughtime.cpp
+++ b/src/tests/test_roughtime.cpp
@@ -132,7 +132,7 @@ class Roughtime final : public Test
          {
          Test::Result result("roughtime nonce");
 
-         auto rand64 = Botan::unlock(Test::rng().random_vec(64));;
+         auto rand64 = Botan::unlock(Test::rng().random_vec(64));
          Botan::Roughtime::Nonce nonce_v(rand64);
          result.confirm("nonce from vector", nonce_v.get_nonce() == Botan::typecast_copy<std::array<uint8_t, 64>>
                         (rand64.data()));
@@ -154,7 +154,7 @@ class Roughtime final : public Test
          Botan::Roughtime::Chain c1;
          result.confirm("default constructed is empty", c1.links().empty() && c1.responses().empty());
 
-         auto rand64 = Botan::unlock(Test::rng().random_vec(64));;
+         auto rand64 = Botan::unlock(Test::rng().random_vec(64));
          Botan::Roughtime::Nonce nonce_v(rand64);
          result.confirm("empty chain nonce is blind",
                         c1.next_nonce(nonce_v).get_nonce() == Botan::typecast_copy<std::array<uint8_t, 64>>(rand64.data()));
diff --git a/src/tests/test_tls_record_layer_13.cpp b/src/tests/test_tls_record_layer_13.cpp
index 502ccf518..9a2427fd3 100644
--- a/src/tests/test_tls_record_layer_13.cpp
+++ b/src/tests/test_tls_record_layer_13.cpp
@@ -418,7 +418,7 @@ std::vector<Test::Result> write_records()
          }),
       Botan_Tests::CHECK("prepare a dummy CCS", [&](auto& result)
          {
-         auto record = record_layer_client(true).prepare_records(Botan::TLS::Record_Type::CHANGE_CIPHER_SPEC, {0x01});;
+         auto record = record_layer_client(true).prepare_records(Botan::TLS::Record_Type::CHANGE_CIPHER_SPEC, {0x01});
          result.require("record was created", record.size() == Botan::TLS::TLS_HEADER_SIZE + 1);
 
          result.test_eq("CCS record is well-formed", record, Botan::hex_decode("140303000101"));
@@ -724,7 +724,7 @@ std::vector<Test::Result> write_encrypted_records()
 
       Botan_Tests::CHECK("write a dummy CCS (that must not be encrypted)", [&](auto& result)
          {
-         auto record = record_layer_client(true).prepare_records(Botan::TLS::Record_Type::CHANGE_CIPHER_SPEC, {0x01}, cs.get());;
+         auto record = record_layer_client(true).prepare_records(Botan::TLS::Record_Type::CHANGE_CIPHER_SPEC, {0x01}, cs.get());
          result.require("record was created and not encrypted", record.size() == Botan::TLS::TLS_HEADER_SIZE + 1);
 
          result.test_eq("CCS record is well-formed", record, Botan::hex_decode("140303000101"));
diff --git a/src/tests/unit_ecdsa.cpp b/src/tests/unit_ecdsa.cpp
index e4881dc1f..6769b115d 100644
--- a/src/tests/unit_ecdsa.cpp
+++ b/src/tests/unit_ecdsa.cpp
@@ -222,7 +222,7 @@ Test::Result test_ecdsa_create_save_load()
       }
 
    Botan::DataSource_Memory pem_src(ecc_private_key_pem);
-   std::unique_ptr<Botan::Private_Key> loaded_key = Botan::PKCS8::load_key(pem_src);;
+   std::unique_ptr<Botan::Private_Key> loaded_key = Botan::PKCS8::load_key(pem_src);
    Botan::ECDSA_PrivateKey* loaded_ec_key = dynamic_cast<Botan::ECDSA_PrivateKey*>(loaded_key.get());
    result.confirm("the loaded key could be converted into an ECDSA_PrivateKey", loaded_ec_key != nullptr);