ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
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_with_key (const char *server_ip, uint16_t port, const uint8_t server_key[32], uint8_t expected_key[32], bool *has_expected_key)
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[(32 *2+1)])
 Compute SHA256 fingerprint of Ed25519 key for display.
Cleanup
void known_hosts_destroy (void)
 Cleanup function to free cached known_hosts path.

Detailed Description

Known hosts management for MITM attack prevention.

Definition in file known_hosts.h.