aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/tls/tls_callbacks.h12
-rw-r--r--src/lib/tls/tls_channel.cpp12
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,