diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-10-02 19:58:14 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-10-02 19:58:14 -0500 |
commit | 37b6d0d80ff63156326d46ba1e0a19f3b7c02e5b (patch) | |
tree | cb73e51e4ec907e2721bbdc305d7d0024c21ded1 /tdm | |
parent | 48cf3058c5543a65026cb1cc9d8fc7450c4ccc68 (diff) | |
download | tdebase-37b6d0d80ff63156326d46ba1e0a19f3b7c02e5b.tar.gz tdebase-37b6d0d80ff63156326d46ba1e0a19f3b7c02e5b.zip |
Fix cryptographic card login process
Diffstat (limited to 'tdm')
-rw-r--r-- | tdm/kfrontend/kgreeter.cpp | 19 | ||||
-rw-r--r-- | tdm/kfrontend/kgverify.cpp | 17 | ||||
-rw-r--r-- | tdm/kfrontend/kgverify.h | 4 |
3 files changed, 34 insertions, 6 deletions
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp index e14e58491..3fdbc6042 100644 --- a/tdm/kfrontend/kgreeter.cpp +++ b/tdm/kfrontend/kgreeter.cpp @@ -869,6 +869,12 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { } if (login_name != "") { + if (verify->cardLoginInProgress) { + return; + } + verify->cardLoginInProgress = true; + verify->cardLoginDevice = cdevice; + DM dm; SessList sess; bool vt_active = false; @@ -903,12 +909,10 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { cardLoginUser = login_name; verify->setPasswordPrompt(i18n("PIN:")); - TQString autoPIN = cdevice->autoPIN(); - if (autoPIN != TQString::null) { - // Initiate login - verify->setPassword(autoPIN); - verify->accept(); - } + // Bypass initial password prompt + verify->start(); + verify->setPassword(""); + verify->accept(); } } } @@ -921,6 +925,9 @@ void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) { // Restore information message display settings verify->setInfoMessageDisplay(showInfoMessages); + + verify->cardLoginInProgress = false; + verify->cardLoginDevice = NULL; } KStdGreeter::KStdGreeter() diff --git a/tdm/kfrontend/kgverify.cpp b/tdm/kfrontend/kgverify.cpp index 6e6b685db..a3464a5b7 100644 --- a/tdm/kfrontend/kgverify.cpp +++ b/tdm/kfrontend/kgverify.cpp @@ -32,6 +32,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "themer/tdmitem.h" #include "themer/tdmlabel.h" +#include <ksslcertificate.h> + +#include <tdehardwaredevices.h> +#include <tdecryptographiccarddevice.h> + #include <tdeapplication.h> #include <tdelocale.h> #include <klibloader.h> @@ -93,6 +98,8 @@ KGVerify::KGVerify(KGVerifyHandler *_handler, KdmThemer *_themer, , isClear(true) , inGreeterPlugin(false) , abortRequested(false) + , cardLoginInProgress(false) + , cardLoginDevice(NULL) { connect( &timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) ); connect( kapp, TQT_SIGNAL(activity()), TQT_SLOT(slotActivity()) ); @@ -654,6 +661,16 @@ KGVerify::handleVerify() inGreeterPlugin = true; greet->textPrompt(msg, echo, ndelay); inGreeterPlugin = !ndelay; + + if (cardLoginInProgress) { + TQString autoPIN = cardLoginDevice->autoPIN(); + if (autoPIN != TQString::null) { + // Initiate login + setPassword(autoPIN); + accept(); + } + cardLoginInProgress = false; + } } else { inGreeterPlugin = true; diff --git a/tdm/kfrontend/kgverify.h b/tdm/kfrontend/kgverify.h index 2ab3ff37b..9935459be 100644 --- a/tdm/kfrontend/kgverify.h +++ b/tdm/kfrontend/kgverify.h @@ -77,6 +77,7 @@ class TQPopupMenu; class TQTimer; class KPushButton; class KLibrary; +class TDECryptographicCardDevice; struct GreeterPluginHandle { KLibrary *library; @@ -180,6 +181,9 @@ class KGVerify : public TQObject, public KGreeterPluginHandler { virtual void gplugMsgBox( TQMessageBox::Icon type, const TQString &text ); static TQVariant getConf( void *ctx, const char *key, const TQVariant &dflt ); + + bool cardLoginInProgress; + TDECryptographicCardDevice* cardLoginDevice; }; class KGStdVerify : public KGVerify { |