File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ This is accomplished with a simple command:
101101
102102This command performs four steps:
103103
104- 1. Creates a new key with the same entropy as the LUKS master key.
104+ 1. Creates a new key with the same entropy as the LUKS master key -- maximum entropy bits is 256 .
1051052. Encrypts the new key with Clevis.
1061063. Stores the Clevis JWE in the LUKS header.
1071074. Enables the new key for use with LUKS.
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ policy. This is accomplished with a simple command:
2020
2121This command performs four steps:
2222
23- 1. Creates a new key with the same entropy as the LUKS master key.
23+ 1. Creates a new key with the same entropy as the LUKS master key -- maximum entropy bits is 256 .
24242. Encrypts the new key with Clevis.
25253. Stores the Clevis JWE in the LUKS header.
26264. Enables the new key for use with LUKS.
Original file line number Diff line number Diff line change @@ -841,6 +841,7 @@ clevis_luks_generate_key() {
841841 [ -z " ${DEV} " ] && return 1
842842
843843 local dump filter bits
844+ local MAX_ENTROPY_BITS=256 # Maximum allowed by pwmake.
844845 dump=$( cryptsetup luksDump " ${DEV} " )
845846 if cryptsetup isLuks --type luks1 " ${DEV} " ; then
846847 filter=" $( echo " ${dump} " | sed -rn ' s|MK bits:[ \t]*([0-9]+)|\1|p' ) "
@@ -852,6 +853,9 @@ clevis_luks_generate_key() {
852853 fi
853854
854855 bits=" $( echo -n " ${filter} " | sort -n | tail -n 1) "
856+ if [ " ${bits} " -gt " ${MAX_ENTROPY_BITS} " ]; then
857+ bits=" ${MAX_ENTROPY_BITS} "
858+ fi
855859 pwmake " ${bits} "
856860}
857861
You can’t perform that action at this time.
0 commit comments