ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
discovery_keys.h
Go to the documentation of this file.
1
50
51#pragma once
52
54#include "../asciichat_errno.h"
55#include "../common.h"
57#include <stdbool.h>
58#include <stdint.h>
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
69#define ACDS_OFFICIAL_SERVER ACDS_OFFICIAL_SERVER_HOSTNAME
70
74#define ACDS_OFFICIAL_KEY_SSH_URL "https://discovery.ascii-chat.com/key.pub"
75#define ACDS_OFFICIAL_KEY_GPG_URL "https://discovery.ascii-chat.com/key.gpg"
76
80#define ACDS_KEYS_CACHE_DIR "acds_keys"
81
114ASCIICHAT_API asciichat_error_t discovery_keys_verify(const char *acds_server, const char *key_spec,
115 uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
116
128 uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
129
143 uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
144
156ASCIICHAT_API asciichat_error_t discovery_keys_get_cache_path(const char *acds_server, char *path_out,
157 size_t path_size);
158
169 uint8_t pubkey_out[ED25519_PUBLIC_KEY_SIZE]);
170
181 const uint8_t pubkey[ED25519_PUBLIC_KEY_SIZE]);
182
201 const uint8_t old_pubkey[ED25519_PUBLIC_KEY_SIZE],
202 const uint8_t new_pubkey[ED25519_PUBLIC_KEY_SIZE]);
203
214
215#ifdef __cplusplus
216}
217#endif
ascii-chat Discovery Service (ACDS) Protocol Message Formats
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
⚙️ Common definitions, error codes, macros, and types shared throughout the application
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:60
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
#define ASCIICHAT_API
Export symbols on Unix platforms (Linux, macOS).
Definition api.h:82
char file_path[4096]
Definition mmap.c:42
#define ED25519_PUBLIC_KEY_SIZE
Ed25519 public key size in bytes.
Definition sizes.h:33