aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-01-04 18:46:49 +0000
committerlloyd <[email protected]>2012-01-04 18:46:49 +0000
commit550faf230b01c657b5883a35643e8b9865b122ca (patch)
tree14f24717e4b539e02408841a54b08f7530e9996b /src
parent01f21a93c66965876097ee1c989cf7b4ce1f9a2a (diff)
As someone pointed out on the TLS list, NPN isn't really a negotiation
per-se, it's a notification by the client. Rename accordingly.
Diffstat (limited to 'src')
-rw-r--r--src/tls/c_hello.cpp4
-rw-r--r--src/tls/s_hello.cpp4
-rw-r--r--src/tls/tls_channel.cpp4
-rw-r--r--src/tls/tls_client.cpp6
-rw-r--r--src/tls/tls_extensions.cpp8
-rw-r--r--src/tls/tls_extensions.h10
-rw-r--r--src/tls/tls_messages.h4
-rw-r--r--src/tls/tls_server.cpp6
8 files changed, 23 insertions, 23 deletions
diff --git a/src/tls/c_hello.cpp b/src/tls/c_hello.cpp
index fa187dbf1..448b8d575 100644
--- a/src/tls/c_hello.cpp
+++ b/src/tls/c_hello.cpp
@@ -152,7 +152,7 @@ MemoryVector<byte> Client_Hello::serialize() const
extensions.push_back(new SRP_Identifier(m_srp_identifier));
if(m_next_protocol)
- extensions.push_back(new Next_Protocol_Negotiation());
+ extensions.push_back(new Next_Protocol_Notification());
}
else
{
@@ -246,7 +246,7 @@ void Client_Hello::deserialize(const MemoryRegion<byte>& buf)
{
m_srp_identifier = srp->identifier();
}
- else if(Next_Protocol_Negotiation* npn = dynamic_cast<Next_Protocol_Negotiation*>(extn))
+ else if(Next_Protocol_Notification* npn = dynamic_cast<Next_Protocol_Notification*>(extn))
{
if(!npn->protocols().empty())
throw Decoding_Error("Client sent non-empty NPN extension");
diff --git a/src/tls/s_hello.cpp b/src/tls/s_hello.cpp
index 4fa67ca53..90e18ae90 100644
--- a/src/tls/s_hello.cpp
+++ b/src/tls/s_hello.cpp
@@ -116,7 +116,7 @@ MemoryVector<byte> Server_Hello::serialize() const
extensions.push_back(new Maximum_Fragment_Length(m_fragment_size));
if(m_next_protocol)
- extensions.push_back(new Next_Protocol_Negotiation(m_next_protocols));
+ extensions.push_back(new Next_Protocol_Notification(m_next_protocols));
buf += extensions.serialize();
@@ -164,7 +164,7 @@ void Server_Hello::deserialize(const MemoryRegion<byte>& buf)
m_secure_renegotiation = true;
m_renegotiation_info = reneg->renegotiation_info();
}
- else if(Next_Protocol_Negotiation* npn = dynamic_cast<Next_Protocol_Negotiation*>(extn))
+ else if(Next_Protocol_Notification* npn = dynamic_cast<Next_Protocol_Notification*>(extn))
{
m_next_protocols = npn->protocols();
m_next_protocol = true;
diff --git a/src/tls/tls_channel.cpp b/src/tls/tls_channel.cpp
index c20ee78f8..28cc8a0a4 100644
--- a/src/tls/tls_channel.cpp
+++ b/src/tls/tls_channel.cpp
@@ -222,7 +222,7 @@ void TLS_Channel::Secure_Renegotiation_State::update(Client_Hello* client_hello)
{
if(secure_renegotiation != client_hello->secure_renegotiation())
throw TLS_Exception(HANDSHAKE_FAILURE,
- "Client changed its mind about secure negotiation");
+ "Client changed its mind about secure renegotiation");
}
if(client_hello->secure_renegotiation())
@@ -257,7 +257,7 @@ void TLS_Channel::Secure_Renegotiation_State::update(Server_Hello* server_hello)
{
if(secure_renegotiation != server_hello->secure_renegotiation())
throw TLS_Exception(HANDSHAKE_FAILURE,
- "Server changed its mind about secure negotiation");
+ "Server changed its mind about secure renegotiation");
}
if(secure_renegotiation)
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp
index f796736fa..e79fb18d8 100644
--- a/src/tls/tls_client.cpp
+++ b/src/tls/tls_client.cpp
@@ -154,8 +154,8 @@ void TLS_Client::process_handshake_msg(Handshake_Type type,
"Server replied with compression method we didn't send");
}
- if(!state->client_hello->next_protocol_negotiation() &&
- state->server_hello->next_protocol_negotiation())
+ if(!state->client_hello->next_protocol_notification() &&
+ state->server_hello->next_protocol_notification())
{
throw TLS_Exception(HANDSHAKE_FAILURE,
"Server sent next protocol but we didn't request it");
@@ -350,7 +350,7 @@ void TLS_Client::process_handshake_msg(Handshake_Type type,
writer.activate(state->suite, state->keys, CLIENT);
- if(state->server_hello->next_protocol_negotiation())
+ if(state->server_hello->next_protocol_notification())
{
const std::string protocol =
state->client_npn_cb(state->server_hello->next_protocols());
diff --git a/src/tls/tls_extensions.cpp b/src/tls/tls_extensions.cpp
index c74790ea1..c57f7cc81 100644
--- a/src/tls/tls_extensions.cpp
+++ b/src/tls/tls_extensions.cpp
@@ -26,7 +26,7 @@ TLS_Extension* make_extension(TLS_Data_Reader& reader,
else if(code == TLSEXT_SAFE_RENEGOTIATION)
return new Renegotation_Extension(reader, size);
else if(code == TLSEXT_NEXT_PROTOCOL)
- return new Next_Protocol_Negotiation(reader, size);
+ return new Next_Protocol_Notification(reader, size);
else
return 0; // not known
}
@@ -230,8 +230,8 @@ Maximum_Fragment_Length::Maximum_Fragment_Length(TLS_Data_Reader& reader,
val = reader.get_byte();
}
-Next_Protocol_Negotiation::Next_Protocol_Negotiation(TLS_Data_Reader& reader,
- u16bit extension_size)
+Next_Protocol_Notification::Next_Protocol_Notification(TLS_Data_Reader& reader,
+ u16bit extension_size)
{
if(extension_size == 0)
return; // empty extension
@@ -251,7 +251,7 @@ Next_Protocol_Negotiation::Next_Protocol_Negotiation(TLS_Data_Reader& reader,
}
}
-MemoryVector<byte> Next_Protocol_Negotiation::serialize() const
+MemoryVector<byte> Next_Protocol_Notification::serialize() const
{
MemoryVector<byte> buf;
diff --git a/src/tls/tls_extensions.h b/src/tls/tls_extensions.h
index c4021159d..62f179998 100644
--- a/src/tls/tls_extensions.h
+++ b/src/tls/tls_extensions.h
@@ -146,7 +146,7 @@ class Maximum_Fragment_Length : public TLS_Extension
* spec (implemented in Chromium); the internet draft leaves the format
* unspecified.
*/
-class Next_Protocol_Negotiation : public TLS_Extension
+class Next_Protocol_Notification : public TLS_Extension
{
public:
TLS_Handshake_Extension_Type type() const
@@ -158,16 +158,16 @@ class Next_Protocol_Negotiation : public TLS_Extension
/**
* Empty extension, used by client
*/
- Next_Protocol_Negotiation() {}
+ Next_Protocol_Notification() {}
/**
* List of protocols, used by server
*/
- Next_Protocol_Negotiation(const std::vector<std::string>& protocols) :
+ Next_Protocol_Notification(const std::vector<std::string>& protocols) :
m_protocols(protocols) {}
- Next_Protocol_Negotiation(TLS_Data_Reader& reader,
- u16bit extension_size);
+ Next_Protocol_Notification(TLS_Data_Reader& reader,
+ u16bit extension_size);
MemoryVector<byte> serialize() const;
diff --git a/src/tls/tls_messages.h b/src/tls/tls_messages.h
index 3da9b1076..6c2749e42 100644
--- a/src/tls/tls_messages.h
+++ b/src/tls/tls_messages.h
@@ -75,7 +75,7 @@ class Client_Hello : public Handshake_Message
bool offered_suite(u16bit ciphersuite) const;
- bool next_protocol_negotiation() const { return m_next_protocol; }
+ bool next_protocol_notification() const { return m_next_protocol; }
size_t fragment_size() const { return m_fragment_size; }
@@ -142,7 +142,7 @@ class Server_Hello : public Handshake_Message
bool secure_renegotiation() const { return m_secure_renegotiation; }
- bool next_protocol_negotiation() const { return m_next_protocol; }
+ bool next_protocol_notification() const { return m_next_protocol; }
const std::vector<std::string>& next_protocols() const
{ return m_next_protocols; }
diff --git a/src/tls/tls_server.cpp b/src/tls/tls_server.cpp
index 729c185df..c37e05f16 100644
--- a/src/tls/tls_server.cpp
+++ b/src/tls/tls_server.cpp
@@ -183,7 +183,7 @@ void TLS_Server::process_handshake_msg(Handshake_Type type,
session_info.fragment_size(),
secure_renegotiation.supported(),
secure_renegotiation.for_server_hello(),
- state->client_hello->next_protocol_negotiation(),
+ state->client_hello->next_protocol_notification(),
m_possible_protocols,
rng);
@@ -233,7 +233,7 @@ void TLS_Server::process_handshake_msg(Handshake_Type type,
policy,
secure_renegotiation.supported(),
secure_renegotiation.for_server_hello(),
- state->client_hello->next_protocol_negotiation(),
+ state->client_hello->next_protocol_notification(),
m_possible_protocols,
rng);
@@ -351,7 +351,7 @@ void TLS_Server::process_handshake_msg(Handshake_Type type,
}
else if(type == HANDSHAKE_CCS)
{
- if(state->server_hello->next_protocol_negotiation())
+ if(state->server_hello->next_protocol_notification())
state->set_expected_next(NEXT_PROTOCOL);
else
state->set_expected_next(FINISHED);