summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rc2
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rc2')
-rw-r--r--src/lib/libcrypto/rc2/rc2.h4
-rw-r--r--src/lib/libcrypto/rc2/rc2_skey.c17
2 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libcrypto/rc2/rc2.h b/src/lib/libcrypto/rc2/rc2.h
index 34c8362317..e542ec94ff 100644
--- a/src/lib/libcrypto/rc2/rc2.h
+++ b/src/lib/libcrypto/rc2/rc2.h
@@ -79,7 +79,9 @@ typedef struct rc2_key_st
79 RC2_INT data[64]; 79 RC2_INT data[64];
80 } RC2_KEY; 80 } RC2_KEY;
81 81
82 82#ifdef OPENSSL_FIPS
83void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
84#endif
83void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); 85void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
84void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, 86void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key,
85 int enc); 87 int enc);
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
62static unsigned char key_table[256]={ 67static 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
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;