fix: ignore SSL NoError;
authorKonrad Rosenbaum <konrad@silmor.de>
Mon, 23 Jul 2012 06:57:55 +0000 (08:57 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Mon, 23 Jul 2012 06:57:55 +0000 (08:57 +0200)
show smoke data path in about box

src/iface/sslexception.cpp
src/main.cpp

index 80457fc..6b8340e 100644 (file)
@@ -38,6 +38,7 @@ MSslExceptions::MSslExceptions(QString p)
                        QSslCertificate c(el.text().toAscii());
                        if(c.isNull())continue;
                        sslexcept.append(QPair<QSslCertificate,int>(c,e));
+                       qDebug()<<"Note: will ignore SSL exception of type"<<e<<"from certificate (hash)"<<c.digest(QCryptographicHash::Sha1).toHex().data();
                }
        }
 }
@@ -85,6 +86,7 @@ bool MSslExceptions::checksslexcept(const QList<QSslError>&errs)
 {
        //stage 1: record unknown exceptions
        for(int i=0;i<errs.size();i++){
+               if(errs[i].error()==QSslError::NoError)continue;
                QPair<QSslCertificate,int>p(errs[i].certificate(),errs[i].error());
                bool known=false;
                for(int j=0;j<sslrecord.size();j++){
@@ -97,6 +99,7 @@ bool MSslExceptions::checksslexcept(const QList<QSslError>&errs)
        }
        //stage 2: compare to acceptable exceptions
        for(int i=0;i<errs.size();i++){
+               if(errs[i].error()==QSslError::NoError)continue;
                QPair<QSslCertificate,int>p(errs[i].certificate(),errs[i].error());
                bool known=false;
                for(int j=0;j<sslexcept.size();j++){
@@ -105,7 +108,10 @@ bool MSslExceptions::checksslexcept(const QList<QSslError>&errs)
                                break;
                        }
                }
-               if(!known)return false;
+               if(!known){
+                       qDebug()<<"Ooops! Non-ignored SSL exception of type"<<(int)errs[i].error()<<"certificate\n"<<errs[i].certificate().toPem().data();
+                       return false;
+               }
        }
        return true;
 }
index 3fb7195..db654a9 100644 (file)
@@ -90,16 +90,19 @@ void MApplication::aboutMS()
        QMessageBox mb;
        mb.setIconPixmap(QPixmap(":/icon.png"));
        mb.setWindowTitle(tr("About MagicSmoke"));
+       MSInterface*ifc=MSInterface::instance();
        mb.setText(tr(  "<h3>MagicSmoke v. %1</h3>"
                        "&copy; Konrad Rosenbaum, 2007-2011<br>"
                        "&copy; Peter Keller, 2007-2008<br>"
                        "protected under the GNU GPL v.3 or at your option any newer<p>"
                        "See also the <a href=\"%2\">MagicSmoke Homepage</a>.<p>"
-                       "This version was compiled from repository '%3' revision '%4'.")
+                       "This version was compiled from repository '%3' revision '%4'.<p>"
+                       "The current application data base path is '%5'.")
                        .arg(MSInterface::staticVersionInfo(WOb::VersionHR)) //%1
                        .arg(HOMEPAGE_BASEURL) //%2
                        .arg(MSInterface::staticVersionInfo(WOb::VersionRootURL)) //%3
                        .arg(MSInterface::staticVersionInfo(WOb::VersionNumber)) //%4
+                       .arg(ifc?ifc->dataDir(): ::dataDir)
                );
        mb.setStandardButtons(QMessageBox::Ok);
        mb.exec();