mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-06-04 23:51:33 +00:00
rename version
This commit is contained in:
@@ -155,7 +155,7 @@ clientStub sessionId thVersion thAuth = do
|
||||
thVersion,
|
||||
thAuth,
|
||||
blockSize = smpBlockSize,
|
||||
encrypt = thVersion >= encryptTransmissionSMPVersion,
|
||||
encrypt = thVersion >= dontSendSessionIdSMPVersion,
|
||||
batch = True
|
||||
},
|
||||
sessionTs = undefined,
|
||||
|
||||
@@ -18,8 +18,8 @@ import Simplex.Messaging.Version
|
||||
ntfBlockSize :: Int
|
||||
ntfBlockSize = 512
|
||||
|
||||
encryptTransmissionNTFVersion :: Version
|
||||
encryptTransmissionNTFVersion = 2
|
||||
dontSendSessionIdNTFVersion :: Version
|
||||
dontSendSessionIdNTFVersion = 2
|
||||
|
||||
authEncryptCmdsNTFVersion :: Version
|
||||
authEncryptCmdsNTFVersion = 3
|
||||
@@ -108,7 +108,7 @@ ntfThHandle :: forall c. THandle c -> Version -> C.PrivateKeyX25519 -> Maybe C.P
|
||||
ntfThHandle th@THandle {params} v pk k_ =
|
||||
-- TODO drop SMP v6: make thAuth non-optional
|
||||
let thAuth = (\k -> THandleAuth {peerPubKey = k, privKey = pk, dhSecret = C.dh' k pk}) <$> k_
|
||||
params' = params {thVersion = v, thAuth, encrypt = v >= encryptTransmissionNTFVersion}
|
||||
params' = params {thVersion = v, thAuth, encrypt = v >= dontSendSessionIdNTFVersion}
|
||||
in (th :: THandle c) {params = params'}
|
||||
|
||||
ntfTHandle :: Transport c => c -> THandle c
|
||||
|
||||
@@ -33,7 +33,7 @@ module Simplex.Messaging.Transport
|
||||
currentServerSMPRelayVersion,
|
||||
basicAuthSMPVersion,
|
||||
subModeSMPVersion,
|
||||
encryptTransmissionSMPVersion,
|
||||
dontSendSessionIdSMPVersion,
|
||||
authEncryptCmdsSMPVersion,
|
||||
simplexMQVersion,
|
||||
smpBlockSize,
|
||||
@@ -122,8 +122,8 @@ basicAuthSMPVersion = 5
|
||||
subModeSMPVersion :: Version
|
||||
subModeSMPVersion = 6
|
||||
|
||||
encryptTransmissionSMPVersion :: Version
|
||||
encryptTransmissionSMPVersion = 7
|
||||
dontSendSessionIdSMPVersion :: Version
|
||||
dontSendSessionIdSMPVersion = 7
|
||||
|
||||
authEncryptCmdsSMPVersion :: Version
|
||||
authEncryptCmdsSMPVersion = 8
|
||||
@@ -440,7 +440,7 @@ smpThHandle :: forall c. THandle c -> Version -> C.PrivateKeyX25519 -> Maybe C.P
|
||||
smpThHandle th@THandle {params} v pk k_ =
|
||||
-- TODO drop SMP v6: make thAuth non-optional
|
||||
let thAuth = (\k -> THandleAuth {peerPubKey = k, privKey = pk, dhSecret = C.dh' k pk}) <$> k_
|
||||
params' = params {thVersion = v, thAuth, encrypt = v >= encryptTransmissionSMPVersion, batch = v >= batchCmdsSMPVersion}
|
||||
params' = params {thVersion = v, thAuth, encrypt = v >= dontSendSessionIdSMPVersion, batch = v >= batchCmdsSMPVersion}
|
||||
in (th :: THandle c) {params = params'}
|
||||
|
||||
sendHandshake :: (Transport c, Encoding smp) => THandle c -> smp -> ExceptT TransportError IO ()
|
||||
|
||||
@@ -319,7 +319,7 @@ testTHandleParams v sessionId =
|
||||
blockSize = smpBlockSize,
|
||||
thVersion = v,
|
||||
thAuth = Nothing,
|
||||
encrypt = v >= encryptTransmissionSMPVersion,
|
||||
encrypt = v >= dontSendSessionIdSMPVersion,
|
||||
batch = True
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user