|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
📜 SSH known_hosts file parser for host key verification and trust management More...
Go to the source code of this file.
Functions | |
| const char * | get_known_hosts_path (void) |
| Get the path to the known_hosts file. | |
| asciichat_error_t | check_known_host (const char *server_ip, uint16_t port, const uint8_t server_key[32]) |
| asciichat_error_t | check_known_host_no_identity (const char *server_ip, uint16_t port) |
| asciichat_error_t | add_known_host (const char *server_ip, uint16_t port, const uint8_t server_key[32]) |
| asciichat_error_t | remove_known_host (const char *server_ip, uint16_t port) |
| void | compute_key_fingerprint (const uint8_t key[ED25519_PUBLIC_KEY_SIZE], char fingerprint[CRYPTO_HEX_KEY_SIZE_NULL]) |
| bool | prompt_unknown_host (const char *server_ip, uint16_t port, const uint8_t server_key[32]) |
| bool | display_mitm_warning (const char *server_ip, uint16_t port, const uint8_t expected_key[32], const uint8_t received_key[32]) |
| bool | prompt_unknown_host_no_identity (const char *server_ip, uint16_t port) |
| void | known_hosts_destroy (void) |
📜 SSH known_hosts file parser for host key verification and trust management
Definition in file known_hosts.c.
| asciichat_error_t add_known_host | ( | const char * | server_ip, |
| uint16_t | port, | ||
| const uint8_t | server_key[32] | ||
| ) |
Definition at line 381 of file known_hosts.c.
References format_ip_with_port(), get_known_hosts_path(), platform_fopen(), and safe_fprintf().
Referenced by crypto_handshake_client_key_exchange().
| asciichat_error_t check_known_host | ( | const char * | server_ip, |
| uint16_t | port, | ||
| const uint8_t | server_key[32] | ||
| ) |
Definition at line 78 of file known_hosts.c.
References compare_ip_port_strings(), config_file_list_destroy(), crypto_regex_match_known_hosts(), format_ip_with_port(), parse_public_key(), platform_close(), platform_find_config_file(), platform_open(), and safe_snprintf().
Referenced by crypto_handshake_client_key_exchange().
| asciichat_error_t check_known_host_no_identity | ( | const char * | server_ip, |
| uint16_t | port | ||
| ) |
Definition at line 251 of file known_hosts.c.
References compare_ip_port_strings(), crypto_regex_match_known_hosts(), format_ip_with_port(), get_known_hosts_path(), platform_close(), platform_open(), and safe_snprintf().
Referenced by crypto_handshake_client_key_exchange().
| void compute_key_fingerprint | ( | const uint8_t | key[ED25519_PUBLIC_KEY_SIZE], |
| char | fingerprint[CRYPTO_HEX_KEY_SIZE_NULL] | ||
| ) |
Definition at line 570 of file known_hosts.c.
Referenced by discovery_keys_verify_change(), display_mitm_warning(), and prompt_unknown_host().
| bool display_mitm_warning | ( | const char * | server_ip, |
| uint16_t | port, | ||
| const uint8_t | expected_key[32], | ||
| const uint8_t | received_key[32] | ||
| ) |
Definition at line 655 of file known_hosts.c.
References compute_key_fingerprint(), escape_ascii(), format_ip_with_port(), get_known_hosts_path(), and safe_snprintf().
Referenced by crypto_handshake_client_key_exchange().
| const char * get_known_hosts_path | ( | void | ) |
Get the path to the known_hosts file.
Returns the path to the known_hosts file, using the same directory as all other ascii-chat configuration files (get_config_dir()).
PATH RESOLUTION:
Definition at line 47 of file known_hosts.c.
References get_config_dir(), and safe_snprintf().
Referenced by add_known_host(), check_known_host_no_identity(), crypto_handshake_client_key_exchange(), display_mitm_warning(), prompt_unknown_host(), and remove_known_host().
| void known_hosts_destroy | ( | void | ) |
Definition at line 828 of file known_hosts.c.
Referenced by asciichat_shared_destroy().
| bool prompt_unknown_host | ( | const char * | server_ip, |
| uint16_t | port, | ||
| const uint8_t | server_key[32] | ||
| ) |
Definition at line 584 of file known_hosts.c.
References compute_key_fingerprint(), format_ip_with_port(), get_known_hosts_path(), log_lock_terminal(), log_unlock_terminal(), platform_getenv(), platform_prompt_yes_no(), safe_snprintf(), and terminal_can_prompt_user().
Referenced by crypto_handshake_client_key_exchange().
| bool prompt_unknown_host_no_identity | ( | const char * | server_ip, |
| uint16_t | port | ||
| ) |
Definition at line 766 of file known_hosts.c.
References format_ip_with_port(), platform_prompt_yes_no(), and safe_snprintf().
Referenced by crypto_handshake_client_key_exchange().
| asciichat_error_t remove_known_host | ( | const char * | server_ip, |
| uint16_t | port | ||
| ) |
Definition at line 486 of file known_hosts.c.
References format_ip_with_port(), get_known_hosts_path(), platform_close(), platform_open(), platform_strdup(), and safe_snprintf().