diff options
author | lloyd <[email protected]> | 2013-04-19 14:56:02 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-04-19 14:56:02 +0000 |
commit | abbf2b764c6fd2339c9e4fbc4647072087683f48 (patch) | |
tree | 21495af9492a03a0707343b3a0d8ade830c0699e | |
parent | d6d870741bb2272b564153b26a638fb6e29ddd89 (diff) |
Rename ARC4 to RC4
-rw-r--r-- | checks/bench.cpp | 2 | ||||
-rw-r--r-- | checks/validate.dat | 2 | ||||
-rw-r--r-- | doc/algos.rst | 2 | ||||
-rw-r--r-- | doc/relnotes/1_11_4.rst | 2 | ||||
-rwxr-xr-x | src/build-data/scripts/tls_suite_info.py | 8 | ||||
-rw-r--r-- | src/engine/core_engine/lookup_stream.cpp | 12 | ||||
-rw-r--r-- | src/engine/openssl/ossl_arc4.cpp | 32 | ||||
-rw-r--r-- | src/libstate/policy.cpp | 3 | ||||
-rw-r--r-- | src/stream/arc4/info.txt | 1 | ||||
-rw-r--r-- | src/stream/rc4/info.txt | 1 | ||||
-rw-r--r-- | src/stream/rc4/rc4.cpp (renamed from src/stream/arc4/arc4.cpp) | 20 | ||||
-rw-r--r-- | src/stream/rc4/rc4.h (renamed from src/stream/arc4/arc4.h) | 16 | ||||
-rw-r--r-- | src/tls/info.txt | 5 | ||||
-rw-r--r-- | src/tls/tls_ciphersuite.cpp | 2 | ||||
-rw-r--r-- | src/tls/tls_policy.cpp | 4 | ||||
-rw-r--r-- | src/tls/tls_suite_info.cpp | 22 |
16 files changed, 68 insertions, 66 deletions
diff --git a/checks/bench.cpp b/checks/bench.cpp index ddb4ec8e2..ee34b5233 100644 --- a/checks/bench.cpp +++ b/checks/bench.cpp @@ -77,7 +77,7 @@ const std::string algos[] = { "Serpent/XTS", /* Stream ciphers */ - "ARC4", + "RC4", "Salsa20", /* Checksums */ diff --git a/checks/validate.dat b/checks/validate.dat index f6ed43c02..f8589ce81 100644 --- a/checks/validate.dat +++ b/checks/validate.dat @@ -42076,7 +42076,7 @@ E5F790088393EC494F34AF1B4BE73B63666874BF31D74D64C749A0DD067F6BEC681AA339\ # A few tests from somewhere (maybe the original reverse engineered code, or # the BSAFE vectors that were published soon after? I don't have those posts # anymore...), followed by a load of randomly generated vectors by OpenSSL. -[ARC4] +[RC4] 0000000000000000:7494C2E7104B0879:0123456789ABCDEF 0000000000000000:DE188941A3375D3A:0000000000000000 00000000000000000000:D6A141A7EC3C38DFBD61:EF012345 diff --git a/doc/algos.rst b/doc/algos.rst index 8b2f14b36..7f976a141 100644 --- a/doc/algos.rst +++ b/doc/algos.rst @@ -57,7 +57,7 @@ Block ciphers Stream Ciphers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * RC4 of course + * RC4 * Salsa20/XSalsa20 * CTR and OFB modes also present a stream cipher interface diff --git a/doc/relnotes/1_11_4.rst b/doc/relnotes/1_11_4.rst index 72418e9d5..91a33ae58 100644 --- a/doc/relnotes/1_11_4.rst +++ b/doc/relnotes/1_11_4.rst @@ -18,3 +18,5 @@ Version 1.11.4, Not Yet Released * A new TLS policy :cpp:class:`NSA_Suite_B_128` is available, which will negotiate only the 128-bit security NSA Suite B. See :rfc:`6460` for more information about Suite B. + +* Rename ARC4 to RC4 diff --git a/src/build-data/scripts/tls_suite_info.py b/src/build-data/scripts/tls_suite_info.py index 7043469d2..8c454f35a 100755 --- a/src/build-data/scripts/tls_suite_info.py +++ b/src/build-data/scripts/tls_suite_info.py @@ -42,7 +42,7 @@ def to_ciphersuite_info(code, name): cipher = cipher_and_mac[:-1] cipher_info = { - 'RC4': ('ARC4',None), + 'RC4': ('RC4',None), 'IDEA': ('IDEA',16), 'DES': ('DES',8), '3DES': ('3DES',24), @@ -59,7 +59,7 @@ def to_ciphersuite_info(code, name): 'SHA256': 'SHA-256', 'SHA384': 'SHA-384', 'SHA512': 'SHA-512', - 'RC4': 'ARC4', + 'RC4': 'RC4', '3DES': 'TripleDES', 'DSS': 'DSA', 'ECDSA': 'ECDSA', @@ -98,7 +98,7 @@ def to_ciphersuite_info(code, name): modestr = '' mode = '' ivlen = 0 - if cipher_algo != 'ARC4': + if cipher_algo != 'RC4': mode = cipher[-1] if mode not in ['CBC', 'GCM', 'CCM', 'OCB']: print "#warning Unknown mode %s" % (' '.join(cipher)) @@ -108,7 +108,7 @@ def to_ciphersuite_info(code, name): if mode != 'CBC': cipher_algo += '/' + mode - if cipher_algo != 'ARC4' and mode != 'CBC': + if cipher_algo != 'RC4' and mode != 'CBC': return 'Ciphersuite(0x%s, "%s", "%s", "%s", %d, %d, "AEAD", %d, "%s")' % ( code, sig_algo, kex_algo, cipher_algo, cipher_keylen, 4, 0, mac_algo) else: diff --git a/src/engine/core_engine/lookup_stream.cpp b/src/engine/core_engine/lookup_stream.cpp index 683ee6b8c..b26bbedcd 100644 --- a/src/engine/core_engine/lookup_stream.cpp +++ b/src/engine/core_engine/lookup_stream.cpp @@ -8,8 +8,8 @@ #include <botan/internal/core_engine.h> #include <botan/scan_name.h> -#if defined(BOTAN_HAS_ARC4) - #include <botan/arc4.h> +#if defined(BOTAN_HAS_RC4) + #include <botan/rc4.h> #endif #if defined(BOTAN_HAS_SALSA20) @@ -25,11 +25,11 @@ StreamCipher* Core_Engine::find_stream_cipher(const SCAN_Name& request, Algorithm_Factory&) const { -#if defined(BOTAN_HAS_ARC4) - if(request.algo_name() == "ARC4") - return new ARC4(request.arg_as_integer(0, 0)); +#if defined(BOTAN_HAS_RC4) + if(request.algo_name() == "RC4") + return new RC4(request.arg_as_integer(0, 0)); if(request.algo_name() == "RC4_drop") - return new ARC4(768); + return new RC4(768); #endif #if defined(BOTAN_HAS_SALSA20) diff --git a/src/engine/openssl/ossl_arc4.cpp b/src/engine/openssl/ossl_arc4.cpp index cad194a59..0eb404af1 100644 --- a/src/engine/openssl/ossl_arc4.cpp +++ b/src/engine/openssl/ossl_arc4.cpp @@ -1,5 +1,5 @@ /* -* OpenSSL ARC4 +* OpenSSL RC4 * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license @@ -14,15 +14,15 @@ namespace Botan { namespace { /** -* ARC4 as implemented by OpenSSL +* RC4 as implemented by OpenSSL */ -class ARC4_OpenSSL : public StreamCipher +class RC4_OpenSSL : public StreamCipher { public: void clear() { clear_mem(&state, 1); } std::string name() const; - StreamCipher* clone() const { return new ARC4_OpenSSL(SKIP); } + StreamCipher* clone() const { return new RC4_OpenSSL(SKIP); } Key_Length_Specification key_spec() const { @@ -30,8 +30,8 @@ class ARC4_OpenSSL : public StreamCipher } - ARC4_OpenSSL(size_t s = 0) : SKIP(s) { clear(); } - ~ARC4_OpenSSL() { clear(); } + RC4_OpenSSL(size_t s = 0) : SKIP(s) { clear(); } + ~RC4_OpenSSL() { clear(); } private: void cipher(const byte[], byte[], size_t); void key_schedule(const byte[], size_t); @@ -43,17 +43,17 @@ class ARC4_OpenSSL : public StreamCipher /* * Return the name of this type */ -std::string ARC4_OpenSSL::name() const +std::string RC4_OpenSSL::name() const { - if(SKIP == 0) return "ARC4"; + if(SKIP == 0) return "RC4"; if(SKIP == 256) return "MARK-4"; else return "RC4_skip(" + std::to_string(SKIP) + ")"; } /* -* ARC4 Key Schedule +* RC4 Key Schedule */ -void ARC4_OpenSSL::key_schedule(const byte key[], size_t length) +void RC4_OpenSSL::key_schedule(const byte key[], size_t length) { RC4_set_key(&state, length, key); byte dummy = 0; @@ -62,9 +62,9 @@ void ARC4_OpenSSL::key_schedule(const byte key[], size_t length) } /* -* ARC4 Encryption +* RC4 Encryption */ -void ARC4_OpenSSL::cipher(const byte in[], byte out[], size_t length) +void RC4_OpenSSL::cipher(const byte in[], byte out[], size_t length) { RC4(&state, length, in, out); } @@ -72,16 +72,16 @@ void ARC4_OpenSSL::cipher(const byte in[], byte out[], size_t length) } /** -* Look for an OpenSSL-supported stream cipher (ARC4) +* Look for an OpenSSL-supported stream cipher (RC4) */ StreamCipher* OpenSSL_Engine::find_stream_cipher(const SCAN_Name& request, Algorithm_Factory&) const { - if(request.algo_name() == "ARC4") - return new ARC4_OpenSSL(request.arg_as_integer(0, 0)); + if(request.algo_name() == "RC4") + return new RC4_OpenSSL(request.arg_as_integer(0, 0)); if(request.algo_name() == "RC4_drop") - return new ARC4_OpenSSL(768); + return new RC4_OpenSSL(768); return 0; } diff --git a/src/libstate/policy.cpp b/src/libstate/policy.cpp index 75b7c0db8..172da27f4 100644 --- a/src/libstate/policy.cpp +++ b/src/libstate/policy.cpp @@ -290,7 +290,8 @@ void set_default_aliases(Library_State& config) config.add_alias("CAST5", "CAST-128"); config.add_alias("SHA1", "SHA-160"); config.add_alias("SHA-1", "SHA-160"); - config.add_alias("MARK-4", "ARC4(256)"); + config.add_alias("MARK-4", "RC4(256)"); + config.add_alias("ARC4", "RC4"); config.add_alias("OMAC", "CMAC"); config.add_alias("GOST", "GOST-28147-89"); config.add_alias("GOST-34.11", "GOST-R-34.11-94"); diff --git a/src/stream/arc4/info.txt b/src/stream/arc4/info.txt deleted file mode 100644 index e3022925c..000000000 --- a/src/stream/arc4/info.txt +++ /dev/null @@ -1 +0,0 @@ -define ARC4 diff --git a/src/stream/rc4/info.txt b/src/stream/rc4/info.txt new file mode 100644 index 000000000..587a5fea8 --- /dev/null +++ b/src/stream/rc4/info.txt @@ -0,0 +1 @@ +define RC4 diff --git a/src/stream/arc4/arc4.cpp b/src/stream/rc4/rc4.cpp index da1694a96..bd4c710a9 100644 --- a/src/stream/arc4/arc4.cpp +++ b/src/stream/rc4/rc4.cpp @@ -1,5 +1,5 @@ /* -* ARC4 +* RC4 * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license @@ -14,7 +14,7 @@ namespace Botan { /* * Combine cipher stream with message */ -void ARC4::cipher(const byte in[], byte out[], size_t length) +void RC4::cipher(const byte in[], byte out[], size_t length) { while(length >= buffer.size() - position) { @@ -31,7 +31,7 @@ void ARC4::cipher(const byte in[], byte out[], size_t length) /* * Generate cipher stream */ -void ARC4::generate() +void RC4::generate() { byte SX, SY; for(size_t i = 0; i != buffer.size(); i += 4) @@ -57,9 +57,9 @@ void ARC4::generate() } /* -* ARC4 Key Schedule +* RC4 Key Schedule */ -void ARC4::key_schedule(const byte key[], size_t length) +void RC4::key_schedule(const byte key[], size_t length) { state.resize(256); buffer.resize(round_up<size_t>(DEFAULT_BUFFERSIZE, 4)); @@ -84,9 +84,9 @@ void ARC4::key_schedule(const byte key[], size_t length) /* * Return the name of this type */ -std::string ARC4::name() const +std::string RC4::name() const { - if(SKIP == 0) return "ARC4"; + if(SKIP == 0) return "RC4"; if(SKIP == 256) return "MARK-4"; else return "RC4_skip(" + std::to_string(SKIP) + ")"; } @@ -94,7 +94,7 @@ std::string ARC4::name() const /* * Clear memory of sensitive data */ -void ARC4::clear() +void RC4::clear() { zap(state); zap(buffer); @@ -102,8 +102,8 @@ void ARC4::clear() } /* -* ARC4 Constructor +* RC4 Constructor */ -ARC4::ARC4(size_t s) : SKIP(s) {} +RC4::RC4(size_t s) : SKIP(s) {} } diff --git a/src/stream/arc4/arc4.h b/src/stream/rc4/rc4.h index 8f8de87b6..c23f8c853 100644 --- a/src/stream/arc4/arc4.h +++ b/src/stream/rc4/rc4.h @@ -1,12 +1,12 @@ /* -* ARC4 +* RC4 * (C) 1999-2008 Jack Lloyd * * Distributed under the terms of the Botan license */ -#ifndef BOTAN_ARC4_H__ -#define BOTAN_ARC4_H__ +#ifndef BOTAN_RC4_H__ +#define BOTAN_RC4_H__ #include <botan/stream_cipher.h> #include <botan/types.h> @@ -14,9 +14,9 @@ namespace Botan { /** -* Alleged RC4 +* RC4 stream cipher */ -class BOTAN_DLL ARC4 : public StreamCipher +class BOTAN_DLL RC4 : public StreamCipher { public: void cipher(const byte in[], byte out[], size_t length); @@ -24,7 +24,7 @@ class BOTAN_DLL ARC4 : public StreamCipher void clear(); std::string name() const; - StreamCipher* clone() const { return new ARC4(SKIP); } + StreamCipher* clone() const { return new RC4(SKIP); } Key_Length_Specification key_spec() const { @@ -34,9 +34,9 @@ class BOTAN_DLL ARC4 : public StreamCipher /** * @param skip skip this many initial bytes in the keystream */ - ARC4(size_t skip = 0); + RC4(size_t skip = 0); - ~ARC4() { clear(); } + ~RC4() { clear(); } private: void key_schedule(const byte[], size_t); void generate(); diff --git a/src/tls/info.txt b/src/tls/info.txt index 5bc64b44e..2440baa99 100644 --- a/src/tls/info.txt +++ b/src/tls/info.txt @@ -71,7 +71,6 @@ tls_version.cpp <requires> aes -arc4 asn1 camellia cbc @@ -83,18 +82,18 @@ ecdh ecdsa eme_pkcs emsa3 -filters hmac kdf2 md5 prf_ssl3 prf_tls +rc4 rng rsa seed -srp6 sha1 sha2_32 +srp6 ssl3mac x509 </requires> diff --git a/src/tls/tls_ciphersuite.cpp b/src/tls/tls_ciphersuite.cpp index 9c9950818..9718a5b08 100644 --- a/src/tls/tls_ciphersuite.cpp +++ b/src/tls/tls_ciphersuite.cpp @@ -96,7 +96,7 @@ std::string Ciphersuite::to_string() const out << "WITH_"; - if(cipher_algo() == "ARC4") + if(cipher_algo() == "RC4") { out << "RC4_128_"; } diff --git a/src/tls/tls_policy.cpp b/src/tls/tls_policy.cpp index 230b02ad0..15e061da8 100644 --- a/src/tls/tls_policy.cpp +++ b/src/tls/tls_policy.cpp @@ -22,7 +22,7 @@ std::vector<std::string> Policy::allowed_ciphers() const "AES-128/GCM", "AES-256", "AES-128", - "ARC4", + "RC4", //"Camellia-256", //"Camellia-128", //"SEED" @@ -228,7 +228,7 @@ std::vector<u16bit> Policy::ciphersuite_list(Protocol_Version version, if(!have_srp && suite.kex_algo() == "SRP_SHA") continue; - if(version.is_datagram_protocol() && suite.cipher_algo() == "ARC4") + if(version.is_datagram_protocol() && suite.cipher_algo() == "RC4") continue; if(!version.supports_aead_modes() && suite.mac_algo() == "AEAD") diff --git a/src/tls/tls_suite_info.cpp b/src/tls/tls_suite_info.cpp index dcc5d69b4..a2a371063 100644 --- a/src/tls/tls_suite_info.cpp +++ b/src/tls/tls_suite_info.cpp @@ -2,7 +2,7 @@ * TLS cipher suite information * * This file was automatically generated from the IANA assignments -* by ./src/build-data/scripts/tls_suite_info.py on 2013-04-12 +* by ./src/build-data/scripts/tls_suite_info.py on 2013-04-19 * * Released under the terms of the Botan license */ @@ -57,7 +57,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC081, "DSA", "DH", "Camellia-256/GCM", 32, 4, "AEAD", 0, "SHA-384"); case 0x0066: // DHE_DSS_WITH_RC4_128_SHA - return Ciphersuite(0x0066, "DSA", "DH", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0x0066, "DSA", "DH", "RC4", 16, 0, "SHA-1", 20); case 0x0099: // DHE_DSS_WITH_SEED_CBC_SHA return Ciphersuite(0x0099, "DSA", "DH", "SEED", 16, 16, "SHA-1", 20); @@ -96,7 +96,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC091, "", "DHE_PSK", "Camellia-256/GCM", 32, 4, "AEAD", 0, "SHA-384"); case 0x008E: // DHE_PSK_WITH_RC4_128_SHA - return Ciphersuite(0x008E, "", "DHE_PSK", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0x008E, "", "DHE_PSK", "RC4", 16, 0, "SHA-1", 20); case 0x0016: // DHE_RSA_WITH_3DES_EDE_CBC_SHA return Ciphersuite(0x0016, "RSA", "DH", "3DES", 24, 8, "SHA-1", 20); @@ -180,7 +180,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC085, "", "DH", "Camellia-256/GCM", 32, 4, "AEAD", 0, "SHA-384"); case 0x0018: // DH_anon_WITH_RC4_128_MD5 - return Ciphersuite(0x0018, "", "DH", "ARC4", 16, 0, "MD5", 16); + return Ciphersuite(0x0018, "", "DH", "RC4", 16, 0, "MD5", 16); case 0x009B: // DH_anon_WITH_SEED_CBC_SHA return Ciphersuite(0x009B, "", "DH", "SEED", 16, 16, "SHA-1", 20); @@ -219,7 +219,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC087, "ECDSA", "ECDH", "Camellia-256/GCM", 32, 4, "AEAD", 0, "SHA-384"); case 0xC007: // ECDHE_ECDSA_WITH_RC4_128_SHA - return Ciphersuite(0xC007, "ECDSA", "ECDH", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0xC007, "ECDSA", "ECDH", "RC4", 16, 0, "SHA-1", 20); case 0xC034: // ECDHE_PSK_WITH_3DES_EDE_CBC_SHA return Ciphersuite(0xC034, "", "ECDHE_PSK", "3DES", 24, 8, "SHA-1", 20); @@ -243,7 +243,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC09B, "", "ECDHE_PSK", "Camellia-256", 32, 16, "SHA-384", 48); case 0xC033: // ECDHE_PSK_WITH_RC4_128_SHA - return Ciphersuite(0xC033, "", "ECDHE_PSK", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0xC033, "", "ECDHE_PSK", "RC4", 16, 0, "SHA-1", 20); case 0xC012: // ECDHE_RSA_WITH_3DES_EDE_CBC_SHA return Ciphersuite(0xC012, "RSA", "ECDH", "3DES", 24, 8, "SHA-1", 20); @@ -279,7 +279,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC08B, "RSA", "ECDH", "Camellia-256/GCM", 32, 4, "AEAD", 0, "SHA-384"); case 0xC011: // ECDHE_RSA_WITH_RC4_128_SHA - return Ciphersuite(0xC011, "RSA", "ECDH", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0xC011, "RSA", "ECDH", "RC4", 16, 0, "SHA-1", 20); case 0xC017: // ECDH_anon_WITH_3DES_EDE_CBC_SHA return Ciphersuite(0xC017, "", "ECDH", "3DES", 24, 8, "SHA-1", 20); @@ -291,7 +291,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC019, "", "ECDH", "AES-256", 32, 16, "SHA-1", 20); case 0xC016: // ECDH_anon_WITH_RC4_128_SHA - return Ciphersuite(0xC016, "", "ECDH", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0xC016, "", "ECDH", "RC4", 16, 0, "SHA-1", 20); case 0x008B: // PSK_WITH_3DES_EDE_CBC_SHA return Ciphersuite(0x008B, "", "PSK", "3DES", 24, 8, "SHA-1", 20); @@ -327,7 +327,7 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC08F, "", "PSK", "Camellia-256/GCM", 32, 4, "AEAD", 0, "SHA-384"); case 0x008A: // PSK_WITH_RC4_128_SHA - return Ciphersuite(0x008A, "", "PSK", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0x008A, "", "PSK", "RC4", 16, 0, "SHA-1", 20); case 0x000A: // RSA_WITH_3DES_EDE_CBC_SHA return Ciphersuite(0x000A, "RSA", "RSA", "3DES", 24, 8, "SHA-1", 20); @@ -369,10 +369,10 @@ Ciphersuite Ciphersuite::by_id(u16bit suite) return Ciphersuite(0xC07B, "RSA", "RSA", "Camellia-256/GCM", 32, 4, "AEAD", 0, "SHA-384"); case 0x0004: // RSA_WITH_RC4_128_MD5 - return Ciphersuite(0x0004, "RSA", "RSA", "ARC4", 16, 0, "MD5", 16); + return Ciphersuite(0x0004, "RSA", "RSA", "RC4", 16, 0, "MD5", 16); case 0x0005: // RSA_WITH_RC4_128_SHA - return Ciphersuite(0x0005, "RSA", "RSA", "ARC4", 16, 0, "SHA-1", 20); + return Ciphersuite(0x0005, "RSA", "RSA", "RC4", 16, 0, "SHA-1", 20); case 0x0096: // RSA_WITH_SEED_CBC_SHA return Ciphersuite(0x0096, "RSA", "RSA", "SEED", 16, 16, "SHA-1", 20); |