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:
Evgeny @ SimpleX Chat authored and GitHub committed 2026-11-13 06:59:41 +00:00
1 parent 528479789c
commit e8c7b01d3f
5 files changed
+25 -9

No files matched your search

+2 -1
View File
@@ -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
+1 -3
View File
@@ -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,