]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: SMP: make SM/PER/KDU/BI-04-C happy
authorChristian Eggers <ceggers@arri.de>
Wed, 25 Feb 2026 17:07:28 +0000 (18:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2026 10:08:52 +0000 (11:08 +0100)
[ Upstream commit 0e4d4dcc1a6e82cc6f9abf32193558efa7e1613d ]

The last test step ("Test with Invalid public key X and Y, all set to
0") expects to get an "DHKEY check failed" instead of "unspecified".

Fixes: 6d19628f539f ("Bluetooth: SMP: Fail if remote and local public keys are identical")
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/smp.c

index 3a33fd06e6a4c66ebd474c7ff5f55622129bce25..204c5fe3a8d08c95568cbd5fe2f4047341d31c3a 100644 (file)
@@ -2743,7 +2743,7 @@ static int smp_cmd_public_key(struct l2cap_conn *conn, struct sk_buff *skb)
        if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) &&
            !crypto_memneq(key, smp->local_pk, 64)) {
                bt_dev_err(hdev, "Remote and local public keys are identical");
-               return SMP_UNSPECIFIED;
+               return SMP_DHKEY_CHECK_FAILED;
        }
 
        memcpy(smp->remote_pk, key, 64);