When proxying for a special remote, avoid unncessary hashing

Like the comment says, the client will do its own verification. But it was
calling verifyKeyContentPostRetrieval, which was hashing the file.
This commit is contained in:
Joey Hess 2024-07-29 11:18:03 -04:00
parent 7402ae61d9
commit 0dc064a9ad
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 2 additions and 7 deletions

View file

@ -16,7 +16,6 @@ import P2P.Proxy
import P2P.Protocol import P2P.Protocol
import P2P.IO import P2P.IO
import Remote.Helper.Ssh (openP2PShellConnection', closeP2PShellConnection) import Remote.Helper.Ssh (openP2PShellConnection', closeP2PShellConnection)
import Annex.Content
import Annex.Concurrent import Annex.Concurrent
import Annex.Tmp import Annex.Tmp
import Logs.Proxy import Logs.Proxy
@ -209,12 +208,7 @@ proxySpecialRemote protoversion r ihdl ohdl owaitv oclosedv = go
-- because the client will do its own verification. -- because the client will do its own verification.
let vc = Remote.NoVerify let vc = Remote.NoVerify
tryNonAsync (Remote.retrieveKeyFile r k af (fromRawFilePath tmpfile) nullMeterUpdate vc) >>= \case tryNonAsync (Remote.retrieveKeyFile r k af (fromRawFilePath tmpfile) nullMeterUpdate vc) >>= \case
Right v -> Right _ -> liftIO $ senddata offset tmpfile
ifM (verifyKeyContentPostRetrieval Remote.RetrievalVerifiableKeysSecure vc v k tmpfile)
( liftIO $ senddata offset tmpfile
, liftIO $ sendmessage $
ERROR "verification of content failed"
)
Left err -> liftIO $ propagateerror err Left err -> liftIO $ propagateerror err
senddata (Offset offset) f = do senddata (Offset offset) f = do

View file

@ -13,6 +13,7 @@ git-annex (10.20240702) UNRELEASED; urgency=medium
* Avoid potential data loss in situations where git-annex-shell or * Avoid potential data loss in situations where git-annex-shell or
git-annex remotedaemon is killed while locking a key to prevent its git-annex remotedaemon is killed while locking a key to prevent its
removal. removal.
* When proxying for a special remote, avoid unncessary hashing.
* Added a dependency on clock. * Added a dependency on clock.
* Propagate --force to git-annex transferrer. * Propagate --force to git-annex transferrer.