Skip to content
Snippets Groups Projects
Commit d52364ba authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

Fix random salt generation.

The generation of a random salt, when one was not provided, was in the
wrong place and being generated too late to be used properly. Also, the
generation of the value was duplicated.
parent 3e5c54d4
No related branches found
No related tags found
No related merge requests found
...@@ -768,7 +768,12 @@ def main(): ...@@ -768,7 +768,12 @@ def main():
commands.append([name, "vault_mod_internal", args]) commands.append([name, "vault_mod_internal", args])
else: else:
if vault_type == 'symmetric' \
and 'ipavaultsalt' not in args:
args['ipavaultsalt'] = os.urandom(32)
commands.append([name, "vault_add_internal", args]) commands.append([name, "vault_add_internal", args])
if vault_type != 'standard' and vault_data is None: if vault_type != 'standard' and vault_data is None:
vault_data = '' vault_data = ''
...@@ -826,14 +831,6 @@ def main(): ...@@ -826,14 +831,6 @@ def main():
commands.append( commands.append(
[name, 'vault_remove_owner', owner_del_args]) [name, 'vault_remove_owner', owner_del_args])
if vault_type == 'symmetric' \
and 'ipavaultsalt' not in args:
args['ipavaultsalt'] = os.urandom(32)
if vault_type == 'symmetric' \
and 'ipavaultsalt' not in args:
args['ipavaultsalt'] = os.urandom(32)
elif action in "member": elif action in "member":
# Add users and groups # Add users and groups
if any([users, groups, services]): if any([users, groups, services]):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment