diff options
author | lloyd <[email protected]> | 2012-01-22 00:54:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-22 00:54:37 +0000 |
commit | 8566e2784dc83c6d8c02de42cf2448cb408100f1 (patch) | |
tree | fa6f680d8c4ef76c1e0f0fe6d6b0bd7ed87a27f2 | |
parent | 87fd27adfe84478c52186107fc383890544eeeba (diff) |
Reorder for readability
-rw-r--r-- | src/tls/tls_suites.cpp | 94 |
1 files changed, 48 insertions, 46 deletions
diff --git a/src/tls/tls_suites.cpp b/src/tls/tls_suites.cpp index d49cfe097..c24cdb9f7 100644 --- a/src/tls/tls_suites.cpp +++ b/src/tls/tls_suites.cpp @@ -19,43 +19,34 @@ TLS_Ciphersuite TLS_Ciphersuite::lookup_ciphersuite(u16bit suite) { // RSA ciphersuites - case TLS_RSA_WITH_RC4_128_MD5: - return TLS_Ciphersuite("RSA", "", "MD5", "ARC4", 16); - - case TLS_RSA_WITH_RC4_128_SHA: - return TLS_Ciphersuite("RSA", "", "SHA-1", "ARC4", 16); - - case TLS_RSA_WITH_3DES_EDE_CBC_SHA: - return TLS_Ciphersuite("RSA", "", "SHA-1", "TripleDES", 24); - case TLS_RSA_WITH_AES_128_CBC_SHA: return TLS_Ciphersuite("RSA", "", "SHA-1", "AES-128", 16); case TLS_RSA_WITH_AES_256_CBC_SHA: return TLS_Ciphersuite("RSA", "", "SHA-1", "AES-256", 32); - case TLS_RSA_WITH_SEED_CBC_SHA: - return TLS_Ciphersuite("RSA", "", "SHA-1", "SEED", 16); - case TLS_RSA_WITH_AES_128_CBC_SHA256: return TLS_Ciphersuite("RSA", "", "SHA-256", "AES-128", 16); case TLS_RSA_WITH_AES_256_CBC_SHA256: return TLS_Ciphersuite("RSA", "", "SHA-256", "AES-256", 32); - // DH/DSS ciphersuites + case TLS_RSA_WITH_3DES_EDE_CBC_SHA: + return TLS_Ciphersuite("RSA", "", "SHA-1", "TripleDES", 24); - case TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA: - return TLS_Ciphersuite("DSA", "DH", "SHA-1", "TripleDES", 24); + case TLS_RSA_WITH_RC4_128_SHA: + return TLS_Ciphersuite("RSA", "", "SHA-1", "ARC4", 16); - case TLS_DHE_DSS_WITH_AES_128_CBC_SHA: - return TLS_Ciphersuite("DSA", "DH", "SHA-1", "AES-128", 16); + case TLS_RSA_WITH_RC4_128_MD5: + return TLS_Ciphersuite("RSA", "", "MD5", "ARC4", 16); - case TLS_DHE_DSS_WITH_SEED_CBC_SHA: - return TLS_Ciphersuite("DSA", "DH", "SHA-1", "SEED", 16); + case TLS_RSA_WITH_SEED_CBC_SHA: + return TLS_Ciphersuite("RSA", "", "SHA-1", "SEED", 16); - case TLS_DHE_DSS_WITH_RC4_128_SHA: - return TLS_Ciphersuite("DSA", "DH", "SHA-1", "ARC4", 16); + // DH/DSS ciphersuites + + case TLS_DHE_DSS_WITH_AES_128_CBC_SHA: + return TLS_Ciphersuite("DSA", "DH", "SHA-1", "AES-128", 16); case TLS_DHE_DSS_WITH_AES_256_CBC_SHA: return TLS_Ciphersuite("DSA", "DH", "SHA-1", "AES-256", 32); @@ -66,17 +57,20 @@ TLS_Ciphersuite TLS_Ciphersuite::lookup_ciphersuite(u16bit suite) case TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: return TLS_Ciphersuite("DSA", "DH", "SHA-256", "AES-256", 32); - // DH/RSA ciphersuites + case TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA: + return TLS_Ciphersuite("DSA", "DH", "SHA-1", "TripleDES", 24); - case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: - return TLS_Ciphersuite("RSA", "DH", "SHA-1", "TripleDES", 24); + case TLS_DHE_DSS_WITH_RC4_128_SHA: + return TLS_Ciphersuite("DSA", "DH", "SHA-1", "ARC4", 16); + + case TLS_DHE_DSS_WITH_SEED_CBC_SHA: + return TLS_Ciphersuite("DSA", "DH", "SHA-1", "SEED", 16); + + // DH/RSA ciphersuites case TLS_DHE_RSA_WITH_AES_128_CBC_SHA: return TLS_Ciphersuite("RSA", "DH", "SHA-1", "AES-128", 16); - case TLS_DHE_RSA_WITH_SEED_CBC_SHA: - return TLS_Ciphersuite("RSA", "DH", "SHA-1", "SEED", 16); - case TLS_DHE_RSA_WITH_AES_256_CBC_SHA: return TLS_Ciphersuite("RSA", "DH", "SHA-1", "AES-256", 32); @@ -86,46 +80,48 @@ TLS_Ciphersuite TLS_Ciphersuite::lookup_ciphersuite(u16bit suite) case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: return TLS_Ciphersuite("RSA", "DH", "SHA-256", "AES-256", 32); - // ECDH/RSA ciphersuites - case TLS_ECDHE_RSA_WITH_RC4_128_SHA: - return TLS_Ciphersuite("RSA", "ECDH", "SHA-1", "ARC4", 16); + case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + return TLS_Ciphersuite("RSA", "DH", "SHA-1", "TripleDES", 24); - case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: - return TLS_Ciphersuite("RSA", "ECDH", "SHA-1", "TripleDES", 24); + case TLS_DHE_RSA_WITH_SEED_CBC_SHA: + return TLS_Ciphersuite("RSA", "DH", "SHA-1", "SEED", 16); + // ECDH/RSA ciphersuites case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: return TLS_Ciphersuite("RSA", "ECDH", "SHA-1", "AES-128", 16); case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: return TLS_Ciphersuite("RSA", "ECDH", "SHA-1", "AES-256", 32); - // SRP ciphersuites + case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: + return TLS_Ciphersuite("RSA", "ECDH", "SHA-1", "TripleDES", 24); - case TLS_SRP_SHA_RSA_WITH_3DES_EDE_SHA: - return TLS_Ciphersuite("RSA", "SRP", "SHA-1", "TripleDES", 24); + case TLS_ECDHE_RSA_WITH_RC4_128_SHA: + return TLS_Ciphersuite("RSA", "ECDH", "SHA-1", "ARC4", 16); - case TLS_SRP_SHA_DSS_WITH_3DES_EDE_SHA: - return TLS_Ciphersuite("DSA", "SRP", "SHA-1", "TripleDES", 24); + // SRP/RSA ciphersuites case TLS_SRP_SHA_RSA_WITH_AES_128_SHA: return TLS_Ciphersuite("RSA", "SRP", "SHA-1", "AES-128", 16); - case TLS_SRP_SHA_DSS_WITH_AES_128_SHA: - return TLS_Ciphersuite("DSA", "SRP", "SHA-1", "AES-128", 16); - case TLS_SRP_SHA_RSA_WITH_AES_256_SHA: return TLS_Ciphersuite("RSA", "SRP", "SHA-1", "AES-256", 32); + case TLS_SRP_SHA_RSA_WITH_3DES_EDE_SHA: + return TLS_Ciphersuite("RSA", "SRP", "SHA-1", "TripleDES", 24); + + // SRP/DSA ciphersuites + + case TLS_SRP_SHA_DSS_WITH_AES_128_SHA: + return TLS_Ciphersuite("DSA", "SRP", "SHA-1", "AES-128", 16); + case TLS_SRP_SHA_DSS_WITH_AES_256_SHA: return TLS_Ciphersuite("DSA", "SRP", "SHA-1", "AES-256", 32); - // ECDH/ECDSA ciphersuites - - case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: - return TLS_Ciphersuite("ECDSA", "ECDH", "SHA-1", "ARC4", 16); + case TLS_SRP_SHA_DSS_WITH_3DES_EDE_SHA: + return TLS_Ciphersuite("DSA", "SRP", "SHA-1", "TripleDES", 24); - case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: - return TLS_Ciphersuite("ECDSA", "ECDH", "SHA-1", "TripleDES", 24); + // ECDH/ECDSA ciphersuites case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: return TLS_Ciphersuite("ECDSA", "ECDH", "SHA-1", "AES-128", 16); @@ -145,6 +141,12 @@ TLS_Ciphersuite TLS_Ciphersuite::lookup_ciphersuite(u16bit suite) case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: return TLS_Ciphersuite("ECDSA", "ECDH", "SHA-384", "AES-256", 32); + case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: + return TLS_Ciphersuite("ECDSA", "ECDH", "SHA-1", "ARC4", 16); + + case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: + return TLS_Ciphersuite("ECDSA", "ECDH", "SHA-1", "TripleDES", 24); + default: return TLS_Ciphersuite(); // some unknown ciphersuite } |