]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup: remove redundant check
authorLennart Poettering <lennart@poettering.net>
Tue, 24 Oct 2023 16:15:36 +0000 (18:15 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 25 Oct 2023 12:18:17 +0000 (13:18 +0100)
The immediately preceeding check already covered that.

This removes and addition made back in aae6eb96117acd54ce5ac572aac6a11b34c4ad99.

cc @williamcroberts

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

index 5230a84025442deabc1cf8483e46ecfb9e6cd006..34bf92c7500ccd85522bf1e680ada96c8b0ce190 100644 (file)
@@ -57,10 +57,6 @@ int acquire_luks2_key(
         if ((flags & TPM2_FLAGS_USE_PIN) && !pin)
                 return -ENOANO;
 
-        /* If we're using a PIN, and the luks header has a salt, it better have a pin too */
-        if ((flags & TPM2_FLAGS_USE_PIN) && salt_size > 0 && !pin)
-                return -ENOANO;
-
         if (pin && salt_size > 0) {
                 uint8_t salted_pin[SHA256_DIGEST_SIZE] = {};
                 CLEANUP_ERASE(salted_pin);