aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_callbacks.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-01-21 14:00:12 -0500
committerJack Lloyd <[email protected]>2018-01-27 09:43:14 -0500
commitdd960f0a5e34ec4b0319c8069fb1ccb58ef8c901 (patch)
tree4141982ddd71262d5e66e791a5ddf238db69df30 /src/lib/tls/tls_callbacks.h
parent936da0514b06b341e6fab372477e32c90df05d57 (diff)
Add an examine callback also
Diffstat (limited to 'src/lib/tls/tls_callbacks.h')
-rw-r--r--src/lib/tls/tls_callbacks.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/lib/tls/tls_callbacks.h b/src/lib/tls/tls_callbacks.h
index 3ac1a9d2f..dd6ad2d4b 100644
--- a/src/lib/tls/tls_callbacks.h
+++ b/src/lib/tls/tls_callbacks.h
@@ -251,15 +251,37 @@ class BOTAN_PUBLIC_API(2,0) Callbacks
virtual std::string tls_server_choose_app_protocol(const std::vector<std::string>& client_protos);
/**
- * Optional callback: examine/modify Extensions before sending. Both
- * client and server will call this callback on the Extensions object
- * before serializing it in the client/server hellos. This allows a client
- * to modify which extensions are sent during the handshake. This also
- * allows creating custom extensions.
+ * Optional callback: examine/modify Extensions before sending.
+ *
+ * Both client and server will call this callback on the Extensions object
+ * before serializing it in the client/server hellos. This allows an
+ * application to modify which extensions are sent during the
+ * handshake.
*
* Default implementation does nothing.
+ *
+ * @param extn the extensions
+ * @param which_side will be CLIENT or SERVER which is the current
+ * applications role in the exchange.
+ */
+ virtual void tls_modify_extensions(Extensions& extn, Connection_Side which_side);
+
+ /**
+ * Optional callback: examine peer extensions.
+ *
+ * Both client and server will call this callback with the Extensions
+ * object after receiving it from the peer. This allows examining the
+ * Extensions, for example to implement a custom extension. It also allows
+ * an application to require that a particular extension be implemented;
+ * throw an exception from this function to abort the handshake.
+ *
+ * Default implementation does nothing.
+ *
+ * @param extn the extensions
+ * @param which_side will be CLIENT if these are are the clients extensions (ie we are
+ * the server) or SERVER if these are the server extensions (we are the client).
*/
- virtual void tls_modify_extensions(Extensions& extn);
+ virtual void tls_examine_extensions(const Extensions& extn, Connection_Side which_side);
/**
* Optional callback: error logging. (not currently called)