From af7dac72f4063dd8d4dac71973ea51c25896089a Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 11 Sep 2020 18:29:33 +0200 Subject: FORMAT: Run clang-format 10 on all C/CXX source-files --- src/murmur/Cert.cpp | 55 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) (limited to 'src/murmur/Cert.cpp') diff --git a/src/murmur/Cert.cpp b/src/murmur/Cert.cpp index 52adf638c..c9f140564 100644 --- a/src/murmur/Cert.cpp +++ b/src/murmur/Cert.cpp @@ -6,31 +6,31 @@ #include #ifdef Q_OS_WIN -# include "win.h" +# include "win.h" #endif #include "Meta.h" -#include "Server.h" #include "SelfSignedCertificate.h" +#include "Server.h" #include #include #include #ifdef Q_OS_WIN -# include +# include #endif bool Server::isKeyForCert(const QSslKey &key, const QSslCertificate &cert) { if (key.isNull() || cert.isNull() || (key.type() != QSsl::PrivateKey)) return false; - QByteArray qbaKey = key.toDer(); + QByteArray qbaKey = key.toDer(); QByteArray qbaCert = cert.toDer(); - X509 *x509 = nullptr; + X509 *x509 = nullptr; EVP_PKEY *pkey = nullptr; - BIO *mem = nullptr; + BIO *mem = nullptr; mem = BIO_new_mem_buf(qbaKey.data(), qbaKey.size()); Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE)); @@ -80,30 +80,30 @@ void Server::initializeCert() { qsdhpDHParams = QSslDiffieHellmanParameters(); #endif - crt = getConf("certificate", QString()).toByteArray(); - key = getConf("key", QString()).toByteArray(); - pass = getConf("passphrase", QByteArray()).toByteArray(); + crt = getConf("certificate", QString()).toByteArray(); + key = getConf("key", QString()).toByteArray(); + pass = getConf("passphrase", QByteArray()).toByteArray(); dhparams = getConf("sslDHParams", Meta::mp.qbaDHParams).toByteArray(); - QList ql; + QList< QSslCertificate > ql; // Attempt to load the private key. - if (! key.isEmpty()) { + if (!key.isEmpty()) { qskKey = Server::privateKeyFromPEM(key, pass); } // If we still can't load the key, try loading any keys from the certificate - if (qskKey.isNull() && ! crt.isEmpty()) { + if (qskKey.isNull() && !crt.isEmpty()) { qskKey = Server::privateKeyFromPEM(crt); } // If have a key, walk the list of certs, find the one for our key, // remove any certs for our key from the list, what's left is part of // the CA certificate chain. - if (! qskKey.isNull()) { + if (!qskKey.isNull()) { ql << QSslCertificate::fromData(crt); ql << QSslCertificate::fromData(key); - for (int i=0;i