[rhel7-branch 6/29] Add check for the format of grub2 encrypted password (#1070327)

bcl installerbot-noreply at redhat.com
Tue Jun 2 00:31:07 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/284512bb2513e92a511674dad5e51aff25f58f73


More information about the anaconda-patches mailing list