@ -26,7 +26,7 @@
# include <kmdcodec.h>
# include <kmdcodec.h>
# include <tdemessagebox.h>
# include <tdemessagebox.h>
# include <kpassdlg.h>
# include <kpassdlg.h>
# include < k procio.h>
# include < tde procio.h>
//app includes
//app includes
# include "security.h"
# include "security.h"
@ -55,10 +55,10 @@ void Security::readKeys()
}
}
m_runMode = List ;
m_runMode = List ;
m_keys . clear ( ) ;
m_keys . clear ( ) ;
KProcIO * readProcess = new K ProcIO( ) ;
TDEProcIO * readProcess = new TDE ProcIO( ) ;
* readProcess < < " gpg " < < " --no-secmem-warning " < < " --no-tty " < < " --with-colon " < < " --list-keys " ;
* readProcess < < " gpg " < < " --no-secmem-warning " < < " --no-tty " < < " --with-colon " < < " --list-keys " ;
connect ( readProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( readProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( readProcess , TQ_SIGNAL ( readReady ( K ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( K ProcIO * ) ) ) ;
connect ( readProcess , TQ_SIGNAL ( readReady ( TDE ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( TDE ProcIO * ) ) ) ;
if ( ! readProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
if ( ! readProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
KMessageBox : : error ( 0L , i18n ( " <qt>Cannot start <i>gpg</i> and retrieve the available keys. Make sure that <i>gpg</i> is installed, otherwise verification of downloaded resources will not be possible.</qt> " ) ) ;
KMessageBox : : error ( 0L , i18n ( " <qt>Cannot start <i>gpg</i> and retrieve the available keys. Make sure that <i>gpg</i> is installed, otherwise verification of downloaded resources will not be possible.</qt> " ) ) ;
else
else
@ -73,10 +73,10 @@ void Security::readSecretKeys()
return ;
return ;
}
}
m_runMode = ListSecret ;
m_runMode = ListSecret ;
KProcIO * readProcess = new K ProcIO( ) ;
TDEProcIO * readProcess = new TDE ProcIO( ) ;
* readProcess < < " gpg " < < " --no-secmem-warning " < < " --no-tty " < < " --with-colon " < < " --list-secret-keys " ;
* readProcess < < " gpg " < < " --no-secmem-warning " < < " --no-tty " < < " --with-colon " < < " --list-secret-keys " ;
connect ( readProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( readProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( readProcess , TQ_SIGNAL ( readReady ( K ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( K ProcIO * ) ) ) ;
connect ( readProcess , TQ_SIGNAL ( readReady ( TDE ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( TDE ProcIO * ) ) ) ;
if ( readProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
if ( readProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
m_gpgRunning = true ;
m_gpgRunning = true ;
}
}
@ -98,7 +98,7 @@ void Security::slotProcessExited(TDEProcess *process)
delete process ;
delete process ;
}
}
void Security : : slotDataArrived ( K ProcIO * procIO )
void Security : : slotDataArrived ( TDE ProcIO * procIO )
{
{
TQString data ;
TQString data ;
while ( procIO - > readln ( data , true ) ! = - 1 )
while ( procIO - > readln ( data , true ) ! = - 1 )
@ -246,10 +246,10 @@ void Security::slotCheckValidity()
m_signatureKey . trusted = false ;
m_signatureKey . trusted = false ;
//verify the signature
//verify the signature
KProcIO * verifyProcess = new K ProcIO( ) ;
TDEProcIO * verifyProcess = new TDE ProcIO( ) ;
* verifyProcess < < " gpg " < < " --no-secmem-warning " < < " --status-fd=2 " < < " --command-fd=0 " < < " --verify " < < f . dirPath ( ) + " /signature " < < m_fileName ;
* verifyProcess < < " gpg " < < " --no-secmem-warning " < < " --status-fd=2 " < < " --command-fd=0 " < < " --verify " < < f . dirPath ( ) + " /signature " < < m_fileName ;
connect ( verifyProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( verifyProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( verifyProcess , TQ_SIGNAL ( readReady ( K ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( K ProcIO * ) ) ) ;
connect ( verifyProcess , TQ_SIGNAL ( readReady ( TDE ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( TDE ProcIO * ) ) ) ;
if ( verifyProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
if ( verifyProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
m_gpgRunning = true ;
m_gpgRunning = true ;
else
else
@ -326,10 +326,10 @@ void Security::slotSignFile()
m_secretKey = secretKeys [ 0 ] ;
m_secretKey = secretKeys [ 0 ] ;
//verify the signature
//verify the signature
KProcIO * signProcess = new K ProcIO( ) ;
TDEProcIO * signProcess = new TDE ProcIO( ) ;
* signProcess < < " gpg " < < " --no-secmem-warning " < < " --status-fd=2 " < < " --command-fd=0 " < < " --no-tty " < < " --detach-sign " < < " -u " < < m_secretKey < < " -o " < < f . dirPath ( ) + " /signature " < < m_fileName ;
* signProcess < < " gpg " < < " --no-secmem-warning " < < " --status-fd=2 " < < " --command-fd=0 " < < " --no-tty " < < " --detach-sign " < < " -u " < < m_secretKey < < " -o " < < f . dirPath ( ) + " /signature " < < m_fileName ;
connect ( signProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( signProcess , TQ_SIGNAL ( processExited ( TDEProcess * ) ) , this , TQ_SLOT ( slotProcessExited ( TDEProcess * ) ) ) ;
connect ( signProcess , TQ_SIGNAL ( readReady ( K ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( K ProcIO * ) ) ) ;
connect ( signProcess , TQ_SIGNAL ( readReady ( TDE ProcIO * ) ) , this , TQ_SLOT ( slotDataArrived ( TDE ProcIO * ) ) ) ;
m_runMode = Sign ;
m_runMode = Sign ;
if ( signProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
if ( signProcess - > start ( TDEProcess : : NotifyOnExit , true ) )
m_gpgRunning = true ;
m_gpgRunning = true ;