mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-11-22 19:58:39 +00:00
agent: authorize sender commands with X25519 keys (#2054)
* agent: authorize sender commands with X25519 keys * tests: check that new sender keys are X25519 * docs: sender command authorization in the crypto registry
This commit is contained in:
1 parent
528479789c
commit
e8c7b01d3f
5 files changed
+25
-9
No files matched your search
@@ -1322,11 +1322,12 @@ getConnShortLink' :: forall c. AgentClient -> NetworkRequestMode -> UserId -> Co
|
||||
getConnShortLink' c nm userId = \case
|
||||
CSLInvitation _ srv linkId linkKey -> do
|
||||
g <- asks random
|
||||
C.AuthAlg a <- asks $ sndAuthAlg . config
|
||||
invLink <- withStore' c $ \db -> do
|
||||
getInvShortLink db srv linkId >>= \case
|
||||
Just sl@InvShortLink {linkKey = lk} | linkKey == lk -> pure sl
|
||||
_ -> do
|
||||
sndPrivateKey <- atomically $ C.generatePrivateAuthKey C.SEd25519 g
|
||||
sndPrivateKey <- atomically $ C.generatePrivateAuthKey a g
|
||||
let sl = InvShortLink {server = srv, linkId, linkKey, sndPrivateKey, sndId = Nothing}
|
||||
createInvShortLink db sl
|
||||
pure sl
|
||||
|
||||
@@ -222,10 +222,8 @@ defaultAgentConfig :: AgentConfig
|
||||
defaultAgentConfig =
|
||||
AgentConfig
|
||||
{ tcpPort = Just "5224",
|
||||
-- while the current client version supports X25519, it can only be enabled once support for SMP v6 is dropped,
|
||||
-- and all servers are required to support v7 to be compatible.
|
||||
rcvAuthAlg = C.AuthAlg C.SEd25519, -- this will stay as Ed25519
|
||||
sndAuthAlg = C.AuthAlg C.SEd25519, -- TODO replace with X25519 when switching to v7
|
||||
sndAuthAlg = C.AuthAlg C.SX25519,
|
||||
connIdBytes = 12,
|
||||
tbqSize = 128,
|
||||
smpCfg = defaultSMPClientConfig,
|
||||
|
||||
Reference in new issue
Block a user