Loading src/ssl.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -258,7 +258,7 @@ namespace netplus { return std::vector<uint8_t>(p, p + len); } static bool parsePkcs1RsaPrivateKeyDer( [[maybe_unused]] static bool parsePkcs1RsaPrivateKeyDer( const netplus::ASN1Node& seq, std::vector<uint8_t>& nBE, std::vector<uint8_t>& eBE, Loading Loading @@ -4380,7 +4380,7 @@ size_t netplus::ssl::recvData(buffer& data, int flags) throw n; } static std::vector<uint8_t> readFileBytesDer(const std::string& path) { [[maybe_unused]] static std::vector<uint8_t> readFileBytesDer(const std::string& path) { std::ifstream f(path, std::ios::binary | std::ios::ate); if (!f.is_open()) { netplus::NetException e; Loading Loading @@ -4409,13 +4409,13 @@ static std::vector<uint8_t> readFileBytesDer(const std::string& path) { } // Check if OID matches P-256 (prime256v1): 1.2.840.10045.3.1.7 static bool isOidP256(const uint8_t* oid, size_t len) { [[maybe_unused]] static bool isOidP256(const uint8_t* oid, size_t len) { static const uint8_t P256_OID[] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07}; return (len == sizeof(P256_OID) && std::memcmp(oid, P256_OID, len) == 0); } // Check if OID matches ecPublicKey: 1.2.840.10045.2.1 static bool isOidEcPublicKey(const uint8_t* oid, size_t len) { [[maybe_unused]] static bool isOidEcPublicKey(const uint8_t* oid, size_t len) { static const uint8_t EC_OID[] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01}; return (len == sizeof(EC_OID) && std::memcmp(oid, EC_OID, len) == 0); } Loading test/ecc.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ static void dump_point(const char* tag, const netplus::P256Point& P){ std::cout << "\n"; } static netplus::P256Point to_mont_point(const netplus::P256Point& Pstd) [[maybe_unused]] static netplus::P256Point to_mont_point(const netplus::P256Point& Pstd) { netplus::P256Point P = Pstd; if (!P.inf) { Loading Loading @@ -726,7 +726,7 @@ static bool test_mont_roundtrip_big(const u256& x) return true; } static netplus::P256Point scalar_mul_ref_std(const uint8_t k[32], const netplus::P256Point& Pstd) [[maybe_unused]] static netplus::P256Point scalar_mul_ref_std(const uint8_t k[32], const netplus::P256Point& Pstd) { using namespace netplus; Loading test/tls.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ private: uint8_t rtype = rec[0]; uint16_t ver = (uint16_t(rec[1])<<8) | rec[2]; uint16_t rlen = (uint16_t(rec[3])<<8) | rec[4]; if (5 + rlen != rec.size()) throw std::runtime_error("record length mismatch"); if (5 + size_t(rlen) != rec.size()) throw std::runtime_error("record length mismatch"); Dec d; std::vector<uint8_t> plain; Loading Loading
src/ssl.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -258,7 +258,7 @@ namespace netplus { return std::vector<uint8_t>(p, p + len); } static bool parsePkcs1RsaPrivateKeyDer( [[maybe_unused]] static bool parsePkcs1RsaPrivateKeyDer( const netplus::ASN1Node& seq, std::vector<uint8_t>& nBE, std::vector<uint8_t>& eBE, Loading Loading @@ -4380,7 +4380,7 @@ size_t netplus::ssl::recvData(buffer& data, int flags) throw n; } static std::vector<uint8_t> readFileBytesDer(const std::string& path) { [[maybe_unused]] static std::vector<uint8_t> readFileBytesDer(const std::string& path) { std::ifstream f(path, std::ios::binary | std::ios::ate); if (!f.is_open()) { netplus::NetException e; Loading Loading @@ -4409,13 +4409,13 @@ static std::vector<uint8_t> readFileBytesDer(const std::string& path) { } // Check if OID matches P-256 (prime256v1): 1.2.840.10045.3.1.7 static bool isOidP256(const uint8_t* oid, size_t len) { [[maybe_unused]] static bool isOidP256(const uint8_t* oid, size_t len) { static const uint8_t P256_OID[] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07}; return (len == sizeof(P256_OID) && std::memcmp(oid, P256_OID, len) == 0); } // Check if OID matches ecPublicKey: 1.2.840.10045.2.1 static bool isOidEcPublicKey(const uint8_t* oid, size_t len) { [[maybe_unused]] static bool isOidEcPublicKey(const uint8_t* oid, size_t len) { static const uint8_t EC_OID[] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01}; return (len == sizeof(EC_OID) && std::memcmp(oid, EC_OID, len) == 0); } Loading
test/ecc.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ static void dump_point(const char* tag, const netplus::P256Point& P){ std::cout << "\n"; } static netplus::P256Point to_mont_point(const netplus::P256Point& Pstd) [[maybe_unused]] static netplus::P256Point to_mont_point(const netplus::P256Point& Pstd) { netplus::P256Point P = Pstd; if (!P.inf) { Loading Loading @@ -726,7 +726,7 @@ static bool test_mont_roundtrip_big(const u256& x) return true; } static netplus::P256Point scalar_mul_ref_std(const uint8_t k[32], const netplus::P256Point& Pstd) [[maybe_unused]] static netplus::P256Point scalar_mul_ref_std(const uint8_t k[32], const netplus::P256Point& Pstd) { using namespace netplus; Loading
test/tls.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ private: uint8_t rtype = rec[0]; uint16_t ver = (uint16_t(rec[1])<<8) | rec[2]; uint16_t rlen = (uint16_t(rec[3])<<8) | rec[4]; if (5 + rlen != rec.size()) throw std::runtime_error("record length mismatch"); if (5 + size_t(rlen) != rec.size()) throw std::runtime_error("record length mismatch"); Dec d; std::vector<uint8_t> plain; Loading