summaryrefslogtreecommitdiffstats
path: root/crypto/rc2/rc2_skey.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rc2/rc2_skey.c')
-rw-r--r--crypto/rc2/rc2_skey.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/rc2/rc2_skey.c b/crypto/rc2/rc2_skey.c
index 4953642..4e000e5 100644
--- a/crypto/rc2/rc2_skey.c
+++ b/crypto/rc2/rc2_skey.c
@@ -57,6 +57,11 @@
*/
#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,8 +99,20 @@ 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;
RC2_INT *ki;
OpenPOWER on IntegriCloud