Loading src/cluster.cpp +3 −16 Changes for src/cluster.cpp: 3 added lines, 16 removed lines. Original line number Diff line number Diff line Loading @@ -57,11 +57,7 @@ namespace authdb { // --- SessionBlock serialization --- // Session block magic: "SESS" (0x53455353) static constexpr uint8_t SESSION_MAGIC[4] = { 0x53, 0x45, 0x53, 0x53 }; // Wire format: // [4B magic "SESS"] // [16B sid][16B uid][16B did] // [4B member_count] // [16B * member_count member uuids] Loading @@ -86,17 +82,13 @@ namespace authdb { std::vector<std::pair<uuid::uuid, bool>> gpo_results; sess.getGPOResults(gpo_results); // Header: 4(magic) + 16+16+16 + 4 + members*16 + 4 + username + 4 + gpos*17 size_t total = 4 + 48 + 4 + (members.size() * 16) + 4 + username_len // Header: 16+16+16 + 4 + members*16 + 4 + username + 4 + gpos*17 size_t total = 48 + 4 + (members.size() * 16) + 4 + username_len + 4 + (gpo_results.size() * 17); std::vector<uint8_t> buf(total); size_t pos = 0; // Magic std::memcpy(buf.data() + pos, SESSION_MAGIC, 4); pos += 4; // SID std::memcpy(buf.data() + pos, sid.value, 16); pos += 16; Loading Loading @@ -150,15 +142,10 @@ namespace authdb { std::vector<uuid::uuid> &members, std::string &username, std::vector<std::pair<uuid::uuid, bool>> &gpo_results) { if (data.size() < 60) return false; if (data.size() < 56) return false; size_t pos = 0; // Check magic if (std::memcmp(data.data(), SESSION_MAGIC, 4) != 0) return false; pos += 4; std::memcpy(sid.value, data.data() + pos, 16); pos += 16; Loading Loading
src/cluster.cpp +3 −16 Changes for src/cluster.cpp: 3 added lines, 16 removed lines. Original line number Diff line number Diff line Loading @@ -57,11 +57,7 @@ namespace authdb { // --- SessionBlock serialization --- // Session block magic: "SESS" (0x53455353) static constexpr uint8_t SESSION_MAGIC[4] = { 0x53, 0x45, 0x53, 0x53 }; // Wire format: // [4B magic "SESS"] // [16B sid][16B uid][16B did] // [4B member_count] // [16B * member_count member uuids] Loading @@ -86,17 +82,13 @@ namespace authdb { std::vector<std::pair<uuid::uuid, bool>> gpo_results; sess.getGPOResults(gpo_results); // Header: 4(magic) + 16+16+16 + 4 + members*16 + 4 + username + 4 + gpos*17 size_t total = 4 + 48 + 4 + (members.size() * 16) + 4 + username_len // Header: 16+16+16 + 4 + members*16 + 4 + username + 4 + gpos*17 size_t total = 48 + 4 + (members.size() * 16) + 4 + username_len + 4 + (gpo_results.size() * 17); std::vector<uint8_t> buf(total); size_t pos = 0; // Magic std::memcpy(buf.data() + pos, SESSION_MAGIC, 4); pos += 4; // SID std::memcpy(buf.data() + pos, sid.value, 16); pos += 16; Loading Loading @@ -150,15 +142,10 @@ namespace authdb { std::vector<uuid::uuid> &members, std::string &username, std::vector<std::pair<uuid::uuid, bool>> &gpo_results) { if (data.size() < 60) return false; if (data.size() < 56) return false; size_t pos = 0; // Check magic if (std::memcmp(data.data(), SESSION_MAGIC, 4) != 0) return false; pos += 4; std::memcpy(sid.value, data.data() + pos, 16); pos += 16; Loading