1
0
Fork 0
Commit Graph

24 Commits

Author SHA1 Message Date
Felix Weilbach 88426de4dd Add missing error handling for downloads of client side encryption
The missing error handlers can cause the sync to hang forever

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-11 10:59:08 +00:00
Kevin Ottens 36b8e7c2a4
Remove the encryption flag check from encrypted propagation code
If we use those encrypted propagation code paths, we already know from
the discovery phase (and thus the journal db) that the folders are
encrypted so no need to check again.

This will remove another expensive round trip with the server.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens 1d07af07a5
Start hooking up E2EE to the new discovery algorithm
Now we pull the encrypted metadata during the discovery which is a
better approach than before. This shall remove the need for some of the
deep propfinds we have been using so far. It already simplifies the code
a bit for the download scenario.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Hannah von Reth 93152761a1
Use verbose function names instead of direct member access 2020-12-15 10:59:20 +01:00
Hannah von Reth 8cbdb4451b
Remove now unneede csync_instruction_str 2020-12-15 10:59:10 +01:00
Kevin Ottens d2e8cd4469 Deal properly with encrypted item updates accross connections
In such cases we get a download for which _file is already the demangled
name and _encryptedFileName has the mangled information. This is
different to what we encountered so far where initially _file was
mangled and _encryptedFileName was empty. Let's deal with that case
properly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens 8d5c79c219 Better separate between absolute and relative paths on downloads
I wish this would be all driven by the type system instead of
error-prone string concatenation everywhere. That will be for a (much)
later refactoring hopefully.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens 8a181adb3a Always use an absolute remote path for GetFolderEncryptStatusJob
It turns out this job expected an absolute remote path even in the case
of a subfolder sync point.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens 3182c613ac Take care of mangled paths on download as well
This means adjusting PropagateDownloadEncrypted so that it knows where
the file will end (otherwise it would create temporary files in non
existant paths for instance).
In turn we have to adjust PropagateDownloadFile accordingly so that it
resolves the local folder the file will end up in.
And last we adjust PropagateLocalMkdir to resolve paths as well and
demangle as needed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens 6dc12166ad Update the item even if we don't call decryptFile()
This way it makes it usable in a directory context.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens 2abc3ce2f5 Stop leaking PropagateDownloadEncrypted objects
We give them a parent to make sure they will be destroyed when the jobs
which created them are destroyed themselves.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Roeland Jago Douma ce545b1e47
propage*encrypted Q_UNUSED
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-07-02 12:45:44 +02:00
Daniel Nicoletti 3eb3535d0f Fix downloading NEW encrypted files 2018-04-09 13:23:52 +02:00
Daniel Nicoletti defe2d7631 Fix matching encrypted data for downloading 2018-04-09 13:23:52 +02:00
Daniel Nicoletti b12066f1aa Properly remove encryption data from JSON of deleted file 2018-04-09 13:23:52 +02:00
Daniel Nicoletti a9208f6581 Remove unused encrypted property 2018-04-09 13:23:52 +02:00
Daniel Nicoletti a7a8de8787 Fix matching encrypted file for download 2018-04-09 13:23:52 +02:00
Daniel Nicoletti d5ab642e46 Fix sync status running when encryption data is missing
When a file on the server of an encrypted folder do
not have a matching entry on the JSON metadata, we
need to report an error and be done with the job
so that Sync status is not "running".

This eventually should cause the file to be removed
from the server as it can not be recovered anymore.
2018-04-09 13:23:52 +02:00
Tomaz Canabrava b4b3e422de Handle gracefully failures in file decryption 2018-03-27 09:18:54 +02:00
Tomaz Canabrava ed6f56257e Dont use new with QFiles. 2018-03-26 22:18:07 +02:00
Daniel Nicoletti 99117078f3 Remove table for e2e and add an e2eMangledName column (#169)
If the code was not complex enough syncing two tables
already started to give UNIQUE constrains errors on
simple sync operations, this also adds initial support
remote delete of an encrypted file
2018-02-12 12:50:51 +01:00
Tomaz Canabrava e9a7a56359 [CSE] Store the encrypted file name on the SyncFilePtr 2018-01-28 18:37:01 +01:00
Tomaz Canabrava cae6bbc853 [CSE] Start the download process 2018-01-22 14:08:32 +01:00
Tomaz Canabrava 2d872f2a8d [CSE] Add missing files 2018-01-21 21:26:05 +01:00