ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
crypto.c File Reference

Stub implementations for crypto-related functions in WASM build. More...

Go to the source code of this file.

Functions

asciichat_error_t ed25519_verify_signature (const uint8_t public_key[32], const uint8_t *message, size_t message_len, const uint8_t signature[64], const char *gpg_key_id)
 
asciichat_error_t ed25519_sign_message (const private_key_t *key, const uint8_t *message, size_t message_len, uint8_t signature[64])
 
asciichat_error_t parse_public_keys (const char *input, public_key_t *keys_out, size_t *num_keys, size_t max_keys)
 
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)
 
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 (const char *server_ip, uint16_t port, const uint8_t server_key[32])
 
bool prompt_unknown_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])
 
const char * get_known_hosts_path (void)
 
asciichat_error_t prompt_password (const char *prompt_text, char *password_out, size_t password_max_len)
 

Detailed Description

Stub implementations for crypto-related functions in WASM build.

Definition in file lib/platform/wasm/stubs/crypto.c.

Function Documentation

◆ add_known_host()

asciichat_error_t add_known_host ( const char *  server_ip,
uint16_t  port,
const uint8_t  server_key[32] 
)

Definition at line 61 of file lib/platform/wasm/stubs/crypto.c.

61 {
62 // Known hosts file updates not supported in WASM
63 return ASCIICHAT_OK;
64}

◆ check_known_host()

asciichat_error_t check_known_host ( const char *  server_ip,
uint16_t  port,
const uint8_t  server_key[32] 
)

Definition at line 35 of file lib/platform/wasm/stubs/crypto.c.

35 {
36 // Known hosts checking not supported in WASM
37 return ASCIICHAT_OK;
38}

◆ check_known_host_no_identity()

asciichat_error_t check_known_host_no_identity ( const char *  server_ip,
uint16_t  port 
)

Definition at line 40 of file lib/platform/wasm/stubs/crypto.c.

40 {
41 // Known hosts checking not supported in WASM
42 return ASCIICHAT_OK;
43}

◆ display_mitm_warning()

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 45 of file lib/platform/wasm/stubs/crypto.c.

46 {
47 // MITM warnings not displayed in WASM (browser console log instead)
48 return false;
49}

◆ ed25519_sign_message()

asciichat_error_t ed25519_sign_message ( const private_key_t *  key,
const uint8_t *  message,
size_t  message_len,
uint8_t  signature[64] 
)

Definition at line 22 of file lib/platform/wasm/stubs/crypto.c.

23 {
24 // Client authentication not supported in WASM (no client keys)
25 return SET_ERRNO(ERROR_NOT_SUPPORTED, "Ed25519 signing not supported in WASM");
26}

◆ ed25519_verify_signature()

asciichat_error_t ed25519_verify_signature ( const uint8_t  public_key[32],
const uint8_t *  message,
size_t  message_len,
const uint8_t  signature[64],
const char *  gpg_key_id 
)

Definition at line 16 of file lib/platform/wasm/stubs/crypto.c.

17 {
18 // Server identity verification not supported in WASM (no known_hosts file)
19 return ASCIICHAT_OK;
20}

◆ get_known_hosts_path()

const char * get_known_hosts_path ( void  )

Definition at line 66 of file lib/platform/wasm/stubs/crypto.c.

66 {
67 // No filesystem in WASM
68 return NULL;
69}

◆ parse_public_keys()

asciichat_error_t parse_public_keys ( const char *  input,
public_key_t *  keys_out,
size_t *  num_keys,
size_t  max_keys 
)

Definition at line 29 of file lib/platform/wasm/stubs/crypto.c.

29 {
30 // Key file parsing not supported in WASM
31 return SET_ERRNO(ERROR_NOT_SUPPORTED, "Public key file parsing not supported in WASM");
32}

◆ prompt_password()

asciichat_error_t prompt_password ( const char *  prompt_text,
char *  password_out,
size_t  password_max_len 
)

Definition at line 72 of file lib/platform/wasm/stubs/crypto.c.

72 {
73 // Password prompts not supported in WASM
74 return SET_ERRNO(ERROR_NOT_SUPPORTED, "Password prompts not supported in WASM");
75}

Referenced by crypto_handshake_client_auth_response().

◆ prompt_unknown_host()

bool prompt_unknown_host ( const char *  server_ip,
uint16_t  port,
const uint8_t  server_key[32] 
)

Definition at line 51 of file lib/platform/wasm/stubs/crypto.c.

51 {
52 // No interactive prompts in WASM - auto-accept
53 return true;
54}

◆ prompt_unknown_host_no_identity()

bool prompt_unknown_host_no_identity ( const char *  server_ip,
uint16_t  port 
)

Definition at line 56 of file lib/platform/wasm/stubs/crypto.c.

56 {
57 // No interactive prompts in WASM - auto-accept
58 return true;
59}