|
|
|
@ -75,21 +75,6 @@
|
|
|
|
|
TQT_DBusData convertDBUSDataToVariantData(TQT_DBusData);
|
|
|
|
|
#endif // defined(WITH_UDISKS) || defined(WITH_UDISKS2)
|
|
|
|
|
|
|
|
|
|
#if defined(WITH_CRYPTSETUP)
|
|
|
|
|
int TDEStorageDevice::cryptsetup_password_entry_callback(const char *msg, char *buf, size_t length, void *usrptr) {
|
|
|
|
|
TDEStorageDevice* sdevice = (TDEStorageDevice*)usrptr;
|
|
|
|
|
|
|
|
|
|
unsigned int passwd_len = sdevice->m_cryptDevicePassword.size();
|
|
|
|
|
if (passwd_len < length) {
|
|
|
|
|
memcpy(buf, sdevice->m_cryptDevicePassword.data(), length);
|
|
|
|
|
return passwd_len;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
TDEStorageDevice::TDEStorageDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn), m_mediaInserted(true), m_cryptDevice(NULL) {
|
|
|
|
|
m_diskType = TDEDiskDeviceType::Null;
|
|
|
|
|
m_diskStatus = TDEDiskDeviceStatus::Null;
|
|
|
|
@ -142,7 +127,6 @@ void TDEStorageDevice::internalInitializeLUKSIfNeeded() {
|
|
|
|
|
if (node != "") {
|
|
|
|
|
ret = crypt_init(&m_cryptDevice, node.ascii());
|
|
|
|
|
if (ret == 0) {
|
|
|
|
|
crypt_set_password_callback(m_cryptDevice, TDEStorageDevice::cryptsetup_password_entry_callback, this);
|
|
|
|
|
ret = crypt_load(m_cryptDevice, NULL, NULL);
|
|
|
|
|
if (ret == 0) {
|
|
|
|
|
int keyslot_count;
|
|
|
|
|