Skip to content

Commit d74d0bd

Browse files
yuwatadtardon
authored andcommitted
cryptsetup: check the existence of salt by salt_size > 0
Follow-up for 504d0ac. The function may be called with non-NULL salt and salt_size == 0. (cherry picked from commit 8c2264a) Related: RHEL-40119
1 parent a3de42d commit d74d0bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cryptsetup/cryptsetup-tokens/luks2-tpm2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int acquire_luks2_key(
5858
return -ENOANO;
5959

6060
/* If we're using a PIN, and the luks header has a salt, it better have a pin too */
61-
if ((flags & TPM2_FLAGS_USE_PIN) && salt && !pin)
61+
if ((flags & TPM2_FLAGS_USE_PIN) && salt_size > 0 && !pin)
6262
return -ENOANO;
6363

6464
if (pin && salt_size > 0) {

0 commit comments

Comments
 (0)