X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientauthhandler.cpp;h=a29505f990187645504c3cb5ae940a1a291ecdac;hp=322f58ad289f2d3bccbccced5ae1d433d7c01fae;hb=ab7ef4d24f62b5848b628482b7762ebfc0b53e1a;hpb=c55df5f2d765b100b7a1ead5a72202f969aa9581 diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index 322f58ad..a29505f9 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.cpp @@ -20,8 +20,6 @@ #include "clientauthhandler.h" -// TODO: support system application proxy (new in Qt 4.6) - #include #ifdef HAVE_SSL @@ -35,10 +33,6 @@ #include "logmessage.h" #include "peerfactory.h" -#if QT_VERSION < 0x050000 -# include "../../3rdparty/sha512/sha512.h" -#endif - using namespace Protocol; ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent) @@ -505,11 +499,7 @@ void ClientAuthHandler::onSslErrors() break; case ClientAuthHandler::DigestVersion::Sha2_512: -#if QT_VERSION >= 0x050000 calculatedDigest = socket->peerCertificate().digest(QCryptographicHash::Sha512); -#else - calculatedDigest = sha2_512(socket->peerCertificate().toDer()); -#endif break; default: @@ -527,11 +517,7 @@ void ClientAuthHandler::onSslErrors() } if (permanently) { -#if QT_VERSION >= 0x050000 s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512)); -#else - s.setAccountValue("SslCert", sha2_512(socket->peerCertificate().toDer())); -#endif s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest); } else { @@ -540,28 +526,11 @@ void ClientAuthHandler::onSslErrors() } } else if (knownDigestVersion != ClientAuthHandler::DigestVersion::Latest) { -#if QT_VERSION >= 0x050000 s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512)); -#else - s.setAccountValue("SslCert", sha2_512(socket->peerCertificate().toDer())); -#endif s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest); } socket->ignoreSslErrors(); } -#if QT_VERSION < 0x050000 -QByteArray ClientAuthHandler::sha2_512(const QByteArray &input) { - unsigned char output[64]; - sha512((unsigned char*) input.constData(), input.size(), output, false); - // QByteArray::fromRawData() cannot be used here because that constructor - // does not copy "output" and the data is clobbered when the variable goes - // out of scope. - QByteArray result; - result.append((char*) output, 64); - return result; -} -#endif - #endif /* HAVE_SSL */