Bypass signature mismatch in the encrypted file#34710
Bypass signature mismatch in the encrypted file#34710
Conversation
Bypass signature mismatch in the encrypted file. This would be handy when files are transferred to other users. In this changeset the HintException is not re-thrown. Instead it is catched and the exception is logged. Signed-off-by: Sujith H <sharidasan@owncloud.com>
|
I would like to have feedback here regarding the approach taken to achieve the list of affected files. Let me also know if there is a better approach here. Thanks. |
Codecov Report
@@ Coverage Diff @@
## master #34710 +/- ##
============================================
- Coverage 65.28% 65.27% -0.02%
- Complexity 18481 18497 +16
============================================
Files 1210 1210
Lines 69984 70008 +24
Branches 1280 1280
============================================
+ Hits 45688 45696 +8
- Misses 23924 23940 +16
Partials 372 372
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #34710 +/- ##
============================================
- Coverage 65.28% 65.27% -0.02%
- Complexity 18481 18497 +16
============================================
Files 1210 1210
Lines 69984 70008 +24
Branches 1280 1280
============================================
+ Hits 45688 45696 +8
- Misses 23924 23940 +16
Partials 372 372
Continue to review full report at Codecov.
|
|
Closing this PR in favour of owncloud/encryption#115 |
Bypass signature mismatch in the encrypted file.
This would be handy when files are transferred to
other users. In this changeset the HintException
is not re-thrown. Instead it is catched and the
exception is logged.
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
The signature check done during decryption is bypassed. The reason/motivation behind this change set is, due to known reason ( yet to be investigated ), the files have encrypted column in the file cache with values which cause signature mismatch. And this was resulting in exception,
HintException. So if the user tries to transfer files from sayuser1touser2, then the transfer is aborted because of this. During this task, it is also observed that bypassing the signature does not prohibit the decryption of files. The files tested ( the txt files ) were successfully decrypted.Few details regarding the implementation details of this changeset:
I have used Symfony events to let the transfer-ownership command know which are the files affected.
The symfony event
files.aftersignaturemismatchis transmitted from :The listeners of this event in the order of priority are ( the higher positive number the higher priority ):
signatureMismatchEventcopyBetweenStoragetransferWhen the signature mismatch happens, an argument
signatureMismatchis set to true. This is verified once the read operation is completed at copyBetweenStorage and the file which has signature mismatch issue is detected and an argumentfileNameis added to this event which has value of the file name. Also this is logged in the owncloud.log file. This is verified in the transfer ownership command and an array is populated to grab the affected files. Once the rename operation in the transfer ownership is completed, the list of affected files are shown to the admin, if any are available.Related Issue
Motivation and Context
Bypass the signature check in the Crypt and log the affected files which have signature mismatch.
How Has This Been Tested?
user1anduser2( kindly login to both users )user1create a foldertestand create files as undertesta.txtb.txtbig.txtTry to edit the database as shown below:
a.txtandbig.txtwere listed as shown above.Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: