浏览代码

Enable or disable password storage

Bob Mottram 8 年前
父节点
当前提交
1b0820bf46
共有 2 个文件被更改,包括 22 次插入10 次删除
  1. 7
    0
      src/freedombone-pass
  2. 15
    10
      src/freedombone-sec

+ 7
- 0
src/freedombone-pass 查看文件

@@ -160,6 +160,13 @@ do
160 160
         -c|--clear|--erase)
161 161
             clear_passwords
162 162
             ;;
163
+        -e|--enable)
164
+            shift
165
+            if [ -f $NO_PASSWORD_STORE_FILE ]; then
166
+                rm $NO_PASSWORD_STORE_FILE
167
+                echo $'Password storage has been enabled'
168
+            fi
169
+            ;;
163 170
         -u|--user|--username)
164 171
             shift
165 172
             CURR_USERNAME="${1}"

+ 15
- 10
src/freedombone-sec 查看文件

@@ -685,19 +685,24 @@ function remove_pinning {
685 685
     esac
686 686
 }
687 687
 
688
-function clear_passwords {
689
-    dialog --title $"Clear Passwords" \
688
+function store_passwords {
689
+    dialog --title $"Store Passwords" \
690 690
            --backtitle $"Freedombone Security Configuration" \
691
-           --defaultno \
692
-           --yesno $"\nThis will remove all user passwords from the system. Are you sure that you want to do this?" 8 60
691
+           --yesno $"\nDo you wish to store passwords on the system? Stored passwords are convenient but carry some additional security risk." 10 60
693 692
     sel=$?
694 693
     case $sel in
695
-        1) return;;
694
+        0)
695
+            ${PROJECT_NAME}-pass --enable yes
696
+            return
697
+            ;;
698
+        1)
699
+            ${PROJECT_NAME}-pass --clear yes
700
+            dialog --title $"Passwords were removed and will not be stored" \
701
+                   --msgbox $"\nFor the best security you should now manually change passwords via web interfaces so that there is no possibility of them being recovered from the disk" 9 60
702
+            return
703
+            ;;
696 704
         255) return;;
697 705
     esac
698
-    ${PROJECT_NAME}-pass --clear yes
699
-    dialog --title $"Passwords were removed" \
700
-           --msgbox $"\nFor the best security you should now manually change passwords via web interfaces so that there is no possibility of them being recovered from the disk" 9 60
701 706
 }
702 707
 
703 708
 function menu_security_settings {
@@ -707,7 +712,7 @@ function menu_security_settings {
707 712
            --title $"Security Settings" \
708 713
            --radiolist $"Choose an operation:" 18 76 18 \
709 714
            1 $"Show ssh host public key" off \
710
-           2 $"Clear password store" off \
715
+           2 $"Password storage" off \
711 716
            3 $"Regenerate ssh host keys" off \
712 717
            4 $"Regenerate Diffie-Hellman keys" off \
713 718
            5 $"Update cipersuite" off \
@@ -744,7 +749,7 @@ function menu_security_settings {
744 749
             exit 0
745 750
             ;;
746 751
         2)
747
-            clear_passwords
752
+            store_passwords
748 753
             exit 0
749 754
             ;;
750 755
         3)