Sign / verify SMP commands (#37)

* 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
This commit is contained in:
Evgeny Poberezkin
2021-02-14 12:00:04 +00:00
committed by Efim Poberezkin
parent 88e799797c
commit 3de4fa7518
+2 -1
View File
@@ -36,8 +36,9 @@ cfg :: AgentConfig
cfg =
AgentConfig
{ tcpPort = undefined, -- TODO maybe take it out of config
tbqSize = 16,
rsaKeySize = 2048 `div` 8,
connIdBytes = 12,
tbqSize = 16,
dbFile = "smp-chat.db",
smpCfg = smpDefaultConfig
}