Skip to content

Commit d1098dc

Browse files
committed
CreateCertIcingaCA(EVP_PKEY*, X509_NAME*): enable optional CA creation
1 parent 9345caa commit d1098dc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/base/tlsutility.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ String GetIcingaCADir()
706706
return Configuration::DataDir + "/ca";
707707
}
708708

709-
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
709+
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject, bool ca)
710710
{
711711
char errbuf[256];
712712

@@ -743,7 +743,7 @@ std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
743743
EVP_PKEY *privkey = EVP_PKEY_new();
744744
EVP_PKEY_assign_RSA(privkey, rsa);
745745

746-
return CreateCert(pubkey, subject, X509_get_subject_name(cacert.get()), privkey, false);
746+
return CreateCert(pubkey, subject, X509_get_subject_name(cacert.get()), privkey, ca);
747747
}
748748

749749
std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert)

lib/base/tlsutility.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ String GetIcingaCADir();
5858
String CertificateToString(const std::shared_ptr<X509>& cert);
5959

6060
std::shared_ptr<X509> StringToCertificate(const String& cert);
61-
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject);
61+
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject, bool ca = false);
6262
std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert);
6363
bool IsCertUptodate(const std::shared_ptr<X509>& cert);
6464
bool IsCaUptodate(X509* cert);

0 commit comments

Comments
 (0)