LibEmiddle v2.6.0
π― Overview
Production-readiness sprint delivering security hardening, encrypted persistence, structured error handling, and comprehensive test coverage across the full Signal Protocol stack.
β¨ What's New
π Security Hardening
- NEW: Group session replay attack protection β per-sender message ID tracking with 1,000-entry cap
- NEW: Chat session replay protection β 500-message sliding window FIFO ring buffer
- NEW: Post-removal forward secrecy β automatic chain key rotation when a group member is removed
- NEW: Encrypted device list persistence β AES-GCM authenticated storage with atomic writes
π‘ API & Messaging
- NEW:
StartListeningAsync()now auto-starts mailbox polling β no extra call needed - NEW: O(1) message routing via
SenderIdentityKeyfield onEncryptedMessageβ replaces O(n) brute-force session scan - NEW:
CreateChatSessionAsync(byte[] identityKey)overload β cache-first, transport fallback - NEW:
SendToDeviceAsync(deviceId, message)β device-to-device encrypted message routing - NEW:
FetchRecipientKeyBundleAsync()β validates bundle signature before caching - NEW: OPKManager one-time prekey consumption tracking with automatic replenishment
ποΈ Persistence & Lifecycle
- NEW:
DeviceStorageβ survives process restarts with encrypted device list files - NEW:
IAsyncDisposableonLibEmiddleClientβ safeawait usingcleanup - NEW:
LibEmiddleExceptionwith typedLibEmiddleErrorCodeβ 12 structured error codes replacing generic exceptions
π§ͺ Testing
- NEW: Concurrency tests β 7 tests covering multi-thread encrypt/decrypt, session isolation, nonce uniqueness
- NEW: Stress tests β 10 sessions Γ 50 messages, 5 group sessions Γ 20 messages, error path coverage
β οΈ Important Changes
- Password KDF migrated from HKDF + fixed salt to Argon2id (64 MB, 2 passes) β stronger brute-force resistance
SecureWebSocketClientnow throwsLibEmiddleException(TransportError)instead of bareException- Fixed AES-GCM detached decryption P/Invoke signature (was silently failing all decryption)
- Fixed
MessageSigning.VerifyObject<T>()reversed argument order (was failing all signature verification)
β Compatibility
Fully backward compatible with v2.5.1 β drop-in replacement, no code changes needed for existing integrations.
π Testing
- β 532 tests passing (up from 388 baseline)
- β No breaking changes
- β No new failures