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

Issue 2630 #2631

Closed
wants to merge 2 commits into from
Closed

Issue 2630 #2631

wants to merge 2 commits into from

Conversation

magriggs
Copy link
Contributor

Description

A public property must be of type string, so that it remains editable in PropertyGrid. However, password should be stored in a SecureString backing variable. Conversion from plain string to SecureString happens whenever the Setter() is called. The Getter() returns a default password that is only to allow the GUI to show that a password has been added. Calling the Getter() will NOT return the plaintext password. There is a helper functions to access Plaintext password only when required, which should be at the point of connection, or during unit tests.

Added more secure encrypt/decrypt functions where required to avoid early conversion from SecureString to string.

Motivation and Context

Fixes issue-2630

How Has This Been Tested?

Confirmed through manual testing that password can be edited, and the edit is persisted.
Same # unit tests are passing as previous builds.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Changed feature (non-breaking change which changes functionality)
  • Changed feature (breaking change which changes functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Updated translation

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • All Tests within VisualStudio are passing
  • This pull request does not target the master branch.
  • I have updated the changelog file accordingly, if necessary.
  • I have updated the documentation accordingly, if necessary.

… property must be of type string, so that it remains editable in PropertyGrid. However, password should be stored in a SecureString backing variable. Conversion to SecureString happens whenever the Setter() is called. The Getter() returns a default password that is only for display purposes. Add helper functions to access Plaintext password only when required. Add more secure encrypt/decrypt functions where required to avoid early conversion from SecureString to string.
@magriggs magriggs requested a review from Kvarkas August 19, 2024 10:01
@magriggs magriggs marked this pull request as draft August 20, 2024 10:58
@magriggs magriggs closed this Aug 21, 2024
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.

SecureString password not editable in propertygrid
1 participant