aboutsummaryrefslogtreecommitdiffstats
path: root/epan/crypt/airpdcap_tkip.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-04-23 18:11:12 +0000
committerGuy Harris <guy@alum.mit.edu>2007-04-23 18:11:12 +0000
commitcdb59eed638d3522d9eb8ec42fe05c930e38996c (patch)
treea63e8ace3eafe841bf948a1775d15eaf5aeb9953 /epan/crypt/airpdcap_tkip.c
parent6f4a938c640b229bd854ad39939daf71ab3d0734 (diff)
Make Mk16_le() work on both big-endian and little-endian processors and
on processors that don't support unaligned loads - just use pletohs(). svn path=/trunk/; revision=21534
Diffstat (limited to 'epan/crypt/airpdcap_tkip.c')
-rw-r--r--epan/crypt/airpdcap_tkip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/crypt/airpdcap_tkip.c b/epan/crypt/airpdcap_tkip.c
index fad8790c3e..9c83314325 100644
--- a/epan/crypt/airpdcap_tkip.c
+++ b/epan/crypt/airpdcap_tkip.c
@@ -35,6 +35,7 @@
/******************************************************************************/
/* File includes */
/* */
+#include <epan/pint.h>
#include "airpdcap_system.h"
#include "airpdcap_int.h"
@@ -132,9 +133,7 @@ static const UINT16 Sbox[256] = {
#define Mk16(hi, lo) \
((UINT16)((lo) | (((UINT16) (hi)) << 8)))
-/* XXX - does this assume a little-endian processor? */
-/* For that matter, does it assume a processor that handles unaligned loads? */
-#define Mk16_le(v) ((UINT16)*(v))
+#define Mk16_le(v) ((UINT16)pletohs(v))
#define _S_(v) \
((UINT16)(Sbox[Lo8(v)] ^ ((Sbox[Hi8(v)] << 8) | (Sbox[Hi8(v)] >> 8))))