ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
discovery_keys.h
Go to the documentation of this file.
1
53
54#pragma once
55
56#include "../asciichat_errno.h"
57#include "../common.h"
60#include <stdbool.h>
61#include <stdint.h>
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
72#define ACDS_OFFICIAL_SERVER ACDS_OFFICIAL_SERVER_HOSTNAME
73
77#define ACDS_OFFICIAL_KEY_SSH_URL "https://discovery.ascii-chat.com/key.pub"
78#define ACDS_OFFICIAL_KEY_GPG_URL "https://discovery.ascii-chat.com/key.gpg"
79
83#define ACDS_KEYS_CACHE_DIR "acds_keys"
84
119discovery_keys_verify(const char *acds_server, const char *key_spec,
120 uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
121
133 const char *url, uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
134
148 const char *file_path, uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
149
162 const char *acds_server, char *path_out, size_t path_size);
163
175 const char *acds_server, uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
176
187 const char *acds_server, const uint8_t pubkey[ED25519_PUBLIC_KEY_SIZE]);
188
207 const char *acds_server, const uint8_t old_pubkey[ED25519_PUBLIC_KEY_SIZE],
208 const uint8_t new_pubkey[ED25519_PUBLIC_KEY_SIZE]);
209
220discovery_keys_clear_cache(const char *acds_server);
221
222#ifdef __cplusplus
223}
224#endif
ascii-chat Discovery Service (ACDS) Protocol Message Formats
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
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
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
#define ASCIICHAT_API
Export symbols on Unix platforms (Linux, macOS).
Definition api.h:87
⚙️ Common definitions, error codes, macros, and types shared throughout the application
char file_path[PLATFORM_MAX_PATH_LENGTH]
Definition mmap.c:44
#define ED25519_PUBLIC_KEY_SIZE
Ed25519 public key size in bytes.
Definition sizes.h:38