"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/base/tlsutility.hpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

tlsutility.hpp  (icinga2-2.11.5):tlsutility.hpp  (icinga2-2.12.0)
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#ifndef TLSUTILITY_H #ifndef TLSUTILITY_H
#define TLSUTILITY_H #define TLSUTILITY_H
#include "base/i2-base.hpp" #include "base/i2-base.hpp"
#include "base/object.hpp" #include "base/object.hpp"
#include "base/shared.hpp"
#include "base/array.hpp"
#include "base/string.hpp" #include "base/string.hpp"
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/bio.h> #include <openssl/bio.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/comp.h> #include <openssl/comp.h>
#include <openssl/sha.h> #include <openssl/sha.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h> #include <openssl/x509v3.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <boost/asio/ssl/context.hpp> #include <boost/asio/ssl/context.hpp>
#include <boost/exception/info.hpp> #include <boost/exception/info.hpp>
namespace icinga namespace icinga
{ {
void InitializeOpenSSL(); void InitializeOpenSSL();
std::shared_ptr<boost::asio::ssl::context> MakeAsioSslContext(const String& pubk String GetOpenSSLVersion();
ey = String(), const String& privkey = String(), const String& cakey = String())
; Shared<boost::asio::ssl::context>::Ptr MakeAsioSslContext(const String& pubkey =
void AddCRLToSSLContext(const std::shared_ptr<boost::asio::ssl::context>& contex String(), const String& privkey = String(), const String& cakey = String());
t, const String& crlPath); void AddCRLToSSLContext(const Shared<boost::asio::ssl::context>::Ptr& context, c
void SetCipherListToSSLContext(const std::shared_ptr<boost::asio::ssl::context>& onst String& crlPath);
context, const String& cipherList); void SetCipherListToSSLContext(const Shared<boost::asio::ssl::context>::Ptr& con
void SetTlsProtocolminToSSLContext(const std::shared_ptr<boost::asio::ssl::conte text, const String& cipherList);
xt>& context, const String& tlsProtocolmin); void SetTlsProtocolminToSSLContext(const Shared<boost::asio::ssl::context>::Ptr&
context, const String& tlsProtocolmin);
String GetCertificateCN(const std::shared_ptr<X509>& certificate); String GetCertificateCN(const std::shared_ptr<X509>& certificate);
std::shared_ptr<X509> GetX509Certificate(const String& pemfile); 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); 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); std::shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca);
String GetIcingaCADir(); 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);
std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert); std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert);
String PBKDF2_SHA1(const String& password, const String& salt, int iterations); String PBKDF2_SHA1(const String& password, const String& salt, int iterations);
String PBKDF2_SHA256(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 SHA1(const String& s, bool binary = false);
String SHA256(const String& s); String SHA256(const String& s);
String RandomString(int length); String RandomString(int length);
bool VerifyCertificate(const std::shared_ptr<X509>& caCertificate, const std::sh ared_ptr<X509>& certificate); bool VerifyCertificate(const std::shared_ptr<X509>& caCertificate, const std::sh ared_ptr<X509>& certificate);
bool IsCa(const std::shared_ptr<X509>& cacert);
int GetCertificateVersion(const std::shared_ptr<X509>& cert);
String GetSignatureAlgorithm(const std::shared_ptr<X509>& cert);
Array::Ptr GetSubjectAltNames(const std::shared_ptr<X509>& cert);
class openssl_error : virtual public std::exception, virtual public boost::excep tion { }; class openssl_error : virtual public std::exception, virtual public boost::excep tion { };
struct errinfo_openssl_error_; struct errinfo_openssl_error_;
typedef boost::error_info<struct errinfo_openssl_error_, unsigned long> errinfo_ openssl_error; typedef boost::error_info<struct errinfo_openssl_error_, unsigned long> errinfo_ openssl_error;
std::string to_string(const errinfo_openssl_error& e); std::string to_string(const errinfo_openssl_error& e);
} }
 End of changes. 4 change blocks. 
9 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)