diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-29 04:49:24 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-29 04:49:24 +0000 |
commit | de060dd25bf45b1ca8cb18b26bd9c59d144686c7 (patch) | |
tree | 4c7e9cead02cc96ac8467cf7fcce545de722fe75 /md5.c | |
parent | f2529d4563eea317dcbb7bdbefcfd198da83936f (diff) |
Simplify endianness and fix for unaligned reads (bug #3867)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5295 f38db490-d61c-443f-a65b-d21fe96a405b
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 |