diff options
Diffstat (limited to 'src/lib/libcrypto/rc2/rc2_skey.c')
| -rw-r--r-- | src/lib/libcrypto/rc2/rc2_skey.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/libcrypto/rc2/rc2_skey.c b/src/lib/libcrypto/rc2/rc2_skey.c index 4953642056..4e000e5b99 100644 --- a/src/lib/libcrypto/rc2/rc2_skey.c +++ b/src/lib/libcrypto/rc2/rc2_skey.c | |||
| @@ -57,6 +57,11 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <openssl/rc2.h> | 59 | #include <openssl/rc2.h> |
| 60 | #include <openssl/crypto.h> | ||
| 61 | #ifdef OPENSSL_FIPS | ||
| 62 | #include <openssl/fips.h> | ||
| 63 | #endif | ||
| 64 | |||
| 60 | #include "rc2_locl.h" | 65 | #include "rc2_locl.h" |
| 61 | 66 | ||
| 62 | static unsigned char key_table[256]={ | 67 | static unsigned char key_table[256]={ |
| @@ -94,8 +99,20 @@ static unsigned char key_table[256]={ | |||
| 94 | * BSAFE uses the 'retarded' version. What I previously shipped is | 99 | * BSAFE uses the 'retarded' version. What I previously shipped is |
| 95 | * the same as specifying 1024 for the 'bits' parameter. Bsafe uses | 100 | * the same as specifying 1024 for the 'bits' parameter. Bsafe uses |
| 96 | * a version where the bits parameter is the same as len*8 */ | 101 | * a version where the bits parameter is the same as len*8 */ |
| 102 | |||
| 103 | #ifdef OPENSSL_FIPS | ||
| 97 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) | 104 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) |
| 98 | { | 105 | { |
| 106 | if (FIPS_mode()) | ||
| 107 | FIPS_BAD_ABORT(RC2) | ||
| 108 | private_RC2_set_key(key, len, data, bits); | ||
| 109 | } | ||
| 110 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, | ||
| 111 | int bits) | ||
| 112 | #else | ||
| 113 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) | ||
| 114 | #endif | ||
| 115 | { | ||
| 99 | int i,j; | 116 | int i,j; |
| 100 | unsigned char *k; | 117 | unsigned char *k; |
| 101 | RC2_INT *ki; | 118 | RC2_INT *ki; |
