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

Clear clipboard after login screen #1071

Merged
merged 2 commits into from
Apr 30, 2020

Conversation

eloquence
Copy link
Member

@eloquence eloquence commented Apr 25, 2020

Description

Fixes #1051 by clearing the system clipboard contents after logging into online or offline mode.

Status

Ready for review

Test plan (online mode)

  • Run the client from this branch, preferably in Qubes
  • While the login screen is displayed, copy some string into the clipboard, e.g., "asdf" or your password
  • Observe that the string you copied can be successfully pasted multiple times
  • Log into the client
  • Observe that the string you copied can no longer be pasted into the reply box

Test plan (online mode)

  • Run the client from this branch, preferably in Qubes
  • Copy some string into the clipboard, e.g., "asdf"
  • Observe that the string you copied can be successfully pasted multiple times
  • Click the offline mode option
  • Observe that the string you copied can no longer be pasted (you may have to pick another window to paste into, e.g., a terminal)

Checklist

  • Tested in Qubes. Qubes testing required.
  • No AppArmor implications
  • No migrations

@eloquence
Copy link
Member Author

Not on the sprint, but I feel we may want to land a version of this alongside freedomofpress/securedrop-workstation#533, to put some guardrails around the vault password copying story.

@@ -432,6 +434,9 @@ def login_offline_mode(self):
Allow user to view in offline mode without authentication.
"""
self.gui.hide_login()
# Clear clipboard contents in case of previously pasted creds (user
# may have attempted online mode login, then switched to offline)
self.gui.clear_clipboard()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The duplication here is intentional; I felt that this behavior should not be a side effect of another function, but explicitly invoked so the intended business logic is clear.

@eloquence eloquence marked this pull request as ready for review April 30, 2020 17:05
@eloquence
Copy link
Member Author

Added test plan & tests; will take a quick spin in Qubes now, as well.

@eloquence
Copy link
Member Author

Tested both scenarios successfully in Qubes, including w/ cross-VM copying.

@redshiftzero redshiftzero force-pushed the clear-clipboard-after-login-screen branch from 8ab83da to 58b8db4 Compare April 30, 2020 22:10
Copy link
Contributor

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM, thanks for preparing it. Ran through the testing in Qubes and all works as advertised.

@redshiftzero redshiftzero merged commit d302702 into master Apr 30, 2020
@redshiftzero redshiftzero deleted the clear-clipboard-after-login-screen branch April 30, 2020 22:14
@redshiftzero redshiftzero mentioned this pull request May 7, 2020
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wipe clipboard after login
2 participants