Browse Source

Simpler master password

Bob Mottram 8 years ago
parent
commit
9176ac12d7
1 changed files with 8 additions and 13 deletions
  1. 8
    13
      src/freedombone-pass

+ 8
- 13
src/freedombone-pass View File

@@ -251,8 +251,14 @@ fi
251 251
 get_backup_key_id
252 252
 
253 253
 if [ ${#MASTER_PASSWORD} -eq 0 ]; then
254
-    # Use the backups private key as a symmetric passphrase
255
-    MASTER_PASSWORD=$(gpg -q --armor --export-secret-key $MY_BACKUP_KEY_ID | sed '/---/d' | sed '/Version/d' | sed '/^$/d')
254
+    if [ ! -d /root/.passwords/root ]; then
255
+        mkdir -p /root/.passwords/root
256
+    fi
257
+    if [ ! -f /root/.passwords/root/master ]; then
258
+        echo "$(openssl rand -base64 32 | cut -c1-30)" > /root/.passwords/root/master
259
+        chmod 700 /root/.passwords/root/master
260
+    fi
261
+    MASTER_PASSWORD=$(cat /root/.passwords/root/master)
256 262
 fi
257 263
 
258 264
 if [ $TESTS ]; then
@@ -289,17 +295,6 @@ if [ ! $CURR_APP ]; then
289 295
     exit 3
290 296
 fi
291 297
 
292
-if [[ "$CURR_USERNAME" == "root" ]]; then
293
-    if [ ! -d /root/.passwords/root ]; then
294
-        mkdir -p /root/.passwords/root
295
-    fi
296
-    if [ ! -f /root/.passwords/root/master ]; then
297
-        echo "$(openssl rand -base64 32 | cut -c1-30)" > /root/.passwords/root/master
298
-        chmod 700 /root/.passwords/root/master
299
-    fi
300
-    MASTER_PASSWORD=$(cat /root/.passwords/root/master)
301
-fi
302
-
303 298
 if [ ${#CURR_PASSWORD} -eq 0 ]; then
304 299
     # retrieve password
305 300
     if [ ! -f ~/.passwords/$CURR_USERNAME/$CURR_APP ]; then