* make KeyHash non-optional, StrEncoding class
* change server URI format in agent config, refactor with StrEncoding
* refactor Crypto using checkAlgorithm
* refactor parsing connection requests
* prepare to validate CA fingerprint sent in client handshake
* KeyHash check in handshake
* rename type to CliCommand
* server validates keyhash sent by the client
* validate -a option when parsing
* more of StrEncoding
* binary SMP protocol encoding (server tests fail)
* use 1 byte for bytestring length when encoding/decoding
* Encoding class, binary tags
* update server tests
* negotiate SMP version in client/server handshake
* add version columns to queues and connections
* split parsing SMP client commands and server responses to different functions
* check uniqueness of protocol tags
* split client commands and server responses/messages to separate types
* update types in SMP client
* remove pattern synonyms for SMP errors
* simplify getHandshake
* update SMP protocol encoding in protocol spec
* encode time as a number of seconds (64-bit integer) since epoch
* SMP commands for notifications (LSTN, NTFY) with separate queue IDs and keys
* rename Notifier types
* remove notify key and id from NEW and IDS commands (TODO add other commands)
* fix StoreLog serialization
* add commands for managing notifications
* add notification subscribers to server state, add notifier ID and key to store log
* add notifier ID and key to the queue
* refactor END notification to work for both types of subscriptions, deliver message notification (NMSG)
* process NSUB command - subscribe to message notifications
* test for message notifications
* fix SMP client function for NSUB command
* fix parse/serialize NID command
* refactor use ifM
* check duplicate notifier ID only against other notifier IDs
* refactor getQueue
* test notifier ID and key with store log
* Update src/Simplex/Messaging/Client.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
* Update src/Simplex/Messaging/Server.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
* store log: s/NOTIFY/NOTIFIER/
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
* example websockets server
* example of ws client
* type class TConnection for generic TCP/WebSockets implementation
* support WebSockets transport
* rename TConnection methods
* revert runClient to not need transport arg
* pass the list of ports and transports via SMP server config
* remove TypeApplications
* s/Transport/TProxy/, s/TConnection/Transport/
* fix server with multiple transports, make SMP client use WS transport with port 80 (TODO fallback to WS)
* 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
* move server keys to config
* add server keys from files
* create server keys if key files do not exist
* validate loaded server key pair
* refactor fromString functions
* key files in /etc/opt/simplex
* 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
* generate key pair
* crypto: sign/verify functions
* remove extension
* parse/serialize keys
* use RSA recipient/sender keys (TODO sign/verify)
* make PublicKey newtype, assign 0s to private_p & private_q
* replace SMP command parsing with Attoparsec
* rename types: Signed->Transmission, Transmission->SignedTransmission
* sign and verify commands (server tests skipped, agent tests pass)
* SMP client: avoid seralizing transmission twice when sending commands
* update SMP server tests to use command signatures
* remove support for "SEND :msg" syntax from SMP server protocol
* rename RSA module name to R to avoid confusion with C used for S.M.Crypto
* update key sizes to use bits `div` 8
* tidy up