CreateCertIcingaCA(EVP_PKEY*, X509_NAME*): enable optional CA creation

This commit is contained in:
Alexander A. Klimov 2023-11-06 10:28:55 +01:00
parent dc338a406a
commit 7b55df6f11
2 changed files with 3 additions and 3 deletions

View File

@ -714,7 +714,7 @@ String GetIcingaCADir()
return Configuration::DataDir + "/ca"; return Configuration::DataDir + "/ca";
} }
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject) std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject, bool ca)
{ {
char errbuf[256]; char errbuf[256];
@ -751,7 +751,7 @@ std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
EVP_PKEY *privkey = EVP_PKEY_new(); EVP_PKEY *privkey = EVP_PKEY_new();
EVP_PKEY_assign_RSA(privkey, rsa); EVP_PKEY_assign_RSA(privkey, rsa);
return CreateCert(pubkey, subject, X509_get_subject_name(cacert.get()), privkey, false); return CreateCert(pubkey, subject, X509_get_subject_name(cacert.get()), privkey, ca);
} }
std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert) std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert)

View File

@ -61,7 +61,7 @@ String GetIcingaCADir();
String CertificateToString(const std::shared_ptr<X509>& cert); String CertificateToString(const std::shared_ptr<X509>& cert);
std::shared_ptr<X509> StringToCertificate(const String& cert); std::shared_ptr<X509> StringToCertificate(const String& cert);
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject); 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); std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert);
bool IsCertUptodate(const std::shared_ptr<X509>& cert); bool IsCertUptodate(const std::shared_ptr<X509>& cert);
bool IsCaUptodate(X509* cert); bool IsCaUptodate(X509* cert);