* <appro@fy.chalmers.se>
*/
+#include <openssl/crypto.h>
+#include <openssl/fips.h>
+#include <openssl/err.h>
+
#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN)
#error "DATA_ORDER must be defined!"
#endif
*/
#undef ROTATE
#ifndef PEDANTIC
-# if defined(_MSC_VER) || defined(__ICC)
+# if 0 /* defined(_MSC_VER) */
# define ROTATE(a,n) _lrotl(a,n)
# elif defined(__MWERKS__)
# if defined(__POWERPC__)
if ((((unsigned long)data)%4) == 0)
{
/* data is properly aligned so that we can cast it: */
- HASH_BLOCK_DATA_ORDER_ALIGNED (c,(const HASH_LONG *)data,sw);
+ HASH_BLOCK_DATA_ORDER_ALIGNED (c,(HASH_LONG *)data,sw);
sw*=HASH_CBLOCK;
data+=sw;
len-=sw;
#if defined(HASH_BLOCK_DATA_ORDER_ALIGNED)
if ((((unsigned long)data)%4) == 0)
/* data is properly aligned so that we can cast it: */
- HASH_BLOCK_DATA_ORDER_ALIGNED (c,(const HASH_LONG *)data,1);
+ HASH_BLOCK_DATA_ORDER_ALIGNED (c,(HASH_LONG *)data,1);
else
#if !defined(HASH_BLOCK_DATA_ORDER)
{
static const unsigned char end[4]={0x80,0x00,0x00,0x00};
const unsigned char *cp=end;
+#ifdef OPENSSL_FIPS
+ if(FIPS_mode() && !FIPS_md5_allowed())
+ {
+ FIPSerr(FIPS_F_HASH_FINAL,FIPS_R_NON_FIPS_METHOD);
+ return 0;
+ }
+#endif
+
/* c->num should definitly have room for at least one more byte. */
p=c->data;
i=c->num>>2;