summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdecryptographiccarddevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/tdehw/tdecryptographiccarddevice.cpp')
-rw-r--r--tdecore/tdehw/tdecryptographiccarddevice.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.cpp b/tdecore/tdehw/tdecryptographiccarddevice.cpp
index 5958e86d7..98706befd 100644
--- a/tdecore/tdehw/tdecryptographiccarddevice.cpp
+++ b/tdecore/tdehw/tdecryptographiccarddevice.cpp
@@ -300,7 +300,7 @@ static PKCS11H_BOOL pkcs_pin_hook(IN void * const global_data, IN void * const u
#endif
int CryptoCardDeviceWatcher::initializePkcs() {
-#if WITH_PKCS
+#if defined(WITH_PKCS)
CK_RV rv;
printf("Initializing pkcs11-helper\n");
if ((rv = pkcs11h_initialize()) != CKR_OK) {
@@ -346,7 +346,7 @@ int CryptoCardDeviceWatcher::initializePkcs() {
}
int CryptoCardDeviceWatcher::retrieveCardCertificates(TQString readerName) {
-#if WITH_PKCS
+#if defined(WITH_PKCS)
int ret = -1;
CK_RV rv;
@@ -571,6 +571,7 @@ void TDECryptographicCardDevice::setProvidedPin(TQString pin) {
}
TQString TDECryptographicCardDevice::autoPIN() {
+#if defined(WITH_PKCS)
TQString retString = TQString::null;
// Use subjAltName field in card certificate to provide the card's PIN,
@@ -634,6 +635,9 @@ TQString TDECryptographicCardDevice::autoPIN() {
OBJ_cleanup();
return retString;
+#else
+ return TQString::null;
+#endif
}
void TDECryptographicCardDevice::workerRequestedPin(TQString prompt) {
@@ -654,7 +658,7 @@ int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQByteArra
}
int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueList<TQByteArray> &cipherTextList, TQValueList<TQByteArray> &plainTextList, TQValueList<int> &retcodes, TQString *errstr) {
-#if WITH_PKCS
+#if defined(WITH_PKCS)
int ret = -1;
if (!m_watcherObject) {
@@ -840,6 +844,7 @@ int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueLis
}
int TDECryptographicCardDevice::createNewSecretRSAKeyFromCertificate(TQByteArray &plaintext, TQByteArray &ciphertext, X509* certificate) {
+#if defined(WITH_PKCS)
unsigned int i;
int retcode = -1;
@@ -885,10 +890,17 @@ int TDECryptographicCardDevice::createNewSecretRSAKeyFromCertificate(TQByteArray
}
return retcode;
+#else
+ return -1;
+#endif
}
TQString TDECryptographicCardDevice::pkcsProviderLibrary() {
+#if defined(WITH_PKCS)
return OPENSC_PKCS11_PROVIDER_LIBRARY;
+#else
+ return TQString::null;
+#endif
}
#include "tdecryptographiccarddevice.moc"