From a2c42d7685bb003ec48af1f8153f2e8d979f0c41 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 8 Jul 2016 09:05:45 -0700 Subject: [PATCH] Rename (s3,d1)_meth.c. These are where the DTLS- and TLS-specific transport layer hooks will be defined. Later we can probably move much of the implementations of these hooks into these files so those functions can be static. While I'm here, fix up the naming of some constants. Change-Id: I1009dd9fdc3cc4fd49fbff0802f6289931abec3d Reviewed-on: https://boringssl-review.googlesource.com/8665 Reviewed-by: Steven Valdez Reviewed-by: David Benjamin --- ssl/CMakeLists.txt | 4 ++-- ssl/{d1_meth.c => dtls_method.c} | 20 ++++++++++---------- ssl/{s3_meth.c => tls_method.c} | 32 ++++++++++++++++---------------- 3 files changed, 28 insertions(+), 28 deletions(-) rename ssl/{d1_meth.c => dtls_method.c} (93%) rename ssl/{s3_meth.c => tls_method.c} (91%) diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index 27162411..d5cb8703 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt @@ -8,14 +8,13 @@ add_library( handshake_client.c d1_both.c d1_lib.c - d1_meth.c d1_pkt.c d1_srtp.c + dtls_method.c dtls_record.c s3_both.c s3_enc.c s3_lib.c - s3_meth.c s3_pkt.c ssl_aead_ctx.c ssl_asn1.c @@ -30,6 +29,7 @@ add_library( ssl_stat.c t1_enc.c t1_lib.c + tls_method.c tls_record.c ) diff --git a/ssl/d1_meth.c b/ssl/dtls_method.c similarity index 93% rename from ssl/d1_meth.c rename to ssl/dtls_method.c index 19b7af06..00454dd7 100644 --- a/ssl/d1_meth.c +++ b/ssl/dtls_method.c @@ -88,7 +88,7 @@ static uint16_t dtls1_version_to_wire(uint16_t version) { return ~(version - 0x0201); } -static const SSL_PROTOCOL_METHOD DTLS_protocol_method = { +static const SSL_PROTOCOL_METHOD kDTLSProtocolMethod = { 1 /* is_dtls */, TLS1_1_VERSION, TLS1_2_VERSION, @@ -112,29 +112,29 @@ static const SSL_PROTOCOL_METHOD DTLS_protocol_method = { }; const SSL_METHOD *DTLS_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { 0, - &DTLS_protocol_method, + &kDTLSProtocolMethod, }; - return &method; + return &kMethod; } /* Legacy version-locked methods. */ const SSL_METHOD *DTLSv1_2_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { DTLS1_2_VERSION, - &DTLS_protocol_method, + &kDTLSProtocolMethod, }; - return &method; + return &kMethod; } const SSL_METHOD *DTLSv1_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { DTLS1_VERSION, - &DTLS_protocol_method, + &kDTLSProtocolMethod, }; - return &method; + return &kMethod; } /* Legacy side-specific methods. */ diff --git a/ssl/s3_meth.c b/ssl/tls_method.c similarity index 91% rename from ssl/s3_meth.c rename to ssl/tls_method.c index b3cfd8c1..e8cf1d6b 100644 --- a/ssl/s3_meth.c +++ b/ssl/tls_method.c @@ -65,7 +65,7 @@ static uint16_t ssl3_version_from_wire(uint16_t wire_version) { static uint16_t ssl3_version_to_wire(uint16_t version) { return version; } -static const SSL_PROTOCOL_METHOD TLS_protocol_method = { +static const SSL_PROTOCOL_METHOD kTLSProtocolMethod = { 0 /* is_dtls */, SSL3_VERSION, TLS1_3_VERSION, @@ -89,11 +89,11 @@ static const SSL_PROTOCOL_METHOD TLS_protocol_method = { }; const SSL_METHOD *TLS_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { 0, - &TLS_protocol_method, + &kTLSProtocolMethod, }; - return &method; + return &kMethod; } const SSL_METHOD *SSLv23_method(void) { @@ -103,35 +103,35 @@ const SSL_METHOD *SSLv23_method(void) { /* Legacy version-locked methods. */ const SSL_METHOD *TLSv1_2_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { TLS1_2_VERSION, - &TLS_protocol_method, + &kTLSProtocolMethod, }; - return &method; + return &kMethod; } const SSL_METHOD *TLSv1_1_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { TLS1_1_VERSION, - &TLS_protocol_method, + &kTLSProtocolMethod, }; - return &method; + return &kMethod; } const SSL_METHOD *TLSv1_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { TLS1_VERSION, - &TLS_protocol_method, + &kTLSProtocolMethod, }; - return &method; + return &kMethod; } const SSL_METHOD *SSLv3_method(void) { - static const SSL_METHOD method = { + static const SSL_METHOD kMethod = { SSL3_VERSION, - &TLS_protocol_method, + &kTLSProtocolMethod, }; - return &method; + return &kMethod; } /* Legacy side-specific methods. */