diff --git a/src/qbrowserlib/log.cxx b/src/qbrowserlib/log.cxx index b16e490..979ab4a 100644 --- a/src/qbrowserlib/log.cxx +++ b/src/qbrowserlib/log.cxx @@ -14,23 +14,29 @@ namespace qbrowserlib { unsigned int Log::_level(0); Log::Log(const void* addr, const std::string& name, - const std::string& file, unsigned long line): - _debug(DEBUG), _addr(addr), _name(name), _file(file), _line(line) { - if (!_debug) return; + const std::string& file, unsigned long line, + bool traceOpenClose): + _debug(DEBUG), _close(traceOpenClose), + _addr(addr), _name(name), _file(file), _line(line) { + if (!_debug || !_close) return; ++_level; std::stringstream ss; - init(ss); + // init(ss); indent(ss)<<"\\ "<<_name; - std::clog<append(*this, ss.str()); } Log::~Log() throw() { - if (!_debug) return; + if (!_debug || !_close) return; std::stringstream ss; - init(ss); + // init(ss); indent(ss)<<"/ "<<_name; - std::clog<append(*this, ss.str()); } void Log::show(QWidget* p) { diff --git a/src/qbrowserlib/log.hxx b/src/qbrowserlib/log.hxx index 8c5b380..7e5a7fa 100644 --- a/src/qbrowserlib/log.hxx +++ b/src/qbrowserlib/log.hxx @@ -13,6 +13,7 @@ #include #endif +#include #include #include #include @@ -29,8 +30,6 @@ namespace qbrowserlib { #ifndef LOG #define LOG \ QBROWSERLIB_LOCAL_TRACER - // #define LOG - // qbrowserlib::Log(1, __PRETTY_FUNCTION__, __FILE__, __LINE__) #endif #ifndef TRC @@ -45,6 +44,29 @@ namespace qbrowserlib { (0, __PRETTY_FUNCTION__, __FILE__, __LINE__) #endif +#define CRYPTOKI_LOG(X) \ + qbrowserlib::Log(0, __PRETTY_FUNCTION__, __FILE__, __LINE__, false)< Log& operator<<(TYPE arg); @@ -79,6 +102,7 @@ namespace qbrowserlib { static LogDialog* _dialog; static unsigned int _level; bool _debug; + bool _close; const void* _addr; const std::string _name; const std::string _file; @@ -193,11 +217,11 @@ namespace qbrowserlib { template Log& Log::operator<<(TYPE arg) { if (!_debug) return *this; std::stringstream ss; - init(ss); + // init(ss); indent(ss)<<" → "<append(*this, arg); + _dialog->append(*this, ss.str()); return *this; } diff --git a/src/smartcardauth.hxx b/src/smartcardauth.hxx index 02074cb..92da872 100644 --- a/src/smartcardauth.hxx +++ b/src/smartcardauth.hxx @@ -118,40 +118,24 @@ class CryptokiEngine: public QObject, public openssl::Engine { return "CryptokiEngine_NAME"; } - virtual std::string rsaSign(const std::string& in, unsigned int type) { + virtual std::string rsaSign(const std::string& in, unsigned int type) try { TRC; LOG<<"log; type="<sign(data+in, CKM_RSA_PKCS); + return _privateKey->sign(in, CKM_RSA_PKCS); } catch (const std::exception& x) { - LOG<<"signature failed"; + LOG<<"signature failed, reason: "<sign(data+in, CKM_RSA_PKCS); // try again + return _privateKey->sign(in, CKM_RSA_PKCS); // try again } + } catch (const std::exception& x) { + TRC; LOG<<"rsaSign failed, reason: "< QMessageBox - + Authentication failed, please try again. - + Wrong PIN diff --git a/src/swissbrowser_en.ts b/src/swissbrowser_en.ts index 769dd16..83cc1d6 100644 --- a/src/swissbrowser_en.ts +++ b/src/swissbrowser_en.ts @@ -724,12 +724,12 @@ openssl-%7 (%9) %10 QMessageBox - + Authentication failed, please try again. - + Wrong PIN diff --git a/src/swissbrowser_fr.ts b/src/swissbrowser_fr.ts index 3200b37..9f82a11 100644 --- a/src/swissbrowser_fr.ts +++ b/src/swissbrowser_fr.ts @@ -724,12 +724,12 @@ openssl-%7 (%9) %10 QMessageBox - + Authentication failed, please try again. - + Wrong PIN diff --git a/src/swissbrowser_it.ts b/src/swissbrowser_it.ts index b4103ef..0b018ff 100644 --- a/src/swissbrowser_it.ts +++ b/src/swissbrowser_it.ts @@ -724,12 +724,12 @@ openssl-%7 (%9) %10 QMessageBox - + Authentication failed, please try again. - + Wrong PIN