Config: Added [allowed_keys] section for client public key authorization on server

- Added CFG_ALLOWED_KEY struct with binary key storage (64 bytes) for fast memcmp comparison
- Implemented parsing of [allowed_keys] section with allow_all flag and per-key entries
- Added key validation in etcp_connections.c server handler (errorcode=8 for rejected keys)
- Default behavior: deny all if [allowed_keys] section is missing or allow_all=0 with no keys
- Added proper memory cleanup and debug logging for allowed_keys configuration
- Updated all test configs to include [allowed_keys] allow_all=1 for backward compatibility
This commit is contained in:
Evgeny committed 2026-04-24 00:16:30 +03:00
1 parent 3625a4e5d5
commit e39979bfac
12 files changed
+131 -10

No files matched your search

+4 -1
View File
@@ -55,7 +55,10 @@ static const char* server_config_content =
"\n"
"[server: test]\n"
"addr=127.0.0.1:9031\n"
"type=public\n";
"type=public\n"
"\n"
"[allowed_keys]\n"
"allow_all=1\n";
// Client config content (uses ports 9032)
static const char* client_config_content =