nixos/luksroot: remove useless $new_k_luks (#115832)

This commit is contained in:
Sandro 2025-04-30 16:51:33 +02:00 committed by GitHub
commit 55e8dc37a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -408,13 +408,12 @@ let
return
fi
if [ ! -z "$k_user" ]; then
new_k_luks="$(echo -n $k_user | pbkdf2-sha512 ${toString dev.yubikey.keyLength} $new_iterations $new_response | rbtohex)"
if [ -n "$k_user" ]; then
echo -n $k_user
else
new_k_luks="$(echo | pbkdf2-sha512 ${toString dev.yubikey.keyLength} $new_iterations $new_response | rbtohex)"
fi
echo
fi | pbkdf2-sha512 ${toString dev.yubikey.keyLength} $new_iterations $new_response > /crypt-ramfs/new_key
echo -n "$new_k_luks" | hextorb > /crypt-ramfs/new_key
echo -n "$k_luks" | hextorb | ${cschange} --key-file=- /crypt-ramfs/new_key
if [ $? == 0 ]; then