diff options
| author | djm <> | 2008-09-06 12:15:56 +0000 |
|---|---|---|
| committer | djm <> | 2008-09-06 12:15:56 +0000 |
| commit | 5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80 (patch) | |
| tree | aba68249883aa9d2361d92eef69a81d0c4961732 /src/lib/libcrypto/rc2 | |
| parent | f6198d4d0ab97685dc56be2d48715ed39fcc74b9 (diff) | |
| download | openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.gz openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.bz2 openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.zip | |
import of OpenSSL 0.9.8h
Diffstat (limited to 'src/lib/libcrypto/rc2')
| -rw-r--r-- | src/lib/libcrypto/rc2/rc2.h | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/rc2/rc2_ecb.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/rc2/rc2_skey.c | 21 |
3 files changed, 10 insertions, 20 deletions
diff --git a/src/lib/libcrypto/rc2/rc2.h b/src/lib/libcrypto/rc2/rc2.h index 71788158d8..34c8362317 100644 --- a/src/lib/libcrypto/rc2/rc2.h +++ b/src/lib/libcrypto/rc2/rc2.h | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | #ifndef HEADER_RC2_H | 59 | #ifndef HEADER_RC2_H |
| 60 | #define HEADER_RC2_H | 60 | #define HEADER_RC2_H |
| 61 | 61 | ||
| 62 | #include <openssl/opensslconf.h> /* OPENSSL_NO_RC2, RC2_INT */ | ||
| 62 | #ifdef OPENSSL_NO_RC2 | 63 | #ifdef OPENSSL_NO_RC2 |
| 63 | #error RC2 is disabled. | 64 | #error RC2 is disabled. |
| 64 | #endif | 65 | #endif |
| @@ -66,7 +67,6 @@ | |||
| 66 | #define RC2_ENCRYPT 1 | 67 | #define RC2_ENCRYPT 1 |
| 67 | #define RC2_DECRYPT 0 | 68 | #define RC2_DECRYPT 0 |
| 68 | 69 | ||
| 69 | #include <openssl/opensslconf.h> /* RC2_INT */ | ||
| 70 | #define RC2_BLOCK 8 | 70 | #define RC2_BLOCK 8 |
| 71 | #define RC2_KEY_LENGTH 16 | 71 | #define RC2_KEY_LENGTH 16 |
| 72 | 72 | ||
| @@ -79,10 +79,7 @@ typedef struct rc2_key_st | |||
| 79 | RC2_INT data[64]; | 79 | RC2_INT data[64]; |
| 80 | } RC2_KEY; | 80 | } RC2_KEY; |
| 81 | 81 | ||
| 82 | #ifdef OPENSSL_FIPS | 82 | |
| 83 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, | ||
| 84 | int bits); | ||
| 85 | #endif | ||
| 86 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); | 83 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); |
| 87 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, | 84 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, |
| 88 | int enc); | 85 | int enc); |
diff --git a/src/lib/libcrypto/rc2/rc2_ecb.c b/src/lib/libcrypto/rc2/rc2_ecb.c index d3e8c2718a..fff86c7af8 100644 --- a/src/lib/libcrypto/rc2/rc2_ecb.c +++ b/src/lib/libcrypto/rc2/rc2_ecb.c | |||
| @@ -60,7 +60,7 @@ | |||
| 60 | #include "rc2_locl.h" | 60 | #include "rc2_locl.h" |
| 61 | #include <openssl/opensslv.h> | 61 | #include <openssl/opensslv.h> |
| 62 | 62 | ||
| 63 | const char *RC2_version="RC2" OPENSSL_VERSION_PTEXT; | 63 | const char RC2_version[]="RC2" OPENSSL_VERSION_PTEXT; |
| 64 | 64 | ||
| 65 | /* RC2 as implemented frm a posting from | 65 | /* RC2 as implemented frm a posting from |
| 66 | * Newsgroups: sci.crypt | 66 | * Newsgroups: sci.crypt |
diff --git a/src/lib/libcrypto/rc2/rc2_skey.c b/src/lib/libcrypto/rc2/rc2_skey.c index 9652865188..4953642056 100644 --- a/src/lib/libcrypto/rc2/rc2_skey.c +++ b/src/lib/libcrypto/rc2/rc2_skey.c | |||
| @@ -57,8 +57,6 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <openssl/rc2.h> | 59 | #include <openssl/rc2.h> |
| 60 | #include <openssl/crypto.h> | ||
| 61 | #include <openssl/fips.h> | ||
| 62 | #include "rc2_locl.h" | 60 | #include "rc2_locl.h" |
| 63 | 61 | ||
| 64 | static unsigned char key_table[256]={ | 62 | static unsigned char key_table[256]={ |
| @@ -86,25 +84,17 @@ static unsigned char key_table[256]={ | |||
| 86 | 0xfe,0x7f,0xc1,0xad, | 84 | 0xfe,0x7f,0xc1,0xad, |
| 87 | }; | 85 | }; |
| 88 | 86 | ||
| 87 | #if defined(_MSC_VER) && defined(_ARM_) | ||
| 88 | #pragma optimize("g",off) | ||
| 89 | #endif | ||
| 90 | |||
| 89 | /* It has come to my attention that there are 2 versions of the RC2 | 91 | /* It has come to my attention that there are 2 versions of the RC2 |
| 90 | * key schedule. One which is normal, and anther which has a hook to | 92 | * key schedule. One which is normal, and anther which has a hook to |
| 91 | * use a reduced key length. | 93 | * use a reduced key length. |
| 92 | * BSAFE uses the 'retarded' version. What I previously shipped is | 94 | * BSAFE uses the 'retarded' version. What I previously shipped is |
| 93 | * the same as specifying 1024 for the 'bits' parameter. Bsafe uses | 95 | * the same as specifying 1024 for the 'bits' parameter. Bsafe uses |
| 94 | * a version where the bits parameter is the same as len*8 */ | 96 | * a version where the bits parameter is the same as len*8 */ |
| 95 | |||
| 96 | #ifdef OPENSSL_FIPS | ||
| 97 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) | ||
| 98 | { | ||
| 99 | if (FIPS_mode()) | ||
| 100 | FIPS_BAD_ABORT(RC2) | ||
| 101 | private_RC2_set_key(key, len, data, bits); | ||
| 102 | } | ||
| 103 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, | ||
| 104 | int bits) | ||
| 105 | #else | ||
| 106 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) | 97 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) |
| 107 | #endif | ||
| 108 | { | 98 | { |
| 109 | int i,j; | 99 | int i,j; |
| 110 | unsigned char *k; | 100 | unsigned char *k; |
| @@ -150,3 +140,6 @@ void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) | |||
| 150 | *(ki--)=((k[i]<<8)|k[i-1])&0xffff; | 140 | *(ki--)=((k[i]<<8)|k[i-1])&0xffff; |
| 151 | } | 141 | } |
| 152 | 142 | ||
| 143 | #if defined(_MSC_VER) | ||
| 144 | #pragma optimize("",on) | ||
| 145 | #endif | ||
