encryption icon indicating copy to clipboard operation
encryption copied to clipboard

Decryption incorrectly attempted when recovery re-encryption is not complete

Open tomneedham opened this issue 6 years ago • 4 comments

We have a flag for recoveryEnabled which triggers the encryption on login.

However, until they have logged in, they are not actually ready for decryption. We need to store this additional status somehow. I suggest a flag/marker on the user, that is added after the recovery key is used to re-encrypt the files. This should be checked when attempting to decrypt.

tomneedham avatar Feb 12 '19 14:02 tomneedham

is the flag just a convenience ?

I suppose it might be possible to get the required information already by checking whether the user already has keys generated. However this is more complicated to get at and wouldn't work with a simple DB query.

PVince81 avatar Feb 12 '19 14:02 PVince81

Add flag here https://github.com/owncloud/encryption/blob/master/lib/Recovery.php#L206 and then check in here if they are ready and able to decrypt with recovery key https://github.com/owncloud/encryption/blob/master/lib/Crypto/DecryptAll.php#L160

tomneedham avatar Feb 12 '19 14:02 tomneedham

is the flag just a convenience ?

It marks that it is complete, for all files. Otherwise you have to check all the keys for all the files to determine if its ready.

tomneedham avatar Feb 12 '19 14:02 tomneedham

@tomneedham mind rewording the subject ? this is a technical solution to solve which problem ?

from what I understand this is about being able to run decrypt-all in one pass for all users after knowing they are all ready ? migration case ?

PVince81 avatar Feb 12 '19 14:02 PVince81