* use SQLCipher
* pass database key via options, use local direct-sqlcipher and sqlcipher-simple
* update stack.yaml
* use dependencies in git
* update sqlcipher dependencies
* store SMP client version per queue
* use versioned format for queue addresses (not compatible with v1)
* multiple server hosts in queue URI/data, versioned encoding (cross-version tests fail)
* choose server host based on socksProxy setting
* test works
* multiple server addresses mostly work
* add onion hosts for provided servers
* update SMP hosts
* ntf: use separate key to encrypt NMsgMeta
* key negotiation
* save key on server, use for encryption
* refactor?
* store error
* NtfQueueCreds
* server - NtfCreds
* comment, rename
* fix type
* ClientNtfCreds
* encoding
* support stopping and resuming agent (#385)
* export agentDbPath
* support fully closing and resuming agent
* whitespace
* clean up
* support message flags visible to SMP server to control notifications (and for any future extensions)
* simplify message flags encoding
* GET command
* make sending confirmation asynchronous
* confirm first queue synchronously (on JOIN, and delete connection on failure), second queue asynchronously (from REPLY msg)
* test to retry JOIN when the first attempt fails
* process confirmation delivery errors
* separate skipped messages from ratchet
* return diff for skipped messages instead of the whole state (tests fail)
* fix ratchet tests
* JSON encoding/decoding for ratchet state
* schema for ratchets
* split MonadUnliftIO instance for ExceptT to a separate file
* update StrEncoding instance for Str
* ratchet store methods
* updateRatchet store method
* move E2E ratchet params to Ratchet module
* x3dh key agreement for double ratchet
* test/fix x3dh, use x3dh for ratchets initialization
* store/get x3dh keys, save ratchet of fixed X448 type
* double-ratchet encryption integration (tests fail)
* fix double ratchet
* fix padding and message length
* remove unused code for "activations"
* remove comment
* add version checks for forward/backward compatibility
* split loading ratchet and skipped message keys
* remove unused encoding instances for Algorithm types
* update ratchet initialization params
* types and encodings for double ratchet integration
* upgrade stack resolver
* type classes for version agreement, encode/decode connection request links and E2E params with versioning
* encode/decode client parameters (version and DH key) in SMP queue URI using query string parameters
* restore support of the current SMP queue URI format
* update AMessage to only send queues in REPLY message (not the full connection request)
* new agent message evnvelopes (tests fail)
* new message envelopes - tests pass
* store fully encrypted messages before sending
* unify message delivery via DB queue (excluding confirmation and invitation)
* remove activateSecuredQueue
* linter hints
* remove comment
* export order
* save rachet-encrypted message, not per-queue encrypted
* delete message after it is accepted by the server, reduce message delivery interval for the tests
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
* asynchronous message sending to allow accepting messages when agent (or server) is offline
* send pending messages after agent restart; test for pending messages delivery when server restarted
* test pending message delivery after agent restart
* message delivery process per server
* test layout
* commands to support introduction
* agent messages / envelopes to support introductions
* introductions and invitations table; insert record with random unique ID
* store class methods and types for introductions
* process INTRO and ACPT commands for connection introductions
* fix tests: add MonadFail constraint, remove OK response to JOIN
* process agent messages for introductions
* ICON notification when introduction is completed
* replace multiway if with case
* correction
* support random connection IDs
* save additional connection fields, refactor create connection funcs
* refactor
* refactor
* test duplex connection with random IDs
* store methods for introductions
* test introduction
* fix parsing of CON agent message
* test introduction with random connection IDs
* broadcast with random connection and broadcast IDs
* clean up sql
* agent: send CON to user when the 1st party responds HELLO; fix REPLY vulnerability
* test for getRcvConn
* add commented OK response to JOIN command
* store: use Only newtype to select one field
* inventory of error handling problems and types
* Change SMP protocol errors syntax
* connection errors in agent protocol (ERR CONN), STORE error -> AGENT error
* include exception in SEInternal error
* add MESSAGE errors, remove CRYPTO and SIZE errors
* agent protocol SYNTAX and AGENT errors
* BROKER errors
* group all client command (and agent response) errors
* BROKER TRANSPORT error
* simplify Client
* clean up
* transport errors
* simplify client
* parse / serialize agent errors
* differentiate crypto errors
* update errors.md
* make agent and SMP protocol errors consistent, simplify
* update doc
* test: parse / serialize protocol errors with QuickCheck
* add String to internal error
* exponential back-off when retrying to send HELLO
* refactor Client.hs
* replace fold with recursion in startTCPClient
* fail test if server did not start, refactor
* test: wait till TCP server stops
* test: refactor waiting for server to stop
* test: fail with error if server did not start/stop
* key encoding primitives (WIP)
* use X509/PKCS8 to read/write server key files
* make PrivateKey type class
* clean up
* remove separate public key file
* specific import
* transport encryption (WIP - using fixed key, parsing/serialization works, SMP tests fail)
* transport encryption
* transport encryption: separate keys to receive and to send, counter-based IVs
* docs: update transport encryption and handshake
* transport encryption handshake (TODO: validate key hash, welcome block, move keys to system environment)
* change KeyHash type to newtype of Digest SHA256
* transport encryption: validate public key hash
* send and receive welcome block with SMP version
* refactor: parsing SMPServer
* remove unused function
* verify that client version is compatible with server version (major version is not smaller)
* update (fix) SMP server tests