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

Make sure modify_setting value is Base64-encoded #98

Merged
merged 3 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
`get_preference`
* Fixed wrong order of key and value for condition_data, event_data and
method_data dict parameters of `modify_alert` method.
* Ensure `modify_setting` value is Base64-encoded

# python-gvm 1.0.0.beta2 (04.12.2018)

Expand Down
2 changes: 1 addition & 1 deletion gvm/protocols/gmpv7.py
Original file line number Diff line number Diff line change
Expand Up @@ -4782,7 +4782,7 @@ def modify_setting(self, setting_id=None, name=None, value=None):
else:
cmd.add_element('name', name)

cmd.add_element('value', value)
cmd.add_element('value', _to_base64(value))

return self._send_xml_command(cmd)

Expand Down
4 changes: 2 additions & 2 deletions tests/protocols/gmpv7/test_modify_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_modify_setting(self):

self.connection.send.has_been_called_with(
'<modify_setting setting_id="s1">'
'<value>bar</value>'
'<value>YmFy</value>'
'</modify_setting>'
)

Expand All @@ -50,7 +50,7 @@ def test_modify_setting(self):
self.connection.send.has_been_called_with(
'<modify_setting>'
'<name>s1</name>'
'<value>bar</value>'
'<value>YmFy</value>'
'</modify_setting>'
)

Expand Down