diff ui/downloader_win.cpp @ 18:f4f957c58e0a

Move listuitol and add cert pinning with a test certificate
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Feb 2014 15:41:14 +0000
parents c12825a651ed
children fec1a610d43f
line wrap: on
line diff
--- a/ui/downloader_win.cpp	Wed Feb 19 14:22:26 2014 +0000
+++ b/ui/downloader_win.cpp	Wed Feb 19 15:41:14 2014 +0000
@@ -214,6 +214,7 @@
     if (!retval) {
         DEBUG << "Certificate is not the same as the pinned one!"
               << "Base64 cert: " << serverCert.toBase64();
+        emit error("Invalid certificate", InvalidCertificate);
     }
 
     CertFreeCertificateContext(certContext);
@@ -258,7 +259,7 @@
 
     if (!verifyCertificate(hRequest)) {
         DEBUG << "Certificate verification failed";
-        // TODO error out
+        goto cleanup;
     }
 
     if (!(WinHttpQueryHeaders(hRequest,
@@ -327,7 +328,7 @@
 
     if (!verifyCertificate(hRequest)) {
         DEBUG << "Certificate verification failed";
-        // TODO error out
+        goto cleanup;
     }
 
 

http://wald.intevation.org/projects/trustbridge/