From 7aad21b7edf55f2adea4584aae58ef01cfc4beba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 19 May 2025 18:22:58 -0400 Subject: [PATCH 01/20] value: cleanup --- include/opendht/value.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/opendht/value.h b/include/opendht/value.h index acf0eaa1..1a013f48 100644 --- a/include/opendht/value.h +++ b/include/opendht/value.h @@ -137,8 +137,6 @@ private: std::map types {}; }; -struct CryptoValueCache; - /** * A "value" is data potentially stored on the Dht, with some metadata. * From 5cfb1c6c9c8fcab0aead0ac5b77f731163a2c459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 19 May 2025 23:45:27 -0400 Subject: [PATCH 02/20] tests/dhtrunner: wait separately for two conditions --- tests/dhtrunnertester.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/dhtrunnertester.cpp b/tests/dhtrunnertester.cpp index a882794f..24f5f9be 100644 --- a/tests/dhtrunnertester.cpp +++ b/tests/dhtrunnertester.cpp @@ -358,7 +358,8 @@ DhtRunnerTester::testIdOps() { { std::unique_lock lk(mutex); - CPPUNIT_ASSERT(cv.wait_for(lk, 20s, [&]{ return valueCount == 7 && valueCountEdit == 2; })); + CPPUNIT_ASSERT(cv.wait_for(lk, 20s, [&]{ return valueCount == 7; })); + CPPUNIT_ASSERT(cv.wait_for(lk, 20s, [&]{ return valueCountEdit == 2; })); } // editValue->data = dht::packMsg("v2"); From 38b0b2248f65653c3c4b55c91d1dcffab42be6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 19 May 2025 23:47:14 -0400 Subject: [PATCH 03/20] crypto: add Certificate::getDN() to read RFC4514 distinguished name --- include/opendht/crypto.h | 6 ++++++ src/crypto.cpp | 42 ++++++++++++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/include/opendht/crypto.h b/include/opendht/crypto.h index 6e8ff7a9..4bd9d525 100644 --- a/include/opendht/crypto.h +++ b/include/opendht/crypto.h @@ -512,12 +512,18 @@ struct OPENDHT_PUBLIC Certificate { Blob getSerialNumber() const; + /** Read certificate full DN as described in RFC4514 */ + std::string getDN() const; + /** Read certificate Common Name (CN) */ std::string getName() const; /** Read certificate User ID (UID) */ std::string getUID() const; + /** Read certificate issuer DN as described in RFC4514 */ + std::string getIssuerDN() const; + /** Read certificate issuer Common Name (CN) */ std::string getIssuerName() const; diff --git a/src/crypto.cpp b/src/crypto.cpp index e71fe02e..c0874da8 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -646,7 +646,7 @@ GnuTLSFromType(NameType type) } static std::string -getDN(gnutls_x509_crq_t request, const char* oid) +readDN(gnutls_x509_crq_t request, const char* oid) { std::string dn; dn.resize(512); @@ -704,13 +704,13 @@ CertificateRequest::setName(const std::string& name) std::string CertificateRequest::getName() const { - return getDN(request, GNUTLS_OID_X520_COMMON_NAME); + return readDN(request, GNUTLS_OID_X520_COMMON_NAME); } std::string CertificateRequest::getUID() const { - return getDN(request, GNUTLS_OID_LDAP_UID); + return readDN(request, GNUTLS_OID_LDAP_UID); } void @@ -769,7 +769,21 @@ CertificateRequest::toString() const // Certificate static std::string -getDN(gnutls_x509_crt_t cert, const char* oid, bool issuer = false) +readDN(gnutls_x509_crt_t cert, bool issuer = false) +{ + gnutls_datum_t dn; + int err = issuer + ? gnutls_x509_crt_get_issuer_dn3(cert, &dn, 0) + : gnutls_x509_crt_get_dn3( cert, &dn, 0); + if (err != GNUTLS_E_SUCCESS) + return {}; + std::string ret((const char*)dn.data, dn.size); + gnutls_free(dn.data); + return ret; +} + +static std::string +readDN(gnutls_x509_crt_t cert, const char* oid, bool issuer = false) { std::string dn; dn.resize(512); @@ -927,28 +941,40 @@ Certificate::getSerialNumber() const return {serial, serial + size}; } +std::string +Certificate::getDN() const +{ + return readDN(cert); +} + std::string Certificate::getName() const { - return getDN(cert, GNUTLS_OID_X520_COMMON_NAME); + return readDN(cert, GNUTLS_OID_X520_COMMON_NAME); } std::string Certificate::getUID() const { - return getDN(cert, GNUTLS_OID_LDAP_UID); + return readDN(cert, GNUTLS_OID_LDAP_UID); +} + +std::string +Certificate::getIssuerDN() const +{ + return readDN(cert, true); } std::string Certificate::getIssuerName() const { - return getDN(cert, GNUTLS_OID_X520_COMMON_NAME, true); + return readDN(cert, GNUTLS_OID_X520_COMMON_NAME, true); } std::string Certificate::getIssuerUID() const { - return getDN(cert, GNUTLS_OID_LDAP_UID, true); + return readDN(cert, GNUTLS_OID_LDAP_UID, true); } std::vector> From b3b050ca2693824cd5256fcf201cbc2afbf43bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 19 May 2025 23:47:46 -0400 Subject: [PATCH 04/20] build/cmake: declare support for cmake up to 3.31 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77646904..5b09122e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.16..3.28) +cmake_minimum_required (VERSION 3.16..3.31) if(POLICY CMP0135) cmake_policy(SET CMP0135 NEW) endif() From 2bc46e9657c94adcce2479807a0a04c2f783bd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 19 May 2025 23:47:46 -0400 Subject: [PATCH 05/20] build/cmake: search llhttp with pkg_search_module --- CMakeLists.txt | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b09122e..f67cae38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,29 +97,35 @@ if (NOT MSVC) find_package(Restinio REQUIRED) # llhttp - find_path(LLHTTP_INCLUDE_DIR llhttp.h) - find_library(LLHTTP_LIBRARY NAMES llhttp libllhttp) - if (LLHTTP_INCLUDE_DIR AND LLHTTP_LIBRARY) - message(STATUS "Found llhttp ${LLHTTP_INCLUDE_DIR} ${LLHTTP_LIBRARY}") - add_library(llhttp_static STATIC IMPORTED) - set_target_properties(llhttp_static PROPERTIES - IMPORTED_LOCATION ${LLHTTP_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES ${LLHTTP_INCLUDE_DIR} - ) - set(llhttp_target llhttp_static) + pkg_search_module(LLHTTP IMPORTED_TARGET llhttp libllhttp) + if (LLHTTP_FOUND) + message(STATUS "Found llhttp ${LLHTTP_INCLUDE_DIRS}") + set(llhttp_target PkgConfig::LLHTTP) else() - FetchContent_Declare(llhttp-local URL "https://github.com/nodejs/llhttp/archive/refs/tags/release/v9.2.1.tar.gz") - if (BUILD_SHARED_LIBS) - set(BUILD_SHARED_LIBS ON CACHE INTERNAL "") - else() - set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "") - set(BUILD_STATIC_LIBS ON CACHE INTERNAL "") - endif() - FetchContent_MakeAvailable(llhttp-local) - if (BUILD_SHARED_LIBS) - set(llhttp_target llhttp_shared) - else() + find_path(LLHTTP_INCLUDE_DIR llhttp.h) + find_library(LLHTTP_LIBRARY NAMES llhttp libllhttp) + if (LLHTTP_INCLUDE_DIR AND LLHTTP_LIBRARY) + message(STATUS "Found llhttp ${LLHTTP_INCLUDE_DIR} ${LLHTTP_LIBRARY}") + add_library(llhttp_static STATIC IMPORTED) + set_target_properties(llhttp_static PROPERTIES + IMPORTED_LOCATION ${LLHTTP_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${LLHTTP_INCLUDE_DIR} + ) set(llhttp_target llhttp_static) + else() + FetchContent_Declare(llhttp-local URL "https://github.com/nodejs/llhttp/archive/refs/tags/release/v9.2.1.tar.gz") + if (BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS ON CACHE INTERNAL "") + else() + set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "") + set(BUILD_STATIC_LIBS ON CACHE INTERNAL "") + endif() + FetchContent_MakeAvailable(llhttp-local) + if (BUILD_SHARED_LIBS) + set(llhttp_target llhttp_shared) + else() + set(llhttp_target llhttp_static) + endif() endif() endif() set(http_lib "-lllhttp") From 13af7a6002dc1d1c15cdd572dd8903244bae5621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 19 May 2025 17:21:58 -0400 Subject: [PATCH 06/20] dhtrunner: registerCertificate: take certificate by const ref --- include/opendht/dhtrunner.h | 2 +- include/opendht/securedht.h | 2 +- src/dhtrunner.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/opendht/dhtrunner.h b/include/opendht/dhtrunner.h index aa2d05d9..bef88baa 100644 --- a/include/opendht/dhtrunner.h +++ b/include/opendht/dhtrunner.h @@ -384,7 +384,7 @@ public: // securedht methods void findCertificate(InfoHash hash, std::function&)>); - void registerCertificate(std::shared_ptr cert); + void registerCertificate(const std::shared_ptr& cert); void setLocalCertificateStore(CertificateStoreQuery&& query_method); /** diff --git a/include/opendht/securedht.h b/include/opendht/securedht.h index e057a72d..801e3def 100644 --- a/include/opendht/securedht.h +++ b/include/opendht/securedht.h @@ -136,7 +136,7 @@ public: void findPublicKey(const InfoHash& node, const std::function)>& cb); Sp registerCertificate(const InfoHash& node, const Blob& cert); - void registerCertificate(Sp& cert); + void registerCertificate(const Sp& cert); Sp getCertificate(const InfoHash& node) const; Sp getPublicKey(const InfoHash& node) const; diff --git a/src/dhtrunner.cpp b/src/dhtrunner.cpp index 4c1e3040..5d1ddce8 100644 --- a/src/dhtrunner.cpp +++ b/src/dhtrunner.cpp @@ -619,7 +619,7 @@ DhtRunner::getPublicAddress(std::function&&)> cb, sa_ } void -DhtRunner::registerCertificate(std::shared_ptr cert) { +DhtRunner::registerCertificate(const std::shared_ptr& cert) { std::lock_guard lck(dht_mtx); dht_->registerCertificate(cert); } From 8d030f75f6fa38b9ef1901fbe1eaf317935631ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 19 May 2025 17:27:28 -0400 Subject: [PATCH 07/20] valuetype: compare certificate using longId --- include/opendht/securedht.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/opendht/securedht.h b/include/opendht/securedht.h index 801e3def..faddef7c 100644 --- a/include/opendht/securedht.h +++ b/include/opendht/securedht.h @@ -387,7 +387,7 @@ const ValueType CERTIFICATE_TYPE = { }, [](InfoHash, const Sp& o, Sp& n, const InfoHash&, const SockAddr&) { try { - return crypto::Certificate(o->data).getPublicKey().getId() == crypto::Certificate(n->data).getPublicKey().getId(); + return crypto::Certificate(o->data).getPublicKey().getLongId() == crypto::Certificate(n->data).getPublicKey().getLongId(); } catch (const std::exception& e) {} return false; } From a2dff6a12337f2399fbd298ef24171429273eb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Tue, 20 May 2025 21:55:04 -0400 Subject: [PATCH 08/20] dhtrunner: registerCertificate: take certificate by const ref --- src/securedht.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/securedht.cpp b/src/securedht.cpp index 9aca9fb4..0a3f8477 100644 --- a/src/securedht.cpp +++ b/src/securedht.cpp @@ -158,7 +158,7 @@ SecureDht::registerCertificate(const InfoHash& node, const Blob& data) } void -SecureDht::registerCertificate(Sp& cert) +SecureDht::registerCertificate(const Sp& cert) { if (cert) nodesCertificates_[cert->getId()] = cert; From 3e407e65fa27afbbeec04cdf055d4342ad93b258 Mon Sep 17 00:00:00 2001 From: Adrien Beraud Date: Thu, 22 May 2025 11:36:16 -0400 Subject: [PATCH 09/20] storage: remove previous value size from quota when appropriate --- src/storage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage.h b/src/storage.h index dc5f2d94..5e7f034f 100644 --- a/src/storage.h +++ b/src/storage.h @@ -224,7 +224,7 @@ Storage::store(const InfoHash& id, const Sp& value, time_point created, t //DHT_LOG.DEBUG("Updating %s -> %s", id.toString().c_str(), value->toString().c_str()); // clear quota for previous value if (it->store_bucket) - it->store_bucket->erase(id, *value, it->expiration); + it->store_bucket->erase(id, *it->data, it->expiration); it->expiration = expiration; // update quota for new value it->store_bucket = sb; From 405220795b0167bfc4a03e181b0f9aebfa83fcea Mon Sep 17 00:00:00 2001 From: Adrien Beraud Date: Thu, 22 May 2025 11:36:40 -0400 Subject: [PATCH 10/20] http: check for cb in async_read_until --- src/http.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.cpp b/src/http.cpp index 54bc63af..865d2dea 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -604,7 +604,7 @@ Connection::async_read_until(const char* delim, BytesHandlerCb cb) { std::lock_guard lock(mutex_); if (!is_open()) { - asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); }); + if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); }); return; } if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb))); From d9afd2631b6775fc2525b9ee01cff36e6b164efb Mon Sep 17 00:00:00 2001 From: Adrien Beraud Date: Thu, 22 May 2025 12:05:31 -0400 Subject: [PATCH 11/20] update version to 3.4.0 --- CMakeLists.txt | 2 +- configure.ac | 2 +- meson.build | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f67cae38..1dd67bd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ include(CTest) include(FetchContent) set (opendht_VERSION_MAJOR 3) -set (opendht_VERSION_MINOR 3.0) +set (opendht_VERSION_MINOR 4.0) set (opendht_VERSION ${opendht_VERSION_MAJOR}.${opendht_VERSION_MINOR}) set (PACKAGE_VERSION ${opendht_VERSION}) set (VERSION "${opendht_VERSION}") diff --git a/configure.ac b/configure.ac index bdada013..b54d5b49 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl define macros m4_define([opendht_major_version], 3) -m4_define([opendht_minor_version], 3) +m4_define([opendht_minor_version], 4) m4_define([opendht_patch_version], 0) m4_define([opendht_version], [opendht_major_version.opendht_minor_version.opendht_patch_version]) diff --git a/meson.build b/meson.build index 2f77f948..142b06e6 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('opendht', 'c', 'cpp', 'cython', - version: '3.3.0', + version: '3.4.0', default_options: [ 'cpp_std=c++17', 'warning_level=3' From c4e75ae66ce71573c747426f0a582caf7771c2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Thu, 22 May 2025 19:04:36 -0400 Subject: [PATCH 12/20] update copyright year --- CMakeLists.txt | 2 +- README.md | 4 ++-- c/opendht.cpp | 2 +- c/opendht_c.h | 4 ++-- include/opendht.h | 2 +- include/opendht/callbacks.h | 2 +- include/opendht/crypto.h | 4 ++-- include/opendht/crypto/secure_vector.h | 2 +- include/opendht/default_types.h | 2 +- include/opendht/dht.h | 2 +- include/opendht/dht_interface.h | 2 +- include/opendht/dht_proxy_client.h | 2 +- include/opendht/dht_proxy_server.h | 2 +- include/opendht/dhtrunner.h | 2 +- include/opendht/http.h | 2 +- include/opendht/indexation/pht.h | 2 +- include/opendht/infohash.h | 2 +- include/opendht/log.h | 2 +- include/opendht/logger.h | 2 +- include/opendht/network_engine.h | 2 +- include/opendht/network_utils.h | 2 +- include/opendht/node.h | 2 +- include/opendht/node_cache.h | 2 +- include/opendht/node_export.h | 2 +- include/opendht/peer_discovery.h | 2 +- include/opendht/proxy.h | 2 +- include/opendht/rate_limiter.h | 2 +- include/opendht/rng.h | 2 +- include/opendht/routing_table.h | 2 +- include/opendht/scheduler.h | 2 +- include/opendht/securedht.h | 2 +- include/opendht/sockaddr.h | 2 +- include/opendht/thread_pool.h | 2 +- include/opendht/utils.h | 2 +- include/opendht/value.h | 2 +- python/setup.py.in | 2 +- python/tools/benchmark.py | 2 +- python/tools/dhtcluster.py | 2 +- rust/examples/dhtnode.rs | 2 +- rust/src/blob.rs | 2 +- rust/src/crypto.rs | 2 +- rust/src/dhtrunner.rs | 2 +- rust/src/ffi.rs | 2 +- rust/src/infohash.rs | 2 +- rust/src/lib.rs | 2 +- rust/src/pkid.rs | 2 +- rust/src/value.rs | 2 +- src/base64.cpp | 2 +- src/base64.h | 2 +- src/callbacks.cpp | 2 +- src/compat/msvc/unistd.h | 2 +- src/compat/os_cert.cpp | 2 +- src/compat/os_cert.h | 2 +- src/crypto.cpp | 2 +- src/default_types.cpp | 2 +- src/dht.cpp | 2 +- src/dht_proxy_client.cpp | 2 +- src/dht_proxy_server.cpp | 2 +- src/dhtrunner.cpp | 2 +- src/http.cpp | 2 +- src/indexation/pht.cpp | 2 +- src/listener.h | 2 +- src/log.cpp | 2 +- src/net.h | 2 +- src/network_engine.cpp | 2 +- src/network_utils.cpp | 2 +- src/node.cpp | 2 +- src/node_cache.cpp | 2 +- src/op_cache.cpp | 2 +- src/op_cache.h | 2 +- src/parsed_message.h | 2 +- src/peer_discovery.cpp | 2 +- src/request.h | 2 +- src/routing_table.cpp | 2 +- src/search.h | 2 +- src/securedht.cpp | 2 +- src/storage.h | 2 +- src/thread_pool.cpp | 2 +- src/utils.cpp | 2 +- src/value.cpp | 2 +- src/value_cache.h | 2 +- tests/cryptotester.cpp | 2 +- tests/cryptotester.h | 2 +- tests/dhtproxy_stress_tester.h | 2 +- tests/dhtproxytester.cpp | 2 +- tests/dhtproxytester.h | 2 +- tests/dhtrunnertester.cpp | 2 +- tests/dhtrunnertester.h | 2 +- tests/httptester.cpp | 2 +- tests/httptester.h | 2 +- tests/infohashtester.cpp | 2 +- tests/infohashtester.h | 2 +- tests/peerdiscoverytester.cpp | 2 +- tests/peerdiscoverytester.h | 2 +- tests/tests_runner.cpp | 2 +- tests/threadpooltester.cpp | 2 +- tests/threadpooltester.h | 2 +- tests/valuetester.cpp | 2 +- tests/valuetester.h | 2 +- tools/dhtchat.cpp | 2 +- tools/dhtcnode.c | 2 +- tools/dhtnode.cpp | 2 +- tools/dhtscanner.cpp | 2 +- tools/durl.cpp | 2 +- tools/perftest.cpp | 2 +- tools/proxy_loadtester.py | 2 +- tools/tools_common.h | 2 +- 107 files changed, 110 insertions(+), 110 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dd67bd3..9470f2b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,7 +176,7 @@ if (OPENDHT_HTTP OR OPENDHT_PEER_DISCOVERY) endif() if (NOT MSVC) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type -Wno-deprecated -Wall -Wextra -Wnon-virtual-dtor -pedantic-errors -fvisibility=hidden") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wall -Wextra -Wnon-virtual-dtor -pedantic-errors -fvisibility=hidden") if (OPENDHT_SANITIZE) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fstack-protector-strong") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fstack-protector-strong") diff --git a/README.md b/README.md index 2c2aad9b..7137e7ac 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ for r in results: IRC: join us on Libera.chat at [`#opendht`](https://web.libera.chat/#opendht). ## License -Copyright (C) 2014-2023 Savoir-faire Linux Inc. +Copyright (C) 2014-2025 Savoir-faire Linux Inc. OpenDHT is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -118,4 +118,4 @@ See COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html for the full GPLv3 l ## Acknowledgements This project was originally based on https://github.com/jech/dht by Juliusz Chroboczek. -It is independent from another project called OpenDHT (Sean Rhea. Ph.D. Thesis, 2005), now extinct. +It is independent from another (now extinct) project called OpenDHT (Sean Rhea. Ph.D. Thesis, 2005). diff --git a/c/opendht.cpp b/c/opendht.cpp index cf80546f..0ac831dc 100644 --- a/c/opendht.cpp +++ b/c/opendht.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/c/opendht_c.h b/c/opendht_c.h index dd3750bf..137193d3 100644 --- a/c/opendht_c.h +++ b/c/opendht_c.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify @@ -91,7 +91,7 @@ OPENDHT_C_PUBLIC dht_pkid dht_certificate_get_long_id(const dht_certificate*); OPENDHT_C_PUBLIC dht_publickey* dht_certificate_get_publickey(const dht_certificate*); OPENDHT_C_PUBLIC void dht_certificate_delete(dht_certificate*); -struct OPENDHT_PUBLIC dht_identity { +struct OPENDHT_C_PUBLIC dht_identity { dht_privatekey* privatekey; dht_certificate* certificate; }; diff --git a/include/opendht.h b/include/opendht.h index 017fba43..107146d2 100644 --- a/include/opendht.h +++ b/include/opendht.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/callbacks.h b/include/opendht/callbacks.h index 8303c410..2bce51d7 100644 --- a/include/opendht/callbacks.h +++ b/include/opendht/callbacks.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Authors: Adrien Béraud * Simon Désaulniers * Sébastien Blin diff --git a/include/opendht/crypto.h b/include/opendht/crypto.h index 4bd9d525..dd6fe736 100644 --- a/include/opendht/crypto.h +++ b/include/opendht/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * Vsevolod Ivanov * @@ -754,7 +754,7 @@ OPENDHT_PUBLIC Blob aesGetSalt(const uint8_t* data, size_t data_length); OPENDHT_PUBLIC Blob inline aesGetSalt(const Blob& data) { return aesGetSalt(data.data(), data.size()); } -/** Get the encrypted data part of data password-encrypted with `aesEncrypt(data, password)` */ +/** Get the encrypted data (ciphertext) part of data password-encrypted with `aesEncrypt(data, password)` */ OPENDHT_PUBLIC std::string_view aesGetEncrypted(const uint8_t* data, size_t data_length); OPENDHT_PUBLIC std::string_view inline aesGetEncrypted(const Blob& data) { return aesGetEncrypted(data.data(), data.size()); diff --git a/include/opendht/crypto/secure_vector.h b/include/opendht/crypto/secure_vector.h index 1dfb5036..b69d6e2c 100644 --- a/include/opendht/crypto/secure_vector.h +++ b/include/opendht/crypto/secure_vector.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/opendht/default_types.h b/include/opendht/default_types.h index 61f17be0..f3c25873 100644 --- a/include/opendht/default_types.h +++ b/include/opendht/default_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/dht.h b/include/opendht/dht.h index b45fbab6..5413f4b7 100644 --- a/include/opendht/dht.h +++ b/include/opendht/dht.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Authors: Adrien Béraud * Simon Désaulniers * Sébastien Blin diff --git a/include/opendht/dht_interface.h b/include/opendht/dht_interface.h index 783b0371..2ccc80ee 100644 --- a/include/opendht/dht_interface.h +++ b/include/opendht/dht_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/dht_proxy_client.h b/include/opendht/dht_proxy_client.h index 21a9d81d..441f5faf 100644 --- a/include/opendht/dht_proxy_client.h +++ b/include/opendht/dht_proxy_client.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * Adrien Béraud * Vsevolod Ivanov diff --git a/include/opendht/dht_proxy_server.h b/include/opendht/dht_proxy_server.h index b87c47b4..926d6477 100644 --- a/include/opendht/dht_proxy_server.h +++ b/include/opendht/dht_proxy_server.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * Adrien Béraud * Vsevolod Ivanov diff --git a/include/opendht/dhtrunner.h b/include/opendht/dhtrunner.h index bef88baa..d8d960a6 100644 --- a/include/opendht/dhtrunner.h +++ b/include/opendht/dhtrunner.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Authors: Adrien Béraud * Simon Désaulniers * Sébastien Blin diff --git a/include/opendht/http.h b/include/opendht/http.h index 219fc5f6..8735e693 100644 --- a/include/opendht/http.h +++ b/include/opendht/http.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Vsevolod Ivanov * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/indexation/pht.h b/include/opendht/indexation/pht.h index cfc3382c..ba1cb364 100644 --- a/include/opendht/indexation/pht.h +++ b/include/opendht/indexation/pht.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * Nicolas Reynaud diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index a7340209..6e744031 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/log.h b/include/opendht/log.h index 7c8e9ade..14a349a2 100644 --- a/include/opendht/log.h +++ b/include/opendht/log.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/include/opendht/logger.h b/include/opendht/logger.h index af32a816..afc0895c 100644 --- a/include/opendht/logger.h +++ b/include/opendht/logger.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/network_engine.h b/include/opendht/network_engine.h index 3d7f3280..a10e6b49 100644 --- a/include/opendht/network_engine.h +++ b/include/opendht/network_engine.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/include/opendht/network_utils.h b/include/opendht/network_utils.h index ae0f7a68..c8d840f9 100644 --- a/include/opendht/network_utils.h +++ b/include/opendht/network_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/node.h b/include/opendht/node.h index dec8c75f..a692ea44 100644 --- a/include/opendht/node.h +++ b/include/opendht/node.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/include/opendht/node_cache.h b/include/opendht/node_cache.h index 353eb73a..19224202 100644 --- a/include/opendht/node_cache.h +++ b/include/opendht/node_cache.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/node_export.h b/include/opendht/node_export.h index bb451acc..1b8f76b7 100644 --- a/include/opendht/node_export.h +++ b/include/opendht/node_export.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/opendht/peer_discovery.h b/include/opendht/peer_discovery.h index a22f4218..28debfdb 100644 --- a/include/opendht/peer_discovery.h +++ b/include/opendht/peer_discovery.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Mingrui Zhang * Vsevolod Ivanov * diff --git a/include/opendht/proxy.h b/include/opendht/proxy.h index 2274acbe..976a0ad1 100644 --- a/include/opendht/proxy.h +++ b/include/opendht/proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/rate_limiter.h b/include/opendht/rate_limiter.h index a7d45c0c..7f602a86 100644 --- a/include/opendht/rate_limiter.h +++ b/include/opendht/rate_limiter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/rng.h b/include/opendht/rng.h index a913c467..2677b01b 100644 --- a/include/opendht/rng.h +++ b/include/opendht/rng.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/routing_table.h b/include/opendht/routing_table.h index 0a984815..66a2009a 100644 --- a/include/opendht/routing_table.h +++ b/include/opendht/routing_table.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/include/opendht/scheduler.h b/include/opendht/scheduler.h index 6ed995e5..8b5880f7 100644 --- a/include/opendht/scheduler.h +++ b/include/opendht/scheduler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/include/opendht/securedht.h b/include/opendht/securedht.h index faddef7c..818d2ffe 100644 --- a/include/opendht/securedht.h +++ b/include/opendht/securedht.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Authors: Adrien Béraud * Simon Désaulniers * Sébastien Blin diff --git a/include/opendht/sockaddr.h b/include/opendht/sockaddr.h index a8f3116f..31f5db31 100644 --- a/include/opendht/sockaddr.h +++ b/include/opendht/sockaddr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/thread_pool.h b/include/opendht/thread_pool.h index 8b0ebfb2..e650c4a7 100644 --- a/include/opendht/thread_pool.h +++ b/include/opendht/thread_pool.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/include/opendht/utils.h b/include/opendht/utils.h index efdd576a..0f79a052 100644 --- a/include/opendht/utils.h +++ b/include/opendht/utils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/include/opendht/value.h b/include/opendht/value.h index 1a013f48..91616342 100644 --- a/include/opendht/value.h +++ b/include/opendht/value.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/python/setup.py.in b/python/setup.py.in index 47de421b..3de80f52 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2023 Savoir-faire Linux Inc. +# Copyright (C) 2014-2025 Savoir-faire Linux Inc. # Author: Guillaume Roguez # Author: Adrien Béraud # diff --git a/python/tools/benchmark.py b/python/tools/benchmark.py index 2dfd8445..cace4543 100755 --- a/python/tools/benchmark.py +++ b/python/tools/benchmark.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright (C) 2014-2023 Savoir-faire Linux Inc. +# Copyright (C) 2014-2025 Savoir-faire Linux Inc. # Author(s): Adrien Béraud # Simon Désaulniers # diff --git a/python/tools/dhtcluster.py b/python/tools/dhtcluster.py index 574d3bce..4c6cc5e0 100755 --- a/python/tools/dhtcluster.py +++ b/python/tools/dhtcluster.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright (C) 2014-2023 Savoir-faire Linux Inc. +# Copyright (C) 2014-2025 Savoir-faire Linux Inc. # Author(s): Adrien Béraud # # This program is free software; you can redistribute it and/or modify diff --git a/rust/examples/dhtnode.rs b/rust/examples/dhtnode.rs index fdac0bbe..a971c470 100644 --- a/rust/examples/dhtnode.rs +++ b/rust/examples/dhtnode.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/blob.rs b/rust/src/blob.rs index 9ef54356..8c95a007 100644 --- a/rust/src/blob.rs +++ b/rust/src/blob.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/crypto.rs b/rust/src/crypto.rs index 16c23072..59ff3467 100644 --- a/rust/src/crypto.rs +++ b/rust/src/crypto.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/dhtrunner.rs b/rust/src/dhtrunner.rs index 687ce82a..e6ba5404 100644 --- a/rust/src/dhtrunner.rs +++ b/rust/src/dhtrunner.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/ffi.rs b/rust/src/ffi.rs index fb50b03a..211d9f2b 100644 --- a/rust/src/ffi.rs +++ b/rust/src/ffi.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/infohash.rs b/rust/src/infohash.rs index 7ff9c1b8..8780f63f 100644 --- a/rust/src/infohash.rs +++ b/rust/src/infohash.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/lib.rs b/rust/src/lib.rs index ce6b1ee1..c3d622ac 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/pkid.rs b/rust/src/pkid.rs index 83f72312..1b3498c0 100644 --- a/rust/src/pkid.rs +++ b/rust/src/pkid.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/rust/src/value.rs b/rust/src/value.rs index 1fab2ef3..e33917b8 100644 --- a/rust/src/value.rs +++ b/rust/src/value.rs @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/src/base64.cpp b/src/base64.cpp index 58af373b..963549b3 100644 --- a/src/base64.cpp +++ b/src/base64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/base64.h b/src/base64.h index 6363ec8a..80d04364 100644 --- a/src/base64.h +++ b/src/base64.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/callbacks.cpp b/src/callbacks.cpp index 759c6716..6b21f098 100644 --- a/src/callbacks.cpp +++ b/src/callbacks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/compat/msvc/unistd.h b/src/compat/msvc/unistd.h index d43d4796..03687459 100644 --- a/src/compat/msvc/unistd.h +++ b/src/compat/msvc/unistd.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Andreas Traczyk * diff --git a/src/compat/os_cert.cpp b/src/compat/os_cert.cpp index 1bf84c33..d8ed6a30 100644 --- a/src/compat/os_cert.cpp +++ b/src/compat/os_cert.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Andreas Traczyk * * This program is free software; you can redistribute it and/or modify diff --git a/src/compat/os_cert.h b/src/compat/os_cert.h index 54052d62..f1384d21 100644 --- a/src/compat/os_cert.h +++ b/src/compat/os_cert.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Andreas Traczyk * * This program is free software; you can redistribute it and/or modify diff --git a/src/crypto.cpp b/src/crypto.cpp index c0874da8..288e40e6 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * Vsevolod Ivanov * diff --git a/src/default_types.cpp b/src/default_types.cpp index b37f2faa..6d98b7a3 100644 --- a/src/default_types.cpp +++ b/src/default_types.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/dht.cpp b/src/dht.cpp index b013017d..5d5637a8 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/src/dht_proxy_client.cpp b/src/dht_proxy_client.cpp index af579201..69c056d5 100644 --- a/src/dht_proxy_client.cpp +++ b/src/dht_proxy_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * Adrien Béraud * Vsevolod Ivanov diff --git a/src/dht_proxy_server.cpp b/src/dht_proxy_server.cpp index f1c02154..137b029c 100644 --- a/src/dht_proxy_server.cpp +++ b/src/dht_proxy_server.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * Adrien Béraud * Vsevolod Ivanov diff --git a/src/dhtrunner.cpp b/src/dhtrunner.cpp index 5d1ddce8..77ddb80f 100644 --- a/src/dhtrunner.cpp +++ b/src/dhtrunner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Authors: Adrien Béraud * Simon Désaulniers * Sébastien Blin diff --git a/src/http.cpp b/src/http.cpp index 865d2dea..6459b7da 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Vsevolod Ivanov * * This program is free software; you can redistribute it and/or modify diff --git a/src/indexation/pht.cpp b/src/indexation/pht.cpp index a5b14c0d..67adbc79 100644 --- a/src/indexation/pht.cpp +++ b/src/indexation/pht.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * Nicolas Reynaud diff --git a/src/listener.h b/src/listener.h index ba920a3e..bd622ca3 100644 --- a/src/listener.h +++ b/src/listener.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/log.cpp b/src/log.cpp index daca16dc..5d6876f2 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/src/net.h b/src/net.h index ba9c520e..162a9270 100644 --- a/src/net.h +++ b/src/net.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/network_engine.cpp b/src/network_engine.cpp index fd6b8c92..52690bcb 100644 --- a/src/network_engine.cpp +++ b/src/network_engine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/src/network_utils.cpp b/src/network_utils.cpp index c681f0e1..820cd1d2 100644 --- a/src/network_utils.cpp +++ b/src/network_utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/node.cpp b/src/node.cpp index ac2be22d..d5c62d00 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/src/node_cache.cpp b/src/node_cache.cpp index 58a7018a..0dea8846 100644 --- a/src/node_cache.cpp +++ b/src/node_cache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/op_cache.cpp b/src/op_cache.cpp index f775402d..a0cc6271 100644 --- a/src/op_cache.cpp +++ b/src/op_cache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/op_cache.h b/src/op_cache.h index 4289be37..1283e412 100644 --- a/src/op_cache.h +++ b/src/op_cache.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/parsed_message.h b/src/parsed_message.h index b85a8e8e..a4b77e72 100644 --- a/src/parsed_message.h +++ b/src/parsed_message.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/peer_discovery.cpp b/src/peer_discovery.cpp index d6788394..30d4a723 100644 --- a/src/peer_discovery.cpp +++ b/src/peer_discovery.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Mingrui Zhang * Vsevolod Ivanov * Adrien Béraud diff --git a/src/request.h b/src/request.h index 0f48eef3..1be5a9f4 100644 --- a/src/request.h +++ b/src/request.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/src/routing_table.cpp b/src/routing_table.cpp index 54c57d57..ded72cb2 100644 --- a/src/routing_table.cpp +++ b/src/routing_table.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/search.h b/src/search.h index 52d991b7..a78831c5 100644 --- a/src/search.h +++ b/src/search.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/securedht.cpp b/src/securedht.cpp index 0a3f8477..a24dfd43 100644 --- a/src/securedht.cpp +++ b/src/securedht.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Authors: Adrien Béraud * Simon Désaulniers * Sébastien Blin diff --git a/src/storage.h b/src/storage.h index 5e7f034f..a73926b0 100644 --- a/src/storage.h +++ b/src/storage.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index 7fab7c11..910cc2b9 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/src/utils.cpp b/src/utils.cpp index 2af58854..5e6a96bd 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/src/value.cpp b/src/value.cpp index 2f0fa8be..653bcd29 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * Simon Désaulniers * diff --git a/src/value_cache.h b/src/value_cache.h index 1789e6a5..11334eb3 100644 --- a/src/value_cache.h +++ b/src/value_cache.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author(s) : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/tests/cryptotester.cpp b/tests/cryptotester.cpp index 1673784c..1768d1fd 100644 --- a/tests/cryptotester.cpp +++ b/tests/cryptotester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * Vsevolod Ivanov diff --git a/tests/cryptotester.h b/tests/cryptotester.h index 6cd552c4..d26934f9 100644 --- a/tests/cryptotester.h +++ b/tests/cryptotester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * Vsevolod Ivanov diff --git a/tests/dhtproxy_stress_tester.h b/tests/dhtproxy_stress_tester.h index 8ad11137..74600d6c 100644 --- a/tests/dhtproxy_stress_tester.h +++ b/tests/dhtproxy_stress_tester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/dhtproxytester.cpp b/tests/dhtproxytester.cpp index ec3db48a..8ad47fe5 100644 --- a/tests/dhtproxytester.cpp +++ b/tests/dhtproxytester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Sébastien Blin * Vsevolod Ivanov diff --git a/tests/dhtproxytester.h b/tests/dhtproxytester.h index 55032ce5..413e83f0 100644 --- a/tests/dhtproxytester.h +++ b/tests/dhtproxytester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Sébastien Blin * diff --git a/tests/dhtrunnertester.cpp b/tests/dhtrunnertester.cpp index 24f5f9be..8948f328 100644 --- a/tests/dhtrunnertester.cpp +++ b/tests/dhtrunnertester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tests/dhtrunnertester.h b/tests/dhtrunnertester.h index 501679d7..d72f69e3 100644 --- a/tests/dhtrunnertester.h +++ b/tests/dhtrunnertester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tests/httptester.cpp b/tests/httptester.cpp index b3c713af..c040798b 100644 --- a/tests/httptester.cpp +++ b/tests/httptester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Vsevolod Ivanov * diff --git a/tests/httptester.h b/tests/httptester.h index 6c870a1e..a86fc908 100644 --- a/tests/httptester.h +++ b/tests/httptester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Vsevolod Ivanov * diff --git a/tests/infohashtester.cpp b/tests/infohashtester.cpp index 074eab48..b045de23 100644 --- a/tests/infohashtester.cpp +++ b/tests/infohashtester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Sébastien Blin * diff --git a/tests/infohashtester.h b/tests/infohashtester.h index 902c4ba3..23af731a 100644 --- a/tests/infohashtester.h +++ b/tests/infohashtester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Sébastien Blin * diff --git a/tests/peerdiscoverytester.cpp b/tests/peerdiscoverytester.cpp index 8ccd63b9..d10ce98b 100644 --- a/tests/peerdiscoverytester.cpp +++ b/tests/peerdiscoverytester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Mingrui Zhang * diff --git a/tests/peerdiscoverytester.h b/tests/peerdiscoverytester.h index b5484e49..99866d64 100644 --- a/tests/peerdiscoverytester.h +++ b/tests/peerdiscoverytester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Mingrui Zhang * diff --git a/tests/tests_runner.cpp b/tests/tests_runner.cpp index b471cb31..15f6cf17 100644 --- a/tests/tests_runner.cpp +++ b/tests/tests_runner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author: Sébastien Blin * * This program is free software; you can redistribute it and/or modify diff --git a/tests/threadpooltester.cpp b/tests/threadpooltester.cpp index 65460bb6..e0de30e4 100644 --- a/tests/threadpooltester.cpp +++ b/tests/threadpooltester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tests/threadpooltester.h b/tests/threadpooltester.h index bfc2ce1e..a16d92bc 100644 --- a/tests/threadpooltester.h +++ b/tests/threadpooltester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tests/valuetester.cpp b/tests/valuetester.cpp index 20b76b34..469aa42c 100644 --- a/tests/valuetester.cpp +++ b/tests/valuetester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tests/valuetester.h b/tests/valuetester.h index a2b3f098..06fb7016 100644 --- a/tests/valuetester.h +++ b/tests/valuetester.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tools/dhtchat.cpp b/tools/dhtchat.cpp index 9c4c3117..1aa54dd2 100644 --- a/tools/dhtchat.cpp +++ b/tools/dhtchat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tools/dhtcnode.c b/tools/dhtcnode.c index cdb04714..3b8d0530 100644 --- a/tools/dhtcnode.c +++ b/tools/dhtcnode.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * Author : Adrien Béraud * * This program is free software; you can redistribute it and/or modify diff --git a/tools/dhtnode.cpp b/tools/dhtnode.cpp index 5284aa56..27ee6a16 100644 --- a/tools/dhtnode.cpp +++ b/tools/dhtnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Authors: Adrien Béraud * Simon Désaulniers diff --git a/tools/dhtscanner.cpp b/tools/dhtscanner.cpp index 2141f890..e9f62987 100644 --- a/tools/dhtscanner.cpp +++ b/tools/dhtscanner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tools/durl.cpp b/tools/durl.cpp index ab9afe43..55759edd 100644 --- a/tools/durl.cpp +++ b/tools/durl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Authors: Adrien Béraud * diff --git a/tools/perftest.cpp b/tools/perftest.cpp index 4dc759d2..59d639ee 100644 --- a/tools/perftest.cpp +++ b/tools/perftest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * diff --git a/tools/proxy_loadtester.py b/tools/proxy_loadtester.py index 48344d14..eba3db66 100644 --- a/tools/proxy_loadtester.py +++ b/tools/proxy_loadtester.py @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2023 Savoir-faire Linux Inc. +# Copyright (C) 2014-2025 Savoir-faire Linux Inc. # Author: Vsevolod Ivanov # # This program is free software; you can redistribute it and/or modify diff --git a/tools/tools_common.h b/tools/tools_common.h index d12d9575..d19454fe 100644 --- a/tools/tools_common.h +++ b/tools/tools_common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Savoir-faire Linux Inc. + * Copyright (C) 2014-2025 Savoir-faire Linux Inc. * * Author: Adrien Béraud * Author: Sébastien Blin From aeb0b163cfa78eb28efb4866c042c314a1d26cac Mon Sep 17 00:00:00 2001 From: Andrey Vukolov Date: Fri, 23 May 2025 14:36:46 +0200 Subject: [PATCH 13/20] MS Visual Studio .gitignore fix for CMake implicit builds - Addresses review https://github.com/savoirfairelinux/opendht/pull/750#discussion_r2089277264 in #750 - Allows clean clone and build in MS Visual Studio with different settings --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index fd367eaa..c9bba8af 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,10 @@ Makefile.in # VSCode .vscode/* +# Visual Studio +.vs/ +CMakeSettings.json + # Eclipse CDT .cproject .project @@ -78,3 +82,5 @@ doc/Doxyfile build build_dev .DS_Store +build-*/ +install/ From b9bd954dfde4e38845ca4abb4435429ba0456445 Mon Sep 17 00:00:00 2001 From: Andrey Vukolov Date: Fri, 23 May 2025 15:57:40 +0200 Subject: [PATCH 14/20] GnuTLS version handler routine for versions 3.8.7 and later - Added GnuTLS version handler directives for versions 3.8.7 and later https://github.com/savoirfairelinux/opendht/pull/750#discussion_r2089284896 --- src/crypto.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/crypto.cpp b/src/crypto.cpp index 288e40e6..192d974b 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -1501,7 +1501,22 @@ OcspResponse::getCertificateStatus() const { int ret; unsigned int status; + // MSVC/vcpkg GnuTLS cast workaround +#if _WIN32 && (GNUTLS_VERSION_NUMBER >= 0x030807) + ret = gnutls_ocsp_resp_get_single(response, + 0, + NULL, + NULL, + NULL, + NULL, + reinterpret_cast(& status), + NULL, + NULL, + NULL, + NULL); +#else ret = gnutls_ocsp_resp_get_single(response, 0, NULL, NULL, NULL, NULL, &status, NULL, NULL, NULL, NULL); +#endif if (ret < 0) throw CryptoException(gnutls_strerror(ret)); return (gnutls_ocsp_cert_status_t) status; @@ -1559,8 +1574,23 @@ OcspResponse::verifyDirect(const Certificate& crt, const Blob& nonce) throw CryptoException(gnutls_strerror(ret)); // Check certificate revocation status - unsigned status_ocsp; + unsigned int status_ocsp; + // MSVC/vcpkg GnuTLS cast workaround +#if _WIN32 && (GNUTLS_VERSION_NUMBER >= 0x030807) + ret = gnutls_ocsp_resp_get_single(response, + 0, + NULL, + NULL, + NULL, + NULL, + reinterpret_cast(& status_ocsp), + NULL, + NULL, + NULL, + NULL); +#else ret = gnutls_ocsp_resp_get_single(response, 0, NULL, NULL, NULL, NULL, &status_ocsp, NULL, NULL, NULL, NULL); +#endif if (ret < 0) throw CryptoException(gnutls_strerror(ret)); return (gnutls_ocsp_cert_status_t)status_ocsp; From a7227261961b982d8ed9ac4da16694bff79b68af Mon Sep 17 00:00:00 2001 From: Andrey Vukolov Date: Fri, 23 May 2025 16:02:41 +0200 Subject: [PATCH 15/20] GNUTLS_INTERNAL_BUILD fix - Removed GNUTLS_INTERNAL_BUILD definition to avoid problems with gnutls_free() function (https://github.com/savoirfairelinux/opendht/pull/750#issuecomment-2832005765) https://github.com/ShiftMediaProject/gnutls/blob/f78e2e673e84601283fb5ec353bfdd53204becd2/SMP/gnutls/gnutls.h#L2286 --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9470f2b8..0ae277c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,8 +185,7 @@ else () add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN - -DSTATIC_GETOPT - -DGNUTLS_INTERNAL_BUILD) + -DSTATIC_GETOPT) set(DISABLE_MSC_WARNINGS "/wd4101 /wd4244 /wd4267 /wd4273 /wd4804 /wd4834 /wd4996") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DISABLE_MSC_WARNINGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") From 54a8fef0ee38d085a1e4b29c09f18f7dbd8dbb69 Mon Sep 17 00:00:00 2001 From: Andrey Vukolov Date: Fri, 23 May 2025 17:40:46 +0200 Subject: [PATCH 16/20] Windows build fixed for tools (wingetopt, signals) - Addresses https://github.com/savoirfairelinux/opendht/pull/750#discussion_r2089286643 - Structures wingetopt and win32 compatibility files for builds on Windows with MSVC - Adjusts opendht_EXPORTS definition when building tools on MSVC --- src/compat/{msvc => win32}/wingetopt.c | 0 src/compat/{msvc => win32}/wingetopt.h | 0 tools/CMakeLists.txt | 22 +++++++++++----- tools/tools_common.h | 35 ++++++++++++++++++-------- 4 files changed, 41 insertions(+), 16 deletions(-) rename src/compat/{msvc => win32}/wingetopt.c (100%) rename src/compat/{msvc => win32}/wingetopt.h (100%) diff --git a/src/compat/msvc/wingetopt.c b/src/compat/win32/wingetopt.c similarity index 100% rename from src/compat/msvc/wingetopt.c rename to src/compat/win32/wingetopt.c diff --git a/src/compat/msvc/wingetopt.h b/src/compat/win32/wingetopt.h similarity index 100% rename from src/compat/msvc/wingetopt.h rename to src/compat/win32/wingetopt.h diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 29de73d9..172288b9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,16 +1,23 @@ -if (OPENDHT_STATIC) - if (MSVC) - set (MSC_COMPAT_SOURCES ${MSC_COMPAT_DIR}/wingetopt.c) - endif () -endif () +if (MSVC) + set (MSC_COMPAT_DIR ../src/compat/win32) + set (MSC_COMPAT_SOURCES ${MSC_COMPAT_DIR}/wingetopt.c) +endif() function (configure_tool name extra_files) add_executable (${name} ${name}.cpp ${extra_files}) add_dependencies(${name} opendht) - target_link_libraries (${name} LINK_PUBLIC opendht ${READLINE_LIBRARIES}) + if (NOT BUILD_SHARED_LIBS) + target_compile_definitions(${name} PRIVATE OPENDHT_STATIC) # to define proper attributes for the opendht classes + else() + target_compile_definitions(${name} PRIVATE opendht_EXPORTS) + endif() if (MSVC) target_sources(${name} PRIVATE ${MSC_COMPAT_SOURCES}) + target_link_libraries (${name} PUBLIC opendht wsock32 ws2_32) target_include_directories (${name} PRIVATE ${MSC_COMPAT_DIR}) + else() + target_link_libraries (${name} LINK_PUBLIC opendht ${READLINE_LIBRARIES}) + target_include_directories (${name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) endif () endfunction () @@ -36,6 +43,9 @@ if (NOT DEFINED CMAKE_INSTALL_BINDIR) endif () install (TARGETS dhtnode dhtscanner dhtchat RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +if(MSVC) + install(FILES $ $ $ CONFIGURATIONS "Debug" "RelWithDebInfo" DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() if (OPENDHT_SYSTEMD) if (NOT DEFINED OPENDHT_SYSTEMD_UNIT_FILE_LOCATION OR NOT OPENDHT_SYSTEMD_UNIT_FILE_LOCATION) diff --git a/tools/tools_common.h b/tools/tools_common.h index d19454fe..5d530583 100644 --- a/tools/tools_common.h +++ b/tools/tools_common.h @@ -34,14 +34,29 @@ #include -#ifndef _MSC_VER -#include -#include -#include -#else -#define SIGHUP 0 -#include "wingetopt.h" -#include +#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(__NT__) + #pragma message "Building on UNIX-like platform, linking system getopt" + #include + #include + #include +#endif +#ifdef _MSC_VER + #pragma message("Building on WIN32 platform using MSVC, linking wingetopt") + #define SIGHUP 0 + #include "wingetopt.h" + #include +#endif +#if defined(__MINGW32__) || defined (__MINGW64__) + #pragma message "Building on MinGW, linking system-wide getopt" + #define SIGHUP 0 + #include + #include + #include + #include +#endif + +#if defined(_MSC_VER) || defined(__MINGW32__) || defined (__MINGW64__) + #define DISABLE_SIGNALS #endif #include @@ -440,7 +455,7 @@ void signal_handler(int sig) void setupSignals() { -#ifndef _MSC_VER +#ifndef DISABLE_SIGNALS signal(SIGCHLD,SIG_IGN); /* ignore child */ signal(SIGTSTP,SIG_IGN); /* ignore tty signals */ signal(SIGTTOU,SIG_IGN); @@ -453,7 +468,7 @@ void setupSignals() void daemonize() { -#ifndef _MSC_VER +#ifndef DISABLE_SIGNALS pid_t pid = fork(); if (pid < 0) exit(EXIT_FAILURE); if (pid > 0) exit(EXIT_SUCCESS); From 68dc6a64be5472862cadff91b327eb5a366c6f94 Mon Sep 17 00:00:00 2001 From: Andrey Vukolov Date: Tue, 27 May 2025 10:40:59 +0200 Subject: [PATCH 17/20] Definitions fix for #756 --- tools/tools_common.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/tools_common.h b/tools/tools_common.h index 5d530583..f3d3c349 100644 --- a/tools/tools_common.h +++ b/tools/tools_common.h @@ -42,20 +42,18 @@ #endif #ifdef _MSC_VER #pragma message("Building on WIN32 platform using MSVC, linking wingetopt") - #define SIGHUP 0 #include "wingetopt.h" - #include #endif #if defined(__MINGW32__) || defined (__MINGW64__) #pragma message "Building on MinGW, linking system-wide getopt" - #define SIGHUP 0 - #include #include #include #include #endif #if defined(_MSC_VER) || defined(__MINGW32__) || defined (__MINGW64__) + #define SIGHUP 0 + #include #define DISABLE_SIGNALS #endif From acae4bc4ff9b8ac72388e1b7c61de310fd13d22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Tue, 27 May 2025 11:19:51 -0400 Subject: [PATCH 18/20] peer_discovery: use string_view for service type --- include/opendht/peer_discovery.h | 16 ++++++------ src/dhtrunner.cpp | 4 ++- src/peer_discovery.cpp | 42 +++++++++++++++++--------------- tests/peerdiscoverytester.cpp | 6 +++-- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/include/opendht/peer_discovery.h b/include/opendht/peer_discovery.h index 28debfdb..4f34dd8c 100644 --- a/include/opendht/peer_discovery.h +++ b/include/opendht/peer_discovery.h @@ -49,10 +49,10 @@ public: * startDiscovery - Keep Listening data from the sender until node is joinned * or stop is called */ - void startDiscovery(const std::string &type, ServiceDiscoveredCallback callback); + void startDiscovery(std::string_view type, ServiceDiscoveredCallback callback); template - void startDiscovery(const std::string &type, std::function cb) { + void startDiscovery(std::string_view type, std::function cb) { startDiscovery(type, [cb](msgpack::object &&ob, SockAddr &&addr) { cb(ob.as(), std::move(addr)); }); @@ -61,11 +61,11 @@ public: /** * startPublish - Keeping sending data until node is joinned or stop is called */ - void startPublish(const std::string &type, const msgpack::sbuffer &pack_buf); - void startPublish(sa_family_t domain, const std::string &type, const msgpack::sbuffer &pack_buf); + void startPublish(std::string_view type, const msgpack::sbuffer &pack_buf); + void startPublish(sa_family_t domain, std::string_view type, const msgpack::sbuffer &pack_buf); template - void startPublish(const std::string &type, const T &object) { + void startPublish(std::string_view type, const T &object) { msgpack::sbuffer buf; msgpack::pack(buf, object); startPublish(type, buf); @@ -79,13 +79,13 @@ public: /** * Remove possible callBack to discovery */ - bool stopDiscovery(const std::string &type); + bool stopDiscovery(std::string_view type); /** * Remove different serivce message to send */ - bool stopPublish(const std::string &type); - bool stopPublish(sa_family_t domain, const std::string &type); + bool stopPublish(std::string_view type); + bool stopPublish(sa_family_t domain, std::string_view type); void connectivityChanged(); diff --git a/src/dhtrunner.cpp b/src/dhtrunner.cpp index 77ddb80f..f3af2142 100644 --- a/src/dhtrunner.cpp +++ b/src/dhtrunner.cpp @@ -36,7 +36,9 @@ namespace dht { -static const std::string PEER_DISCOVERY_DHT_SERVICE = "dht"; +using namespace std::literals; + +constexpr auto PEER_DISCOVERY_DHT_SERVICE = "dht"sv; struct NodeInsertionPack { dht::InfoHash nodeId; diff --git a/src/peer_discovery.cpp b/src/peer_discovery.cpp index 30d4a723..f6aa9ad3 100644 --- a/src/peer_discovery.cpp +++ b/src/peer_discovery.cpp @@ -42,13 +42,13 @@ public: DomainPeerDiscovery(asio::ip::udp domain, in_port_t port, Sp ioContext = {}, Sp logger = {}); ~DomainPeerDiscovery(); - void startDiscovery(const std::string &type, ServiceDiscoveredCallback callback); - void startPublish(const std::string &type, const msgpack::sbuffer &pack_buf); + void startDiscovery(std::string_view type, ServiceDiscoveredCallback callback); + void startPublish(std::string_view type, const msgpack::sbuffer &pack_buf); void stop(); - bool stopDiscovery(const std::string &type); - bool stopPublish(const std::string &type); + bool stopDiscovery(std::string_view type); + bool stopPublish(std::string_view type); void connectivityChanged(); @@ -75,7 +75,7 @@ private: asio::ip::udp::endpoint receiveFrom_; msgpack::sbuffer sbuf_; - std::map messages_; + std::map> messages_; std::map> callbackmap_; bool lrunning_ {false}; bool drunning_ {false}; @@ -133,10 +133,10 @@ PeerDiscovery::DomainPeerDiscovery::~DomainPeerDiscovery() } void -PeerDiscovery::DomainPeerDiscovery::startDiscovery(const std::string &type, ServiceDiscoveredCallback callback) +PeerDiscovery::DomainPeerDiscovery::startDiscovery(std::string_view type, ServiceDiscoveredCallback callback) { std::lock_guard lck(dmtx_); - callbackmap_[type] = callback; + callbackmap_[std::string(type)] = callback; if (not drunning_) { drunning_ = true; asio::post(*ioContext_, [this] () { @@ -236,23 +236,25 @@ PeerDiscovery::DomainPeerDiscovery::publish(const asio::ip::udp::endpoint& peer) void -PeerDiscovery::DomainPeerDiscovery::startPublish(const std::string &type, const msgpack::sbuffer &pack_buf) +PeerDiscovery::DomainPeerDiscovery::startPublish(std::string_view type, const msgpack::sbuffer &pack_buf) { msgpack::sbuffer pack_buf_c(pack_buf.size()); pack_buf_c.write(pack_buf.data(), pack_buf.size()); std::lock_guard lck(mtx_); - messages_[type] = std::move(pack_buf_c); + messages_[std::string(type)] = std::move(pack_buf_c); reloadMessages(); lrunning_ = true; asio::post(*ioContext_, [this] () { publish(sockAddrSend_); }); } bool -PeerDiscovery::DomainPeerDiscovery::stopDiscovery(const std::string& type) +PeerDiscovery::DomainPeerDiscovery::stopDiscovery(std::string_view type) { std::lock_guard lck(dmtx_); - if (callbackmap_.erase(type) > 0) { + auto it = callbackmap_.find(type); + if (it != callbackmap_.end()) { + callbackmap_.erase(it); if (callbackmap_.empty()) stopDiscovery(); return true; @@ -261,10 +263,12 @@ PeerDiscovery::DomainPeerDiscovery::stopDiscovery(const std::string& type) } bool -PeerDiscovery::DomainPeerDiscovery::stopPublish(const std::string& type) +PeerDiscovery::DomainPeerDiscovery::stopPublish(std::string_view type) { std::lock_guard lck(mtx_); - if (messages_.erase(type) > 0) { + auto it = messages_.find(type); + if (it != messages_.end()) { + messages_.erase(it); if (messages_.empty()) stopPublish(); else @@ -397,21 +401,21 @@ PeerDiscovery::~PeerDiscovery() { } void -PeerDiscovery::startDiscovery(const std::string& type, ServiceDiscoveredCallback callback) +PeerDiscovery::startDiscovery(std::string_view type, ServiceDiscoveredCallback callback) { if (peerDiscovery4_) peerDiscovery4_->startDiscovery(type, callback); if (peerDiscovery6_) peerDiscovery6_->startDiscovery(type, callback); } void -PeerDiscovery::startPublish(const std::string& type, const msgpack::sbuffer& pack_buf) +PeerDiscovery::startPublish(std::string_view type, const msgpack::sbuffer& pack_buf) { if (peerDiscovery4_) peerDiscovery4_->startPublish(type, pack_buf); if (peerDiscovery6_) peerDiscovery6_->startPublish(type, pack_buf); } void -PeerDiscovery::startPublish(sa_family_t domain, const std::string& type, const msgpack::sbuffer& pack_buf) +PeerDiscovery::startPublish(sa_family_t domain, std::string_view type, const msgpack::sbuffer& pack_buf) { if (domain == AF_INET) { if (peerDiscovery4_) peerDiscovery4_->startPublish(type, pack_buf); @@ -428,7 +432,7 @@ PeerDiscovery::stop() } bool -PeerDiscovery::stopDiscovery(const std::string &type) +PeerDiscovery::stopDiscovery(std::string_view type) { bool stopped4 = peerDiscovery4_ and peerDiscovery4_->stopDiscovery(type); bool stopped6 = peerDiscovery6_ and peerDiscovery6_->stopDiscovery(type); @@ -436,7 +440,7 @@ PeerDiscovery::stopDiscovery(const std::string &type) } bool -PeerDiscovery::stopPublish(const std::string &type) +PeerDiscovery::stopPublish(std::string_view type) { bool stopped4 = peerDiscovery4_ and peerDiscovery4_->stopPublish(type); bool stopped6 = peerDiscovery6_ and peerDiscovery6_->stopPublish(type); @@ -444,7 +448,7 @@ PeerDiscovery::stopPublish(const std::string &type) } bool -PeerDiscovery::stopPublish(sa_family_t domain, const std::string& type) +PeerDiscovery::stopPublish(sa_family_t domain, std::string_view type) { if (domain == AF_INET) { return peerDiscovery4_ and peerDiscovery4_->stopPublish(type); diff --git a/tests/peerdiscoverytester.cpp b/tests/peerdiscoverytester.cpp index d10ce98b..a172804c 100644 --- a/tests/peerdiscoverytester.cpp +++ b/tests/peerdiscoverytester.cpp @@ -25,9 +25,11 @@ namespace test { +using namespace std::literals; + constexpr unsigned MULTICAST_PORT = 2222; -const std::string DHT_NODE_NAME {"dht"}; -const std::string JAMI_NODE_NAME {"jami"}; +constexpr auto DHT_NODE_NAME {"dht"sv}; +constexpr auto JAMI_NODE_NAME {"jami"sv}; struct DhtNode { dht::InfoHash nodeid; From 5c214017280dadab70ccba4bba98e4c5d58fdd75 Mon Sep 17 00:00:00 2001 From: Andrey Vukolov Date: Fri, 23 May 2025 15:27:13 +0200 Subject: [PATCH 19/20] constexpr fixes for preparation of MSVC build - Addresses https://github.com/savoirfairelinux/opendht/pull/750/files#r2089281221 in #750 - Adds infohash.cpp file for correct build of the DLL nametables in SHARED mode with MSVC - Reverted commits 352e36500c3973678e13ca875622fb5b928dbcb7 and 6a264d6f73515bf93ae5df864bedefe4ffb9fd4e - Fixes DLL build issues on Windows due to OPENDHT_PUBLIC definitions described in #750 - Prepares the build system for merging changes from #750 (@aberaud) --- CMakeLists.txt | 1 + include/opendht/infohash.h | 16 +++++----------- src/Makefile.am | 1 + src/infohash.cpp | 12 ++++++++++++ src/utils.cpp | 2 ++ 5 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 src/infohash.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ae277c0..3671a282 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,6 +219,7 @@ set (top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}") # Sources list (APPEND opendht_SOURCES + src/infohash.cpp src/utils.cpp src/crypto.cpp src/default_types.cpp diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index 6e744031..7cfc0e1b 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -63,7 +63,7 @@ namespace crypto { * Hashes identify nodes and values in the Dht. */ template -class OPENDHT_PUBLIC Hash { +class Hash { public: using T = std::array; typedef typename T::iterator iterator; @@ -251,10 +251,10 @@ public: static Hash getRandom(Rd&); template - OPENDHT_PUBLIC friend std::ostream& operator<< (std::ostream& s, const Hash& h); + friend std::ostream& operator<< (std::ostream& s, const Hash& h); template - OPENDHT_PUBLIC friend std::istream& operator>> (std::istream& s, Hash& h); + friend std::istream& operator>> (std::istream& s, Hash& h); /** Returns view to thread-allocated memory, only valid until the next call to this function. */ std::string_view to_view() const { return std::string_view(to_c_str(), N*2); } @@ -345,18 +345,12 @@ Hash::getRandom(Rd& rdev) } struct alignas(std::max_align_t) HexMap : public std::array, 256> { - constexpr HexMap() : std::array, 256>() { - for (size_t i = 0; i < size(); i++) { - auto& e = (*this)[i]; - e[0] = hex_digits[(i >> 4) & 0x0F]; - e[1] = hex_digits[i & 0x0F]; - } - } + HexMap(); private: static constexpr const char* hex_digits = "0123456789abcdef"; }; -OPENDHT_PUBLIC constexpr HexMap hex_map = {}; +OPENDHT_PUBLIC extern const HexMap hex_map; inline std::string toHex(const uint8_t* data, size_t size) { diff --git a/src/Makefile.am b/src/Makefile.am index 31f66f3a..e63782a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,6 +27,7 @@ libopendht_la_SOURCES = \ default_types.cpp \ log.cpp \ network_utils.cpp \ + infohash.cpp \ thread_pool.cpp nobase_include_HEADERS = \ diff --git a/src/infohash.cpp b/src/infohash.cpp new file mode 100644 index 00000000..e4fd0fe9 --- /dev/null +++ b/src/infohash.cpp @@ -0,0 +1,12 @@ +#include "def.h" +#include "infohash.h" + +OPENDHT_PUBLIC extern const dht::HexMap hex_map; + +dht::HexMap::HexMap() { + for (size_t i = 0; i < size(); i++) { + auto& e = (*this)[i]; + e[0] = hex_digits[(i >> 4) & 0x0F]; + e[1] = hex_digits[i & 0x0F]; + } +} diff --git a/src/utils.cpp b/src/utils.cpp index 5e6a96bd..b25062a2 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -39,6 +39,8 @@ const char* version() { return PACKAGE_VERSION; } +const HexMap hex_map = {}; + static constexpr std::array MAPPED_IPV4_PREFIX {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff}}; std::pair From 9b33ff8a159bc3adfdb6d41fc9a7a1e09a4a3957 Mon Sep 17 00:00:00 2001 From: Andrey Vukolov Date: Fri, 23 May 2025 15:39:27 +0200 Subject: [PATCH 20/20] Fix meson.build --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 142b06e6..8678bf5b 100644 --- a/meson.build +++ b/meson.build @@ -28,6 +28,7 @@ add_project_arguments(['-Wno-return-type','-Wno-deprecated','-Wnon-virtual-dtor' opendht_inc = include_directories('include/opendht') opendht_interface_inc = include_directories('include', is_system: true) opendht_src = [ + 'src/infohash.cpp', 'src/utils.cpp', 'src/crypto.cpp', 'src/default_types.cpp',