Commit graph

3 commits

Author SHA1 Message Date
Stephen Dennis
cb4c101125 fix: resolve Pass 4 Hydra Medium audit defects #1095–#1102
- #1095: WS RSV + control FIN/len≤125 before ext-len (no large PING→PONG)
- #1096: cap writeBuffers_ (256 KiB, close slow FD); subscriber queues drop oldest at 256
- #1097: gRPC/grpc-web login lockout by peer IP; /passwd requires old password
- #1098: RAND_bytes hard-fail; password/scrollback salts via CSPRNG
- #1099: ProcessManager::stopAndWait with SIGKILL escalate; restart + dtor wait/reap
- #1100: scrollback_lines applied on session create/restore; max_sessions_per_account enforced
- #1101: telnet IAC SB reassembly capped at 64 KiB
- #1102: /metrics loopback-only; ListGames/GetGameStatus require session

proxy_regression: ok (RSV, large PING, SB cap + prior WS cases)
hydra: builds with GRPC=1
2026-07-24 18:22:17 -06:00
Stephen Dennis
dd13abe370 Port Hydra proxy to compile on Windows
hydra_log.cpp: localtime_r → _localtime64_s on Win32.

session_manager.cpp: Remove stale sys/socket.h include (unused,
GANL abstracts all networking).

hydra_main.cpp: Replace sigaction with SetConsoleCtrlHandler on
Win32. Replace getpass() with console API readPassword(). Guard
recv() call with platform-appropriate types.

account_manager.cpp: Replace crypt_r (glibc-only) with
PBKDF2-HMAC-SHA256 via OpenSSL on Win32. Guard file permission
checks (S_IROTH/S_IWOTH) as POSIX-only. Use CreateFileA/WriteFile
for master key generation on Win32.

process_manager.cpp/h: Full Win32 implementation using
CreateProcess, TerminateProcess, WaitForSingleObject,
GetExitCodeProcess. HANDLE instead of pid_t. CTRL_BREAK_EVENT
for graceful shutdown instead of SIGTERM.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:38:22 -06:00
Stephen Dennis
c514006a94 Add process manager for local games (Phase 2 Step 4)
Fork/exec local game processes with /start, /stop, /restart commands.
Autostart on first /connect if configured.  Child reaping via
waitpid(WNOHANG) in the event loop, with SIGKILL escalation after 10s
if SIGTERM doesn't terminate the process.

This completes Phase 2 (multi-game and process management).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 12:37:26 -06:00