fixed rekey password handling
This commit is contained in:
parent
00bc74404a
commit
d341ba14a5
2 changed files with 7 additions and 10 deletions
|
@ -112,7 +112,6 @@ class CLI(object):
|
||||||
|
|
||||||
vault_pass = None
|
vault_pass = None
|
||||||
new_vault_pass = None
|
new_vault_pass = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if rekey or not ask_new_vault_pass:
|
if rekey or not ask_new_vault_pass:
|
||||||
vault_pass = getpass.getpass(prompt="Vault password: ")
|
vault_pass = getpass.getpass(prompt="Vault password: ")
|
||||||
|
@ -251,12 +250,10 @@ class CLI(object):
|
||||||
if vault_opts:
|
if vault_opts:
|
||||||
parser.add_option('--ask-vault-pass', default=False, dest='ask_vault_pass', action='store_true',
|
parser.add_option('--ask-vault-pass', default=False, dest='ask_vault_pass', action='store_true',
|
||||||
help='ask for vault password')
|
help='ask for vault password')
|
||||||
parser.add_option('--vault-password-file', default=C.DEFAULT_VAULT_PASSWORD_FILE,
|
parser.add_option('--vault-password-file', default=C.DEFAULT_VAULT_PASSWORD_FILE, dest='vault_password_file',
|
||||||
dest='vault_password_file', help="vault password file", action="callback",
|
help="vault password file", action="callback", callback=CLI.expand_tilde, type=str)
|
||||||
callback=CLI.expand_tilde, type=str)
|
parser.add_option('--new-vault-password-file', dest='new_vault_password_file',
|
||||||
parser.add_option('--new-vault-password-file',
|
help="new vault password file for rekey", action="callback", callback=CLI.expand_tilde, type=str)
|
||||||
dest='new_vault_password_file', help="new vault password file for rekey", action="callback",
|
|
||||||
callback=CLI.expand_tilde, type=str)
|
|
||||||
parser.add_option('--output', default=None, dest='output_file',
|
parser.add_option('--output', default=None, dest='output_file',
|
||||||
help='output file name for encrypt or decrypt; use - for stdout')
|
help='output file name for encrypt or decrypt; use - for stdout')
|
||||||
|
|
||||||
|
|
|
@ -95,9 +95,9 @@ class VaultCLI(CLI):
|
||||||
else:
|
else:
|
||||||
newpass = False
|
newpass = False
|
||||||
rekey = False
|
rekey = False
|
||||||
if self.options.new_vault_password_file:
|
if not self.options.new_vault_password_file:
|
||||||
newpass = self.action in ['create', 'rekey', 'encrypt']
|
newpass = (self.action in ['create', 'rekey', 'encrypt'])
|
||||||
rekey = self.action == 'rekey'
|
rekey = (self.action == 'rekey')
|
||||||
self.vault_pass, self.new_vault_pass = self.ask_vault_passwords(ask_new_vault_pass=newpass, rekey=rekey)
|
self.vault_pass, self.new_vault_pass = self.ask_vault_passwords(ask_new_vault_pass=newpass, rekey=rekey)
|
||||||
|
|
||||||
if self.options.new_vault_password_file:
|
if self.options.new_vault_password_file:
|
||||||
|
|
Loading…
Reference in a new issue