[PATCH] Replace references to _*BYTE_ORDER with WORDS_BIGENDIAN
Per Ekman none
pek
Mon Jun 18 02:26:38 PDT 2012
---
src/crypto/md4-internal.c | 6 +++---
src/eap_peer/ikev2.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/crypto/md4-internal.c b/src/crypto/md4-internal.c
index cd5e6ca..a3afc29 100644
--- a/src/crypto/md4-internal.c
+++ b/src/crypto/md4-internal.c
@@ -196,9 +196,7 @@ MD4Transform(u32 state[4], const u8 block[MD4_BLOCK_LENGTH])
{
u32 a, b, c, d, in[MD4_BLOCK_LENGTH / 4];
-#if BYTE_ORDER == LITTLE_ENDIAN
- os_memcpy(in, block, sizeof(in));
-#else
+#ifdef WORDS_BIGENDIAN
for (a = 0; a < MD4_BLOCK_LENGTH / 4; a++) {
in[a] = (u32)(
(u32)(block[a * 4 + 0]) |
@@ -206,6 +204,8 @@ MD4Transform(u32 state[4], const u8 block[MD4_BLOCK_LENGTH])
(u32)(block[a * 4 + 2]) << 16 |
(u32)(block[a * 4 + 3]) << 24);
}
+#else
+ os_memcpy(in, block, sizeof(in));
#endif
a = state[0];
diff --git a/src/eap_peer/ikev2.c b/src/eap_peer/ikev2.c
index fcf4712..d663d78 100644
--- a/src/eap_peer/ikev2.c
+++ b/src/eap_peer/ikev2.c
@@ -73,7 +73,7 @@ static int ikev2_derive_keys(struct ikev2_responder_data *data)
pos += IKEV2_SPI_LEN;
os_memcpy(pos, data->r_spi, IKEV2_SPI_LEN);
#ifdef CCNS_PL
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef WORDS_BIGENDIAN
{
int i;
u8 *tmp = pos - IKEV2_SPI_LEN;
--
1.7.0.4
--=-=-=--
More information about the Hostap
mailing list