Commit 4e9ccd05 authored by jan.koester's avatar jan.koester
Browse files

tes



Co-authored-by: default avatarCopilot <copilot@github.com>
parent 7f078db5
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -13,17 +13,28 @@ if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
        "${CMAKE_CXX_FLAGS} \
        -fPIC \
        -Wall \
        -O2 \
        -g "
        -O3 \
        -DNDEBUG \
        -flto \
        -fvisibility=hidden \
        -ffunction-sections \
        -fdata-sections "
    )

    set(CMAKE_C_FLAGS 
        "${CMAKE_C_FLAGS} \
        -fPIC \
        -Wall \
        -O2 \
        -g "
        -O3 \
        -DNDEBUG \
        -flto \
        -fvisibility=hidden \
        -ffunction-sections \
        -fdata-sections "
    )

    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -flto")
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -flto")
endif()

if(MSVC)
+13 −0
Original line number Diff line number Diff line
libnetplus (20260505+13) unstable; urgency=medium

  * Optimize: switch to -O3, enable LTO (-flto), add -ffunction-sections
    -fdata-sections with --gc-sections linker flag for smaller binary
  * Optimize: add -fvisibility=hidden to reduce symbol table size
  * Disable all diagnostic logging ([QUIC-DIAG] cerr output removed)
  * Remove x509 certificate validation stdout messages
  * Remove pkcs12 parse warning stderr messages
  * Remove unused dumpHex debug helper from hkdf.cpp
  * Remove unused <iostream> includes from x509.cpp, pkcs12.cpp, hkdf.cpp

 -- Jan Koester <jan.koester@tuxist.de>  Mon, 05 May 2026 18:00:00 +0200

libnetplus (20260505+12) unstable; urgency=high

  * QUIC: fix crash "free(): invalid pointer" in quic::~quic() — child
+0 −20
Original line number Diff line number Diff line
#include "hkdf.h"
#include <iostream>
#include <iomanip>
#include <stdexcept>
#include <cstring>

namespace netplus {

static inline void dumpHex(const char* prefix, const uint8_t* p, size_t n, size_t max = 64) {
    std::ios oldState(nullptr);
    oldState.copyfmt(std::cerr);

    std::cerr << prefix << " (" << n << " bytes)";
    if (n > max) std::cerr << " showing first " << max;
    std::cerr << ":\n  ";

    size_t m = (n < max) ? n : max;
    for (size_t i = 0; i < m; ++i) {
        std::cerr << std::hex << std::setw(2) << std::setfill('0') << int(p[i]) << ' ';
        if ((i % 16) == 15 && i + 1 < m) std::cerr << "\n  ";
    }
    std::cerr << std::dec << "\n";

    std::cerr.copyfmt(oldState);
}

HKDF_SHA256::HKDF_SHA256(Sha256Func sha256, HmacFunc hmac)
    : _sha256(std::move(sha256)), _hmac(std::move(hmac))
{
+1 −5
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
#include <cstring>
#include <stdexcept>
#include <algorithm>
#include <iostream>

namespace {

@@ -569,10 +568,7 @@ bool netplus::pkcs12Parse(const std::vector<uint8_t>& pfxData,
    }
    out.keyDer = std::move(keyDer);

    if (out.certDer.empty())
        std::cerr << "pkcs12Parse: no certificate found in P12" << std::endl;
    if (out.keyDer.empty())
        std::cerr << "pkcs12Parse: no private key found in P12" << std::endl;


    return !out.certDer.empty() || !out.keyDer.empty();
}
+0 −4
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#include <cctype>
#include <string>
#include <vector>
#include <iostream>
#include <stdexcept>
#include <memory>
#include <cstring>
@@ -359,15 +358,12 @@ bool netplus::x509cert::checkValidity() {
    time_t now = time(nullptr);

    if (now < notBefore) {
        std::cout << "Certificate is not yet valid (Future date)." << std::endl;
        return false;
    }
    if (now > notAfter) {
        std::cout << "Certificate has EXPIRED." << std::endl;
        return false;
    }

    std::cout << "Certificate validity: OK." << std::endl;
    return true;
}

Loading