-
Notifications
You must be signed in to change notification settings - Fork 897
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
Do not double encrypt a protected password dialog text field #18031
Conversation
@lfu Please review this is needed for your BZ to prevent double encryption |
app/models/dialog_field_text_box.rb
Outdated
@@ -31,7 +31,7 @@ def value_from_dialog_fields(dialog_values) | |||
|
|||
def automate_output_value | |||
return nil if @value.nil? | |||
return MiqPassword.encrypt(@value) if self.protected? | |||
return MiqPassword.encrypt(@value) if self.protected? && value_is_not_already_encrypted? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use MiqPassword.encrypted?
instead of creating a new method. Also, we need to use MiqPassword methods so we are protected against the encrypted string format changing in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I didn't even realize this existed, nice. Will change.
82a28f0
to
2496b78
Compare
Checked commit eclarizio@2496b78 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/dialog_field_text_box.rb
|
Do not double encrypt a protected password dialog text field (cherry picked from commit 27c9fe3) https://bugzilla.redhat.com/show_bug.cgi?id=1602883
Hammer backport details:
|
When passing in an already encrypted value to a protected field in some back end methods, there was an issue where it would encrypt it again. Whoops.
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1602883
@miq-bot assign @gmcculloug
/cc @mkanoor