mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-25 18:48:50 +02:00
IsCertUptodate(): allow raw pointer input
This commit is contained in:
parent
b3315a4f7e
commit
415ea3a5b7
@ -760,7 +760,7 @@ std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert)
|
||||
return CreateCertIcingaCA(pkey.get(), X509_get_subject_name(cert.get()));
|
||||
}
|
||||
|
||||
bool IsCertUptodate(const std::shared_ptr<X509>& cert)
|
||||
bool IsCertUptodate(X509* cert)
|
||||
{
|
||||
time_t now;
|
||||
time(&now);
|
||||
@ -771,7 +771,7 @@ bool IsCertUptodate(const std::shared_ptr<X509>& cert)
|
||||
time_t forceRenewalEnd = 1483228800; /* January 1st, 2017 */
|
||||
time_t renewalStart = now + RENEW_THRESHOLD;
|
||||
|
||||
return X509_cmp_time(X509_get_notBefore(cert.get()), &forceRenewalEnd) != -1 && X509_cmp_time(X509_get_notAfter(cert.get()), &renewalStart) != -1;
|
||||
return X509_cmp_time(X509_get_notBefore(cert), &forceRenewalEnd) != -1 && X509_cmp_time(X509_get_notAfter(cert), &renewalStart) != -1;
|
||||
}
|
||||
|
||||
String CertificateToString(const std::shared_ptr<X509>& cert)
|
||||
|
@ -63,7 +63,12 @@ String CertificateToString(const std::shared_ptr<X509>& cert);
|
||||
std::shared_ptr<X509> StringToCertificate(const String& cert);
|
||||
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject, bool ca = false);
|
||||
std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert);
|
||||
bool IsCertUptodate(const std::shared_ptr<X509>& cert);
|
||||
bool IsCertUptodate(X509* cert);
|
||||
|
||||
inline bool IsCertUptodate(const std::shared_ptr<X509>& cert)
|
||||
{
|
||||
return IsCertUptodate(cert.get());
|
||||
}
|
||||
|
||||
String PBKDF2_SHA1(const String& password, const String& salt, int iterations);
|
||||
String PBKDF2_SHA256(const String& password, const String& salt, int iterations);
|
||||
|
Loading…
x
Reference in New Issue
Block a user