Skip to content

Refactor AnonConnectionWizard for thread stability, secure file handling and UI privacy#4

Open
sans1924-prog wants to merge 1 commit into
Kicksecure:masterfrom
sans1924-prog:patch-2
Open

Refactor AnonConnectionWizard for thread stability, secure file handling and UI privacy#4
sans1924-prog wants to merge 1 commit into
Kicksecure:masterfrom
sans1924-prog:patch-2

Conversation

@sans1924-prog

Copy link
Copy Markdown

This pull request introduces targeted stability, security, and privacy improvements specifically to the anon_connection_wizard.py module.

Key Changes:

  • Graceful Thread Termination: Introduced a custom _cleanup_bootstrap_thread() method to prevent UI deadlocks[cite: 1]. This waits up to 2 seconds for a graceful exit before forcing termination, and is now properly called when the wizard is cancelled, fails to authenticate, or encounters a missing controller.
  • Secure File Contexts: Replaced standard open().read() calls with secure with open(...) as f: context managers when reading the torrc_file_path[cite: 1]. This ensures file descriptors are reliably closed.
  • Credential Masking: Enhanced UI privacy by applying setEchoMode(QLineEdit.Password) to the proxy password input field (password_edit). This securely masks user credentials while configuring optional proxy settings.

This pull request changes...

Changes

Mandatory Checklist

  • Legal agreements accepted. By contributing to this organisation, you acknowledge you have read, understood, and agree to be bound by these these agreements:

Terms of Service, Privacy Policy, Cookie Policy, E-Sign Consent, DMCA, Imprint

Optional Checklist

The following items are optional but might be requested in certain cases.

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Fixes #

…ing, and UI privacy

This pull request introduces targeted stability, security, and privacy improvements specifically to the `anon_connection_wizard.py` module.

### Key Changes:
* **Graceful Thread Termination:** Introduced a custom `_cleanup_bootstrap_thread()` method to prevent UI deadlocks[cite: 1]. This waits up to 2 seconds for a graceful exit before forcing termination, and is now properly called when the wizard is cancelled, fails to authenticate, or encounters a missing controller[cite: 1].
* **Secure File Contexts:** Replaced standard `open().read()` calls with secure `with open(...) as f:` context managers when reading the `torrc_file_path`[cite: 1]. This ensures file descriptors are reliably closed.
* **Credential Masking:** Enhanced UI privacy by applying `setEchoMode(QLineEdit.Password)` to the proxy password input field (`password_edit`)[cite: 1]. This securely masks user credentials while configuring optional proxy settings[cite: 1].
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.

1 participant