diff options
author | René Meusel <[email protected]> | 2022-05-18 13:18:05 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-05-18 13:18:05 +0200 |
commit | 15228710faef1b85aaad0cad4f207b8b6dfcdf74 (patch) | |
tree | f9bc7580ac098b1cb4ef0b5d284ab59b12ddeca8 /src/lib/tls/tls_callbacks.h | |
parent | 2fb7ba81b0304f0864a557e3f3a010f4c2ce08d3 (diff) | |
parent | 3bedb5f3cb94ecc5607572b404c4a324f7acc2a7 (diff) |
Introduce TLS::Callbacks::tls_current_timestamp()
Diffstat (limited to 'src/lib/tls/tls_callbacks.h')
-rw-r--r-- | src/lib/tls/tls_callbacks.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/tls/tls_callbacks.h b/src/lib/tls/tls_callbacks.h index 67da7c5a7..dd52f848e 100644 --- a/src/lib/tls/tls_callbacks.h +++ b/src/lib/tls/tls_callbacks.h @@ -15,6 +15,7 @@ #include <botan/pubkey.h> #include <botan/ocsp.h> #include <optional> +#include <chrono> namespace Botan { @@ -358,6 +359,17 @@ class BOTAN_PUBLIC_API(2,0) Callbacks virtual std::string tls_peer_network_identity(); /** + * Optional callback: return a custom time stamp value + * + * This allows the library user to specify a custom "now" timestamp when + * needed. By default it will use the current system clock time. + * + * Note that typical usages will not need to override this callback but it + * is useful for testing purposes to allow for deterministic test outcomes. + */ + virtual std::chrono::system_clock::time_point tls_current_timestamp(); + + /** * Optional callback: error logging. (not currently called) * @param err An error message related to this connection. */ |