[rhel7-branch 9/29] Add check for the format of grub2 encrypted password (#1070327)
bcl
installerbot-noreply at redhat.com
Wed Jun 3 00:36:41 UTC 2015
From: "Brian C. Lane" <bcl at redhat.com>
Encrypted grub2 passwords need to use the grub.pbkdf2 algorithm. Check
for this if bootloader --iscrypted is used with grub2 and raise a
KickstartError if it is in the wrong format.
Note that --md5pass is mapped to --iscrypted
Related: rhbz#1070327
(cherry picked from commit 874e40f6050e9b4ed0e14794ce154d2c85facdf7)
Related: rhbz#1196721
---
pyanaconda/kickstart.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 4f6dc86..22b0b81 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -347,6 +347,11 @@ def parse(self, args):
raise KickstartValueError(formatErrorMsg(self.lineno,
msg=_("GRUB2 does not support installation to a partition.")))
+ if self.isCrypted and isinstance(get_bootloader(), GRUB2):
+ if not self.password.startswith("grub.pbkdf2."):
+ raise KickstartValueError(formatErrorMsg(self.lineno,
+ msg="GRUB2 encrypted password must be in grub.pbkdf2 format."))
+
return self
def execute(self, storage, ksdata, instClass):
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/8f3a097fb95f0827b0b3a7fc02fcd1317a71901a
More information about the anaconda-patches
mailing list