summaryrefslogtreecommitdiffstats
path: root/tdm
diff options
context:
space:
mode:
Diffstat (limited to 'tdm')
-rw-r--r--tdm/CMakeLists.txt2
-rw-r--r--tdm/kfrontend/kgreeter.cpp20
-rw-r--r--tdm/kfrontend/kgverify.cpp14
-rw-r--r--tdm/kfrontend/kgverify.h4
-rw-r--r--tdm/kfrontend/sakdlg.cpp9
5 files changed, 39 insertions, 10 deletions
diff --git a/tdm/CMakeLists.txt b/tdm/CMakeLists.txt
index 4d37df766..3a6b6a41b 100644
--- a/tdm/CMakeLists.txt
+++ b/tdm/CMakeLists.txt
@@ -21,7 +21,7 @@ include( ConfigureChecks.cmake )
add_subdirectory( backend )
add_subdirectory( kfrontend )
-add_subdirectory( cryptocardwatcher )
+tde_conditional_add_subdirectory( WITH_TDEHWLIB cryptocardwatcher )
# systemd
if( BUILD_TDM_SYSTEMD_UNIT_FILE AND NOT "${SYSTEMDSYSTEMUNITDIR}" STREQUAL "" )
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp
index cd61aa857..27905e61d 100644
--- a/tdm/kfrontend/kgreeter.cpp
+++ b/tdm/kfrontend/kgreeter.cpp
@@ -35,10 +35,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <dmctl.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <ksslcertificate.h>
-
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
+#endif
#include <tdeapplication.h>
#include <tdelocale.h>
@@ -246,6 +247,7 @@ KGreeter::~KGreeter()
void KGreeter::cryptographicCardWatcherSetup() {
cardLoginUser = TQString::null;
+#ifdef __TDE_HAVE_TDEHWLIB
// Initialize SmartCard readers
TDEGenericDevice *hwdevice;
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
@@ -256,6 +258,7 @@ void KGreeter::cryptographicCardWatcherSetup() {
connect(cdevice, TQT_SIGNAL(cardRemoved(TDECryptographicCardDevice*)), this, TQT_SLOT(cryptographicCardRemoved(TDECryptographicCardDevice*)));
cdevice->enableCardMonitoring(true);
}
+#endif
}
void KGreeter::done(int r) {
@@ -858,7 +861,11 @@ KGreeter::verifySetUser( const TQString &user )
}
void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
-#ifdef HAVE_KRB5
+#ifdef __TDE_HAVE_TDEHWLIB
+#ifndef HAVE_KRB5
+ // Don't enable card-based logins if Kerberos integration was disabled
+ return;
+#endif
// Make sure card logins are enabled before attempting one
KSimpleConfig *systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
systemconfig->setGroup(NULL);
@@ -868,10 +875,6 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
{
return;
}
-#else
- // Don't enable card-based logins if Kerberos integration was disabled
- return;
-#endif
TQString login_name = TQString::null;
X509CertificatePtrList certList = cdevice->cardX509Certificates();
@@ -938,9 +941,11 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
verify->accept();
}
}
+#endif
}
void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) {
+#ifdef __TDE_HAVE_TDEHWLIB
cardLoginUser = TQString::null;
userView->setEnabled(false);
verify->lockUserEntry(false);
@@ -952,6 +957,7 @@ void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) {
verify->cardLoginInProgress = false;
verify->cardLoginDevice = NULL;
+#endif
}
KStdGreeter::KStdGreeter()
@@ -1332,9 +1338,11 @@ KThemedGreeter::updateStatus( bool fail, bool caps, int timedleft )
}
}
+#ifdef __TDE_HAVE_TDEHWLIB
if (cardLoginUser != TQString::null) {
verify->setPasswordPrompt(i18n("PIN:"));
}
+#endif
}
void
diff --git a/tdm/kfrontend/kgverify.cpp b/tdm/kfrontend/kgverify.cpp
index 93bcce27a..d3b0a71b8 100644
--- a/tdm/kfrontend/kgverify.cpp
+++ b/tdm/kfrontend/kgverify.cpp
@@ -32,10 +32,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "themer/tdmitem.h"
#include "themer/tdmlabel.h"
-#include <ksslcertificate.h>
+#ifdef __TDE_HAVE_TDEHWLIB
+#include <ksslcertificate.h>
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
+#endif
#include <tdeapplication.h>
#include <tdelocale.h>
@@ -98,8 +100,10 @@ KGVerify::KGVerify(KGVerifyHandler *_handler, KdmThemer *_themer,
, isClear(true)
, inGreeterPlugin(false)
, abortRequested(false)
+#ifdef __TDE_HAVE_TDEHWLIB
, cardLoginInProgress(false)
, cardLoginDevice(NULL)
+#endif
{
connect( &timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) );
connect( kapp, TQT_SIGNAL(activity()), TQT_SLOT(slotActivity()) );
@@ -324,7 +328,11 @@ KGVerify::start()
_autoLoginDelay = 0, timeable = false;
return;
}
- else if (!cardLoginInProgress) {
+ else
+#ifdef __TDE_HAVE_TDEHWLIB
+ if (!cardLoginInProgress)
+#endif
+ {
applyPreset();
}
}
@@ -664,6 +672,7 @@ KGVerify::handleVerify()
greet->textPrompt(msg, echo, ndelay);
inGreeterPlugin = !ndelay;
+#ifdef __TDE_HAVE_TDEHWLIB
if (cardLoginInProgress) {
TQString autoPIN = cardLoginDevice->autoPIN();
if (autoPIN != TQString::null) {
@@ -673,6 +682,7 @@ KGVerify::handleVerify()
}
cardLoginInProgress = false;
}
+#endif
}
else {
inGreeterPlugin = true;
diff --git a/tdm/kfrontend/kgverify.h b/tdm/kfrontend/kgverify.h
index 9935459be..b76cf55f1 100644
--- a/tdm/kfrontend/kgverify.h
+++ b/tdm/kfrontend/kgverify.h
@@ -77,7 +77,9 @@ class TQPopupMenu;
class TQTimer;
class KPushButton;
class KLibrary;
+#ifdef __TDE_HAVE_TDEHWLIB
class TDECryptographicCardDevice;
+#endif
struct GreeterPluginHandle {
KLibrary *library;
@@ -182,8 +184,10 @@ class KGVerify : public TQObject, public KGreeterPluginHandler {
static TQVariant getConf( void *ctx, const char *key, const TQVariant &dflt );
+#ifdef __TDE_HAVE_TDEHWLIB
bool cardLoginInProgress;
TDECryptographicCardDevice* cardLoginDevice;
+#endif
};
class KGStdVerify : public KGVerify {
diff --git a/tdm/kfrontend/sakdlg.cpp b/tdm/kfrontend/sakdlg.cpp
index 3758a4719..52bffc47e 100644
--- a/tdm/kfrontend/sakdlg.cpp
+++ b/tdm/kfrontend/sakdlg.cpp
@@ -10,10 +10,11 @@
#include <dmctl.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <ksslcertificate.h>
-
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
+#endif
#include <tdeapplication.h>
#include <tdelocale.h>
@@ -135,6 +136,7 @@ SAKDlg::SAKDlg(TQWidget *parent)
connect(mSAKProcess, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(slotSAKProcessExited()));
mSAKProcess->start();
+#ifdef __TDE_HAVE_TDEHWLIB
// Initialize SmartCard readers
TDEGenericDevice *hwdevice;
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
@@ -145,6 +147,7 @@ SAKDlg::SAKDlg(TQWidget *parent)
connect(cdevice, TQT_SIGNAL(cardRemoved(TDECryptographicCardDevice*)), this, TQT_SLOT(cryptographicCardRemoved(TDECryptographicCardDevice*)));
cdevice->enableCardMonitoring(true);
}
+#endif
mControlPipeHandlerThread = new TQEventLoopThread();
mControlPipeHandler = new ControlPipeHandlerObject();
@@ -172,6 +175,7 @@ void SAKDlg::processInputPipeCommand(TQString command) {
}
void SAKDlg::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
+#ifdef __TDE_HAVE_TDEHWLIB
TQString login_name = TQString::null;
X509CertificatePtrList certList = cdevice->cardX509Certificates();
if (certList.count() > 0) {
@@ -213,10 +217,13 @@ void SAKDlg::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
closeDialogForced();
}
}
+#endif
}
void SAKDlg::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) {
+#ifdef __TDE_HAVE_TDEHWLIB
//
+#endif
}
SAKDlg::~SAKDlg()