diff --git a/os_brick/encryptors/luks.py b/os_brick/encryptors/luks.py index d2bb9c8f4..cafba1781 100644 --- a/os_brick/encryptors/luks.py +++ b/os_brick/encryptors/luks.py @@ -118,6 +118,7 @@ class LuksEncryptor(cryptsetup.CryptsetupEncryptor): # Enter new passphrase for key slot: # Verify passphrase: self._execute('cryptsetup', 'luksAddKey', self.dev_path, + '--force-password', process_input=''.join([mangled_passphrase, '\n', passphrase, '\n', passphrase]), run_as_root=True, check_exit_code=True, diff --git a/os_brick/tests/encryptors/test_luks.py b/os_brick/tests/encryptors/test_luks.py index 45c57a0f2..fb4571b05 100644 --- a/os_brick/tests/encryptors/test_luks.py +++ b/os_brick/tests/encryptors/test_luks.py @@ -226,6 +226,7 @@ class LuksEncryptorTestCase(test_cryptsetup.CryptsetupEncryptorTestCase): root_helper=self.root_helper, run_as_root=True, check_exit_code=[0, 4], attempts=3), mock.call('cryptsetup', 'luksAddKey', self.dev_path, + '--force-password', process_input=''.join([fake_key_mangled, '\n', fake_key, '\n', fake_key]),