Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file that fails to decrypt shows up as a gpg file ready to be opened #756

Closed
sssoleileraaa opened this issue Feb 1, 2020 · 2 comments · Fixed by #768
Closed

file that fails to decrypt shows up as a gpg file ready to be opened #756

sssoleileraaa opened this issue Feb 1, 2020 · 2 comments · Fixed by #768
Labels
bug Something isn't working

Comments

@sssoleileraaa
Copy link
Contributor

sssoleileraaa commented Feb 1, 2020

STR

  1. Download a file knowing that it'll see a CryptoError (use an invalid gpg key or raise directly in the code)
  2. See that it exists in <data dir>/<journalist_designation>/<file_counter>-<journalist_designation>-doc/<file_counter>-<journalist_designation>-doc.gz.gpg
  3. Log out and back in

Expected

To see a "Download" link next to file. Perhaps we should provide a "Decrypt" button in the future so the file doesn't have to be re-downloaded.

Actual

The file shows up as <file_counter>-<journalist_designation>-doc.gz.gpg and ready to be opened, printed, and exported. There is no way to re-download or decrypt the file from the client UI.

@sssoleileraaa sssoleileraaa added the bug Something isn't working label Feb 1, 2020
@sssoleileraaa
Copy link
Contributor Author

Note: you have to log out and log back in for step 3 due to this issue: #754

@rmol
Copy link
Contributor

rmol commented Feb 3, 2020

Right now File.is_downloaded determines whether we switch from "download" to "export/print", e.g. here and here.

We should only enable export and print once the file is both downloaded and decrypted. But to avoid downloading a (potentially large) file that is actually present and complete, and just failed to decrypt, we'll need to reliably determine that situation. The SecureDrop server delivers the SHA256 hash of the file in the ETag header, so if we start saving that on the File record, we can tell if we can skip the download and retry decryption.

We can add that logic to the download process, avoiding the need for a separate Decrypt button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants