endif
OBJS += ../src/crypto/md5.o
-OBJS += ../src/crypto/rc4.o
AESOBJS = # none so far
OBJS += ../src/crypto/fips_prf_openssl.o
OBJS_p += ../src/crypto/fips_prf_openssl.o
endif
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_TLS), gnutls)
OBJS += ../src/crypto/crypto_gnutls.o
OBJS_p += ../src/crypto/fips_prf_gnutls.o
endif
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_TLS), internal)
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
OBJS += ../src/crypto/crypto_libtomcrypt.o
OBJS_p += ../src/crypto/crypto_libtomcrypt.o
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_CRYPTO), internal)
OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
CONFIG_INTERNAL_MD4=y
CONFIG_INTERNAL_MD5=y
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
endif
else
CONFIG_INTERNAL_SHA1=y
CONFIG_INTERNAL_MD5=y
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifdef CONFIG_INTERNAL_AES
ifdef CONFIG_INTERNAL_DES
OBJS += ../src/crypto/des-internal.o
endif
+ifdef CONFIG_INTERNAL_RC4
+OBJS += ../src/crypto/rc4.o
+endif
ifdef NEED_SHA256
OBJS += ../src/crypto/sha256.o
#include "radius/radius_client.h"
#include "ieee802_11_auth.h"
#include "sta_info.h"
-#include "rc4.h"
+#include "crypto.h"
#include "ieee802_1x.h"
#include "wpa.h"
#include "wme.h"
#include "radius/radius_client.h"
#include "eapol_sm.h"
#include "md5.h"
-#include "rc4.h"
+#include "crypto.h"
#include "eloop.h"
#include "sta_info.h"
#include "wpa.h"
#include "wpa.h"
#include "sha1.h"
#include "sha256.h"
-#include "rc4.h"
#include "aes_wrap.h"
#include "crypto.h"
#include "eloop.h"
const u8 *modulus, size_t modulus_len,
u8 *result, size_t *result_len);
+/**
+ * rc4_skip - XOR RC4 stream to given data with skip-stream-start
+ * @key: RC4 key
+ * @keylen: RC4 key length
+ * @skip: number of bytes to skip from the beginning of the RC4 stream
+ * @data: data to be XOR'ed with RC4 stream
+ * @data_len: buf length
+ * Returns: 0 on success, -1 on failure
+ *
+ * Generate RC4 pseudo random stream for the given key, skip beginning of the
+ * stream, and XOR the end result with the data buffer to perform RC4
+ * encryption/decryption.
+ */
+int rc4_skip(const u8 *key, size_t keylen, size_t skip,
+ u8 *data, size_t data_len);
+
#endif /* CRYPTO_H */
#include "crypto.h"
#include "md5.h"
#include "sha1.h"
-#include "rc4.h"
#include "aes.h"
#include "tls/rsa.h"
#include "tls/bignum.h"
#include <tomcrypt.h>
#include "common.h"
-#include "rc4.h"
#include "crypto.h"
#ifndef mp_init_multi
#include "sha1.h"
#include "ms_funcs.h"
#include "crypto.h"
-#include "rc4.h"
/**
#include "includes.h"
#include "common.h"
-#include "rc4.h"
+#include "crypto.h"
#define S_SWAP(a,b) do { u8 t = S[a]; S[a] = S[b]; S[b] = t; } while(0)
-/**
- * rc4 - XOR RC4 stream to given data with skip-stream-start
- * @key: RC4 key
- * @keylen: RC4 key length
- * @skip: number of bytes to skip from the beginning of the RC4 stream
- * @data: data to be XOR'ed with RC4 stream
- * @data_len: buf length
- *
- * Generate RC4 pseudo random stream for the given key, skip beginning of the
- * stream, and XOR the end result with the data buffer to perform RC4
- * encryption/decryption.
- */
-void rc4_skip(const u8 *key, size_t keylen, size_t skip,
- u8 *data, size_t data_len)
+int rc4_skip(const u8 *key, size_t keylen, size_t skip,
+ u8 *data, size_t data_len)
{
u32 i, j, k;
u8 S[256], *pos;
S_SWAP(i, j);
*pos++ ^= S[(S[i] + S[j]) & 0xff];
}
+
+ return 0;
}
+++ /dev/null
-/*
- * RC4 stream cipher
- * Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#ifndef RC4_H
-#define RC4_H
-
-void rc4_skip(const u8 *key, size_t keylen, size_t skip,
- u8 *data, size_t data_len);
-
-#endif /* RC4_H */
#include "eloop.h"
#include "eapol_common.h"
#include "md5.h"
-#include "rc4.h"
+#include "crypto.h"
#include "state_machine.h"
#include "wpabuf.h"
#include "includes.h"
#include "common.h"
-#include "rc4.h"
+#include "crypto.h"
#include "aes_wrap.h"
#include "wpa.h"
#include "eloop.h"
OBJS += ../src/utils/common.o
OBJS += ../src/utils/wpa_debug.o
OBJS += ../src/utils/wpabuf.o
-OBJS += ../src/crypto/rc4.o
OBJS_p = wpa_passphrase.o
OBJS_p += ../src/utils/common.o
OBJS_p += ../src/utils/wpa_debug.o
CONFIG_INTERNAL_SHA1=y
CONFIG_INTERNAL_MD5=y
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifdef CONFIG_SMARTCARD
ifndef CONFIG_NATIVE_WINDOWS
ifdef NEED_FIPS186_2_PRF
OBJS += ../src/crypto/fips_prf_openssl.o
endif
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_TLS), gnutls)
OBJS += ../src/crypto/crypto_gnutls.o
OBJS += ../src/crypto/fips_prf_gnutls.o
endif
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_TLS), schannel)
OBJS += ../src/crypto/crypto_cryptoapi.o
OBJS_p += ../src/crypto/crypto_cryptoapi.o
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_TLS), internal)
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
OBJS += ../src/crypto/crypto_libtomcrypt.o
OBJS_p += ../src/crypto/crypto_libtomcrypt.o
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_CRYPTO), internal)
OBJS += ../src/crypto/crypto_internal.o ../src/tls/bignum.o
CONFIG_INTERNAL_MD4=y
CONFIG_INTERNAL_MD5=y
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
ifeq ($(CONFIG_CRYPTO), cryptoapi)
OBJS += ../src/crypto/crypto_cryptoapi.o
OBJS_p += ../src/crypto/crypto_cryptoapi.o
CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
endif
ifeq ($(CONFIG_TLS), none)
OBJS += ../src/crypto/crypto_none.o
OBJS_p += ../src/crypto/crypto_none.o
CONFIG_INTERNAL_SHA256=y
+CONFIG_INTERNAL_RC4=y
endif
else
CONFIG_INTERNAL_AES=y
DESOBJS += ../src/crypto/des-internal.o
endif
+ifdef CONFIG_INTERNAL_RC4
+OBJS += ../src/crypto/rc4.o
+endif
+
ifdef CONFIG_IEEE80211R
NEED_SHA256=y
endif