Evgeny Poberezkin
488398df9f
change message envelopes and encoding, unify message delivery ( #252 )
...
* 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 >
2022-01-05 19:52:37 +00:00
Evgeny Poberezkin
f3523bbba9
make KeyHash non-optional, verify KeyHash in SMP handshake, use StrEncoding class ( #250 )
...
* 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
2022-01-02 22:24:43 +00:00
Evgeny Poberezkin
73cad5a6c4
simple per-queue e2e encryption with NaCl crypto_box ( #242 )
...
* simple per-queue e2e encryption with NaCl crypto_box
* add e2e keys and DH secrets to schema
* agree and save shared DH secret per queue (not used yet)
* protocol changes for uniform padding and message part lengths
* correct message structure diagrams
* make per-queue E2E encryption non-optional
* refactor crypto keys
* use NaCl crypto_box for per-queue E2E encryption, remove RSA keys from queues
* remove RSA support
* merge migration with E2E DH keys
* clean up
* remove unused methods
* parsing/serializing agent messages
* remove sender timestamp from DB and code
* clean up
* slean up
* s/SMPConfMsg/SMPConfirmation/
* serializeAgentMessage = serializeClientMessage . agentToClientMsg
* simplify error handling
* update protocol docs
2021-12-29 14:27:10 +00:00
Evgeny Poberezkin
51a9750891
double ratchet algorithm implementation ( #236 )
...
* started double ratchet implementation
* initialize ratchets
* started ratchet encryption
* ratchet encryption
* simplify / narrow down Ratchet type
* double ratchet decryption "framework"
* advance receive ratched on skipped messages
* more ratchet decryption
* double ratchet encrypt/decrypt (TODO tests)
* double ratchet tests
* double ratchet tests
* use ratchet AD in header encryption, use header and ratchet AD as AD in message encryption
* change ratchet message error, remove Show instances
* Update tests/AgentTests/DoubleRatchetTests.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com >
* Update tests/AgentTests/DoubleRatchetTests.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com >
* Update tests/AgentTests/DoubleRatchetTests.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com >
* Update tests/AgentTests/DoubleRatchetTests.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com >
* Update tests/AgentTests/DoubleRatchetTests.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com >
* Update src/Simplex/Messaging/Crypto/Ratchet.hs
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com >
* test in the same ratchet step
* merge tests
* Update src/Simplex/Messaging/Crypto/Ratchet.hs
* Update src/Simplex/Messaging/Crypto/Ratchet.hs
* remove HMAC comment
Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com >
2021-12-25 17:13:53 +00:00
Efim Poberezkin
e2cd370513
certificate validation on client side; check stored fingerprint on server start-up; non-optional fingerprint parsing ( #234 , closes #155 )
...
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2021-12-22 23:24:58 +04:00
Evgeny Poberezkin
323fb1f03c
remove SMP server signing responses ( #226 )
...
* remove SMP server signing responses
* keep only one session ID
2021-12-16 07:15:45 +00:00
Evgeny Poberezkin
b116408ec3
Merge branch 'master' into v5
2021-12-04 18:55:23 +00:00
Evgeny Poberezkin
04c65d98da
support permanent connection link ("contact") in SMP agent protocols ( #143 )
...
* open/public queue extension for SMP and SMP agent protocols
* add connection mode - invitation or contact
* use ConnectionMode with REQ and ACPT agent notification/command
* parameterize ConnectionRequest with ConnectionMode
* implement Contact connection mode for permanent connection links
* tests for contact connections
2021-12-04 18:42:08 +00:00
Evgeny Poberezkin
6126e72d4f
Merge branch 'master' into v5
2021-12-02 18:06:42 +00:00
Evgeny Poberezkin
606bbf5062
URI syntax for SMP queues and connection requests ( #210 )
...
* URI syntax for SMP queues and connection requests
* fix connection request parsing/serializing
* add ConnectionRequest sqlite instances
2021-12-02 17:43:05 +00:00