From 5a24fb0f61dec76b7a022d8da37fc1c222d63d95 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 1 Mar 2023 20:07:16 +0000 Subject: Add client cert activation/expiration times to the ssl_cert class. --- include/modules/ssl.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'include/modules') diff --git a/include/modules/ssl.h b/include/modules/ssl.h index 603fe9305..5b60ac9a6 100644 --- a/include/modules/ssl.h +++ b/include/modules/ssl.h @@ -47,8 +47,17 @@ class ssl_cert : public refcountbase std::string error; std::string fingerprint; bool trusted, invalid, unknownsigner, revoked; - - ssl_cert() : trusted(false), invalid(true), unknownsigner(true), revoked(false) {} + time_t activation, expiration; + + ssl_cert() + : trusted(false) + , invalid(true) + , unknownsigner(true) + , revoked(false) + , activation(0) + , expiration(0) + { + } /** Get certificate distinguished name * @return Certificate DN @@ -137,6 +146,22 @@ class ssl_cert : public refcountbase return IsUsable() && trusted && !unknownsigner; } + /** Retrieves the client certificate activation time. + * @param The time the client certificate was activated or 0 on error. + */ + time_t GetActivationTime() const + { + return activation; + } + + /** Retrieves the client certificate expiration time. + * @param The time the client certificate will expire or 0 on error. + */ + time_t GetExpirationTime() const + { + return expiration; + } + std::string GetMetaLine() const { std::stringstream value; -- cgit v1.3.1-10-gc9f91