Prepare for 0.9.8j release.
[oweals/openssl.git] / crypto / rc2 / rc2_skey.c
index 49536420566b9021ed9061d960c9107c16293537..4e000e5b992a1428f381bdb1765846d482b005da 100644 (file)
  */
 
 #include <openssl/rc2.h>
+#include <openssl/crypto.h>
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#endif
+
 #include "rc2_locl.h"
 
 static unsigned char key_table[256]={
@@ -94,7 +99,19 @@ static unsigned char key_table[256]={
  * BSAFE uses the 'retarded' version.  What I previously shipped is
  * the same as specifying 1024 for the 'bits' parameter.  Bsafe uses
  * a version where the bits parameter is the same as len*8 */
+
+#ifdef OPENSSL_FIPS
 void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits)
+       {
+       if (FIPS_mode())
+               FIPS_BAD_ABORT(RC2)
+       private_RC2_set_key(key, len, data, bits);
+       }
+void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,
+                                                               int bits)
+#else
+void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits)
+#endif
        {
        int i,j;
        unsigned char *k;