Fix FTBFS when cryptsetup / pkcs options are disabled

This resolves Bug 2530
pull/1/head
Timothy Pearson 9 years ago
parent a17dfea5e7
commit d4b7e6e7da

@ -300,7 +300,7 @@ static PKCS11H_BOOL pkcs_pin_hook(IN void * const global_data, IN void * const u
#endif #endif
int CryptoCardDeviceWatcher::initializePkcs() { int CryptoCardDeviceWatcher::initializePkcs() {
#if WITH_PKCS #if defined(WITH_PKCS)
CK_RV rv; CK_RV rv;
printf("Initializing pkcs11-helper\n"); printf("Initializing pkcs11-helper\n");
if ((rv = pkcs11h_initialize()) != CKR_OK) { if ((rv = pkcs11h_initialize()) != CKR_OK) {
@ -346,7 +346,7 @@ int CryptoCardDeviceWatcher::initializePkcs() {
} }
int CryptoCardDeviceWatcher::retrieveCardCertificates(TQString readerName) { int CryptoCardDeviceWatcher::retrieveCardCertificates(TQString readerName) {
#if WITH_PKCS #if defined(WITH_PKCS)
int ret = -1; int ret = -1;
CK_RV rv; CK_RV rv;
@ -571,6 +571,7 @@ void TDECryptographicCardDevice::setProvidedPin(TQString pin) {
} }
TQString TDECryptographicCardDevice::autoPIN() { TQString TDECryptographicCardDevice::autoPIN() {
#if defined(WITH_PKCS)
TQString retString = TQString::null; TQString retString = TQString::null;
// Use subjAltName field in card certificate to provide the card's PIN, // Use subjAltName field in card certificate to provide the card's PIN,
@ -634,6 +635,9 @@ TQString TDECryptographicCardDevice::autoPIN() {
OBJ_cleanup(); OBJ_cleanup();
return retString; return retString;
#else
return TQString::null;
#endif
} }
void TDECryptographicCardDevice::workerRequestedPin(TQString prompt) { 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) { int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueList<TQByteArray> &cipherTextList, TQValueList<TQByteArray> &plainTextList, TQValueList<int> &retcodes, TQString *errstr) {
#if WITH_PKCS #if defined(WITH_PKCS)
int ret = -1; int ret = -1;
if (!m_watcherObject) { if (!m_watcherObject) {
@ -840,6 +844,7 @@ int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueLis
} }
int TDECryptographicCardDevice::createNewSecretRSAKeyFromCertificate(TQByteArray &plaintext, TQByteArray &ciphertext, X509* certificate) { int TDECryptographicCardDevice::createNewSecretRSAKeyFromCertificate(TQByteArray &plaintext, TQByteArray &ciphertext, X509* certificate) {
#if defined(WITH_PKCS)
unsigned int i; unsigned int i;
int retcode = -1; int retcode = -1;
@ -885,10 +890,17 @@ int TDECryptographicCardDevice::createNewSecretRSAKeyFromCertificate(TQByteArray
} }
return retcode; return retcode;
#else
return -1;
#endif
} }
TQString TDECryptographicCardDevice::pkcsProviderLibrary() { TQString TDECryptographicCardDevice::pkcsProviderLibrary() {
#if defined(WITH_PKCS)
return OPENSC_PKCS11_PROVIDER_LIBRARY; return OPENSC_PKCS11_PROVIDER_LIBRARY;
#else
return TQString::null;
#endif
} }
#include "tdecryptographiccarddevice.moc" #include "tdecryptographiccarddevice.moc"

@ -188,7 +188,9 @@ void TDEStorageDevice::cryptSetOperationsUnlockPassword(TQByteArray password) {
void TDEStorageDevice::cryptClearOperationsUnlockPassword() { void TDEStorageDevice::cryptClearOperationsUnlockPassword() {
m_cryptDevicePassword.fill(0); m_cryptDevicePassword.fill(0);
m_cryptDevicePassword.resize(0); m_cryptDevicePassword.resize(0);
#if defined(WITH_CRYPTSETUP)
crypt_memory_lock(NULL, 0); crypt_memory_lock(NULL, 0);
#endif
} }
bool TDEStorageDevice::cryptOperationsUnlockPasswordSet() { bool TDEStorageDevice::cryptOperationsUnlockPasswordSet() {

Loading…
Cancel
Save