diff options
author | Jack Lloyd <[email protected]> | 2016-08-31 10:39:31 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-08-31 10:39:31 -0400 |
commit | c1fe86cbf842392118c977b3799070de35ee56fc (patch) | |
tree | f673afb1d645098a6edb4552e93f6b2f19fe8d7e | |
parent | 58a8cda50c5f3e206e6a033ff7601cd00086115e (diff) |
Move some Callback functions to a source file.
Just to avoid the unused parameter warning (we want the parameter
to be named in the header for documentation purposes, but in that
case GCC warns that the param is unused).
-rw-r--r-- | src/lib/tls/tls_callbacks.h | 12 | ||||
-rw-r--r-- | src/lib/tls/tls_channel.cpp | 12 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/tls/tls_callbacks.h b/src/lib/tls/tls_callbacks.h index d7a68da31..75887c23f 100644 --- a/src/lib/tls/tls_callbacks.h +++ b/src/lib/tls/tls_callbacks.h @@ -24,7 +24,7 @@ class Handshake_Message; class BOTAN_DLL Callbacks { public: - virtual ~Callbacks() {} + virtual ~Callbacks(); /** * Mandatory callback: output function @@ -77,10 +77,11 @@ class BOTAN_DLL Callbacks /** * Optional callback: inspect handshake message * Throw an exception to abort the handshake. + * Default simply ignores the message. * * @param message the handshake message */ - virtual void tls_inspect_handshake_msg(const Handshake_Message& message) {} + virtual void tls_inspect_handshake_msg(const Handshake_Message& message); /** * Optional callback for server: choose ALPN protocol @@ -93,12 +94,9 @@ class BOTAN_DLL Callbacks * * @return the protocol selected by the server, which need not be on the * list that the client sent; if this is the empty string, the server ignores the - * client ALPN extension + * client ALPN extension. Default return value is empty string. */ - virtual std::string tls_server_choose_app_protocol(const std::vector<std::string>& client_protos) - { - return ""; - } + virtual std::string tls_server_choose_app_protocol(const std::vector<std::string>& client_protos); /** * Optional callback: debug logging. (not currently used) diff --git a/src/lib/tls/tls_channel.cpp b/src/lib/tls/tls_channel.cpp index 5f882af64..a476b21bd 100644 --- a/src/lib/tls/tls_channel.cpp +++ b/src/lib/tls/tls_channel.cpp @@ -19,6 +19,18 @@ namespace Botan { namespace TLS { +Callbacks::~Callbacks() {} + +void Callbacks::tls_inspect_handshake_msg(const Handshake_Message&) + { + // default is no op + } + +std::string Callbacks::tls_server_choose_app_protocol(const std::vector<std::string>&) + { + return ""; + } + size_t TLS::Channel::IO_BUF_DEFAULT_SIZE = 10*1024; Channel::Channel(Callbacks& callbacks, |