ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
known_hosts.h File Reference

Known hosts management for MITM attack prevention. More...

Go to the source code of this file.

Functions

Known Hosts Verification
asciichat_error_t check_known_host (const char *server_ip, uint16_t port, const uint8_t server_key[32])
 Check if server key is in known_hosts.
 
asciichat_error_t check_known_host_no_identity (const char *server_ip, uint16_t port)
 Check known_hosts for servers without identity key (no-identity entries)
 
Known Hosts Management
asciichat_error_t add_known_host (const char *server_ip, uint16_t port, const uint8_t server_key[32])
 Add server to known_hosts.
 
asciichat_error_t remove_known_host (const char *server_ip, uint16_t port)
 Remove server from known_hosts.
 
const char * get_known_hosts_path (void)
 Get the path to the known_hosts file.
 
User Interaction
bool display_mitm_warning (const char *server_ip, uint16_t port, const uint8_t expected_key[32], const uint8_t received_key[32])
 Display MITM warning with key comparison and prompt user for confirmation.
 
bool prompt_unknown_host (const char *server_ip, uint16_t port, const uint8_t server_key[32])
 Interactive prompt for unknown host - returns true if user wants to add, false to abort.
 
bool prompt_unknown_host_no_identity (const char *server_ip, uint16_t port)
 Interactive prompt for unknown host without identity key - returns true if user wants to continue, false to abort.
 
Key Fingerprinting
void compute_key_fingerprint (const uint8_t key[32], char fingerprint[65])
 Compute SHA256 fingerprint of Ed25519 key for display.
 
Cleanup
void known_hosts_cleanup (void)
 Cleanup function to free cached known_hosts path.
 

Detailed Description

Known hosts management for MITM attack prevention.

Definition in file known_hosts.h.