fix ykfde if file exists
This commit is contained in:
@@ -26,6 +26,10 @@ if [ "$YKFDE_SLOT_CHECK" != 1 ]; then
|
||||
fi
|
||||
|
||||
YKFDE_SALT="$(dd if=/dev/random bs=1 count=$YKFDE_SALT_LENGTH 2>/dev/null | rbtohex)"
|
||||
if [ -f "$YKFDE_STORAGE" ]; then
|
||||
YKFDE_SALT="$(head -1 $YKFDE_STORAGE)"
|
||||
echo "$FILE exists."
|
||||
fi
|
||||
YKFDE_CHALLENGE="$(echo -n $YKFDE_SALT | openssl dgst -binary -sha512 | rbtohex)"
|
||||
YKFDE_RESPONSE="$(ykchalresp -2 -x $YKFDE_CHALLENGE 2>/dev/null)"
|
||||
YKFDE_K_LUKS="$(echo | pbkdf2-sha512 $(($YKFDE_KEY_LENGTH / 8)) $YKFDE_ITERATIONS $YKFDE_RESPONSE | rbtohex)"
|
||||
|
||||
Reference in New Issue
Block a user