Evgeny b737b718cf Fix: Auto-generated my_public_key was empty in config
Fixed critical bug where my_public_key was not being generated when auto-adding
to config file. The issue had multiple root causes:

1. Buffer size bug: HEXKEY_LEN constant was too small (64) for public key (needs 129)
2. Silent failure in bytes_to_hex() when buffer too small
3. Wrong validation length checks causing incorrect need_* detection
4. Keypair regeneration instead of deriving public key from private key
5. Node ID conditional logic bug inserting it only when private key was invalid

Changes:
- Added PRIV_HEXKEY_LEN (65) and PUB_HEXKEY_LEN (129) constants
- Added is_valid_priv_key() and is_valid_pub_key() with correct length checks
- Added sc_compute_public_key_from_private() to derive public key when possible
- Fixed node_id insertion logic to check need_node_id instead of need_priv_key
- Updated bytes_to_hex() to null-terminate on error

Tested with real config file - public key now correctly generates as 128 hex chars.
2026-01-20 11:02:33 +03:00
2026-01-18 09:24:13 +03:00
2026-01-18 12:42:42 +03:00
S
Description
No description provided
Readme GPL-3.0
472 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 64.6%
C++ 17.1%
Kotlin 9.4%
HTML 5.8%
Python 1.2%
Other 1.7%