guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

62/67: installer: partition: Add encryption password confirmation.


From: guix-commits
Subject: 62/67: installer: partition: Add encryption password confirmation.
Date: Wed, 16 Jan 2019 19:00:45 -0500 (EST)

civodul pushed a commit to branch wip-newt-installer
in repository guix.

commit 1f040d789b04a59a5eb04012b6a92200948ba0a1
Author: Mathieu Othacehe <address@hidden>
Date:   Sat Jan 12 18:45:58 2019 +0100

    installer: partition: Add encryption password confirmation.
    
    * gnu/installer/newt/partition.scm (prompt-luks-passwords): Add password
    confirmation page.
---
 gnu/installer/newt/partition.scm | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm
index d10e8cd..1c3ce80 100644
--- a/gnu/installer/newt/partition.scm
+++ b/gnu/installer/newt/partition.scm
@@ -149,11 +149,26 @@ USER-PARTITIONS list. Return this list with password 
fields filled-in."
                    (run-input-page
                     (format #f (G_ "Please enter the password for the \
 encryption of partition ~a (label: ~a).") file-name crypt-label)
-                    (G_ "Password required")))))
+                    (G_ "Password required"))))
+                (password-confirm-page
+                 (lambda ()
+                   (run-input-page
+                    (format #f (G_ "Please confirm the password for the \
+encryption of partition ~a (label: ~a).") file-name crypt-label)
+                    (G_ "Password confirmation required")))))
            (if crypt-label
-               (user-partition
-                (inherit user-part)
-                (crypt-password (password-page)))
+               (let loop ()
+                 (let ((password (password-page))
+                       (confirmation (password-confirm-page)))
+                   (if (string=? password confirmation)
+                       (user-partition
+                        (inherit user-part)
+                        (crypt-password password))
+                       (begin
+                         (run-error-page
+                          (G_ "Password mismatch, please try again.")
+                          (G_ "Password error"))
+                         (loop)))))
                user-part)))
        user-partitions))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]