@@ -177,7 +177,7 @@ import Simplex.Messaging.Notifications.Protocol (DeviceToken, NtfRegCode (NtfReg
177177import Simplex.Messaging.Notifications.Server.Push.APNS (PNMessageData (.. ))
178178import Simplex.Messaging.Notifications.Types
179179import Simplex.Messaging.Parsers (parse )
180- import Simplex.Messaging.Protocol (BrokerMsg , Cmd (.. ), EntityId , ErrorType (AUTH ), MsgBody , MsgFlags (.. ), NtfServer , ProtoServerWithAuth , ProtocolType (.. ), ProtocolTypeI (.. ), SMPMsgMeta , SParty (.. ), SProtocolType (.. ), SndPublicAuthKey , SubscriptionMode (.. ), UserProtocol , VersionSMPC , sndAuthKeySMPClientVersion )
180+ import Simplex.Messaging.Protocol (BrokerMsg , Cmd (.. ), ErrorType (AUTH ), MsgBody , MsgFlags (.. ), NtfServer , ProtoServerWithAuth , ProtocolType (.. ), ProtocolTypeI (.. ), SMPMsgMeta , SParty (.. ), SProtocolType (.. ), SndPublicAuthKey , SubscriptionMode (.. ), UserProtocol , VersionSMPC , sndAuthKeySMPClientVersion )
181181import qualified Simplex.Messaging.Protocol as SMP
182182import Simplex.Messaging.ServiceScheme (ServiceScheme (.. ))
183183import qualified Simplex.Messaging.TMap as TM
@@ -891,7 +891,7 @@ joinConnSrv c userId connId hasNewConn enableNtfs cReqUri@CRContactUri {} cInfo
891891 lift (compatibleContactUri cReqUri) >>= \ case
892892 Just (qInfo, vrsn) -> do
893893 (connId', cReq) <- newConnSrv c userId connId hasNewConn enableNtfs SCMInvitation Nothing (CR. IKNoPQ pqSup) subMode srv
894- void $ sendInvitation c userId qInfo vrsn cReq cInfo
894+ void $ sendInvitation c userId connId' qInfo vrsn cReq cInfo
895895 pure (connId', False )
896896 Nothing -> throwE $ AGENT A_VERSION
897897
@@ -2208,7 +2208,7 @@ cleanupManager c@AgentClient {subQ} = do
22082208 deleteExpiredReplicasForDeletion = do
22092209 rcvFilesTTL <- asks $ rcvFilesTTL . config
22102210 withStore' c (`deleteDeletedSndChunkReplicasExpired` rcvFilesTTL)
2211- notify :: forall e . AEntityI e => EntityId -> AEvent e -> AM ()
2211+ notify :: forall e . AEntityI e => AEntityId -> AEvent e -> AM ()
22122212 notify entId cmd = atomically $ writeTBQueue subQ (" " , entId, AEvt (sAEntity @ e ) cmd)
22132213
22142214data ACKd = ACKd | ACKPending
@@ -2345,7 +2345,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
23452345 HELLO -> helloMsg srvMsgId msgMeta conn'' >> ackDel msgId
23462346 -- note that there is no ACK sent for A_MSG, it is sent with agent's user ACK command
23472347 A_MSG body -> do
2348- logServer " <--" c srv rId $ " MSG <MSG>:" <> logSecret srvMsgId
2348+ logServer " <--" c srv rId $ " MSG <MSG>:" <> logSecret' srvMsgId
23492349 notify $ MSG msgMeta msgFlags body
23502350 pure ACKPending
23512351 A_RCVD rcpts -> qDuplex conn'' " RCVD" $ messagesRcvd rcpts msgMeta
@@ -2355,7 +2355,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
23552355 QUSE qs -> qDuplexAckDel conn'' " QUSE" $ qUseMsg srvMsgId qs
23562356 -- no action needed for QTEST
23572357 -- any message in the new queue will mark it active and trigger deletion of the old queue
2358- QTEST _ -> logServer " <--" c srv rId (" MSG <QTEST>:" <> logSecret srvMsgId) >> ackDel msgId
2358+ QTEST _ -> logServer " <--" c srv rId (" MSG <QTEST>:" <> logSecret' srvMsgId) >> ackDel msgId
23592359 EREADY _ -> qDuplexAckDel conn'' " EREADY" $ ereadyMsg rcPrev
23602360 where
23612361 qDuplexAckDel :: Connection c -> String -> (Connection 'CDuplex -> AM () ) -> AM ACKd
@@ -2378,7 +2378,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
23782378 | otherwise ->
23792379 liftEither (parse smpP (AGENT A_MESSAGE ) agentMsgBody) >>= \ case
23802380 AgentMessage _ (A_MSG body) -> do
2381- logServer " <--" c srv rId $ " MSG <MSG>:" <> logSecret srvMsgId
2381+ logServer " <--" c srv rId $ " MSG <MSG>:" <> logSecret' srvMsgId
23822382 notify $ MSG msgMeta msgFlags body
23832383 pure ACKPending
23842384 _ -> ack
@@ -2500,7 +2500,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
25002500
25012501 smpConfirmation :: SMP. MsgId -> Connection c -> Maybe C. APublicAuthKey -> C. PublicKeyX25519 -> Maybe (CR. SndE2ERatchetParams 'C.X448 ) -> ByteString -> VersionSMPC -> VersionSMPA -> AM ()
25022502 smpConfirmation srvMsgId conn' senderKey e2ePubKey e2eEncryption encConnInfo smpClientVersion agentVersion = do
2503- logServer " <--" c srv rId $ " MSG <CONF>:" <> logSecret srvMsgId
2503+ logServer " <--" c srv rId $ " MSG <CONF>:" <> logSecret' srvMsgId
25042504 AgentConfig {smpClientVRange, smpAgentVRange, e2eEncryptVRange} <- asks config
25052505 let ConnData {pqSupport} = toConnData conn'
25062506 unless
@@ -2569,7 +2569,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
25692569
25702570 helloMsg :: SMP. MsgId -> MsgMeta -> Connection c -> AM ()
25712571 helloMsg srvMsgId MsgMeta {pqEncryption} conn' = do
2572- logServer " <--" c srv rId $ " MSG <HELLO>:" <> logSecret srvMsgId
2572+ logServer " <--" c srv rId $ " MSG <HELLO>:" <> logSecret' srvMsgId
25732573 case status of
25742574 Active -> prohibited " hello: active"
25752575 _ ->
@@ -2593,7 +2593,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
25932593 continueSending srvMsgId addr (DuplexConnection _ _ sqs) =
25942594 case findQ addr sqs of
25952595 Just sq -> do
2596- logServer " <--" c srv rId $ " MSG <QCONT>:" <> logSecret srvMsgId
2596+ logServer " <--" c srv rId $ " MSG <QCONT>:" <> logSecret' srvMsgId
25972597 atomically $
25982598 TM. lookup (qAddress sq) (smpDeliveryWorkers c)
25992599 >>= mapM_ (\ (_, retryLock) -> tryPutTMVar retryLock () )
@@ -2602,7 +2602,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
26022602
26032603 messagesRcvd :: NonEmpty AMessageReceipt -> MsgMeta -> Connection 'CDuplex -> AM ACKd
26042604 messagesRcvd rcpts msgMeta@ MsgMeta {broker = (srvMsgId, _)} _ = do
2605- logServer " <--" c srv rId $ " MSG <RCPT>:" <> logSecret srvMsgId
2605+ logServer " <--" c srv rId $ " MSG <RCPT>:" <> logSecret' srvMsgId
26062606 rs <- forM rcpts $ \ rcpt -> clientReceipt rcpt `catchAgentError` \ e -> notify (ERR e) $> Nothing
26072607 case L. nonEmpty . catMaybes $ L. toList rs of
26082608 Just rs' -> notify (RCVD msgMeta rs') $> ACKPending
@@ -2642,7 +2642,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
26422642 sq2 <- withStore c $ \ db -> do
26432643 liftIO $ mapM_ (deleteConnSndQueue db connId) delSqs
26442644 addConnSndQueue db connId (sq_ :: NewSndQueue ) {primary = True , dbReplaceQueueId = Just dbQueueId}
2645- logServer " <--" c srv rId $ " MSG <QADD>:" <> logSecret srvMsgId <> " " <> logSecret (senderId queueAddress)
2645+ logServer " <--" c srv rId $ " MSG <QADD>:" <> logSecret' srvMsgId <> " " <> logSecret (senderId queueAddress)
26462646 let sqInfo' = (sqInfo :: SMPQueueInfo ) {queueAddress = queueAddress {dhPublicKey}}
26472647 void . enqueueMessages c cData' sqs SMP. noMsgFlags $ QKEY [(sqInfo', sndPublicKey)]
26482648 sq1 <- withStore' c $ \ db -> setSndSwitchStatus db sq $ Just SSSendingQKEY
@@ -2663,7 +2663,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
26632663 Just rq'@ RcvQueue {rcvId, e2ePrivKey = dhPrivKey, smpClientVersion = cVer, status = status'}
26642664 | status' == New || status' == Confirmed -> do
26652665 checkRQSwchStatus rq RSSendingQADD
2666- logServer " <--" c srv rId $ " MSG <QKEY>:" <> logSecret srvMsgId <> " " <> logSecret senderId
2666+ logServer " <--" c srv rId $ " MSG <QKEY>:" <> logSecret' srvMsgId <> " " <> logSecret senderId
26672667 let dhSecret = C. dh' dhPublicKey dhPrivKey
26682668 withStore' c $ \ db -> setRcvQueueConfirmedE2E db rq' dhSecret $ min cVer cVer'
26692669 enqueueCommand c " " connId (Just smpServer) $ AInternalCommand $ ICQSecure rcvId senderKey
@@ -2684,7 +2684,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
26842684 case find ((replaceQId == ) . dbQId) sqs of
26852685 Just sq1 -> do
26862686 checkSQSwchStatus sq1 SSSendingQKEY
2687- logServer " <--" c srv rId $ " MSG <QUSE>:" <> logSecret srvMsgId <> " " <> logSecret (snd addr)
2687+ logServer " <--" c srv rId $ " MSG <QUSE>:" <> logSecret' srvMsgId <> " " <> logSecret (snd addr)
26882688 withStore' c $ \ db -> setSndQueueStatus db sq' Secured
26892689 let sq'' = (sq' :: SndQueue ) {status = Secured }
26902690 -- sending QTEST to the new queue only, the old one will be removed if sent successfully
@@ -2708,7 +2708,7 @@ processSMPTransmissions c@AgentClient {subQ} (tSess@(userId, srv, _), _v, sessId
27082708
27092709 smpInvitation :: SMP. MsgId -> Connection c -> ConnectionRequestUri 'CMInvitation -> ConnInfo -> AM ()
27102710 smpInvitation srvMsgId conn' connReq@ (CRInvitationUri crData _) cInfo = do
2711- logServer " <--" c srv rId $ " MSG <KEY>:" <> logSecret srvMsgId
2711+ logServer " <--" c srv rId $ " MSG <KEY>:" <> logSecret' srvMsgId
27122712 case conn' of
27132713 ContactConnection {} -> do
27142714 -- show connection request even if invitaion via contact address is not compatible.
0 commit comments