• Johan Hedberg's avatar
    Bluetooth: Fix setting correct security level when initiating SMP · 2d150da3
    Johan Hedberg authored
    commit 5eb596f5 upstream.
    
    We can only determine the final security level when both pairing request
    and response have been exchanged. When initiating pairing the starting
    target security level is set to MEDIUM unless explicitly specified to be
    HIGH, so that we can still perform pairing even if the remote doesn't
    have MITM capabilities. However, once we've received the pairing
    response we should re-consult the remote and local IO capabilities and
    upgrade the target security level if necessary.
    
    Without this patch the resulting Long Term Key will occasionally be
    reported to be unauthenticated when it in reality is an authenticated
    one.
    Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    [lizf: Backported to 3.4: adjust context]
    Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
    2d150da3
smp.c 23.6 KB