From 451f05121eee771a95e928dbda4146acc0a5d2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Mon, 5 Mar 2018 22:15:39 +0100 Subject: [PATCH] #2197: fix style --- NetSSL_OpenSSL/include/Poco/Net/Context.h | 76 +++++++++++------------ NetSSL_OpenSSL/src/Context.cpp | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/NetSSL_OpenSSL/include/Poco/Net/Context.h b/NetSSL_OpenSSL/include/Poco/Net/Context.h index cd085b053..d66328380 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/Context.h +++ b/NetSSL_OpenSSL/include/Poco/Net/Context.h @@ -103,7 +103,7 @@ public: PROTO_TLSV1_2 = 0x10 }; - struct Params + struct NetSSL_API Params { Params(); /// Initializes the struct with default values. @@ -151,9 +151,9 @@ public: Context(Usage usage, const Params& params); /// Creates a Context using the given parameters. - /// - /// * usage specifies whether the context is used by a client or server. - /// * params specifies the context parameters. + /// + /// * usage specifies whether the context is used by a client or server. + /// * params specifies the context parameters. Context( Usage usage, @@ -164,26 +164,26 @@ public: int verificationDepth = 9, bool loadDefaultCAs = false, const std::string& cipherList = "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); - /// Creates a Context. - /// - /// * usage specifies whether the context is used by a client or server. - /// * privateKeyFile contains the path to the private key file used for encryption. - /// Can be empty if no private key file is used. - /// * certificateFile contains the path to the certificate file (in PEM format). - /// If the private key and the certificate are stored in the same file, this - /// can be empty if privateKeyFile is given. - /// * caLocation contains the path to the file or directory containing the - /// CA/root certificates. Can be empty if the OpenSSL builtin CA certificates - /// are used (see loadDefaultCAs). - /// * verificationMode specifies whether and how peer certificates are validated. - /// * verificationDepth sets the upper limit for verification chain sizes. Verification - /// will fail if a certificate chain larger than this is encountered. - /// * loadDefaultCAs specifies whether the builtin CA certificates from OpenSSL are used. - /// * cipherList specifies the supported ciphers in OpenSSL notation. - /// - /// Note: If the private key is protected by a passphrase, a PrivateKeyPassphraseHandler - /// must have been setup with the SSLManager, or the SSLManager's PrivateKeyPassphraseRequired - /// event must be handled. + /// Creates a Context. + /// + /// * usage specifies whether the context is used by a client or server. + /// * privateKeyFile contains the path to the private key file used for encryption. + /// Can be empty if no private key file is used. + /// * certificateFile contains the path to the certificate file (in PEM format). + /// If the private key and the certificate are stored in the same file, this + /// can be empty if privateKeyFile is given. + /// * caLocation contains the path to the file or directory containing the + /// CA/root certificates. Can be empty if the OpenSSL builtin CA certificates + /// are used (see loadDefaultCAs). + /// * verificationMode specifies whether and how peer certificates are validated. + /// * verificationDepth sets the upper limit for verification chain sizes. Verification + /// will fail if a certificate chain larger than this is encountered. + /// * loadDefaultCAs specifies whether the builtin CA certificates from OpenSSL are used. + /// * cipherList specifies the supported ciphers in OpenSSL notation. + /// + /// Note: If the private key is protected by a passphrase, a PrivateKeyPassphraseHandler + /// must have been setup with the SSLManager, or the SSLManager's PrivateKeyPassphraseRequired + /// event must be handled. Context( Usage usage, @@ -192,20 +192,20 @@ public: int verificationDepth = 9, bool loadDefaultCAs = false, const std::string& cipherList = "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); - /// Creates a Context. - /// - /// * usage specifies whether the context is used by a client or server. - /// * caLocation contains the path to the file or directory containing the - /// CA/root certificates. Can be empty if the OpenSSL builtin CA certificates - /// are used (see loadDefaultCAs). - /// * verificationMode specifies whether and how peer certificates are validated. - /// * verificationDepth sets the upper limit for verification chain sizes. Verification - /// will fail if a certificate chain larger than this is encountered. - /// * loadDefaultCAs specifies whether the builtin CA certificates from OpenSSL are used. - /// * cipherList specifies the supported ciphers in OpenSSL notation. - /// - /// Note that a private key and/or certificate must be specified with - /// usePrivateKey()/useCertificate() before the Context can be used. + /// Creates a Context. + /// + /// * usage specifies whether the context is used by a client or server. + /// * caLocation contains the path to the file or directory containing the + /// CA/root certificates. Can be empty if the OpenSSL builtin CA certificates + /// are used (see loadDefaultCAs). + /// * verificationMode specifies whether and how peer certificates are validated. + /// * verificationDepth sets the upper limit for verification chain sizes. Verification + /// will fail if a certificate chain larger than this is encountered. + /// * loadDefaultCAs specifies whether the builtin CA certificates from OpenSSL are used. + /// * cipherList specifies the supported ciphers in OpenSSL notation. + /// + /// Note that a private key and/or certificate must be specified with + /// usePrivateKey()/useCertificate() before the Context can be used. ~Context(); /// Destroys the Context. diff --git a/NetSSL_OpenSSL/src/Context.cpp b/NetSSL_OpenSSL/src/Context.cpp index db001c193..8815f6d25 100644 --- a/NetSSL_OpenSSL/src/Context.cpp +++ b/NetSSL_OpenSSL/src/Context.cpp @@ -511,7 +511,7 @@ void Context::initDH(const std::string& dhParamsFile) std::string msg = Utility::getLastError(); throw SSLContextException("Error creating Diffie-Hellman parameters", msg); } -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) BIGNUM* p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), 0); BIGNUM* g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), 0); DH_set0_pqg(dh, p, 0, g);