local switch: Implement shared-secret feature

This allows for a “shared secret” to be entered for a network switch,
segmenting traffic so that multiple people could use the feature
simultaneously without accidentally entering into or interfering with
each other's networks.

Takes a string specified in the configuration file (using the
net_%02i_secret key) and hashes it through SHA3-256 to prepend to each
data packet.  This hash is used to compare packets on reception and
allow or discard them.
This commit is contained in:
Mike Swanson
2026-02-09 19:06:45 -08:00
parent ad235874c7
commit f3d22bbef3
4 changed files with 538 additions and 4 deletions

View File

@@ -98,6 +98,7 @@ typedef struct netcard_conf_t {
char host_dev_name[128];
uint32_t link_state;
uint8_t switch_group;
char secret[256];
uint8_t promisc_mode;
char slirp_net[16];
char nrs_hostname[128];