summaryrefslogtreecommitdiff
path: root/crypto/openssl/crypto/md32_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/md32_common.h')
-rw-r--r--crypto/openssl/crypto/md32_common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/openssl/crypto/md32_common.h b/crypto/openssl/crypto/md32_common.h
index 573850b12289..8137c57b1c55 100644
--- a/crypto/openssl/crypto/md32_common.h
+++ b/crypto/openssl/crypto/md32_common.h
@@ -128,6 +128,10 @@
* <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
@@ -555,6 +559,14 @@ int HASH_FINAL (unsigned char *md, HASH_CTX *c)
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;