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
 get_backup_key_id
251
 get_backup_key_id
252
 
252
 
253
 if [ ${#MASTER_PASSWORD} -eq 0 ]; then
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
 fi
262
 fi
257
 
263
 
258
 if [ $TESTS ]; then
264
 if [ $TESTS ]; then
289
     exit 3
295
     exit 3
290
 fi
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
 if [ ${#CURR_PASSWORD} -eq 0 ]; then
298
 if [ ${#CURR_PASSWORD} -eq 0 ]; then
304
     # retrieve password
299
     # retrieve password
305
     if [ ! -f ~/.passwords/$CURR_USERNAME/$CURR_APP ]; then
300
     if [ ! -f ~/.passwords/$CURR_USERNAME/$CURR_APP ]; then