diff options
Diffstat (limited to 'src/lib/libcrypto/rc4')
| -rw-r--r-- | src/lib/libcrypto/rc4/Makefile | 18 | ||||
| -rw-r--r-- | src/lib/libcrypto/rc4/rc4_fblk.c | 75 |
2 files changed, 89 insertions, 4 deletions
diff --git a/src/lib/libcrypto/rc4/Makefile b/src/lib/libcrypto/rc4/Makefile index 187ed5c668..f0bd7678fc 100644 --- a/src/lib/libcrypto/rc4/Makefile +++ b/src/lib/libcrypto/rc4/Makefile | |||
| @@ -21,8 +21,8 @@ TEST=rc4test.c | |||
| 21 | APPS= | 21 | APPS= |
| 22 | 22 | ||
| 23 | LIB=$(TOP)/libcrypto.a | 23 | LIB=$(TOP)/libcrypto.a |
| 24 | LIBSRC=rc4_skey.c rc4_enc.c | 24 | LIBSRC=rc4_skey.c rc4_enc.c rc4_fblk.c |
| 25 | LIBOBJ=$(RC4_ENC) | 25 | LIBOBJ=$(RC4_ENC) rc4_fblk.o |
| 26 | 26 | ||
| 27 | SRC= $(LIBSRC) | 27 | SRC= $(LIBSRC) |
| 28 | 28 | ||
| @@ -37,7 +37,7 @@ top: | |||
| 37 | all: lib | 37 | all: lib |
| 38 | 38 | ||
| 39 | lib: $(LIBOBJ) | 39 | lib: $(LIBOBJ) |
| 40 | $(AR) $(LIB) $(LIBOBJ) | 40 | $(ARX) $(LIB) $(LIBOBJ) |
| 41 | $(RANLIB) $(LIB) || echo Never mind. | 41 | $(RANLIB) $(LIB) || echo Never mind. |
| 42 | @touch lib | 42 | @touch lib |
| 43 | 43 | ||
| @@ -105,10 +105,20 @@ rc4_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
| 105 | rc4_enc.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h | 105 | rc4_enc.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h |
| 106 | rc4_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 106 | rc4_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 107 | rc4_enc.o: ../cryptlib.h rc4_enc.c rc4_locl.h | 107 | rc4_enc.o: ../cryptlib.h rc4_enc.c rc4_locl.h |
| 108 | rc4_fblk.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 109 | rc4_fblk.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 110 | rc4_fblk.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 111 | rc4_fblk.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h | ||
| 112 | rc4_fblk.o: ../../include/openssl/opensslconf.h | ||
| 113 | rc4_fblk.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 114 | rc4_fblk.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h | ||
| 115 | rc4_fblk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 116 | rc4_fblk.o: ../cryptlib.h rc4_fblk.c rc4_locl.h | ||
| 108 | rc4_skey.o: ../../e_os.h ../../include/openssl/bio.h | 117 | rc4_skey.o: ../../e_os.h ../../include/openssl/bio.h |
| 109 | rc4_skey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 118 | rc4_skey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 110 | rc4_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 119 | rc4_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 111 | rc4_skey.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 120 | rc4_skey.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h |
| 121 | rc4_skey.o: ../../include/openssl/opensslconf.h | ||
| 112 | rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 122 | rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 113 | rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h | 123 | rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h |
| 114 | rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 124 | rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
diff --git a/src/lib/libcrypto/rc4/rc4_fblk.c b/src/lib/libcrypto/rc4/rc4_fblk.c new file mode 100644 index 0000000000..1b2a42979b --- /dev/null +++ b/src/lib/libcrypto/rc4/rc4_fblk.c | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | /* crypto/rc4/rc4_fblk.c */ | ||
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | ||
| 3 | * project. | ||
| 4 | */ | ||
| 5 | /* ==================================================================== | ||
| 6 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * | ||
| 12 | * 1. Redistributions of source code must retain the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer. | ||
| 14 | * | ||
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | * notice, this list of conditions and the following disclaimer in | ||
| 17 | * the documentation and/or other materials provided with the | ||
| 18 | * distribution. | ||
| 19 | * | ||
| 20 | * 3. All advertising materials mentioning features or use of this | ||
| 21 | * software must display the following acknowledgment: | ||
| 22 | * "This product includes software developed by the OpenSSL Project | ||
| 23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
| 24 | * | ||
| 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 26 | * endorse or promote products derived from this software without | ||
| 27 | * prior written permission. For written permission, please contact | ||
| 28 | * licensing@OpenSSL.org. | ||
| 29 | * | ||
| 30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
| 31 | * nor may "OpenSSL" appear in their names without prior written | ||
| 32 | * permission of the OpenSSL Project. | ||
| 33 | * | ||
| 34 | * 6. Redistributions of any form whatsoever must retain the following | ||
| 35 | * acknowledgment: | ||
| 36 | * "This product includes software developed by the OpenSSL Project | ||
| 37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
| 38 | * | ||
| 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 51 | * ==================================================================== | ||
| 52 | */ | ||
| 53 | |||
| 54 | |||
| 55 | #include <openssl/rc4.h> | ||
| 56 | #include "rc4_locl.h" | ||
| 57 | #include <openssl/opensslv.h> | ||
| 58 | #include <openssl/crypto.h> | ||
| 59 | #ifdef OPENSSL_FIPS | ||
| 60 | #include <openssl/fips.h> | ||
| 61 | #endif | ||
| 62 | |||
| 63 | /* FIPS mode blocking for RC4 has to be done separately since RC4_set_key | ||
| 64 | * may be implemented in an assembly language file. | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifdef OPENSSL_FIPS | ||
| 68 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) | ||
| 69 | { | ||
| 70 | if (FIPS_mode()) | ||
| 71 | FIPS_BAD_ABORT(RC4) | ||
| 72 | private_RC4_set_key(key, len, data); | ||
| 73 | } | ||
| 74 | #endif | ||
| 75 | |||
