MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CertExpiresWithin

Function CertExpiresWithin

lib/base/tlsutility.cpp:811–817  ·  view source on GitHub ↗

* Checks whether the specified certificate expires within the specified number of seconds. * * @param cert The certificate to its expiration for. * @param seconds The number of seconds to check against. * * @returns True if the certificate expires within the specified number of seconds, false otherwise. */

Source from the content-addressed store, hash-verified

809 * @returns True if the certificate expires within the specified number of seconds, false otherwise.
810 */
811static bool CertExpiresWithin(X509* cert, long seconds)
812{
813 auto now = time(nullptr);
814 std::shared_ptr<ASN1_TIME> renewalStart(X509_time_adj_ex(nullptr, 0, seconds, &now), ASN1_TIME_free);
815
816 return Asn1TimeCompare(X509_get_notAfter(cert), renewalStart.get()) < 0;
817}
818
819bool IsCertUptodate(const std::shared_ptr<X509>& cert)
820{

Callers 2

IsCertUptodateFunction · 0.85
IsCaUptodateFunction · 0.85

Calls 2

Asn1TimeCompareFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected