From 850feb4be8716c2631118c60e5a0588b6afb7dbd Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 13 Feb 2018 21:50:49 -1000 Subject: [PATCH] Disable certificate pinning (for now) --- hecl-gui/DownloadManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hecl-gui/DownloadManager.cpp b/hecl-gui/DownloadManager.cpp index 642ef216c..bd41aebf9 100644 --- a/hecl-gui/DownloadManager.cpp +++ b/hecl-gui/DownloadManager.cpp @@ -1,8 +1,10 @@ #include "DownloadManager.hpp" #include "Common.hpp" -#include #include +#define KEY_PINNING 0 + +#if KEY_PINNING static const char AxioDLPublicKeyPEM[] = "-----BEGIN PUBLIC KEY-----\n" "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvtshImzoP1a++9P5RK0k\n" @@ -25,9 +27,11 @@ static const char AxioDLEdgePublicKeyPEM[] = static const QSslKey AxioDLEdgePublicKey = QSslKey({AxioDLEdgePublicKeyPEM}, QSsl::Ec, QSsl::Pem, QSsl::PublicKey); +#endif void DownloadManager::_validateCert(QNetworkReply* reply) { +#if KEY_PINNING QSslCertificate peerCert = reply->sslConfiguration().peerCertificate(); QSslKey peerKey = peerCert.publicKey(); if (peerKey != AxioDLPublicKey && peerKey != AxioDLEdgePublicKey) @@ -41,6 +45,7 @@ void DownloadManager::_validateCert(QNetworkReply* reply) QStringLiteral("Certificate pinning mismatch")); reply->abort(); } +#endif } static const QString Domain = QStringLiteral("https://releases.axiodl.com/");