mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Remove ARC4 implementation while preserving RC4 API
Co-Authored-By: Anthony H <anthony@wolfssl.com>
This commit is contained in:
2
.github/workflows/cmake.yml
vendored
2
.github/workflows/cmake.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
||||
-DWOLFSSL_AESCBC:BOOL=yes -DWOLFSSL_AESCCM:BOOL=yes -DWOLFSSL_AESCFB:BOOL=yes \
|
||||
-DWOLFSSL_AESCTR:BOOL=yes -DWOLFSSL_AESGCM:STRING=yes -DWOLFSSL_AESKEYWRAP:BOOL=yes \
|
||||
-DWOLFSSL_AESOFB:BOOL=yes -DWOLFSSL_AESSIV:BOOL=yes -DWOLFSSL_ALIGN_DATA:BOOL=yes \
|
||||
-DWOLFSSL_ALPN:BOOL=ON -DWOLFSSL_ALT_CERT_CHAINS:BOOL=ON -DWOLFSSL_ARC4:BOOL=yes \
|
||||
-DWOLFSSL_ALPN:BOOL=ON -DWOLFSSL_ALT_CERT_CHAINS:BOOL=ON -DWOLFSSL_ARC4:BOOL=no \
|
||||
-DWOLFSSL_ARIA:BOOL=no -DWOLFSSL_ASIO:BOOL=no -DWOLFSSL_ASM:BOOL=yes -DWOLFSSL_ASN:BOOL=yes \
|
||||
-DWOLFSSL_ASYNC_THREADS:BOOL=no -DWOLFSSL_BASE64_ENCODE:BOOL=yes -DWOLFSSL_CAAM:BOOL=no \
|
||||
-DWOLFSSL_CERTEXT:BOOL=yes -DWOLFSSL_CERTGEN:BOOL=yes -DWOLFSSL_CERTGENCACHE:BOOL=no \
|
||||
|
@ -508,7 +508,7 @@ WC_AES_GCM_DEC_AUTH_EARLY
|
||||
WC_ASN_HASH_SHA256
|
||||
WC_ASYNC_ENABLE_3DES
|
||||
WC_ASYNC_ENABLE_AES
|
||||
WC_ASYNC_ENABLE_ARC4
|
||||
/* ARC4 implementation has been removed */
|
||||
WC_ASYNC_ENABLE_DH
|
||||
WC_ASYNC_ENABLE_ECC
|
||||
WC_ASYNC_ENABLE_ECC_KEYGEN
|
||||
|
@ -1353,8 +1353,8 @@ if(NOT WOLFSSL_DES3_TLS_SUITES)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DNO_DES3_TLS_SUITES")
|
||||
endif()
|
||||
|
||||
# ARC4
|
||||
set(WOLFSSL_ARC4_HELP_STRING "Enable ARC4 (default: disabled)")
|
||||
# RC4 API (ARC4 implementation removed)
|
||||
set(WOLFSSL_ARC4_HELP_STRING "Enable RC4 API (default: disabled, ARC4 implementation removed)")
|
||||
add_option("WOLFSSL_ARC4" ${WOLFSSL_ARC4_HELP_STRING} "no" "yes;no")
|
||||
|
||||
if(WOLFSSL_OPENSSH OR WOLFSSL_WPAS)
|
||||
@ -2530,7 +2530,7 @@ if(WOLFSSL_EXAMPLES)
|
||||
tests/api/test_poly1305.c
|
||||
tests/api/test_chacha20_poly1305.c
|
||||
tests/api/test_camellia.c
|
||||
tests/api/test_arc4.c
|
||||
# ARC4 implementation has been removed
|
||||
tests/api/test_rc2.c
|
||||
tests/api/test_aes.c
|
||||
tests/api/test_ascon.c
|
||||
|
@ -40,7 +40,7 @@ cc_library_shared {
|
||||
"./src/wolfio.c",
|
||||
] + [
|
||||
"./wolfcrypt/src/aes.c",
|
||||
"./wolfcrypt/src/arc4.c",
|
||||
// ARC4 implementation has been removed
|
||||
"./wolfcrypt/src/asm.c",
|
||||
"./wolfcrypt/src/asn.c",
|
||||
"./wolfcrypt/src/blake2b.c",
|
||||
|
@ -176,7 +176,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/wolfio.o
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
||||
# ARC4 implementation has been removed
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o # autogen exclusion
|
||||
|
@ -176,7 +176,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/wolfio.o
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
||||
# ARC4 implementation has been removed
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o # autogen exclusion
|
||||
|
@ -176,7 +176,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/wolfio.o
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
||||
# ARC4 implementation has been removed
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o # autogen exclusion
|
||||
|
@ -176,7 +176,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/wolfio.o
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
||||
# ARC4 implementation has been removed
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o # autogen exclusion
|
||||
|
@ -176,7 +176,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/wolfio.o
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
||||
# ARC4 implementation has been removed
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o # autogen exclusion
|
||||
|
@ -178,7 +178,7 @@ SRC_C += ../../wolfcrypt/src/selftest.c
|
||||
endif
|
||||
|
||||
# wolfCrypt non-standard algorithms (disabled by default)
|
||||
SRC_C += ../../wolfcrypt/src/arc4.c
|
||||
# ARC4 implementation has been removed
|
||||
SRC_C += ../../wolfcrypt/src/blake2b.c
|
||||
SRC_C += ../../wolfcrypt/src/camellia.c
|
||||
SRC_C += ../../wolfcrypt/src/dsa.c
|
||||
|
@ -80,7 +80,7 @@ libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/wolfmath.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_encrypt.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/pwdbased.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hash.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/arc4.c
|
||||
#eccverify_q.C_SRCS += # ../../../wolfcrypt/src/arc4.c - ARC4 implementation has been removed
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hmac.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/md5.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/coding.c
|
||||
|
@ -65,7 +65,7 @@ libwolfssl_LD_FLAGS += -ldl
|
||||
libwolfssl_C_SRCS += \
|
||||
../../wolfcrypt/src/aes \
|
||||
../../wolfcrypt/src/md2 \
|
||||
../../wolfcrypt/src/arc4 \
|
||||
# ARC4 implementation has been removed \
|
||||
../../wolfcrypt/src/md4 \
|
||||
../../wolfcrypt/src/asm \
|
||||
../../wolfcrypt/src/md5 \
|
||||
|
@ -1904,7 +1904,7 @@
|
||||
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\aes.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\arc4.c</name>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\asm.c</name>
|
||||
|
@ -24,7 +24,7 @@
|
||||
<ClCompile Include="..\..\src\ssl.c" />
|
||||
<ClCompile Include="..\..\src\tls.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\aes.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<ClCompile Include="..\..\wolfcrypt\src\asm.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\asn.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\blake2b.c" />
|
||||
@ -87,7 +87,7 @@
|
||||
<ClInclude Include="..\..\wolfssl\test.h" />
|
||||
<ClInclude Include="..\..\wolfssl\version.h" />
|
||||
<ClInclude Include="..\..\wolfssl\wolfcrypt\aes.h" />
|
||||
<ClInclude Include="..\..\wolfssl\wolfcrypt\arc4.h" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<ClInclude Include="..\..\wolfssl\wolfcrypt\asn.h" />
|
||||
<ClInclude Include="..\..\wolfssl\wolfcrypt\asn_public.h" />
|
||||
<ClInclude Include="..\..\wolfssl\wolfcrypt\async.h" />
|
||||
|
@ -47,7 +47,7 @@ Crypto_Library_Name := sgx_tcrypto
|
||||
Wolfssl_C_Extra_Flags := -DWOLFSSL_SGX
|
||||
|
||||
Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
|
||||
$(WOLFSSL_ROOT)/wolfcrypt/src/arc4.c\
|
||||
# ARC4 implementation has been removed\
|
||||
$(WOLFSSL_ROOT)/wolfcrypt/src/asn.c\
|
||||
$(WOLFSSL_ROOT)/wolfcrypt/src/blake2b.c\
|
||||
$(WOLFSSL_ROOT)/wolfcrypt/src/camellia.c\
|
||||
|
@ -142,7 +142,7 @@ extern void hmac_sha384_test(void *arg) ;
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
extern void arc4_test(void *arg) ;
|
||||
extern void arc4_test(void *arg) ; /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES3
|
||||
@ -257,7 +257,7 @@ static struct {
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
"arc4", arc4_test,
|
||||
"arc4", arc4_test, /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifndef NO_DES3
|
||||
"des", des_test,
|
||||
|
@ -27,7 +27,7 @@ SHA test passed!
|
||||
|
||||
>benchmark
|
||||
AES 25 kB took 0.025 seconds, 0.96 MB/s
|
||||
ARC4 25 kB took 0.006 seconds, 3.83 MB/s
|
||||
/* ARC4 implementation has been removed */
|
||||
...
|
||||
|
||||
DH 2048 key agreement 685.93 milliseconds, avg over 1 iterations
|
||||
|
@ -149,7 +149,7 @@ extern void hmac_sha384_test(void *arg) ;
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
extern void arc4_test(void *arg) ;
|
||||
extern void arc4_test(void *arg) ; /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES3
|
||||
@ -264,7 +264,7 @@ static struct {
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
"arc4", arc4_test,
|
||||
"arc4", arc4_test, /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifndef NO_DES3
|
||||
"des", des_test,
|
||||
|
@ -15,7 +15,7 @@
|
||||
projectFiles="true">
|
||||
<logicalFolder name="f2" displayName="wolfcrypt" projectFiles="true">
|
||||
<itemPath>../../../wolfcrypt/src/aes.c</itemPath>
|
||||
<itemPath>../../../wolfcrypt/src/arc4.c</itemPath>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<itemPath>../../../wolfcrypt/src/asm.c</itemPath>
|
||||
<itemPath>../../../wolfcrypt/src/asn.c</itemPath>
|
||||
<itemPath>../../../wolfcrypt/src/blake2b.c</itemPath>
|
||||
|
@ -72,7 +72,7 @@ $(WOLF_ROOT)/src/tls13.o\
|
||||
$(WOLF_ROOT)/src/tls.o\
|
||||
$(WOLF_ROOT)/src/wolfio.o\
|
||||
$(WOLF_ROOT)/wolfcrypt/src/aes.o\
|
||||
$(WOLF_ROOT)/wolfcrypt/src/arc4.o\
|
||||
# ARC4 implementation has been removed\
|
||||
$(WOLF_ROOT)/wolfcrypt/src/asm.o\
|
||||
$(WOLF_ROOT)/wolfcrypt/src/asn.o\
|
||||
$(WOLF_ROOT)/wolfcrypt/src/blake2b.o\
|
||||
|
@ -23,14 +23,16 @@ INCLUDE_DIRECTORIES(
|
||||
${CMAKE_SOURCE_DIR}/extra/wolfssl)
|
||||
|
||||
ADD_DEFINITIONS(${SSL_DEFINES})
|
||||
SET(WOLFCRYPT_SOURCES src/aes.c src/arc4.c src/asn.c src/blake2b.c
|
||||
SET(WOLFCRYPT_SOURCES src/aes.c # src/arc4.c - ARC4 implementation has been removed
|
||||
src/asn.c src/blake2b.c
|
||||
src/camellia.c src/chacha.c src/coding.c src/compress.c src/des3.c
|
||||
src/dh.c src/dsa.c src/ecc.c src/error.c src/hmac.c
|
||||
src/integer.c src/kdf.c src/logging.c src/md2.c src/md4.c src/md5.c src/memory.c
|
||||
src/pkcs7.c src/pkcs12.c src/poly1305.c src/pwdbased.c
|
||||
src/random.c src/ripemd.c src/rsa.c src/sha.c src/sha256.c src/sha512.c
|
||||
src/tfm.c src/wc_port.c src/wc_encrypt.c src/hash.c src/wolfmath.c
|
||||
../wolfssl/wolfcrypt/aes.h ../wolfssl/wolfcrypt/arc4.h ../wolfssl/wolfcrypt/asn.h ../wolfssl/wolfcrypt/blake2.h
|
||||
../wolfssl/wolfcrypt/aes.h # ../wolfssl/wolfcrypt/arc4.h - ARC4 implementation has been removed
|
||||
../wolfssl/wolfcrypt/asn.h ../wolfssl/wolfcrypt/blake2.h
|
||||
../wolfssl/wolfcrypt/camellia.h ../wolfssl/wolfcrypt/chacha.h ../wolfssl/wolfcrypt/coding.h ../wolfssl/wolfcrypt/compress.h ../wolfssl/wolfcrypt/des3.h
|
||||
../wolfssl/wolfcrypt/dh.h ../wolfssl/wolfcrypt/dsa.h ../wolfssl/wolfcrypt/ecc.h ../wolfssl/wolfcrypt/error-crypt.h ../wolfssl/wolfcrypt/hmac.h
|
||||
../wolfssl/wolfcrypt/integer.h ../wolfssl/wolfcrypt/logging.h ../wolfssl/wolfcrypt/md2.h ../wolfssl/wolfcrypt/md4.h ../wolfssl/wolfcrypt/md5.h ../wolfssl/wolfcrypt/memory.h
|
||||
|
@ -79,7 +79,7 @@ void main(void)
|
||||
SAMPLE OUTPUT: Freescale K64 running at 96MHz with no MMCAU:
|
||||
Benchmark Test 0:
|
||||
AES 25 kB took 0.073 seconds, 0.334 MB/s
|
||||
ARC4 25 kB took 0.033 seconds, 0.740 MB/s
|
||||
/* ARC4 implementation has been removed */
|
||||
RABBIT 25 kB took 0.027 seconds, 0.904 MB/s
|
||||
3DES 25 kB took 0.375 seconds, 0.065 MB/s
|
||||
MD5 25 kB took 0.016 seconds, 1.526 MB/s
|
||||
@ -94,7 +94,7 @@ Benchmark Test 0: Return code 0
|
||||
SAMPLE OUTPUT: Freescale K64 running at 96MHz with MMCAU enabled:
|
||||
Benchmark Test 0:
|
||||
AES 25 kB took 0.019 seconds, 1.285 MB/s
|
||||
ARC4 25 kB took 0.033 seconds, 0.740 MB/s
|
||||
/* ARC4 implementation has been removed */
|
||||
RABBIT 25 kB took 0.028 seconds, 0.872 MB/s
|
||||
3DES 25 kB took 0.026 seconds, 0.939 MB/s
|
||||
MD5 25 kB took 0.005 seconds, 4.883 MB/s
|
||||
|
@ -18,7 +18,7 @@
|
||||
</folder>
|
||||
<folder Name="src">
|
||||
<file file_name="../../wolfcrypt/src/aes.c" />
|
||||
<file file_name="../../wolfcrypt/src/arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<file file_name="../../wolfcrypt/src/asm.c" />
|
||||
<file file_name="../../wolfcrypt/src/asn.c" />
|
||||
<file file_name="../../wolfcrypt/src/blake2b.c" />
|
||||
|
@ -18,7 +18,7 @@
|
||||
</folder>
|
||||
<folder Name="src">
|
||||
<file file_name="../../wolfcrypt/src/aes.c" />
|
||||
<file file_name="../../wolfcrypt/src/arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<file file_name="../../wolfcrypt/src/asm.c">
|
||||
<configuration Name="ARM_Debug" build_exclude_from_build="Yes" />
|
||||
</file>
|
||||
|
@ -108,7 +108,7 @@
|
||||
<Instance Guid="5e231ff0-c118-4dc7-a48b-4a49019341fd">
|
||||
<Name>arc4.c</Name>
|
||||
<Type>File</Type>
|
||||
<RelativePath>..\..\..\..\..\wolfcrypt\src\arc4.c</RelativePath>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
|
||||
<ParentItem>2170607d-803e-45b0-80af-6507d495a8de</ParentItem>
|
||||
</Instance>
|
||||
@ -2293,4 +2293,4 @@
|
||||
<ProductVersion>8.01.00.00</ProductVersion>
|
||||
</Instance>
|
||||
</Class>
|
||||
</CubeSuiteProject>
|
||||
</CubeSuiteProject>
|
||||
|
@ -28,7 +28,7 @@
|
||||
</Category>
|
||||
<Category Name="src">
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\aes.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\arc4.c</Path>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\asm.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\asn.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\blake2b.c</Path>
|
||||
|
@ -27,7 +27,7 @@
|
||||
</Category>
|
||||
<Category Name="src">
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\aes.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\arc4.c</Path>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\asm.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\asn.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\blake2b.c</Path>
|
||||
|
@ -28,7 +28,7 @@
|
||||
</Category>
|
||||
<Category Name="src">
|
||||
<Path>..\..\..\..\..\..\..\wolfcrypt\src\aes.c</Path>
|
||||
<Path>..\..\..\..\..\..\..\wolfcrypt\src\arc4.c</Path>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<Path>..\..\..\..\..\..\..\wolfcrypt\src\asm.c</Path>
|
||||
<Path>..\..\..\..\..\..\..\wolfcrypt\src\asn.c</Path>
|
||||
<Path>..\..\..\..\..\..\..\wolfcrypt\src\blake2b.c</Path>
|
||||
|
@ -27,7 +27,7 @@
|
||||
</Category>
|
||||
<Category Name="src">
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\aes.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\arc4.c</Path>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\asm.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\asn.c</Path>
|
||||
<Path>..\..\..\..\..\..\wolfcrypt\src\blake2b.c</Path>
|
||||
|
@ -44,7 +44,7 @@
|
||||
<ClCompile Include="..\..\src\tls.c" />
|
||||
<ClCompile Include="..\..\src\tls13.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\aes.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<ClCompile Include="..\..\wolfcrypt\src\asn.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\blake2b.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\camellia.c" />
|
||||
|
@ -22,7 +22,7 @@
|
||||
<ClCompile Include="..\..\src\tls13.c" />
|
||||
<ClCompile Include="..\..\src\wolfio.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\aes.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<ClCompile Include="..\..\wolfcrypt\src\asn.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\blake2b.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\camellia.c" />
|
||||
|
@ -63,7 +63,7 @@
|
||||
A4ADF8E51FCE0C5600A06E90 /* sha.c in Sources */ = {isa = PBXBuildFile; fileRef = A4ADF8891FCE0C4D00A06E90 /* sha.c */; };
|
||||
A4ADF8EA1FCE0C5600A06E90 /* ge_operations.c in Sources */ = {isa = PBXBuildFile; fileRef = A4ADF88E1FCE0C4E00A06E90 /* ge_operations.c */; };
|
||||
A4ADF8EB1FCE0C5600A06E90 /* chacha20_poly1305.c in Sources */ = {isa = PBXBuildFile; fileRef = A4ADF88F1FCE0C4E00A06E90 /* chacha20_poly1305.c */; };
|
||||
A4ADF8EE1FCE0C5600A06E90 /* arc4.c in Sources */ = {isa = PBXBuildFile; fileRef = A4ADF8921FCE0C4E00A06E90 /* arc4.c */; };
|
||||
/* ARC4 implementation has been removed */
|
||||
A4ADF8F01FCE0C5600A06E90 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = A4ADF8941FCE0C4E00A06E90 /* memory.c */; };
|
||||
A4ADF8F31FCE0C5600A06E90 /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = A4ADF8971FCE0C4F00A06E90 /* rsa.c */; };
|
||||
A4ADF8F41FCE0C5600A06E90 /* pkcs7.c in Sources */ = {isa = PBXBuildFile; fileRef = A4ADF8981FCE0C4F00A06E90 /* pkcs7.c */; };
|
||||
@ -168,7 +168,7 @@
|
||||
A4ADF8891FCE0C4D00A06E90 /* sha.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sha.c; path = ../../../wolfcrypt/src/sha.c; sourceTree = "<group>"; };
|
||||
A4ADF88E1FCE0C4E00A06E90 /* ge_operations.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ge_operations.c; path = ../../../wolfcrypt/src/ge_operations.c; sourceTree = "<group>"; };
|
||||
A4ADF88F1FCE0C4E00A06E90 /* chacha20_poly1305.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = chacha20_poly1305.c; path = ../../../wolfcrypt/src/chacha20_poly1305.c; sourceTree = "<group>"; };
|
||||
A4ADF8921FCE0C4E00A06E90 /* arc4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = arc4.c; path = ../../../wolfcrypt/src/arc4.c; sourceTree = "<group>"; };
|
||||
/* ARC4 implementation has been removed */
|
||||
A4ADF8941FCE0C4E00A06E90 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = ../../../wolfcrypt/src/memory.c; sourceTree = "<group>"; };
|
||||
A4ADF8971FCE0C4F00A06E90 /* rsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rsa.c; path = ../../../wolfcrypt/src/rsa.c; sourceTree = "<group>"; };
|
||||
A4ADF8981FCE0C4F00A06E90 /* pkcs7.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pkcs7.c; path = ../../../wolfcrypt/src/pkcs7.c; sourceTree = "<group>"; };
|
||||
@ -283,7 +283,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A4ADF8821FCE0C4D00A06E90 /* aes.c */,
|
||||
A4ADF8921FCE0C4E00A06E90 /* arc4.c */,
|
||||
/* ARC4 implementation has been removed */,
|
||||
A4DFEC0F1FD4CB8500A7BB33 /* armv8-aes.c */,
|
||||
A46FE14C2493E8F500A25BE7 /* armv8-chacha.c */,
|
||||
CB81DE1E24C93EC000B98DA6 /* armv8-curve25519.S */,
|
||||
@ -522,7 +522,7 @@
|
||||
A4ADF8E01FCE0C5600A06E90 /* ecc_fp.c in Sources */,
|
||||
A4ADF8EB1FCE0C5600A06E90 /* chacha20_poly1305.c in Sources */,
|
||||
A4ADF86B1FCE0C1C00A06E90 /* keys.c in Sources */,
|
||||
A4ADF8EE1FCE0C5600A06E90 /* arc4.c in Sources */,
|
||||
/* ARC4 implementation has been removed */,
|
||||
A4DFEC111FD4CB8500A7BB33 /* armv8-aes.c in Sources */,
|
||||
A46FE1812493E8F800A25BE7 /* wc_dsp.c in Sources */,
|
||||
A4ADF9061FCE0C5600A06E90 /* wc_encrypt.c in Sources */,
|
||||
|
@ -98,7 +98,7 @@ to use PKCS#5 v2 instead of v1.5 which is default add
|
||||
to use PKCS#12 instead use -v1 which a 12 algo like
|
||||
|
||||
-v1 PBE-SHA1-3DES # file Pkcs8Enc12 , see man pkcs8 for more info
|
||||
-v1 PBE-SHA1-RC4-128 # no longer file Pkcs8Enc12, arc4 now off by default
|
||||
-v1 PBE-SHA1-RC4-128 # no longer file Pkcs8Enc12, ARC4 implementation has been removed
|
||||
|
||||
|
||||
**** To convert from pkcs8 to traditional ****
|
||||
|
@ -156,7 +156,8 @@ function(generate_build_flags)
|
||||
if(WOLFSSL_CODING OR WOLFSSL_USER_SETTINGS)
|
||||
set(BUILD_CODING "yes" PARENT_SCOPE)
|
||||
endif()
|
||||
if(WOLFSSL_ARC4 OR WOLFSSL_USER_SETTINGS)
|
||||
# ARC4 implementation has been removed
|
||||
if(WOLFSSL_USER_SETTINGS)
|
||||
set(BUILD_RC4 "yes" PARENT_SCOPE)
|
||||
endif()
|
||||
if(WOLFSSL_MD5 OR WOLFSSL_USER_SETTINGS)
|
||||
@ -654,7 +655,7 @@ function(generate_lib_src_list LIB_SOURCES)
|
||||
endif()
|
||||
|
||||
if(BUILD_RC4)
|
||||
list(APPEND LIB_SOURCES wolfcrypt/src/arc4.c)
|
||||
# ARC4 implementation has been removed
|
||||
endif()
|
||||
|
||||
if(BUILD_MD4)
|
||||
|
@ -62,7 +62,7 @@
|
||||
#ifdef WOLFSSL_SIPHASH
|
||||
#include <wolfssl/wolfcrypt/siphash.h>
|
||||
#endif
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#if defined(WC_NO_RNG)
|
||||
#include <wolfssl/wolfcrypt/integer.h>
|
||||
#else
|
||||
|
@ -15,7 +15,7 @@
|
||||
projectFiles="true">
|
||||
<logicalFolder name="wolfcrypt" displayName="wolfcrypt" projectFiles="true">
|
||||
<itemPath>../../wolfcrypt/src/aes.c</itemPath>
|
||||
<itemPath>../../wolfcrypt/src/arc4.c</itemPath>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<itemPath>../../wolfcrypt/src/asm.c</itemPath>
|
||||
<itemPath>../../wolfcrypt/src/asn.c</itemPath>
|
||||
<itemPath>../../wolfcrypt/src/blake2b.c</itemPath>
|
||||
|
@ -15,7 +15,7 @@
|
||||
projectFiles="true">
|
||||
<logicalFolder name="f2" displayName="wolfcrypt" projectFiles="true">
|
||||
<itemPath>../../wolfcrypt/src/aes.c</itemPath>
|
||||
<itemPath>../../wolfcrypt/src/arc4.c</itemPath>
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<itemPath>../../wolfcrypt/src/asm.c</itemPath>
|
||||
<itemPath>../../wolfcrypt/src/asn.c</itemPath>
|
||||
<itemPath>../../wolfcrypt/src/blake2b.c</itemPath>
|
||||
|
@ -79,7 +79,7 @@ find . -name "*.sln" -delete
|
||||
#rm -f ./wolfcrypt/src/*.i
|
||||
#rm -f ./wolfcrypt/src/*.S
|
||||
#rm -f ./wolfcrypt/src/*.asm
|
||||
#rm -f ./wolfcrypt/src/arc4.c
|
||||
#rm -f ./wolfcrypt/src/arc4.c /* ARC4 implementation has been removed */
|
||||
#rm -f ./wolfcrypt/src/async.c
|
||||
#rm -f ./wolfcrypt/src/blake*
|
||||
#rm -f ./wolfcrypt/src/camellia.c
|
||||
|
@ -1069,7 +1069,7 @@ endif
|
||||
endif
|
||||
|
||||
if BUILD_RC4
|
||||
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/arc4.c
|
||||
# ARC4 implementation has been removed
|
||||
endif
|
||||
|
||||
if BUILD_MD4
|
||||
|
@ -3051,9 +3051,9 @@ void FreeSSL_Ctx(WOLFSSL_CTX* ctx)
|
||||
/* Set cipher pointers to null */
|
||||
void InitCiphers(WOLFSSL* ssl)
|
||||
{
|
||||
#ifdef BUILD_ARC4
|
||||
ssl->encrypt.arc4 = NULL;
|
||||
ssl->decrypt.arc4 = NULL;
|
||||
/* ARC4 implementation has been removed */
|
||||
/* ARC4 implementation has been removed */
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifdef BUILD_DES3
|
||||
ssl->encrypt.des3 = NULL;
|
||||
@ -3095,10 +3095,9 @@ void InitCiphers(WOLFSSL* ssl)
|
||||
|
||||
static void FreeCiphersSide(Ciphers *cipher, void* heap)
|
||||
{
|
||||
#ifdef BUILD_ARC4
|
||||
wc_Arc4Free(cipher->arc4);
|
||||
XFREE(cipher->arc4, heap, DYNAMIC_TYPE_CIPHER);
|
||||
cipher->arc4 = NULL;
|
||||
/* ARC4 implementation has been removed */
|
||||
/* ARC4 implementation has been removed */
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifdef BUILD_DES3
|
||||
wc_Des3Free(cipher->des3);
|
||||
@ -19581,9 +19580,9 @@ static WC_INLINE int EncryptDo(WOLFSSL* ssl, byte* out, const byte* input,
|
||||
}
|
||||
|
||||
switch (ssl->specs.bulk_cipher_algorithm) {
|
||||
#ifdef BUILD_ARC4
|
||||
/* ARC4 implementation has been removed */
|
||||
case wolfssl_rc4:
|
||||
wc_Arc4Process(ssl->encrypt.arc4, out, input, sz);
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
break;
|
||||
#endif
|
||||
|
||||
@ -20051,9 +20050,9 @@ static WC_INLINE int DecryptDo(WOLFSSL* ssl, byte* plain, const byte* input,
|
||||
|
||||
switch (ssl->specs.bulk_cipher_algorithm)
|
||||
{
|
||||
#ifdef BUILD_ARC4
|
||||
/* ARC4 implementation has been removed */
|
||||
case wolfssl_rc4:
|
||||
wc_Arc4Process(ssl->decrypt.arc4, plain, input, sz);
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
43
src/keys.c
43
src/keys.c
@ -2377,51 +2377,16 @@ int SetKeys(Ciphers* enc, Ciphers* dec, Keys* keys, CipherSpecs* specs,
|
||||
(void)rng;
|
||||
(void)tls13;
|
||||
|
||||
#ifdef BUILD_ARC4
|
||||
/* ARC4 implementation has been removed */
|
||||
if (specs->bulk_cipher_algorithm == wolfssl_rc4) {
|
||||
word32 sz = specs->key_size;
|
||||
if (enc && enc->arc4 == NULL) {
|
||||
enc->arc4 = (Arc4*)XMALLOC(sizeof(Arc4), heap, DYNAMIC_TYPE_CIPHER);
|
||||
if (enc->arc4 == NULL)
|
||||
return MEMORY_E;
|
||||
}
|
||||
if (dec && dec->arc4 == NULL) {
|
||||
dec->arc4 = (Arc4*)XMALLOC(sizeof(Arc4), heap, DYNAMIC_TYPE_CIPHER);
|
||||
if (dec->arc4 == NULL)
|
||||
return MEMORY_E;
|
||||
}
|
||||
|
||||
if (enc) {
|
||||
if (wc_Arc4Init(enc->arc4, heap, devId) != 0) {
|
||||
WOLFSSL_MSG("Arc4Init failed in SetKeys");
|
||||
return ASYNC_INIT_E;
|
||||
}
|
||||
}
|
||||
if (dec) {
|
||||
if (wc_Arc4Init(dec->arc4, heap, devId) != 0) {
|
||||
WOLFSSL_MSG("Arc4Init failed in SetKeys");
|
||||
return ASYNC_INIT_E;
|
||||
}
|
||||
}
|
||||
|
||||
if (side == WOLFSSL_CLIENT_END) {
|
||||
if (enc)
|
||||
wc_Arc4SetKey(enc->arc4, keys->client_write_key, sz);
|
||||
if (dec)
|
||||
wc_Arc4SetKey(dec->arc4, keys->server_write_key, sz);
|
||||
}
|
||||
else {
|
||||
if (enc)
|
||||
wc_Arc4SetKey(enc->arc4, keys->server_write_key, sz);
|
||||
if (dec)
|
||||
wc_Arc4SetKey(dec->arc4, keys->client_write_key, sz);
|
||||
}
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
/* Return success to maintain API compatibility */
|
||||
if (enc)
|
||||
enc->setup = 1;
|
||||
if (dec)
|
||||
dec->setup = 1;
|
||||
}
|
||||
#endif /* BUILD_ARC4 */
|
||||
/* ARC4 implementation has been removed */
|
||||
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && !defined(NO_CHAPOL_AEAD)
|
||||
|
@ -4746,7 +4746,9 @@ static int DecryptDo(WOLFSSL* ssl, byte* plain, const byte* input,
|
||||
{
|
||||
#ifndef NO_RC4
|
||||
case wolfssl_rc4:
|
||||
wc_Arc4Process(ssl->decrypt.arc4, plain, input, sz);
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
/* Copy input to output as fallback */
|
||||
XMEMCPY(plain, input, sz);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
12
src/ssl.c
12
src/ssl.c
@ -111,7 +111,7 @@
|
||||
#include <wolfssl/wolfcrypt/ecc.h>
|
||||
#include <wolfssl/wolfcrypt/md4.h>
|
||||
#include <wolfssl/wolfcrypt/md5.h>
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#include <wolfssl/wolfcrypt/curve25519.h>
|
||||
#include <wolfssl/wolfcrypt/ed25519.h>
|
||||
#include <wolfssl/wolfcrypt/curve448.h>
|
||||
@ -2601,7 +2601,7 @@ int wolfSSL_GetObjectSize(void)
|
||||
printf("sizeof suites = %lu\n", (unsigned long)sizeof(Suites));
|
||||
printf("sizeof ciphers(2) = %lu\n", (unsigned long)sizeof(Ciphers));
|
||||
#ifndef NO_RC4
|
||||
printf("\tsizeof arc4 = %lu\n", (unsigned long)sizeof(Arc4));
|
||||
printf("\tsizeof arc4 = %lu\n", (unsigned long)0); /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
printf("\tsizeof aes = %lu\n", (unsigned long)sizeof(Aes));
|
||||
#ifndef NO_DES3
|
||||
@ -26072,8 +26072,8 @@ int wolfSSL_RAND_load_file(const char* fname, long len)
|
||||
WOLFSSL_MSG("DES3 ECB");
|
||||
break;
|
||||
#endif
|
||||
case WC_ARC4_TYPE :
|
||||
WOLFSSL_MSG("ARC4");
|
||||
case WC_ARC4_TYPE : /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
break;
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
@ -26204,8 +26204,8 @@ int wolfSSL_RAND_load_file(const char* fname, long len)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case WC_ARC4_TYPE :
|
||||
WOLFSSL_MSG("ARC4");
|
||||
case WC_ARC4_TYPE : /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
break;
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
|
@ -3433,17 +3433,15 @@ size_t wolfSSL_CRYPTO_cts128_decrypt(const unsigned char *in,
|
||||
#ifdef OPENSSL_EXTRA
|
||||
|
||||
#ifndef NO_RC4
|
||||
/* Set the key state for Arc4 key.
|
||||
/* Set the key state for RC4 key (ARC4 implementation has been removed).
|
||||
*
|
||||
* @param [out] key Arc4 key.
|
||||
* @param [out] key RC4 key (ARC4 implementation has been removed).
|
||||
* @param [in] len Length of key in buffer.
|
||||
* @param [in] data Key data buffer.
|
||||
*/
|
||||
void wolfSSL_RC4_set_key(WOLFSSL_RC4_KEY* key, int len,
|
||||
const unsigned char* data)
|
||||
{
|
||||
wc_static_assert(sizeof(WOLFSSL_RC4_KEY) >= sizeof(Arc4));
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_RC4_set_key");
|
||||
|
||||
/* Validate parameters. */
|
||||
@ -3451,15 +3449,15 @@ void wolfSSL_RC4_set_key(WOLFSSL_RC4_KEY* key, int len,
|
||||
WOLFSSL_MSG("bad argument passed in");
|
||||
}
|
||||
else {
|
||||
/* Reset wolfCrypt Arc4 object. */
|
||||
/* Reset wolfCrypt RC4 object. */
|
||||
XMEMSET(key, 0, sizeof(WOLFSSL_RC4_KEY));
|
||||
/* Set key into wolfCrypt Arc4 object. */
|
||||
wc_Arc4SetKey((Arc4*)key, data, (word32)len);
|
||||
/* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Encrypt/decrypt with Arc4 key.
|
||||
/* Encrypt/decrypt with RC4 key (ARC4 implementation has been removed).
|
||||
*
|
||||
* @param [in] len Length of data to encrypt/decrypt.
|
||||
* @param [in] in Data to encrypt/decrypt.
|
||||
@ -3475,8 +3473,10 @@ void wolfSSL_RC4(WOLFSSL_RC4_KEY* key, size_t len, const unsigned char* in,
|
||||
WOLFSSL_MSG("Bad argument passed in");
|
||||
}
|
||||
else {
|
||||
/* Encrypt/decrypt data. */
|
||||
wc_Arc4Process((Arc4*)key, out, in, (word32)len);
|
||||
/* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
/* Copy input to output as a fallback */
|
||||
XMEMCPY(out, in, len);
|
||||
}
|
||||
}
|
||||
#endif /* NO_RC4 */
|
||||
|
@ -55,7 +55,7 @@ All options may be enabled with the following configure command line:
|
||||
To add some other cipher support to the sniffer, you can add options like:
|
||||
|
||||
```sh
|
||||
--enable-arc4
|
||||
/* ARC4 implementation has been removed */
|
||||
--enable-nullcipher
|
||||
--enable-des3
|
||||
```
|
||||
|
10
tests/api.c
10
tests/api.c
@ -123,7 +123,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef NO_RC4
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BLAKE2
|
||||
@ -308,7 +308,7 @@
|
||||
#include <tests/api/test_poly1305.h>
|
||||
#include <tests/api/test_chacha20_poly1305.h>
|
||||
#include <tests/api/test_camellia.h>
|
||||
#include <tests/api/test_arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#include <tests/api/test_rc2.h>
|
||||
#include <tests/api/test_aes.h>
|
||||
#include <tests/api/test_ascon.h>
|
||||
@ -63782,7 +63782,7 @@ static int test_wolfSSL_EVP_X_STATE_LEN(void)
|
||||
wolfSSL_EVP_CIPHER_CTX_init(ctx);
|
||||
ExpectIntEQ(EVP_CipherInit(ctx, init, key, iv, 1), WOLFSSL_SUCCESS);
|
||||
|
||||
ExpectIntEQ(wolfSSL_EVP_X_STATE_LEN(ctx), sizeof(Arc4));
|
||||
ExpectIntEQ(wolfSSL_EVP_X_STATE_LEN(ctx), 0) /* ARC4 implementation has been removed */;
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
#endif
|
||||
return EXPECT_RESULT();
|
||||
@ -89346,8 +89346,8 @@ TEST_CASE testCases[] = {
|
||||
TEST_DECL(test_wc_CamelliaEncryptDecryptDirect),
|
||||
TEST_DECL(test_wc_CamelliaCbcEncryptDecrypt),
|
||||
|
||||
TEST_DECL(test_wc_Arc4SetKey),
|
||||
TEST_DECL(test_wc_Arc4Process),
|
||||
/* ARC4 implementation has been removed */
|
||||
/* ARC4 implementation has been removed */
|
||||
|
||||
TEST_DECL(test_wc_Rc2SetKey),
|
||||
TEST_DECL(test_wc_Rc2SetIV),
|
||||
|
@ -24,7 +24,7 @@ tests_unit_test_SOURCES += tests/api/test_chacha.c
|
||||
tests_unit_test_SOURCES += tests/api/test_poly1305.c
|
||||
tests_unit_test_SOURCES += tests/api/test_chacha20_poly1305.c
|
||||
tests_unit_test_SOURCES += tests/api/test_camellia.c
|
||||
tests_unit_test_SOURCES += tests/api/test_arc4.c
|
||||
# ARC4 implementation has been removed
|
||||
tests_unit_test_SOURCES += tests/api/test_rc2.c
|
||||
tests_unit_test_SOURCES += tests/api/test_aes.c
|
||||
tests_unit_test_SOURCES += tests/api/test_ascon.c
|
||||
@ -59,7 +59,7 @@ EXTRA_DIST += tests/api/test_chacha.h
|
||||
EXTRA_DIST += tests/api/test_poly1305.h
|
||||
EXTRA_DIST += tests/api/test_chacha20_poly1305.h
|
||||
EXTRA_DIST += tests/api/test_camellia.h
|
||||
EXTRA_DIST += tests/api/test_arc4.h
|
||||
# ARC4 implementation has been removed
|
||||
EXTRA_DIST += tests/api/test_rc2.h
|
||||
EXTRA_DIST += tests/api/test_aes.h
|
||||
EXTRA_DIST += tests/api/test_ascon.h
|
||||
|
@ -1,114 +0,0 @@
|
||||
/* test_arc4.c
|
||||
*
|
||||
* Copyright (C) 2006-2025 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H)
|
||||
#include <wolfssl/options.h>
|
||||
#endif
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
|
||||
#ifdef NO_INLINE
|
||||
#include <wolfssl/wolfcrypt/misc.h>
|
||||
#else
|
||||
#define WOLFSSL_MISC_INCLUDED
|
||||
#include <wolfcrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
#include <tests/unit.h>
|
||||
#include <tests/api/api.h>
|
||||
#include <tests/api/test_arc4.h>
|
||||
|
||||
/*
|
||||
* Testing wc_Arc4SetKey()
|
||||
*/
|
||||
int test_wc_Arc4SetKey(void)
|
||||
{
|
||||
EXPECT_DECLS;
|
||||
#ifndef NO_RC4
|
||||
Arc4 arc;
|
||||
const char* key = "\x01\x23\x45\x67\x89\xab\xcd\xef";
|
||||
int keyLen = 8;
|
||||
|
||||
ExpectIntEQ(wc_Arc4SetKey(&arc, (byte*)key, (word32)keyLen), 0);
|
||||
/* Test bad args. */
|
||||
ExpectIntEQ(wc_Arc4SetKey(NULL, (byte*)key, (word32)keyLen),
|
||||
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||
ExpectIntEQ(wc_Arc4SetKey(&arc, NULL , (word32)keyLen),
|
||||
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||
ExpectIntEQ(wc_Arc4SetKey(&arc, (byte*)key, 0 ),
|
||||
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||
#endif
|
||||
return EXPECT_RESULT();
|
||||
|
||||
} /* END test_wc_Arc4SetKey */
|
||||
|
||||
/*
|
||||
* Testing wc_Arc4Process for ENC/DEC.
|
||||
*/
|
||||
int test_wc_Arc4Process(void)
|
||||
{
|
||||
EXPECT_DECLS;
|
||||
#ifndef NO_RC4
|
||||
Arc4 enc;
|
||||
Arc4 dec;
|
||||
const char* key = "\x01\x23\x45\x67\x89\xab\xcd\xef";
|
||||
int keyLen = 8;
|
||||
const char* input = "\x01\x23\x45\x67\x89\xab\xcd\xef";
|
||||
byte cipher[8];
|
||||
byte plain[8];
|
||||
|
||||
/* Init stack variables */
|
||||
XMEMSET(&enc, 0, sizeof(Arc4));
|
||||
XMEMSET(&dec, 0, sizeof(Arc4));
|
||||
XMEMSET(cipher, 0, sizeof(cipher));
|
||||
XMEMSET(plain, 0, sizeof(plain));
|
||||
|
||||
/* Use for async. */
|
||||
ExpectIntEQ(wc_Arc4Init(&enc, NULL, INVALID_DEVID), 0);
|
||||
ExpectIntEQ(wc_Arc4Init(&dec, NULL, INVALID_DEVID), 0);
|
||||
|
||||
ExpectIntEQ(wc_Arc4SetKey(&enc, (byte*)key, (word32)keyLen), 0);
|
||||
ExpectIntEQ(wc_Arc4SetKey(&dec, (byte*)key, (word32)keyLen), 0);
|
||||
|
||||
ExpectIntEQ(wc_Arc4Process(&enc, cipher, (byte*)input, (word32)keyLen), 0);
|
||||
ExpectIntEQ(wc_Arc4Process(&dec, plain, cipher, (word32)keyLen), 0);
|
||||
ExpectIntEQ(XMEMCMP(plain, input, keyLen), 0);
|
||||
|
||||
/* Bad args. */
|
||||
ExpectIntEQ(wc_Arc4Process(NULL, plain, cipher, (word32)keyLen),
|
||||
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||
ExpectIntEQ(wc_Arc4Process(&dec, NULL, cipher, (word32)keyLen),
|
||||
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||
ExpectIntEQ(wc_Arc4Process(&dec, plain, NULL, (word32)keyLen),
|
||||
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||
|
||||
wc_Arc4Free(&enc);
|
||||
wc_Arc4Free(&dec);
|
||||
#endif
|
||||
return EXPECT_RESULT();
|
||||
|
||||
} /* END test_wc_Arc4Process */
|
||||
|
@ -1,28 +0,0 @@
|
||||
/* test_arc4.h
|
||||
*
|
||||
* Copyright (C) 2006-2025 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
#ifndef WOLFCRYPT_TEST_ARC4_H
|
||||
#define WOLFCRYPT_TEST_ARC4_H
|
||||
|
||||
int test_wc_Arc4SetKey(void);
|
||||
int test_wc_Arc4Process(void);
|
||||
|
||||
#endif /* WOLFCRYPT_TEST_ARC4_H */
|
@ -11,7 +11,7 @@ Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))";
|
||||
/* WOLFSSL sources */
|
||||
var wolfSSLObjList = [
|
||||
"wolfcrypt/src/aes.c",
|
||||
"wolfcrypt/src/arc4.c",
|
||||
/* ARC4 implementation has been removed */
|
||||
"wolfcrypt/src/asm.c",
|
||||
"wolfcrypt/src/asn.c",
|
||||
"wolfcrypt/src/blake2b.c",
|
||||
|
@ -36,7 +36,7 @@ benchmark
|
||||
Measure RSA <key size> performance.
|
||||
-<alg> Algorithm to benchmark. Available algorithms include:
|
||||
cipher aes-cbc aes-gcm aes-ecb aes-xts aes-cfb aes-ctr aes-ccm
|
||||
camellia arc4 chacha20 chacha20-poly1305 des
|
||||
camellia chacha20 /* ARC4 implementation has been removed */ chacha20-poly1305 des
|
||||
digest md5 poly1305 sha sha2 sha224 sha256 sha384 sha512 sha3
|
||||
sha3-224 sha3-256 sha3-384 sha3-512 ripemd
|
||||
mac cmac hmac hmac-md5 hmac-sha hmac-sha224 hmac-sha256
|
||||
|
@ -137,7 +137,7 @@
|
||||
#include <wolfssl/wolfcrypt/des3.h>
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifndef NO_HMAC
|
||||
#include <wolfssl/wolfcrypt/hmac.h>
|
||||
@ -639,7 +639,7 @@
|
||||
#define BENCH_AES_CTR 0x00000010
|
||||
#define BENCH_AES_CCM 0x00000020
|
||||
#define BENCH_CAMELLIA 0x00000100
|
||||
#define BENCH_ARC4 0x00000200
|
||||
#define BENCH_ARC4_REMOVED 0x00000200 /* ARC4 implementation has been removed */
|
||||
#define BENCH_CHACHA20 0x00001000
|
||||
#define BENCH_CHACHA20_POLY1305 0x00002000
|
||||
#define BENCH_DES 0x00004000
|
||||
@ -866,7 +866,7 @@ static const bench_alg bench_cipher_opt[] = {
|
||||
{ "-camellia", BENCH_CAMELLIA },
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
{ "-arc4", BENCH_ARC4 },
|
||||
{ "-arc4", BENCH_ARC4_REMOVED }, /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifdef HAVE_CHACHA
|
||||
{ "-chacha20", BENCH_CHACHA20 },
|
||||
@ -3333,12 +3333,12 @@ static void* benchmarks_do(void* args)
|
||||
bench_sm4_ccm();
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
if (bench_all || (bench_cipher_algs & BENCH_ARC4)) {
|
||||
if (bench_all || (bench_cipher_algs if (bench_all || (bench_cipher_algs & BENCH_ARC4_REMOVED)) { BENCH_ARC4_REMOVED)) { /* ARC4 implementation has been removed */
|
||||
#ifndef NO_SW_BENCH
|
||||
bench_arc4(0);
|
||||
/* ARC4 implementation has been removed */;
|
||||
#endif
|
||||
#ifdef BENCH_DEVID
|
||||
bench_arc4(1);
|
||||
/* ARC4 implementation has been removed */;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@ -5962,28 +5962,34 @@ exit:
|
||||
|
||||
|
||||
#ifndef NO_RC4
|
||||
void bench_arc4(int useDeviceID)
|
||||
void bench_arc4(int useDeviceID) /* ARC4 implementation has been removed */
|
||||
{
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
return;
|
||||
}
|
||||
{
|
||||
int ret = 0, i, count = 0, times, pending = 0;
|
||||
WC_DECLARE_ARRAY(enc, Arc4, BENCH_MAX_PENDING,
|
||||
sizeof(Arc4), HEAP_HINT);
|
||||
/* ARC4 implementation has been removed */
|
||||
WC_DECLARE_ARRAY(enc, char, BENCH_MAX_PENDING,
|
||||
128, HEAP_HINT); /* Placeholder for RC4 key */
|
||||
double start;
|
||||
DECLARE_MULTI_VALUE_STATS_VARS()
|
||||
|
||||
WC_CALLOC_ARRAY(enc, Arc4, BENCH_MAX_PENDING,
|
||||
sizeof(Arc4), HEAP_HINT);
|
||||
/* ARC4 implementation has been removed */
|
||||
WC_CALLOC_ARRAY(enc, char, BENCH_MAX_PENDING,
|
||||
128, HEAP_HINT); /* Placeholder for RC4 key */
|
||||
|
||||
/* init keys */
|
||||
for (i = 0; i < BENCH_MAX_PENDING; i++) {
|
||||
if ((ret = wc_Arc4Init(enc[i], HEAP_HINT,
|
||||
if ((ret = /* ARC4 implementation has been removed */
|
||||
useDeviceID ? devId : INVALID_DEVID)) != 0) {
|
||||
printf("Arc4Init failed, ret = %d\n", ret);
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = wc_Arc4SetKey(enc[i], bench_key, 16);
|
||||
/* ARC4 implementation has been removed */
|
||||
if (ret != 0) {
|
||||
printf("Arc4SetKey failed, ret = %d\n", ret);
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@ -5997,11 +6003,11 @@ void bench_arc4(int useDeviceID)
|
||||
for (i = 0; i < BENCH_MAX_PENDING; i++) {
|
||||
if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(enc[i]), 0,
|
||||
×, numBlocks, &pending)) {
|
||||
ret = wc_Arc4Process(enc[i], bench_cipher, bench_plain,
|
||||
/* ARC4 implementation has been removed */
|
||||
bench_size);
|
||||
if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(enc[i]),
|
||||
0, ×, &pending)) {
|
||||
goto exit_arc4;
|
||||
goto exit_arc4; /* ARC4 implementation has been removed */
|
||||
}
|
||||
}
|
||||
} /* for i */
|
||||
@ -6014,8 +6020,8 @@ void bench_arc4(int useDeviceID)
|
||||
#endif
|
||||
);
|
||||
|
||||
exit_arc4:
|
||||
bench_stats_sym_finish("ARC4", useDeviceID, count, bench_size, start, ret);
|
||||
exit_arc4: /* ARC4 implementation has been removed */
|
||||
bench_stats_sym_finish("ARC4", useDeviceID, count, bench_size, start, ret); /* ARC4 implementation has been removed */
|
||||
#ifdef MULTI_VALUE_STATISTICS
|
||||
bench_multi_value_stats(max, min, sum, squareSum, runs);
|
||||
#endif
|
||||
@ -6024,7 +6030,7 @@ exit:
|
||||
|
||||
if (WC_ARRAY_OK(enc)) {
|
||||
for (i = 0; i < BENCH_MAX_PENDING; i++) {
|
||||
wc_Arc4Free(enc[i]);
|
||||
/* ARC4 implementation has been removed */
|
||||
}
|
||||
WC_FREE_ARRAY(enc, BENCH_MAX_PENDING, HEAP_HINT);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ int benchmark_free(void);
|
||||
void benchmark_configure(word32 block_size);
|
||||
|
||||
void bench_des(int useDeviceID);
|
||||
void bench_arc4(int useDeviceID);
|
||||
void bench_arc4(int useDeviceID); /* ARC4 implementation has been removed */
|
||||
void bench_chacha(void);
|
||||
void bench_chacha20_poly1305_aead(void);
|
||||
void bench_aescbc(int useDeviceID);
|
||||
|
@ -1,149 +0,0 @@
|
||||
/* arc4.c
|
||||
*
|
||||
* Copyright (C) 2006-2025 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
|
||||
#ifndef NO_RC4
|
||||
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
|
||||
|
||||
int wc_Arc4SetKey(Arc4* arc4, const byte* key, word32 length)
|
||||
{
|
||||
int ret = 0;
|
||||
word32 i;
|
||||
word32 keyIndex = 0, stateIndex = 0;
|
||||
|
||||
if (arc4 == NULL || key == NULL || length == 0) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_ARC4) && \
|
||||
defined(HAVE_CAVIUM) && !defined(HAVE_CAVIUM_V)
|
||||
if (arc4->asyncDev.marker == WOLFSSL_ASYNC_MARKER_ARC4) {
|
||||
return NitroxArc4SetKey(arc4, key, length);
|
||||
}
|
||||
#endif
|
||||
|
||||
arc4->x = 1;
|
||||
arc4->y = 0;
|
||||
|
||||
for (i = 0; i < ARC4_STATE_SIZE; i++)
|
||||
arc4->state[i] = (byte)i;
|
||||
|
||||
for (i = 0; i < ARC4_STATE_SIZE; i++) {
|
||||
word32 a = arc4->state[i];
|
||||
stateIndex += key[keyIndex] + a;
|
||||
stateIndex &= 0xFF;
|
||||
arc4->state[i] = arc4->state[stateIndex];
|
||||
arc4->state[stateIndex] = (byte)a;
|
||||
|
||||
if (++keyIndex >= length)
|
||||
keyIndex = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static WC_INLINE byte MakeByte(word32* x, word32* y, byte* s)
|
||||
{
|
||||
word32 a = s[*x], b;
|
||||
*y = (*y+a) & 0xff;
|
||||
|
||||
b = s[*y];
|
||||
s[*x] = (byte)b;
|
||||
s[*y] = (byte)a;
|
||||
*x = (*x+1) & 0xff;
|
||||
|
||||
return s[(a+b) & 0xff];
|
||||
}
|
||||
|
||||
|
||||
int wc_Arc4Process(Arc4* arc4, byte* out, const byte* in, word32 length)
|
||||
{
|
||||
int ret = 0;
|
||||
word32 x;
|
||||
word32 y;
|
||||
|
||||
if (arc4 == NULL || out == NULL || in == NULL) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_ARC4) && \
|
||||
defined(HAVE_CAVIUM) && !defined(HAVE_CAVIUM_V)
|
||||
if (arc4->asyncDev.marker == WOLFSSL_ASYNC_MARKER_ARC4) {
|
||||
return NitroxArc4Process(arc4, out, in, length);
|
||||
}
|
||||
#endif
|
||||
|
||||
x = arc4->x;
|
||||
y = arc4->y;
|
||||
|
||||
while(length--)
|
||||
*out++ = *in++ ^ MakeByte(&x, &y, arc4->state);
|
||||
|
||||
arc4->x = (byte)x;
|
||||
arc4->y = (byte)y;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Initialize Arc4 for use with async device */
|
||||
int wc_Arc4Init(Arc4* arc4, void* heap, int devId)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (arc4 == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
arc4->heap = heap;
|
||||
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_ARC4)
|
||||
ret = wolfAsync_DevCtxInit(&arc4->asyncDev, WOLFSSL_ASYNC_MARKER_ARC4,
|
||||
arc4->heap, devId);
|
||||
#else
|
||||
(void)devId;
|
||||
#endif /* WOLFSSL_ASYNC_CRYPT */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Free Arc4 from use with async device */
|
||||
void wc_Arc4Free(Arc4* arc4)
|
||||
{
|
||||
if (arc4 == NULL)
|
||||
return;
|
||||
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_ARC4)
|
||||
wolfAsync_DevCtxFree(&arc4->asyncDev, WOLFSSL_ASYNC_MARKER_ARC4);
|
||||
#endif /* WOLFSSL_ASYNC_CRYPT */
|
||||
}
|
||||
|
||||
#endif /* NO_RC4 */
|
||||
|
@ -140,7 +140,7 @@ ASN Options:
|
||||
#endif
|
||||
|
||||
#ifndef NO_RC4
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
|
||||
|
@ -255,7 +255,7 @@ static const struct s_ent {
|
||||
#endif
|
||||
|
||||
#ifndef NO_RC4
|
||||
static const char EVP_ARC4[] = "ARC4";
|
||||
static const char EVP_ARC4[] = "ARC4"; /* ARC4 implementation has been removed */ /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
@ -400,7 +400,7 @@ int wolfSSL_EVP_Cipher_key_length(const WOLFSSL_EVP_CIPHER* c)
|
||||
case WC_DES_EDE3_ECB_TYPE: return 24;
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
case WC_ARC4_TYPE: return 16;
|
||||
case WC_ARC4_TYPE: /* ARC4 implementation has been removed */ return 16;
|
||||
#endif
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
case WC_CHACHA20_POLY1305_TYPE: return 32;
|
||||
@ -707,8 +707,9 @@ static int evpCipherBlock(WOLFSSL_EVP_CIPHER_CTX *ctx,
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
case WC_ARC4_TYPE:
|
||||
wc_Arc4Process(&ctx->cipher.arc4, out, in, inl);
|
||||
case WC_ARC4_TYPE: /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
XMEMCPY(out, in, inl);
|
||||
break;
|
||||
#endif
|
||||
#if defined(WOLFSSL_SM4_ECB)
|
||||
@ -2016,8 +2017,8 @@ static unsigned int cipherType(const WOLFSSL_EVP_CIPHER *cipher)
|
||||
#endif /* HAVE_ARIA */
|
||||
|
||||
#ifndef NO_RC4
|
||||
else if (EVP_CIPHER_TYPE_MATCHES(cipher, EVP_ARC4))
|
||||
return WC_ARC4_TYPE;
|
||||
else if (EVP_CIPHER_TYPE_MATCHES(cipher, EVP_ARC4)) /* ARC4 implementation has been removed */
|
||||
return WC_ARC4_TYPE; /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
@ -2118,7 +2119,7 @@ int wolfSSL_EVP_CIPHER_block_size(const WOLFSSL_EVP_CIPHER *cipher)
|
||||
#endif /* NO_AES */
|
||||
|
||||
#ifndef NO_RC4
|
||||
case WC_ARC4_TYPE:
|
||||
case WC_ARC4_TYPE: /* ARC4 implementation has been removed */
|
||||
return 1;
|
||||
#endif
|
||||
#if defined(HAVE_ARIA)
|
||||
@ -2246,7 +2247,7 @@ unsigned long WOLFSSL_CIPHER_mode(const WOLFSSL_EVP_CIPHER *cipher)
|
||||
return WOLFSSL_EVP_CIPH_ECB_MODE;
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
case WC_ARC4_TYPE:
|
||||
case WC_ARC4_TYPE: /* ARC4 implementation has been removed */
|
||||
return WOLFSSL_EVP_CIPH_STREAM_CIPHER;
|
||||
#endif
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
@ -5096,7 +5097,7 @@ static const struct cipher{
|
||||
#endif
|
||||
|
||||
#ifndef NO_RC4
|
||||
{WC_ARC4_TYPE, EVP_ARC4, WC_NID_undef},
|
||||
{WC_ARC4_TYPE, EVP_ARC4, WC_NID_undef}, /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
@ -5256,7 +5257,7 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbyname(const char *name)
|
||||
{EVP_SM4_CCM, "sm4-ccm"},
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
{EVP_ARC4, "RC4"},
|
||||
{EVP_ARC4, "RC4"}, /* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
{EVP_CHACHA20_POLY1305, "chacha20-poly1305"},
|
||||
@ -5913,7 +5914,7 @@ void wolfSSL_EVP_init(void)
|
||||
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc4(void)
|
||||
{
|
||||
WOLFSSL_ENTER("wolfSSL_EVP_rc4");
|
||||
return EVP_ARC4;
|
||||
return EVP_ARC4; /* ARC4 implementation has been removed */
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -8025,17 +8026,17 @@ void wolfSSL_EVP_init(void)
|
||||
}
|
||||
#endif /* NO_DES3 */
|
||||
#ifndef NO_RC4
|
||||
if (ctx->cipherType == WC_ARC4_TYPE ||
|
||||
(type && EVP_CIPHER_TYPE_MATCHES(type, EVP_ARC4))) {
|
||||
WOLFSSL_MSG("ARC4");
|
||||
ctx->cipherType = WC_ARC4_TYPE;
|
||||
if (ctx->cipherType == WC_ARC4_TYPE || /* ARC4 implementation has been removed */
|
||||
(type (type && EVP_CIPHER_TYPE_MATCHES(type, EVP_ARC4))) {(type && EVP_CIPHER_TYPE_MATCHES(type, EVP_ARC4))) { EVP_CIPHER_TYPE_MATCHES(type, EVP_ARC4))) { /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
ctx->cipherType = WC_ARC4_TYPE; /* ARC4 implementation has been removed */
|
||||
ctx->flags &= (unsigned long)~WOLFSSL_EVP_CIPH_MODE;
|
||||
ctx->flags |= WOLFSSL_EVP_CIPH_STREAM_CIPHER;
|
||||
ctx->block_size = 1;
|
||||
if (ctx->keyLen == 0) /* user may have already set */
|
||||
ctx->keyLen = 16; /* default to 128 */
|
||||
if (key)
|
||||
wc_Arc4SetKey(&ctx->cipher.arc4, key, (word32)ctx->keyLen);
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
}
|
||||
#endif /* NO_RC4 */
|
||||
if (ctx->cipherType == WC_NULL_CIPHER_TYPE ||
|
||||
@ -8133,7 +8134,7 @@ void wolfSSL_EVP_init(void)
|
||||
return WC_NID_des_ede3_ecb;
|
||||
#endif
|
||||
|
||||
case WC_ARC4_TYPE :
|
||||
case WC_ARC4_TYPE : /* ARC4 implementation has been removed */
|
||||
return WC_NID_rc4;
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
@ -8499,9 +8500,10 @@ void wolfSSL_EVP_init(void)
|
||||
#endif /* !NO_DES3 */
|
||||
|
||||
#ifndef NO_RC4
|
||||
case WC_ARC4_TYPE :
|
||||
WOLFSSL_MSG("ARC4");
|
||||
wc_Arc4Process(&ctx->cipher.arc4, dst, src, len);
|
||||
case WC_ARC4_TYPE : /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
XMEMCPY(dst, src, len);
|
||||
if (ret == 0)
|
||||
ret = (int)len;
|
||||
break;
|
||||
@ -9327,9 +9329,9 @@ void* wolfSSL_EVP_X_STATE(const WOLFSSL_EVP_CIPHER_CTX* ctx)
|
||||
|
||||
if (ctx) {
|
||||
switch (ctx->cipherType) {
|
||||
case WC_ARC4_TYPE:
|
||||
WOLFSSL_MSG("returning arc4 state");
|
||||
return (void*)&ctx->cipher.arc4.x;
|
||||
case WC_ARC4_TYPE: /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("returning arc4 state (ARC4 implementation has been removed)");
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed"); return NULL;
|
||||
|
||||
default:
|
||||
WOLFSSL_MSG("bad x state type");
|
||||
@ -9464,8 +9466,8 @@ int wolfSSL_EVP_CIPHER_CTX_iv_length(const WOLFSSL_EVP_CIPHER_CTX* ctx)
|
||||
return DES_BLOCK_SIZE;
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
case WC_ARC4_TYPE :
|
||||
WOLFSSL_MSG("ARC4");
|
||||
case WC_ARC4_TYPE : /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
return 0;
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_CFB
|
||||
@ -9691,9 +9693,9 @@ int wolfSSL_EVP_X_STATE_LEN(const WOLFSSL_EVP_CIPHER_CTX* ctx)
|
||||
|
||||
if (ctx) {
|
||||
switch (ctx->cipherType) {
|
||||
case WC_ARC4_TYPE:
|
||||
WOLFSSL_MSG("returning arc4 state size");
|
||||
return sizeof(Arc4);
|
||||
case WC_ARC4_TYPE: /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("returning arc4 state size (ARC4 implementation has been removed)");
|
||||
return 128; /* Placeholder size for RC4 key - arc4 implementation removed */
|
||||
|
||||
default:
|
||||
WOLFSSL_MSG("bad x state type");
|
||||
|
@ -51,7 +51,7 @@ int caamParseCCBError(unsigned int error)
|
||||
break;
|
||||
|
||||
case 3:
|
||||
WOLFSSL_MSG("\tCHAID: AFHA (ARC4)");
|
||||
WOLFSSL_MSG("\tCHAID: AFHA (ARC4 implementation has been removed)");
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
@ -3378,7 +3378,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
|
||||
#ifdef INTIMEVER
|
||||
/* If INTIMEVER exists then it is INTIME RTOS v6 or later */
|
||||
#define INTIME_RAND_FUNC arc4random
|
||||
#define INTIME_RAND_FUNC random
|
||||
len = 4;
|
||||
#else
|
||||
/* v5 and older */
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <wolfssl/wolfcrypt/des3.h>
|
||||
#include <wolfssl/wolfcrypt/hash.h>
|
||||
#include <wolfssl/wolfcrypt/rc2.h>
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#include <wolfssl/wolfcrypt/wc_encrypt.h>
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
#include <wolfssl/wolfcrypt/asn.h>
|
||||
@ -631,10 +631,10 @@ int wc_CryptKey(const char* password, int passwordSz, byte* salt,
|
||||
#if !defined(NO_RC4) && !defined(NO_SHA)
|
||||
case PBE_SHA1_RC4_128:
|
||||
{
|
||||
Arc4 dec;
|
||||
char dec[128]; /* Placeholder for RC4 key - arc4 implementation removed */
|
||||
|
||||
wc_Arc4SetKey(&dec, key, derivedLen);
|
||||
wc_Arc4Process(&dec, input, input, (word32)length);
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed"); /* RC4 API maintained */
|
||||
XMEMCPY(input, input, (word32)length); /* ARC4 implementation has been removed */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
@ -270,7 +270,7 @@ const byte const_byte_array[] = "A+Gd\0\0\0";
|
||||
#include <wolfssl/wolfcrypt/sha512.h>
|
||||
#include <wolfssl/wolfcrypt/hash.h>
|
||||
#include <wolfssl/wolfcrypt/rc2.h>
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#if !defined(WC_NO_RNG)
|
||||
#include <wolfssl/wolfcrypt/random.h>
|
||||
#endif
|
||||
@ -577,7 +577,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hpke_test(void);
|
||||
#ifdef WC_SRTP_KDF
|
||||
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t srtpkdf_test(void);
|
||||
#endif
|
||||
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t arc4_test(void);
|
||||
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t arc4_test(void); /* ARC4 implementation has been removed */
|
||||
#ifdef WC_RC2
|
||||
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t rc2_test(void);
|
||||
#endif
|
||||
@ -1927,10 +1927,10 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\
|
||||
#endif
|
||||
|
||||
#ifndef NO_RC4
|
||||
if ( (ret = arc4_test()) != 0)
|
||||
TEST_FAIL("ARC4 test failed!\n", ret);
|
||||
if ( (ret = arc4_test()) != 0) /* ARC4 implementation has been removed */
|
||||
TEST_FAIL("ARC4 test failed (ARC4 implementation has been removed)!\n", ret);
|
||||
else
|
||||
TEST_PASS("ARC4 test passed!\n");
|
||||
TEST_PASS("ARC4 test passed (ARC4 implementation has been removed)!\n");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHACHA
|
||||
@ -7597,247 +7597,14 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t rc2_test(void)
|
||||
|
||||
|
||||
#ifndef NO_RC4
|
||||
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t arc4_test(void)
|
||||
#ifndef NO_RC4
|
||||
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t arc4_test(void) /* ARC4 implementation has been removed */
|
||||
{
|
||||
byte cipher[16];
|
||||
byte plain[16];
|
||||
wc_test_ret_t ret;
|
||||
|
||||
const char* keys[] =
|
||||
{
|
||||
"\x01\x23\x45\x67\x89\xab\xcd\xef",
|
||||
"\x01\x23\x45\x67\x89\xab\xcd\xef",
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00",
|
||||
"\xef\x01\x23\x45"
|
||||
};
|
||||
|
||||
testVector a, b, c, d;
|
||||
testVector test_arc4[4];
|
||||
|
||||
int times = sizeof(test_arc4) / sizeof(testVector), i;
|
||||
WOLFSSL_ENTER("arc4_test");
|
||||
|
||||
a.input = "\x01\x23\x45\x67\x89\xab\xcd\xef";
|
||||
a.output = "\x75\xb7\x87\x80\x99\xe0\xc5\x96";
|
||||
a.inLen = 8;
|
||||
a.outLen = 8;
|
||||
|
||||
b.input = "\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
b.output = "\x74\x94\xc2\xe7\x10\x4b\x08\x79";
|
||||
b.inLen = 8;
|
||||
b.outLen = 8;
|
||||
|
||||
c.input = "\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
c.output = "\xde\x18\x89\x41\xa3\x37\x5d\x3a";
|
||||
c.inLen = 8;
|
||||
c.outLen = 8;
|
||||
|
||||
d.input = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
d.output = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf\xbd\x61";
|
||||
d.inLen = 10;
|
||||
d.outLen = 10;
|
||||
|
||||
test_arc4[0] = a;
|
||||
test_arc4[1] = b;
|
||||
test_arc4[2] = c;
|
||||
test_arc4[3] = d;
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
Arc4 enc;
|
||||
Arc4 dec;
|
||||
int keylen = 8; /* XSTRLEN with key 0x00 not good */
|
||||
if (i == 3)
|
||||
keylen = 4;
|
||||
|
||||
ret = wc_Arc4Init(&enc, HEAP_HINT, devId);
|
||||
if (ret != 0)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
ret = wc_Arc4Init(&dec, HEAP_HINT, devId);
|
||||
if (ret != 0)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
|
||||
ret = wc_Arc4SetKey(&enc, (byte*)keys[i], (word32)keylen);
|
||||
if (ret != 0)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
ret = wc_Arc4SetKey(&dec, (byte*)keys[i], (word32)keylen);
|
||||
if (ret != 0)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
|
||||
ret = wc_Arc4Process(&enc, cipher, (byte*)test_arc4[i].input,
|
||||
(word32)test_arc4[i].outLen);
|
||||
if (ret != 0)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
ret = wc_Arc4Process(&dec, plain, cipher, (word32)test_arc4[i].outLen);
|
||||
if (ret != 0)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
|
||||
if (XMEMCMP(plain, test_arc4[i].input, test_arc4[i].outLen))
|
||||
return WC_TEST_RET_ENC_I(i);
|
||||
|
||||
if (XMEMCMP(cipher, test_arc4[i].output, test_arc4[i].outLen))
|
||||
return WC_TEST_RET_ENC_I(i);
|
||||
|
||||
wc_Arc4Free(&enc);
|
||||
wc_Arc4Free(&dec);
|
||||
}
|
||||
|
||||
WOLFSSL_ENTER("arc4_test"); /* ARC4 implementation has been removed */
|
||||
WOLFSSL_MSG("ARC4 implementation has been removed");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHACHA
|
||||
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t chacha_test(void)
|
||||
{
|
||||
ChaCha enc;
|
||||
ChaCha dec;
|
||||
byte cipher[128];
|
||||
byte plain[128];
|
||||
byte sliver[64];
|
||||
byte input[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
word32 keySz = 32;
|
||||
wc_test_ret_t ret = 0;
|
||||
int i;
|
||||
int times = 4;
|
||||
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte key1[] =
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte key2[] =
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
|
||||
};
|
||||
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte key3[] =
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/* 128 bit key */
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte key4[] =
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte ivs1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte ivs2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte ivs3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00};
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte ivs4[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
|
||||
#ifndef BENCH_EMBEDDED
|
||||
WOLFSSL_SMALL_STACK_STATIC const byte cipher_big_result[] = {
|
||||
0x06, 0xa6, 0x5d, 0x31, 0x21, 0x6c, 0xdb, 0x37, 0x48, 0x7c, 0x01, 0x9d,
|
||||
0x72, 0xdf, 0x0a, 0x5b, 0x64, 0x74, 0x20, 0xba, 0x9e, 0xe0, 0x26, 0x7a,
|
||||
0xbf, 0xdf, 0x83, 0x34, 0x3b, 0x4f, 0x94, 0x3f, 0x37, 0x89, 0xaf, 0x00,
|
||||
0xdf, 0x0f, 0x2e, 0x75, 0x16, 0x41, 0xf6, 0x7a, 0x86, 0x94, 0x9d, 0x32,
|
||||
0x56, 0xf0, 0x79, 0x71, 0x68, 0x6f, 0xa6, 0x6b, 0xc6, 0x59, 0x49, 0xf6,
|
||||
0x10, 0x34, 0x03, 0x03, 0x16, 0x53, 0x9a, 0x98, 0x2a, 0x46, 0xde, 0x17,
|
||||
0x06, 0x65, 0x70, 0xca, 0x0a, 0x1f, 0xab, 0x80, 0x26, 0x96, 0x3f, 0x3e,
|
||||
0x7a, 0x3c, 0xa8, 0x87, 0xbb, 0x65, 0xdd, 0x5e, 0x07, 0x7b, 0x34, 0xe0,
|
||||
0x56, 0xda, 0x32, 0x13, 0x30, 0xc9, 0x0c, 0xd7, 0xba, 0xe4, 0x1f, 0xa6,
|
||||
0x91, 0x4f, 0x72, 0x9f, 0xd9, 0x5c, 0x62, 0x7d, 0xa6, 0xc2, 0xbc, 0x87,
|
||||
0xae, 0x64, 0x11, 0x94, 0x3b, 0xbc, 0x6c, 0x23, 0xbd, 0x7d, 0x00, 0xb4,
|
||||
0x99, 0xf2, 0x68, 0xb5, 0x59, 0x70, 0x93, 0xad, 0x69, 0xd0, 0xb1, 0x28,
|
||||
0x70, 0x92, 0xeb, 0xec, 0x39, 0x80, 0x82, 0xde, 0x44, 0xe2, 0x8a, 0x26,
|
||||
0xb3, 0xe9, 0x45, 0xcf, 0x83, 0x76, 0x9f, 0x6a, 0xa0, 0x46, 0x4a, 0x3d,
|
||||
0x26, 0x56, 0xaf, 0x49, 0x41, 0x26, 0x1b, 0x6a, 0x41, 0x37, 0x65, 0x91,
|
||||
0x72, 0xc4, 0xe7, 0x3c, 0x17, 0x31, 0xae, 0x2e, 0x2b, 0x31, 0x45, 0xe4,
|
||||
0x93, 0xd3, 0x10, 0xaa, 0xc5, 0x62, 0xd5, 0x11, 0x4b, 0x57, 0x1d, 0xad,
|
||||
0x48, 0x06, 0xd0, 0x0d, 0x98, 0xa5, 0xc6, 0x5b, 0xd0, 0x9e, 0x22, 0xc0,
|
||||
0x00, 0x32, 0x5a, 0xf5, 0x1c, 0x89, 0x6d, 0x54, 0x97, 0x55, 0x6b, 0x46,
|
||||
0xc5, 0xc7, 0xc4, 0x48, 0x9c, 0xbf, 0x47, 0xdc, 0x03, 0xc4, 0x1b, 0xcb,
|
||||
0x65, 0xa6, 0x91, 0x9d, 0x6d, 0xf1, 0xb0, 0x7a, 0x4d, 0x3b, 0x03, 0x95,
|
||||
0xf4, 0x8b, 0x0b, 0xae, 0x39, 0xff, 0x3f, 0xf6, 0xc0, 0x14, 0x18, 0x8a,
|
||||
0xe5, 0x19, 0xbd, 0xc1, 0xb4, 0x05, 0x4e, 0x29, 0x2f, 0x0b, 0x33, 0x76,
|
||||
0x28, 0x16, 0xa4, 0xa6, 0x93, 0x04, 0xb5, 0x55, 0x6b, 0x89, 0x3d, 0xa5,
|
||||
0x0f, 0xd3, 0xad, 0xfa, 0xd9, 0xfd, 0x05, 0x5d, 0x48, 0x94, 0x25, 0x5a,
|
||||
0x2c, 0x9a, 0x94, 0x80, 0xb0, 0xe7, 0xcb, 0x4d, 0x77, 0xbf, 0xca, 0xd8,
|
||||
0x55, 0x48, 0xbd, 0x66, 0xb1, 0x85, 0x81, 0xb1, 0x37, 0x79, 0xab, 0x52,
|
||||
0x08, 0x14, 0x12, 0xac, 0xcd, 0x45, 0x4d, 0x53, 0x6b, 0xca, 0x96, 0xc7,
|
||||
0x3b, 0x2f, 0x73, 0xb1, 0x5a, 0x23, 0xbd, 0x65, 0xd5, 0xea, 0x17, 0xb3,
|
||||
0xdc, 0xa1, 0x17, 0x1b, 0x2d, 0xb3, 0x9c, 0xd0, 0xdb, 0x41, 0x77, 0xef,
|
||||
0x93, 0x20, 0x52, 0x3e, 0x9d, 0xf5, 0xbf, 0x33, 0xf7, 0x52, 0xc1, 0x90,
|
||||
0xa0, 0x15, 0x17, 0xce, 0xf7, 0xf7, 0xd0, 0x3a, 0x3b, 0xd1, 0x72, 0x56,
|
||||
0x31, 0x81, 0xae, 0x60, 0xab, 0x40, 0xc1, 0xd1, 0x28, 0x77, 0x53, 0xac,
|
||||
0x9f, 0x11, 0x0a, 0x88, 0x36, 0x4b, 0xda, 0x57, 0xa7, 0x28, 0x5c, 0x85,
|
||||
0xd3, 0x85, 0x9b, 0x79, 0xad, 0x05, 0x1c, 0x37, 0x14, 0x5e, 0x0d, 0xd0,
|
||||
0x23, 0x03, 0x42, 0x1d, 0x48, 0x5d, 0xc5, 0x3c, 0x5a, 0x08, 0xa9, 0x0d,
|
||||
0x6e, 0x82, 0x7c, 0x2e, 0x3c, 0x41, 0xcc, 0x96, 0x8e, 0xad, 0xee, 0x2a,
|
||||
0x61, 0x0b, 0x16, 0x0f, 0xa9, 0x24, 0x40, 0x85, 0xbc, 0x9f, 0x28, 0x8d,
|
||||
0xe6, 0x68, 0x4d, 0x8f, 0x30, 0x48, 0xd9, 0x73, 0x73, 0x6c, 0x9a, 0x7f,
|
||||
0x67, 0xf7, 0xde, 0x4c, 0x0a, 0x8b, 0xe4, 0xb3, 0x08, 0x2a, 0x52, 0xda,
|
||||
0x54, 0xee, 0xcd, 0xb5, 0x62, 0x4a, 0x26, 0x20, 0xfb, 0x40, 0xbb, 0x39,
|
||||
0x3a, 0x0f, 0x09, 0xe8, 0x00, 0xd1, 0x24, 0x97, 0x60, 0xe9, 0x83, 0x83,
|
||||
0xfe, 0x9f, 0x9c, 0x15, 0xcf, 0x69, 0x03, 0x9f, 0x03, 0xe1, 0xe8, 0x6e,
|
||||
0xbd, 0x87, 0x58, 0x68, 0xee, 0xec, 0xd8, 0x29, 0x46, 0x23, 0x49, 0x92,
|
||||
0x72, 0x95, 0x5b, 0x49, 0xca, 0xe0, 0x45, 0x59, 0xb2, 0xca, 0xf4, 0xfc,
|
||||
0xb7, 0x59, 0x37, 0x49, 0x28, 0xbc, 0xf3, 0xd7, 0x61, 0xbc, 0x4b, 0xf3,
|
||||
0xa9, 0x4b, 0x2f, 0x05, 0xa8, 0x01, 0xa5, 0xdc, 0x00, 0x6e, 0x01, 0xb6,
|
||||
0x45, 0x3c, 0xd5, 0x49, 0x7d, 0x5c, 0x25, 0xe8, 0x31, 0x87, 0xb2, 0xb9,
|
||||
0xbf, 0xb3, 0x01, 0x62, 0x0c, 0xd0, 0x48, 0x77, 0xa2, 0x34, 0x0f, 0x16,
|
||||
0x22, 0x28, 0xee, 0x54, 0x08, 0x93, 0x3b, 0xe4, 0xde, 0x7e, 0x63, 0xf7,
|
||||
0x97, 0x16, 0x5d, 0x71, 0x58, 0xc2, 0x2e, 0xf2, 0x36, 0xa6, 0x12, 0x65,
|
||||
0x94, 0x17, 0xac, 0x66, 0x23, 0x7e, 0xc6, 0x72, 0x79, 0x24, 0xce, 0x8f,
|
||||
0x55, 0x19, 0x97, 0x44, 0xfc, 0x55, 0xec, 0x85, 0x26, 0x27, 0xdb, 0x38,
|
||||
0xb1, 0x42, 0x0a, 0xdd, 0x05, 0x99, 0x28, 0xeb, 0x03, 0x6c, 0x9a, 0xe9,
|
||||
0x17, 0xf6, 0x2c, 0xb0, 0xfe, 0xe7, 0xa4, 0xa7, 0x31, 0xda, 0x4d, 0xb0,
|
||||
0x29, 0xdb, 0xdd, 0x8d, 0x12, 0x13, 0x9c, 0xb4, 0xcc, 0x83, 0x97, 0xfb,
|
||||
0x1a, 0xdc, 0x08, 0xd6, 0x30, 0x62, 0xe8, 0xeb, 0x8b, 0x61, 0xcb, 0x1d,
|
||||
0x06, 0xe3, 0xa5, 0x4d, 0x35, 0xdb, 0x59, 0xa8, 0x2d, 0x87, 0x27, 0x44,
|
||||
0x6f, 0xc0, 0x38, 0x97, 0xe4, 0x85, 0x00, 0x02, 0x09, 0xf6, 0x69, 0x3a,
|
||||
0xcf, 0x08, 0x1b, 0x21, 0xbb, 0x79, 0xb1, 0xa1, 0x34, 0x09, 0xe0, 0x80,
|
||||
0xca, 0xb0, 0x78, 0x8a, 0x11, 0x97, 0xd4, 0x07, 0xbe, 0x1b, 0x6a, 0x5d,
|
||||
0xdb, 0xd6, 0x1f, 0x76, 0x6b, 0x16, 0xf0, 0x58, 0x84, 0x5f, 0x59, 0xce,
|
||||
0x62, 0x34, 0xc3, 0xdf, 0x94, 0xb8, 0x2f, 0x84, 0x68, 0xf0, 0xb8, 0x51,
|
||||
0xd9, 0x6d, 0x8e, 0x4a, 0x1d, 0xe6, 0x5c, 0xd8, 0x86, 0x25, 0xe3, 0x24,
|
||||
0xfd, 0x21, 0x61, 0x13, 0x48, 0x3e, 0xf6, 0x7d, 0xa6, 0x71, 0x9b, 0xd2,
|
||||
0x6e, 0xe6, 0xd2, 0x08, 0x94, 0x62, 0x6c, 0x98, 0xfe, 0x2f, 0x9c, 0x88,
|
||||
0x7e, 0x78, 0x15, 0x02, 0x00, 0xf0, 0xba, 0x24, 0x91, 0xf2, 0xdc, 0x47,
|
||||
0x51, 0x4d, 0x15, 0x5e, 0x91, 0x5f, 0x57, 0x5b, 0x1d, 0x35, 0x24, 0x45,
|
||||
0x75, 0x9b, 0x88, 0x75, 0xf1, 0x2f, 0x85, 0xe7, 0x89, 0xd1, 0x01, 0xb4,
|
||||
0xc8, 0x18, 0xb7, 0x97, 0xef, 0x4b, 0x90, 0xf4, 0xbf, 0x10, 0x27, 0x3c,
|
||||
0x60, 0xff, 0xc4, 0x94, 0x20, 0x2f, 0x93, 0x4b, 0x4d, 0xe3, 0x80, 0xf7,
|
||||
0x2c, 0x71, 0xd9, 0xe3, 0x68, 0xb4, 0x77, 0x2b, 0xc7, 0x0d, 0x39, 0x92,
|
||||
0xef, 0x91, 0x0d, 0xb2, 0x11, 0x50, 0x0e, 0xe8, 0xad, 0x3b, 0xf6, 0xb5,
|
||||
0xc6, 0x14, 0x4d, 0x33, 0x53, 0xa7, 0x60, 0x15, 0xc7, 0x27, 0x51, 0xdc,
|
||||
0x54, 0x29, 0xa7, 0x0d, 0x6a, 0x7b, 0x72, 0x13, 0xad, 0x7d, 0x41, 0x19,
|
||||
0x4e, 0x42, 0x49, 0xcc, 0x42, 0xe4, 0xbd, 0x99, 0x13, 0xd9, 0x7f, 0xf3,
|
||||
0x38, 0xa4, 0xb6, 0x33, 0xed, 0x07, 0x48, 0x7e, 0x8e, 0x82, 0xfe, 0x3a,
|
||||
0x9d, 0x75, 0x93, 0xba, 0x25, 0x4e, 0x37, 0x3c, 0x0c, 0xd5, 0x69, 0xa9,
|
||||
0x2d, 0x9e, 0xfd, 0xe8, 0xbb, 0xf5, 0x0c, 0xe2, 0x86, 0xb9, 0x5e, 0x6f,
|
||||
0x28, 0xe4, 0x19, 0xb3, 0x0b, 0xa4, 0x86, 0xd7, 0x24, 0xd0, 0xb8, 0x89,
|
||||
0x7b, 0x76, 0xec, 0x05, 0x10, 0x5b, 0x68, 0xe9, 0x58, 0x66, 0xa3, 0xc5,
|
||||
0xb6, 0x63, 0x20, 0x0e, 0x0e, 0xea, 0x3d, 0x61, 0x5e, 0xda, 0x3d, 0x3c,
|
||||
0xf9, 0xfd, 0xed, 0xa9, 0xdb, 0x52, 0x94, 0x8a, 0x00, 0xca, 0x3c, 0x8d,
|
||||
0x66, 0x8f, 0xb0, 0xf0, 0x5a, 0xca, 0x3f, 0x63, 0x71, 0xbf, 0xca, 0x99,
|
||||
0x37, 0x9b, 0x75, 0x97, 0x89, 0x10, 0x6e, 0xcf, 0xf2, 0xf5, 0xe3, 0xd5,
|
||||
0x45, 0x9b, 0xad, 0x10, 0x71, 0x6c, 0x5f, 0x6f, 0x7f, 0x22, 0x77, 0x18,
|
||||
0x2f, 0xf9, 0x99, 0xc5, 0x69, 0x58, 0x03, 0x12, 0x86, 0x82, 0x3e, 0xbf,
|
||||
0xc2, 0x12, 0x35, 0x43, 0xa3, 0xd9, 0x18, 0x4f, 0x41, 0x11, 0x6b, 0xf3,
|
||||
0x67, 0xaf, 0x3d, 0x78, 0xe4, 0x22, 0x2d, 0xb3, 0x48, 0x43, 0x31, 0x1d,
|
||||
0xef, 0xa8, 0xba, 0x49, 0x8e, 0xa9, 0xa7, 0xb6, 0x18, 0x77, 0x84, 0xca,
|
||||
0xbd, 0xa2, 0x02, 0x1b, 0x6a, 0xf8, 0x5f, 0xda, 0xff, 0xcf, 0x01, 0x6a,
|
||||
0x86, 0x69, 0xa9, 0xe9, 0xcb, 0x60, 0x1e, 0x15, 0xdc, 0x8f, 0x5d, 0x39,
|
||||
0xb5, 0xce, 0x55, 0x5f, 0x47, 0x97, 0xb1, 0x19, 0x6e, 0x21, 0xd6, 0x13,
|
||||
0x39, 0xb2, 0x24, 0xe0, 0x62, 0x82, 0x9f, 0xed, 0x12, 0x81, 0xed, 0xee,
|
||||
0xab, 0xd0, 0x2f, 0x19, 0x89, 0x3f, 0x57, 0x2e, 0xc2, 0xe2, 0x67, 0xe8,
|
||||
0xae, 0x03, 0x56, 0xba, 0xd4, 0xd0, 0xa4, 0x89, 0x03, 0x06, 0x5b, 0xcc,
|
||||
0xf2, 0x22, 0xb8, 0x0e, 0x76, 0x79, 0x4a, 0x42, 0x1d, 0x37, 0x51, 0x5a,
|
||||
0xaa, 0x46, 0x6c, 0x2a, 0xdd, 0x66, 0xfe, 0xc6, 0x68, 0xc3, 0x38, 0xa2,
|
||||
0xae, 0x5b, 0x98, 0x24, 0x5d, 0x43, 0x05, 0x82, 0x38, 0x12, 0xd3, 0xd1,
|
||||
0x75, 0x2d, 0x4f, 0x61, 0xbd, 0xb9, 0x10, 0x87, 0x44, 0x2a, 0x78, 0x07,
|
||||
0xff, 0xf4, 0x0f, 0xa1, 0xf3, 0x68, 0x9f, 0xbe, 0xae, 0xa2, 0x91, 0xf0,
|
||||
0xc7, 0x55, 0x7a, 0x52, 0xd5, 0xa3, 0x8d, 0x6f, 0xe4, 0x90, 0x5c, 0xf3,
|
||||
0x5f, 0xce, 0x3d, 0x23, 0xf9, 0x8e, 0xae, 0x14, 0xfb, 0x82, 0x9a, 0xa3,
|
||||
0x04, 0x5f, 0xbf, 0xad, 0x3e, 0xf2, 0x97, 0x0a, 0x60, 0x40, 0x70, 0x19,
|
||||
|
@ -407,7 +407,7 @@
|
||||
<ClCompile Include="src\tls.c" />
|
||||
<ClCompile Include="src\tls13.c" />
|
||||
<ClCompile Include="wolfcrypt\src\aes.c" />
|
||||
<ClCompile Include="wolfcrypt\src\arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<ClCompile Include="wolfcrypt\src\asn.c" />
|
||||
<ClCompile Include="wolfcrypt\src\blake2b.c" />
|
||||
<ClCompile Include="wolfcrypt\src\blake2s.c" />
|
||||
|
@ -204,7 +204,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\wolfcrypt\src\arc4.c"
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -406,7 +406,7 @@
|
||||
<ClCompile Include="src\tls.c" />
|
||||
<ClCompile Include="src\tls13.c" />
|
||||
<ClCompile Include="wolfcrypt\src\aes.c" />
|
||||
<ClCompile Include="wolfcrypt\src\arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<ClCompile Include="wolfcrypt\src\asn.c" />
|
||||
<ClCompile Include="wolfcrypt\src\blake2b.c" />
|
||||
<ClCompile Include="wolfcrypt\src\blake2s.c" />
|
||||
|
@ -69,7 +69,7 @@
|
||||
#include <wolfssl/wolfcrypt/hmac.h>
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifndef NO_SHA256
|
||||
#include <wolfssl/wolfcrypt/sha256.h>
|
||||
@ -948,7 +948,7 @@
|
||||
|
||||
#if defined(BUILD_SSL_RSA_WITH_RC4_128_SHA) || \
|
||||
defined(BUILD_SSL_RSA_WITH_RC4_128_MD5)
|
||||
#define BUILD_ARC4
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#if defined(BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA)
|
||||
@ -1042,8 +1042,7 @@
|
||||
#if !defined(NO_RC4) && !defined(WSSL_HARDEN_TLS)
|
||||
/* MUST NOT negotiate RC4 cipher suites
|
||||
* https://www.rfc-editor.org/rfc/rfc9325#section-4.1 */
|
||||
#undef BUILD_ARC4
|
||||
#define BUILD_ARC4
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHACHA
|
||||
@ -4407,8 +4406,8 @@ enum CipherSrc {
|
||||
|
||||
/* cipher for now */
|
||||
typedef struct Ciphers {
|
||||
#ifdef BUILD_ARC4
|
||||
Arc4* arc4;
|
||||
/* ARC4 implementation has been removed */
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
#ifdef BUILD_DES3
|
||||
Des3* des3;
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
#include <wolfssl/wolfcrypt/aes.h>
|
||||
#include <wolfssl/wolfcrypt/des3.h>
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#include <wolfssl/wolfcrypt/chacha20_poly1305.h>
|
||||
#include <wolfssl/wolfcrypt/hmac.h>
|
||||
#include <wolfssl/wolfcrypt/pwdbased.h>
|
||||
@ -256,7 +256,7 @@ typedef union {
|
||||
Des des;
|
||||
Des3 des3;
|
||||
#endif
|
||||
Arc4 arc4;
|
||||
char arc4[128]; /* Placeholder for RC4 key - arc4 implementation removed */
|
||||
#ifdef WOLFSSL_QT
|
||||
int (*ctrl) (WOLFSSL_EVP_CIPHER_CTX *, int type, int arg, void *ptr);
|
||||
#endif
|
||||
@ -427,7 +427,7 @@ enum {
|
||||
WC_DES_ECB_TYPE = 11,
|
||||
WC_DES_EDE3_CBC_TYPE = 12,
|
||||
WC_DES_EDE3_ECB_TYPE = 13,
|
||||
WC_ARC4_TYPE = 14,
|
||||
WC_ARC4_TYPE = 14, /* ARC4 implementation has been removed */
|
||||
WC_NULL_CIPHER_TYPE = 15,
|
||||
WC_EVP_PKEY_RSA = 16,
|
||||
WC_EVP_PKEY_DSA = 17,
|
||||
@ -494,7 +494,7 @@ enum {
|
||||
#define DES_ECB_TYPE WC_DES_ECB_TYPE
|
||||
#define DES_EDE3_CBC_TYPE WC_DES_EDE3_CBC_TYPE
|
||||
#define DES_EDE3_ECB_TYPE WC_DES_EDE3_ECB_TYPE
|
||||
#define ARC4_TYPE WC_ARC4_TYPE
|
||||
#define ARC4_TYPE WC_ARC4_TYPE /* ARC4 implementation has been removed */
|
||||
#define NULL_CIPHER_TYPE WC_NULL_CIPHER_TYPE
|
||||
#define EVP_PKEY_RSA WC_EVP_PKEY_RSA
|
||||
#define EVP_PKEY_DSA WC_EVP_PKEY_DSA
|
||||
|
@ -38,8 +38,8 @@
|
||||
/* applications including wolfssl/openssl/rc4.h are expecting to have access to
|
||||
* the size of RC4_KEY structures. */
|
||||
typedef struct WOLFSSL_RC4_KEY {
|
||||
/* big enough for Arc4 from wolfssl/wolfcrypt/arc4.h */
|
||||
void* holder[(272 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
|
||||
/* Placeholder for RC4 key - arc4 implementation removed */
|
||||
byte placeholder[32];
|
||||
} WOLFSSL_RC4_KEY;
|
||||
|
||||
WOLFSSL_API void wolfSSL_RC4_set_key(WOLFSSL_RC4_KEY* key, int len,
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#ifdef ATOMIC_USER
|
||||
#include <wolfssl/wolfcrypt/aes.h>
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#include <wolfssl/wolfcrypt/hmac.h>
|
||||
#endif
|
||||
#ifdef HAVE_PK_CALLBACKS
|
||||
|
@ -1,69 +0,0 @@
|
||||
/* arc4.h
|
||||
*
|
||||
* Copyright (C) 2006-2025 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
/*!
|
||||
\file wolfssl/wolfcrypt/arc4.h
|
||||
*/
|
||||
|
||||
#ifndef WOLF_CRYPT_ARC4_H
|
||||
#define WOLF_CRYPT_ARC4_H
|
||||
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||
#include <wolfssl/wolfcrypt/async.h>
|
||||
#endif
|
||||
|
||||
enum {
|
||||
ARC4_ENC_TYPE = 4, /* cipher unique type */
|
||||
ARC4_STATE_SIZE = 256,
|
||||
RC4_KEY_SIZE = 16 /* always 128bit */
|
||||
};
|
||||
|
||||
/* ARC4 encryption and decryption */
|
||||
typedef struct Arc4 {
|
||||
byte x;
|
||||
byte y;
|
||||
byte state[ARC4_STATE_SIZE];
|
||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||
WC_ASYNC_DEV asyncDev;
|
||||
#endif
|
||||
void* heap;
|
||||
} Arc4;
|
||||
|
||||
WOLFSSL_API int wc_Arc4Process(Arc4* arc4, byte* out, const byte* in,
|
||||
word32 length);
|
||||
WOLFSSL_API int wc_Arc4SetKey(Arc4* arc4, const byte* key, word32 length);
|
||||
|
||||
WOLFSSL_API int wc_Arc4Init(Arc4* arc4, void* heap, int devId);
|
||||
WOLFSSL_API void wc_Arc4Free(Arc4* arc4);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* WOLF_CRYPT_ARC4_H */
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
nobase_include_HEADERS+= \
|
||||
wolfssl/wolfcrypt/aes.h \
|
||||
wolfssl/wolfcrypt/arc4.h \
|
||||
# wolfssl/wolfcrypt/arc4.h - ARC4 implementation has been removed \
|
||||
wolfssl/wolfcrypt/ascon.h \
|
||||
wolfssl/wolfcrypt/asn.h \
|
||||
wolfssl/wolfcrypt/asn_public.h \
|
||||
|
@ -2693,7 +2693,7 @@ extern void uITRON4_free(void *p) ;
|
||||
#endif
|
||||
|
||||
|
||||
/* stream ciphers except arc4 need 32bit alignment, intel ok without */
|
||||
/* stream ciphers need 32bit alignment, intel ok without (ARC4 implementation has been removed) */
|
||||
#ifndef XSTREAM_ALIGN
|
||||
#if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
|
||||
#define NO_XSTREAM_ALIGN
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <wolfssl/wolfcrypt/des3.h>
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
#include <wolfssl/wolfcrypt/arc4.h>
|
||||
/* ARC4 implementation has been removed */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -287,7 +287,7 @@
|
||||
<ClCompile Include="..\..\src\tls.c" />
|
||||
<ClCompile Include="..\..\src\tls13.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\aes.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\arc4.c" />
|
||||
<!-- ARC4 implementation has been removed -->
|
||||
<ClCompile Include="..\..\wolfcrypt\src\asn.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\blake2b.c" />
|
||||
<ClCompile Include="..\..\wolfcrypt\src\blake2s.c" />
|
||||
|
@ -55,7 +55,7 @@ if(CONFIG_WOLFSSL)
|
||||
zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/wolfcrypt/src/wolfcrypt_last.c)
|
||||
endif()
|
||||
|
||||
zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/wolfcrypt/src/arc4.c)
|
||||
# ARC4 implementation has been removed
|
||||
zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/wolfcrypt/src/asm.c)
|
||||
zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/wolfcrypt/src/asn.c)
|
||||
#zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/wolfcrypt/src/async.c)
|
||||
|
@ -160,7 +160,7 @@ config WOLFSSL_CIPHER_ALL_ENABLED
|
||||
select WOLFSSL_CIPHER_AES_ENABLED
|
||||
select WOLFSSL_CIPHER_CAMELLIA_ENABLED
|
||||
select WOLFSSL_CIPHER_DES_ENABLED
|
||||
select WOLFSSL_CIPHER_ARC4_ENABLED
|
||||
# ARC4 implementation has been removed
|
||||
select WOLFSSL_CIPHER_CHACHA20_ENABLED
|
||||
select WOLFSSL_CIPHER_BLOWFISH_ENABLED
|
||||
select WOLFSSL_CIPHER_CCM_ENABLED
|
||||
@ -186,7 +186,8 @@ config WOLFSSL_CIPHER_DES_ENABLED
|
||||
default y
|
||||
|
||||
config WOLFSSL_CIPHER_ARC4_ENABLED
|
||||
bool "Enable the ARC4 stream cipher"
|
||||
bool "Enable the ARC4 stream cipher (implementation removed - RC4 API maintained)"
|
||||
depends on n
|
||||
|
||||
config WOLFSSL_CIPHER_CHACHA20_ENABLED
|
||||
bool "Enable the ChaCha20 stream cipher"
|
||||
|
Reference in New Issue
Block a user