ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
discovery_keys.h
Go to the documentation of this file.
1
51#pragma once
52
53#include "../asciichat_errno.h"
54#include "../common.h"
55#include "../network/acip/acds.h"
56#include <stdbool.h>
57#include <stdint.h>
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
68#define ACDS_OFFICIAL_SERVER ACDS_OFFICIAL_SERVER_HOSTNAME
69
73#define ACDS_OFFICIAL_KEY_SSH_URL "https://discovery.ascii-chat.com/key.pub"
74#define ACDS_OFFICIAL_KEY_GPG_URL "https://discovery.ascii-chat.com/key.gpg"
75
79#define ACDS_KEYS_CACHE_DIR "acds_keys"
80
113ASCIICHAT_API asciichat_error_t discovery_keys_verify(const char *acds_server, const char *key_spec,
114 uint8_t pubkey_out[32]);
115
127
141
153ASCIICHAT_API asciichat_error_t discovery_keys_get_cache_path(const char *acds_server, char *path_out,
154 size_t path_size);
155
165ASCIICHAT_API asciichat_error_t discovery_keys_load_cached(const char *acds_server, uint8_t pubkey_out[32]);
166
176ASCIICHAT_API asciichat_error_t discovery_keys_save_cached(const char *acds_server, const uint8_t pubkey[32]);
177
195ASCIICHAT_API asciichat_error_t discovery_keys_verify_change(const char *acds_server, const uint8_t old_pubkey[32],
196 const uint8_t new_pubkey[32]);
197
208
209#ifdef __cplusplus
210}
211#endif
asciichat_error_t discovery_keys_clear_cache(const char *acds_server)
Clear cached key for ACDS server.
asciichat_error_t discovery_keys_load_cached(const char *acds_server, uint8_t pubkey_out[32])
Check if cached key exists and load it.
asciichat_error_t discovery_keys_verify(const char *acds_server, const char *key_spec, uint8_t pubkey_out[32])
Verify and load ACDS server public key.
asciichat_error_t discovery_keys_download_https(const char *url, uint8_t pubkey_out[32])
Download key from HTTPS URL.
asciichat_error_t discovery_keys_verify_change(const char *acds_server, const uint8_t old_pubkey[32], const uint8_t new_pubkey[32])
Verify key change with user.
asciichat_error_t discovery_keys_save_cached(const char *acds_server, const uint8_t pubkey[32])
Save key to cache.
asciichat_error_t discovery_keys_load_file(const char *file_path, uint8_t pubkey_out[32])
Load key from local file.
asciichat_error_t discovery_keys_get_cache_path(const char *acds_server, char *path_out, size_t path_size)
Get cached key path for ACDS server.
unsigned char uint8_t
Definition common.h:56
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:49
#define ASCIICHAT_API
Export symbols on Unix platforms (Linux, macOS)
Definition api.h:82
char file_path[PLATFORM_MAX_PATH_LENGTH]
Definition mmap.c:39
ClangTool/LibTooling compatibility shim for stdbool.h.