]> granicus.if.org Git - icinga2/commitdiff
Quality: Remove old MakeSSLContext() interface
authorMichael Friedrich <michael.friedrich@icinga.com>
Tue, 28 May 2019 11:03:34 +0000 (13:03 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 28 May 2019 11:03:34 +0000 (13:03 +0200)
lib/base/tlsutility.cpp
lib/base/tlsutility.hpp

index 59bf54bf0610bb48813d4b3fb08b3e9fe7d2942c..cc6fe8c176399a07024a9f9953971e02b9fada56 100644 (file)
@@ -129,25 +129,6 @@ static void SetupSslContext(SSL_CTX *sslContext, const String& pubkey, const Str
        }
 }
 
-/**
- * Initializes an SSL context using the specified certificates.
- *
- * @param pubkey The public key.
- * @param privkey The matching private key.
- * @param cakey CA certificate chain file.
- * @returns An SSL context.
- */
-std::shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey)
-{
-       InitializeOpenSSL();
-
-       std::shared_ptr<SSL_CTX> sslContext = std::shared_ptr<SSL_CTX>(SSL_CTX_new(SSLv23_method()), SSL_CTX_free);
-
-       SetupSslContext(sslContext.get(), pubkey, privkey, cakey);
-
-       return sslContext;
-}
-
 /**
  * Initializes an SSL context using the specified certificates.
  *
index 69b10786c97d10ec2fdb37404cbf9ad6e64e5a75..de7033311e5bb1dd81f741e6a638fead804b869a 100644 (file)
@@ -21,25 +21,30 @@ namespace icinga
 {
 
 void InitializeOpenSSL();
-std::shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey = String(), const String& privkey = String(), const String& cakey = String());
+
 std::shared_ptr<boost::asio::ssl::context> MakeAsioSslContext(const String& pubkey = String(), const String& privkey = String(), const String& cakey = String());
 void AddCRLToSSLContext(const std::shared_ptr<boost::asio::ssl::context>& context, const String& crlPath);
 void SetCipherListToSSLContext(const std::shared_ptr<boost::asio::ssl::context>& context, const String& cipherList);
 void SetTlsProtocolminToSSLContext(const std::shared_ptr<boost::asio::ssl::context>& context, const String& tlsProtocolmin);
+
 String GetCertificateCN(const std::shared_ptr<X509>& certificate);
 std::shared_ptr<X509> GetX509Certificate(const String& pemfile);
 int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile = String(), const String& certfile = String(), bool ca = false);
 std::shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca);
+
 String GetIcingaCADir();
 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);
 std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert);
+
 String PBKDF2_SHA1(const String& password, const String& salt, int iterations);
 String PBKDF2_SHA256(const String& password, const String& salt, int iterations);
 String SHA1(const String& s, bool binary = false);
 String SHA256(const String& s);
 String RandomString(int length);
+
 bool VerifyCertificate(const std::shared_ptr<X509>& caCertificate, const std::shared_ptr<X509>& certificate);
 
 class openssl_error : virtual public std::exception, virtual public boost::exception { };