Release Notes: v0.1.14-alpha
Release Date: January 21, 2026
Codename: Modular Architecture + Peer Connection
๐ฏ Highlightsโ
- ๐๏ธ Modular Architecture โ Monolithic ~1800 line main.c split into 8 dedicated modules
- ๐ Peer Connection โ New smp_peer.c module for connecting to peer's SMP server
- โ Server Accepts Confirmation โ AgentConfirmation sent and acknowledged with "OK"
- ๐ DH Key Fix โ Invitation URIs use Standard Base64, not Base64URL
๐ New Module Structureโ
| File | Lines | Purpose |
|---|---|---|
include/smp_types.h | ~80 | Structures, constants, extern declarations |
include/smp_utils.h | - | Base64/URL encoding headers |
include/smp_crypto.h | - | Crypto function headers |
include/smp_network.h | - | Network I/O headers |
include/smp_contacts.h | - | Contact management headers |
include/smp_parser.h | - | Agent Protocol parser headers |
include/smp_peer.h | - | NEW: Peer connection headers |
smp_globals.c | ~25 | Global variables definition |
smp_utils.c | ~100 | Encoding implementation |
smp_crypto.c | ~80 | Crypto implementation |
smp_network.c | ~160 | TLS/TCP I/O |
smp_contacts.c | ~380 | Contact + NVS management |
smp_parser.c | ~260 | Agent Protocol + Auto-Connect |
smp_peer.c | ~220 | NEW: Peer Connection |
main.c | ~350 | Reduced from ~1800! |
๐ New Module: smp_peer.cโ
New peer connection functionality:
// Connect to peer's SMP server
bool peer_connect(const char *host, int port);
// Disconnect from peer server
void peer_disconnect(void);
// Send AgentConfirmation to peer's queue
bool send_agent_confirmation(contact_t *contact);
Auto-Connect Featureโ
Parser automatically triggers peer connection when Invitation received:
if (pending_peer.valid && pending_peer.has_dh) {
peer_connect(pending_peer.host, pending_peer.port);
send_agent_confirmation(contact);
peer_disconnect();
}
๐ Bug Fixesโ
1. tcp_connect Naming Conflictโ
Problem: multiple definition of tcp_connect (collides with lwip)
Solution: Renamed to smp_tcp_connect() everywhere
2. DH Key Extraction from Invitation URIโ
Problem: DH Keys from Invitation URI were not decoded properly
Root Cause: Invitation URIs use Standard Base64 (+, /, =), NOT Base64URL (-, _)!
Solution: Convert before decode:
// Strip '=' padding
while (len > 0 && dh_clean[len - 1] == '=') dh_clean[--len] = '\0';
// Convert +/ to -_ (Standard Base64 โ Base64URL)
for (int x = 0; x < len; x++) {
if (dh_clean[x] == '+') dh_clean[x] = '-';
if (dh_clean[x] == '/') dh_clean[x] = '_';
}
๐ฌ New Discoveriesโ
| # | Discovery |
|---|---|
| 16 | DH Keys in Invitation URIs use Standard Base64, NOT Base64URL |
| 17 | AgentConfirmation format: (agentVersion, 'C', e2eEncryption_, Tail encConnInfo) |
| 18 | Maybe Encoding: '0' = Nothing, '1' + data = Just |
| 19 | Each peer has own SMP server โ separate TLS connection required |
| 20 | SEND to Peer: queue_id as entityId, no signature needed |
๐ New Filesโ
| File | Purpose |
|---|---|
.gitignore | build/, managed_components/, sdkconfig.old, etc. |
docs/ARCHITECTURE.md | Module documentation |
๐ Current Statusโ
| Feature | Status |
|---|---|
| Modular Architecture | โ Complete |
| Peer Server Connection | โ Working |
| TLS + SMP Handshake with Peer | โ Working |
| AgentConfirmation Sent | โ Server: OK |
| App Shows "Connected" | ๐ง Format Issue |
๐ Known Issue: App Not Showing "Connected"โ
Server accepts Confirmation with "OK", but SimpleX App doesn't show "Connected".
Hypothesis: encConnInfo needs more than just our DH Key.
From Haskell source:
AgentConfirmation {agentVersion, e2eEncryption_, encConnInfo}
-- encConnInfo is possibly Ratchet-encrypted or contains profile info
Next Steps:
- Analyze encConnInfo format in Haskell source
- May need to include profile/connInfo data
- May need Double Ratchet initialization
๐ Statisticsโ
| Metric | Before | After |
|---|---|---|
| main.c lines | ~1800 | ~350 |
| Total modules | 1 | 8 |
| Header files | 0 | 7 |
| Code organization | Monolithic | Modular |
๐ Relatedโ
- Previous: v0.1.13-alpha โ Message Type Fix + Peer Queue
- Next: v0.1.15-alpha โ encConnInfo Format Fix (planned)
Part of the Sentinel Secure Messenger Suite