summaryrefslogtreecommitdiffstats
path: root/crypto/md2
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-09-16 10:47:28 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-09-16 10:47:28 +0000
commit96a259e81e47cf61d54eb0cb0dd05434eda2f301 (patch)
treede53299acb413b3d5cbe25d05e17f6f3aa8e422b /crypto/md2
parent59f3477b8236fd431d2cee942b46e3034e0a7b10 (diff)
Merge FIPS low level algorithm blocking code. Give hard errors if non-FIPS
algorithms are use in FIPS mode using low level API. No effect in non-FIPS mode.
Diffstat (limited to 'crypto/md2')
-rw-r--r--crypto/md2/md2.h3
-rw-r--r--crypto/md2/md2_dgst.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/crypto/md2/md2.h b/crypto/md2/md2.h
index a46120e7d4..d59c9f2593 100644
--- a/crypto/md2/md2.h
+++ b/crypto/md2/md2.h
@@ -81,6 +81,9 @@ typedef struct MD2state_st
} MD2_CTX;
const char *MD2_options(void);
+#ifdef OPENSSL_FIPS
+int private_MD2_Init(MD2_CTX *c);
+#endif
int MD2_Init(MD2_CTX *c);
int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len);
int MD2_Final(unsigned char *md, MD2_CTX *c);
diff --git a/crypto/md2/md2_dgst.c b/crypto/md2/md2_dgst.c
index 6f68b25c6a..cc4eeaf7a7 100644
--- a/crypto/md2/md2_dgst.c
+++ b/crypto/md2/md2_dgst.c
@@ -62,6 +62,11 @@
#include <openssl/md2.h>
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#endif
+
+#include <openssl/err.h>
const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT;
@@ -116,7 +121,7 @@ const char *MD2_options(void)
return("md2(int)");
}
-int MD2_Init(MD2_CTX *c)
+FIPS_NON_FIPS_MD_Init(MD2)
{
c->num=0;
memset(c->state,0,sizeof c->state);