From 8c7715ee33108214621aff47aaeb9bdc40ce2c74 Mon Sep 17 00:00:00 2001 From: toddouska Date: Thu, 24 Oct 2013 12:10:09 -0700 Subject: [PATCH] remove CBC naming from HC-128 suites --- cyassl/internal.h | 20 ++++++++++---------- src/internal.c | 36 ++++++++++++++++++------------------ src/keys.c | 12 ++++++------ src/ssl.c | 12 ++++++------ 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/cyassl/internal.h b/cyassl/internal.h index e1b386e5c..3a0ed9147 100644 --- a/cyassl/internal.h +++ b/cyassl/internal.h @@ -255,12 +255,12 @@ void c32to24(word32 in, word24 out); #endif #if !defined(NO_HC128) && !defined(NO_RSA) && !defined(NO_TLS) - #define BUILD_TLS_RSA_WITH_HC_128_CBC_MD5 + #define BUILD_TLS_RSA_WITH_HC_128_MD5 #if !defined(NO_SHA) - #define BUILD_TLS_RSA_WITH_HC_128_CBC_SHA + #define BUILD_TLS_RSA_WITH_HC_128_SHA #endif #if defined(HAVE_BLAKE2) - #define BUILD_TLS_RSA_WITH_HC_128_CBC_B2B256 + #define BUILD_TLS_RSA_WITH_HC_128_B2B256 #endif #endif @@ -389,9 +389,9 @@ void c32to24(word32 in, word24 out); #define BUILD_AESGCM #endif -#if defined(BUILD_TLS_RSA_WITH_HC_128_CBC_SHA) || \ - defined(BUILD_TLS_RSA_WITH_HC_128_CBC_MD5) || \ - defined(BUILD_TLS_RSA_WITH_HC_128_CBC_B2B256) +#if defined(BUILD_TLS_RSA_WITH_HC_128_SHA) || \ + defined(BUILD_TLS_RSA_WITH_HC_128_MD5) || \ + defined(BUILD_TLS_RSA_WITH_HC_128_B2B256) #define BUILD_HC128 #endif @@ -470,14 +470,14 @@ enum { TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0x26, /* CyaSSL extension - eSTREAM */ - TLS_RSA_WITH_HC_128_CBC_MD5 = 0xFB, - TLS_RSA_WITH_HC_128_CBC_SHA = 0xFC, - TLS_RSA_WITH_RABBIT_SHA = 0xFD, + TLS_RSA_WITH_HC_128_MD5 = 0xFB, + TLS_RSA_WITH_HC_128_SHA = 0xFC, + TLS_RSA_WITH_RABBIT_SHA = 0xFD, /* CyaSSL extension - Blake2b 256 */ TLS_RSA_WITH_AES_128_CBC_B2B256 = 0xF8, TLS_RSA_WITH_AES_256_CBC_B2B256 = 0xF9, - TLS_RSA_WITH_HC_128_CBC_B2B256 = 0xFA, /* eSTREAM too */ + TLS_RSA_WITH_HC_128_B2B256 = 0xFA, /* eSTREAM too */ /* CyaSSL extension - NTRU */ diff --git a/src/internal.c b/src/internal.c index 1e34b052c..e7bf2412e 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1091,24 +1091,24 @@ void InitSuites(Suites* suites, ProtocolVersion pv, byte haveRSA, byte havePSK, } #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5 +#ifdef BUILD_TLS_RSA_WITH_HC_128_MD5 if (tls && haveRSA) { suites->suites[idx++] = 0; - suites->suites[idx++] = TLS_RSA_WITH_HC_128_CBC_MD5; + suites->suites[idx++] = TLS_RSA_WITH_HC_128_MD5; } #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA +#ifdef BUILD_TLS_RSA_WITH_HC_128_SHA if (tls && haveRSA) { suites->suites[idx++] = 0; - suites->suites[idx++] = TLS_RSA_WITH_HC_128_CBC_SHA; + suites->suites[idx++] = TLS_RSA_WITH_HC_128_SHA; } #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_B2B256 +#ifdef BUILD_TLS_RSA_WITH_HC_128_B2B256 if (tls && haveRSA) { suites->suites[idx++] = 0; - suites->suites[idx++] = TLS_RSA_WITH_HC_128_CBC_B2B256; + suites->suites[idx++] = TLS_RSA_WITH_HC_128_B2B256; } #endif @@ -6155,15 +6155,15 @@ const char* const cipher_names[] = "PSK-NULL-SHA", #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5 +#ifdef BUILD_TLS_RSA_WITH_HC_128_MD5 "HC128-MD5", #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA +#ifdef BUILD_TLS_RSA_WITH_HC_128_SHA "HC128-SHA", #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_B2B256 +#ifdef BUILD_TLS_RSA_WITH_HC_128_B2B256 "HC128-B2B256", #endif @@ -6475,16 +6475,16 @@ int cipher_name_idx[] = TLS_PSK_WITH_NULL_SHA, #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5 - TLS_RSA_WITH_HC_128_CBC_MD5, +#ifdef BUILD_TLS_RSA_WITH_HC_128_MD5 + TLS_RSA_WITH_HC_128_MD5, #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA - TLS_RSA_WITH_HC_128_CBC_SHA, +#ifdef BUILD_TLS_RSA_WITH_HC_128_SHA + TLS_RSA_WITH_HC_128_SHA, #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_B2B256 - TLS_RSA_WITH_HC_128_CBC_B2B256, +#ifdef BUILD_TLS_RSA_WITH_HC_128_B2B256 + TLS_RSA_WITH_HC_128_B2B256, #endif #ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_B2B256 @@ -9340,17 +9340,17 @@ static void PickHashSigAlgo(CYASSL* ssl, return 1; break; - case TLS_RSA_WITH_HC_128_CBC_MD5 : + case TLS_RSA_WITH_HC_128_MD5 : if (requirement == REQUIRES_RSA) return 1; break; - case TLS_RSA_WITH_HC_128_CBC_SHA : + case TLS_RSA_WITH_HC_128_SHA : if (requirement == REQUIRES_RSA) return 1; break; - case TLS_RSA_WITH_HC_128_CBC_B2B256: + case TLS_RSA_WITH_HC_128_B2B256: if (requirement == REQUIRES_RSA) return 1; break; diff --git a/src/keys.c b/src/keys.c index 91c0bdf36..1f43600d7 100644 --- a/src/keys.c +++ b/src/keys.c @@ -1088,8 +1088,8 @@ int SetCipherSpecs(CYASSL* ssl) break; #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5 - case TLS_RSA_WITH_HC_128_CBC_MD5 : +#ifdef BUILD_TLS_RSA_WITH_HC_128_MD5 + case TLS_RSA_WITH_HC_128_MD5 : ssl->specs.bulk_cipher_algorithm = cyassl_hc128; ssl->specs.cipher_type = stream; ssl->specs.mac_algorithm = md5_mac; @@ -1105,8 +1105,8 @@ int SetCipherSpecs(CYASSL* ssl) break; #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA - case TLS_RSA_WITH_HC_128_CBC_SHA : +#ifdef BUILD_TLS_RSA_WITH_HC_128_SHA + case TLS_RSA_WITH_HC_128_SHA : ssl->specs.bulk_cipher_algorithm = cyassl_hc128; ssl->specs.cipher_type = stream; ssl->specs.mac_algorithm = sha_mac; @@ -1122,8 +1122,8 @@ int SetCipherSpecs(CYASSL* ssl) break; #endif -#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_B2B256 - case TLS_RSA_WITH_HC_128_CBC_B2B256: +#ifdef BUILD_TLS_RSA_WITH_HC_128_B2B256 + case TLS_RSA_WITH_HC_128_B2B256: ssl->specs.bulk_cipher_algorithm = cyassl_hc128; ssl->specs.cipher_type = stream; ssl->specs.mac_algorithm = blake2b_mac; diff --git a/src/ssl.c b/src/ssl.c index 942db276d..2ee2c8e83 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -7580,16 +7580,16 @@ CYASSL_X509* CyaSSL_X509_load_certificate_file(const char* fname, int format) #endif #ifndef NO_HC128 #ifndef NO_MD5 - case TLS_RSA_WITH_HC_128_CBC_MD5 : - return "TLS_RSA_WITH_HC_128_CBC_MD5"; + case TLS_RSA_WITH_HC_128_MD5 : + return "TLS_RSA_WITH_HC_128_MD5"; #endif #ifndef NO_SHA - case TLS_RSA_WITH_HC_128_CBC_SHA : - return "TLS_RSA_WITH_HC_128_CBC_SHA"; + case TLS_RSA_WITH_HC_128_SHA : + return "TLS_RSA_WITH_HC_128_SHA"; #endif #ifdef HAVE_BLAKE2 - case TLS_RSA_WITH_HC_128_CBC_B2B256: - return "TLS_RSA_WITH_HC_128_CBC_B2B256"; + case TLS_RSA_WITH_HC_128_B2B256: + return "TLS_RSA_WITH_HC_128_B2B256"; #endif #endif /* NO_HC128 */ #ifndef NO_SHA