summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rc2/rc2_skey.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rc2/rc2_skey.c')
-rw-r--r--src/lib/libcrypto/rc2/rc2_skey.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/libcrypto/rc2/rc2_skey.c b/src/lib/libcrypto/rc2/rc2_skey.c
index 0150b0e035..4e000e5b99 100644
--- a/src/lib/libcrypto/rc2/rc2_skey.c
+++ b/src/lib/libcrypto/rc2/rc2_skey.c
@@ -57,9 +57,14 @@
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
62static const unsigned char key_table[256]={ 67static unsigned char key_table[256]={
63 0xd9,0x78,0xf9,0xc4,0x19,0xdd,0xb5,0xed,0x28,0xe9,0xfd,0x79, 68 0xd9,0x78,0xf9,0xc4,0x19,0xdd,0xb5,0xed,0x28,0xe9,0xfd,0x79,
64 0x4a,0xa0,0xd8,0x9d,0xc6,0x7e,0x37,0x83,0x2b,0x76,0x53,0x8e, 69 0x4a,0xa0,0xd8,0x9d,0xc6,0x7e,0x37,0x83,0x2b,0x76,0x53,0x8e,
65 0x62,0x4c,0x64,0x88,0x44,0x8b,0xfb,0xa2,0x17,0x9a,0x59,0xf5, 70 0x62,0x4c,0x64,0x88,0x44,0x8b,0xfb,0xa2,0x17,0x9a,0x59,0xf5,
@@ -94,8 +99,20 @@ static const 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
97void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) 104void 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 }
110void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,
111 int bits)
112#else
113void 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;