Bluetooth: Fix smp_e byte order to be consistent with SMP specification
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 18 Mar 2014 10:58:24 +0000 (12:58 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 18 Mar 2014 17:18:26 +0000 (10:18 -0700)
commit943a732ab6440f4edbccd8cd9044a588b35059a0
tree95bf7d7bf65aa96712ffb830a951b7cdfa8f711f
parent66bed1a24ec28e52fc2c7c0a2aa945a893bfa9bc
Bluetooth: Fix smp_e byte order to be consistent with SMP specification

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: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/smp.c