summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rc4
diff options
context:
space:
mode:
authordjm <>2009-01-09 12:14:09 +0000
committerdjm <>2009-01-09 12:14:09 +0000
commit76dd4d55fdccad54d20608e7caf577b9d67b216f (patch)
tree9b645adc5cf0aa0820e1501ee5c6f2c41c454e7c /src/lib/libcrypto/rc4
parentf1625f274acf5dcd5601f6cb5e29e233b2a441a3 (diff)
downloadopenbsd-76dd4d55fdccad54d20608e7caf577b9d67b216f.tar.gz
openbsd-76dd4d55fdccad54d20608e7caf577b9d67b216f.tar.bz2
openbsd-76dd4d55fdccad54d20608e7caf577b9d67b216f.zip
import openssl-0.9.8j
Diffstat (limited to 'src/lib/libcrypto/rc4')
-rw-r--r--src/lib/libcrypto/rc4/Makefile18
-rw-r--r--src/lib/libcrypto/rc4/rc4_fblk.c75
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
21APPS= 21APPS=
22 22
23LIB=$(TOP)/libcrypto.a 23LIB=$(TOP)/libcrypto.a
24LIBSRC=rc4_skey.c rc4_enc.c 24LIBSRC=rc4_skey.c rc4_enc.c rc4_fblk.c
25LIBOBJ=$(RC4_ENC) 25LIBOBJ=$(RC4_ENC) rc4_fblk.o
26 26
27SRC= $(LIBSRC) 27SRC= $(LIBSRC)
28 28
@@ -37,7 +37,7 @@ top:
37all: lib 37all: lib
38 38
39lib: $(LIBOBJ) 39lib: $(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
105rc4_enc.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h 105rc4_enc.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h
106rc4_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 106rc4_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
107rc4_enc.o: ../cryptlib.h rc4_enc.c rc4_locl.h 107rc4_enc.o: ../cryptlib.h rc4_enc.c rc4_locl.h
108rc4_fblk.o: ../../e_os.h ../../include/openssl/bio.h
109rc4_fblk.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
110rc4_fblk.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
111rc4_fblk.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
112rc4_fblk.o: ../../include/openssl/opensslconf.h
113rc4_fblk.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
114rc4_fblk.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h
115rc4_fblk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
116rc4_fblk.o: ../cryptlib.h rc4_fblk.c rc4_locl.h
108rc4_skey.o: ../../e_os.h ../../include/openssl/bio.h 117rc4_skey.o: ../../e_os.h ../../include/openssl/bio.h
109rc4_skey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 118rc4_skey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
110rc4_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 119rc4_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
111rc4_skey.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 120rc4_skey.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
121rc4_skey.o: ../../include/openssl/opensslconf.h
112rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 122rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
113rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h 123rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h
114rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 124rc4_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
68void 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