diff options
author | Mark Spencer <markster@digium.com> | 2005-03-29 04:49:24 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-03-29 04:49:24 +0000 |
commit | f966e5e186f14110a29d38d03992488d88348108 (patch) | |
tree | 4c7e9cead02cc96ac8467cf7fcce545de722fe75 /md5.c | |
parent | bf940e892874c3b0738dc124810cd0b967c7375a (diff) |
Simplify endianness and fix for unaligned reads (bug #3867)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'md5.c')
-rwxr-xr-x | md5.c | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -1,22 +1,5 @@ /* MD5 checksum routines used for authentication. Not covered by GPL, but in the public domain as per the copyright below */ -#if defined( __OpenBSD__ ) -# include <machine/types.h> -# include <sys/endian.h> -#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) -# include <sys/types.h> -# include <sys/endian.h> -#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__) -# include <machine/endian.h> -#elif defined( __sparc__ ) && defined( SOLARIS ) -# define BIG_ENDIAN 4321 -# define BYTE_ORDER BIG_ENDIAN -#else -# include <endian.h> -#endif -# if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN -# define HIGHFIRST 1 -# endif /* * This code implements the MD5 message-digest algorithm. @@ -35,8 +18,12 @@ * will fill a supplied 16-byte array with the digest. */ #include <string.h> /* for memcpy() */ +#include <asterisk/endian.h> #include <asterisk/md5.h> +# if __BYTE_ORDER == __BIG_ENDIAN +# define HIGHFIRST 1 +# endif #ifndef HIGHFIRST #define byteReverse(buf, len) /* Nothing */ #else |