authorize via crypto_box

This commit is contained in:
Evgeny Poberezkin
2024-02-06 22:39:20 +00:00
parent 9a93c6ba80
commit 38cfd57862
8 changed files with 82 additions and 38 deletions
+3 -2
View File
@@ -264,8 +264,9 @@ verifyXFTPTransmission tAuth authorized fId cmd =
where
verify = \case
Right (fr, k) -> XFTPReqCmd fId fr cmd `verifyWith` k
_ -> dummyVerifyCmd authorized tAuth `seq` VRFailed
req `verifyWith` k = if verifyCmdSignature tAuth authorized k then VRVerified req else VRFailed
_ -> dummyVerifyCmd Nothing authorized tAuth `seq` VRFailed
-- TODO verify with DH authorization
req `verifyWith` k = if verifyCmdSignature Nothing tAuth authorized k then VRVerified req else VRFailed
processXFTPRequest :: HTTP2Body -> XFTPRequest -> M (FileResponse, Maybe ServerFile)
processXFTPRequest HTTP2Body {bodyPart} = \case