rename version

This commit is contained in:
Evgeny Poberezkin
2024-02-10 12:13:05 +00:00
parent 8cb82deb9a
commit b5b1709c24
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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 ()
+1 -1
View File
@@ -319,7 +319,7 @@ testTHandleParams v sessionId =
blockSize = smpBlockSize,
thVersion = v,
thAuth = Nothing,
encrypt = v >= encryptTransmissionSMPVersion,
encrypt = v >= dontSendSessionIdSMPVersion,
batch = True
}