• Johan Hedberg's avatar
    Bluetooth: Fix smp_e byte order to be consistent with SMP specification · 943a732a
    Johan Hedberg authored
    The SMP specification is written with the assumption that both key
    information, plaintextData and encryptedData follow the same little
    endian byte ordering as the rest of SMP.
    
    Since the kernel crypto routines expect big endian data the code has had
    to do various byte swapping tricks to make the behavior as expected,
    however the swapping has been scattered all around the place.
    
    This patch centralizes the byte order swapping into the smp_e function
    by making its public interface match what the other SMP functions expect
    as per specification. The benefit is vastly simplified calls to smp_e.
    Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    943a732a
smp.c 32.5 KB