257
286
ToolNamesList->append( "bash" );
258
287
ToolNamesList->append( "vtund" );
259
288
ToolNamesList->append( "cisco_cert_mgr" );
289
ToolNamesList->append( "tail" );
290
ToolNamesList->append( "ssh" );
291
ToolNamesList->append( "ksshaskpass" );
292
ToolNamesList->append( "gnome-ssh-askpass" );
261
294
ToolInfo *currentTool;
262
295
for ( QStringList::Iterator it = ToolNamesList->begin(); it != ToolNamesList->end(); it++ ) {
263
//std::cout << "tool: " << *it << std::endl;
296
//std::cout << "tool: " << qPrintable(QString(*it)) << std::endl;
265
298
currentTool = new ToolInfo( *it );
266
currentTool->programsInPath =config->programsInPath;
299
currentTool->programsInPath =GlobalConfig->programsInPath;
267
300
if ( currentTool->Name == "vpnc" )
268
currentTool->TryPath_first = config->pathToVpnc;
301
currentTool->TryPath_first = GlobalConfig->pathToVpnc;
269
302
else if (currentTool->Name == "vpnclient")
270
currentTool->TryPath_first = config->pathToCiscoVpnc;
303
currentTool->TryPath_first = GlobalConfig->pathToCiscoVpnc;
271
304
else if ( currentTool->Name == "ipsec" )
272
currentTool->TryPath_first = config->pathToFreeswan;
305
currentTool->TryPath_first = GlobalConfig->pathToIpsec;
273
306
else if ( currentTool->Name == "racoon" )
274
currentTool->TryPath_first = config->pathToRacoon;
307
currentTool->TryPath_first = GlobalConfig->pathToRacoon;
308
else if ( currentTool->Name == "racoonctl" )
309
currentTool->TryPath_first = GlobalConfig->pathToRacoonctl;
275
310
else if ( currentTool->Name == "setkey" )
276
currentTool->TryPath_first = config->pathToSetkey;
311
currentTool->TryPath_first = GlobalConfig->pathToSetkey;
277
312
else if ( currentTool->Name == "openvpn" )
278
currentTool->TryPath_first = config->pathToOpenvpn;
313
currentTool->TryPath_first = GlobalConfig->pathToOpenvpn;
279
314
else if ( currentTool->Name == "openssl" )
280
currentTool->TryPath_first = config->pathToOpenssl;
315
currentTool->TryPath_first = GlobalConfig->pathToOpenssl;
281
316
else if ( currentTool->Name == "pppd" )
282
currentTool->TryPath_first = config->pathToPppd;
317
currentTool->TryPath_first = GlobalConfig->pathToPppd;
283
318
else if ( currentTool->Name == "iptables" )
284
currentTool->TryPath_first = config->pathToIptables;
319
currentTool->TryPath_first = GlobalConfig->pathToIptables;
285
320
else if ( currentTool->Name == "kill" )
286
currentTool->TryPath_first = config->pathToKill;
321
currentTool->TryPath_first = GlobalConfig->pathToKill;
287
322
else if ( currentTool->Name == "killall" )
288
currentTool->TryPath_first = config->pathToKillall;
323
currentTool->TryPath_first = GlobalConfig->pathToKillall;
289
324
else if ( currentTool->Name == "ping" )
290
currentTool->TryPath_first = config->pathToPing;
325
currentTool->TryPath_first = GlobalConfig->pathToPing;
291
326
else if ( currentTool->Name == "ip" )
292
currentTool->TryPath_first = config->pathToIp;
327
currentTool->TryPath_first = GlobalConfig->pathToIp;
293
328
else if ( currentTool->Name == "ifconfig" )
294
currentTool->TryPath_first = config->pathToIfconfig;
329
currentTool->TryPath_first = GlobalConfig->pathToIfconfig;
295
330
else if ( currentTool->Name == "route" )
296
currentTool->TryPath_first = config->pathToRoute;
331
currentTool->TryPath_first = GlobalConfig->pathToRoute;
297
332
else if ( currentTool->Name == "pptp" )
298
currentTool->TryPath_first = config->pathToPptp;
333
currentTool->TryPath_first = GlobalConfig->pathToPptp;
299
334
else if ( currentTool->Name == "l2tpd" )
300
currentTool->TryPath_first = config->pathToL2tpd;
335
currentTool->TryPath_first = GlobalConfig->pathToL2tpd;
301
336
else if ( currentTool->Name == "pkcs11-tool" )
302
currentTool->TryPath_first = config->pathToPkcs11Tool;
337
currentTool->TryPath_first = GlobalConfig->pathToPkcs11Tool;
303
338
else if ( currentTool->Name == "bash" )
304
currentTool->TryPath_first = config->InterpreterShell;
339
currentTool->TryPath_first = GlobalConfig->InterpreterShell;
305
340
else if ( currentTool->Name == "vtund" )
306
currentTool->TryPath_first = config->pathToVtund;
341
currentTool->TryPath_first = GlobalConfig->pathToVtund;
307
342
else if ( currentTool->Name == "cisco_cert_mgr" )
308
currentTool->TryPath_first = config->pathToCiscoCertMgr;
343
currentTool->TryPath_first = GlobalConfig->pathToCiscoCertMgr;
344
else if ( currentTool->Name == "tail" )
345
currentTool->TryPath_first = GlobalConfig->pathToTail;
346
else if ( currentTool->Name == "ssh" )
347
currentTool->TryPath_first = GlobalConfig->pathToSsh;
348
else if ( currentTool->Name == "ksshaskpass" )
349
currentTool->TryPath_first = GlobalConfig->pathToKsshAskpass;
350
else if ( currentTool->Name == "gnome-ssh-askpass" )
351
currentTool->TryPath_first = GlobalConfig->pathToGnomeSshAskpass;
310
353
ToolList->append( currentTool );
311
354
currentTool->collectToolInfo();
312
355
//currentTool=0L;
313
// std::cout << "tool: " << currentTool->Name << std::endl;
314
// std::cout << "Version: " << currentTool->Version << std::endl;
315
// std::cout << "Path: " << currentTool->PathToExec << std::endl << std::endl;
356
// std::cout << "tool: " << qPrintable(currentTool->Name) << std::endl;
357
// std::cout << "Version: " << qPrintable(currentTool->Version) << std::endl;
358
// std::cout << "Path: " << qPrintable(currentTool->PathToExec) << std::endl << std::endl;
317
360
ToolList->sort();
374
419
OpenvpnCiphers.clear();
375
420
retrieveOpenvpnCiphers = false;
377
ToolInfo *OpenvpnInfo = getToolInfo( config, "openvpn" );
422
ToolInfo *OpenvpnInfo = getToolInfo( "openvpn" );
378
423
QString pathToOpenvpn = OpenvpnInfo->PathToExec;
380
425
if ( pathToOpenvpn.isEmpty() )
381
426
return OpenvpnCiphers;
383
OpenvpnCiphersProcess = new QProcess( this );
428
OpenvpnCiphersProcess = new Q3Process( this );
384
429
OpenvpnCiphersProcess->addArgument( pathToOpenvpn );
385
430
OpenvpnCiphersProcess->addArgument( "--show-ciphers" );
387
connect( OpenvpnCiphersProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnCiphers() ) );
388
connect( OpenvpnCiphersProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnCiphers() ) );
432
connect( OpenvpnCiphersProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetrieveOpenvpnCiphers() ) );
433
connect( OpenvpnCiphersProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetrieveOpenvpnCiphers() ) );
390
435
if ( !OpenvpnCiphersProcess->start( env ) ) {
391
kdError() << "Unable to fetch openvpn ciphers!" << endl;
436
kError() << "Unable to fetch openvpn ciphers!" << endl;
437
return OpenvpnCiphers;
394
439
while ( OpenvpnCiphersProcess->isRunning() )
395
config->appPointer->processEvents();
398
disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnCiphers() ) );
399
disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnCiphers() ) );
440
GlobalConfig->appPointer->processEvents();
443
disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetrieveOpenvpnCiphers() ) );
444
disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetrieveOpenvpnCiphers() ) );
402
447
return OpenvpnCiphers;
450
Utils::IpsecAlgos Utils::getIpsecAlgos()
454
salgos.IpsecIkeEncryptionAlgorithms.clear();
455
salgos.IpsecIkeHashAlgorithms.clear();
456
salgos.IpsecIkeDhGroups.clear();
457
salgos.IpsecEspEncryptionAlgorithms.clear();
458
salgos.IpsecEspAuthenticationAlgorithms.clear();
459
salgos.IpsecCompressionAlgorithms.clear();
461
retrieveIpsecAlgos = false;
463
ToolInfo *IpsecInfo = getToolInfo( "ipsec" );
464
QString pathToIpsec = IpsecInfo->PathToExec;
466
if ( pathToIpsec.isEmpty() )
469
IpsecAlgosProcess = new Q3Process( this );
470
IpsecAlgosProcess->addArgument( pathToIpsec);
471
IpsecAlgosProcess->addArgument( "auto" );
472
IpsecAlgosProcess->addArgument( "--status" );
474
connect( IpsecAlgosProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetrieveIpsecAlgos() ) );
475
connect( IpsecAlgosProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetrieveIpsecAlgos() ) );
477
if ( !IpsecAlgosProcess->start( env ) ) {
478
kdError() << "Unable to fetch ipsec algos!" << endl;
481
while ( IpsecAlgosProcess->isRunning() )
482
GlobalConfig->appPointer->processEvents();
485
disconnect( IpsecAlgosProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetrieveIpsecAlgos() ) );
486
disconnect( IpsecAlgosProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetrieveIpsecAlgos() ) );
492
Utils::PppdCapabilities Utils::checkPppdCapabilities()
494
pppdcap.pppdHasMppeRequiredSupport=false;
495
pppdcap.pppdHasRequireMppeSupport=false;
496
pppdcap.pppdHasReplacedefaultrouteSupport=false;
497
pppdcap.pppdHasMppeSupport=false;
498
pppdcap.oldPppdStyle=false;
499
pppdcap.pppdOk=false;
501
// test mppe support of pppd
502
testPppdRequireMppe=true;
503
testPppdReplacedefaultroute=false;
504
testPppdMppeRequiredSupport=false;
505
testOldPppdStyle=false;
506
testPppdRequireMppe=false;
507
testPppdMppeRequired=false;
511
int pppd_version_major = 0;
512
int pppd_version_minor = 0;
513
int pppd_version_subminor = 0;
515
ToolInfo *Tool = Utils (GlobalConfig ).getToolInfo ( "pppd" );
516
if ( !Tool->Version.isEmpty() )
518
pppd_version_major = ( Tool->Version.section ( '.', 0, 0 ) ).toInt();
519
pppd_version_minor = ( Tool->Version.section ( '.', 1, 1 ) ).toInt();
520
pppd_version_subminor = ( Tool->Version.section ( '.', 2, 2 ) ).toInt();
521
if ( GlobalConfig->KvpncDebugLevel > 5 )
523
GlobalConfig->appendLogEntry ( i18n ( "pppd version (major): \"%1\"" , QString( pppd_version_major )) , GlobalConfig->debug );
524
GlobalConfig->appendLogEntry ( i18n ( "pppd version (minor): \"%1\"" , QString( pppd_version_minor )) , GlobalConfig->debug );
525
GlobalConfig->appendLogEntry ( i18n ( "pppd version (subminor): \"%1\"" , QString( pppd_version_subminor )) , GlobalConfig->debug );
529
if ( pppd_version_major <2 || (pppd_version_major ==2 && pppd_version_minor < 4 ) )
532
if ( GlobalConfig->KvpncDebugLevel > 5 )
533
GlobalConfig->appendLogEntry ( i18n ( "pppd version is lower than 2.4.0" ) , GlobalConfig->debug );
535
pppdcap.RequireMppeOption="";
536
pppdcap.Require128BitMppeOption="";
537
pppdcap.RefuseMppeOption="";
538
pppdcap.Refuse40BitMppeOption="";
539
pppdcap.Refuse128BitMppeOption="";
541
pppdcap.RequireStatelessOption="";
542
pppdcap.RequireStatefulOption="";
543
pppdcap.MppeOptionsInALine = false;
544
pppdcap.RequireAuthMschapOption="";
545
pppdcap.RequireAuthMschapv2Option="";
546
pppdcap.RequireAuthPapOption="";
549
if (pppd_version_major ==2 && pppd_version_minor == 4 && (pppd_version_subminor == 0 || pppd_version_subminor == 0 ) )
551
// pppd == 2.4.0/2.4.1
552
if ( GlobalConfig->KvpncDebugLevel > 5 )
553
GlobalConfig->appendLogEntry ( i18n ( "pppd version is 2.4.0" ) , GlobalConfig->debug );
555
pppdcap.RequireMppeOption="mppe-40";
556
pppdcap.Require128BitMppeOption="mppe-128";
557
pppdcap.RefuseMppeOption="";
558
pppdcap.Refuse40BitMppeOption="";
559
pppdcap.Refuse128BitMppeOption="";
561
pppdcap.RequireStatelessOption="mppe-stateless";
562
pppdcap.RequireStatefulOption="";
563
pppdcap.MppeOptionsInALine = false;
564
pppdcap.RequireAuthChapOption="";
565
pppdcap.RequireAuthChapOption+="require-chap\n";
566
pppdcap.RequireAuthChapOption+="refuse-chapms\n";
567
pppdcap.RequireAuthChapOption+="refuse-chapms-v2\n";
568
pppdcap.RequireAuthChapOption+="refuse-pap\n";
569
pppdcap.RequireAuthChapOption+="refuse-eap";
570
pppdcap.RequireAuthMschapOption="";
571
// pppdcap.RequireAuthMschapOption+="refuse-chap\n";
572
pppdcap.RequireAuthMschapOption+="require-chapms\n";
573
// pppdcap.RequireAuthMschapOption+="require-chapms-v2\n";
574
pppdcap.RequireAuthMschapOption+="refuse-pap\n";
575
pppdcap.RequireAuthMschapOption+="refuse-eap";
576
pppdcap.RequireAuthMschapv2Option="";
577
// pppdcap.RequireAuthMschapv2Option+="refuse-chap\n";
578
// pppdcap.RequireAuthMschapv2Option+="refuse-chapms\n";
579
pppdcap.RequireAuthMschapv2Option+="require-chapms-v2\n";
580
pppdcap.RequireAuthMschapv2Option+="refuse-pap\nrefuse-eap";
581
pppdcap.RequireAuthPapOption="";
582
pppdcap.RequireAuthPapOption+="require-pap\n";
583
pppdcap.RequireAuthPapOption+="refuse-chap\n";
584
pppdcap.RequireAuthPapOption+="refuse-chapms-v2\n";
585
pppdcap.RequireAuthPapOption+="refuse-chapms-v2\n";
586
pppdcap.RequireAuthPapOption+="refuse-eap";
589
if ( ( pppd_version_major ==2 && pppd_version_minor == 4 && pppd_version_subminor >= 2) || pppd_version_major >2 )
592
if ( GlobalConfig->KvpncDebugLevel > 5 )
593
GlobalConfig->appendLogEntry ( i18n ( "pppd version is >= 2.4.2, good" ) , GlobalConfig->debug );
595
pppdcap.RequireMppeOption="require-mppe";
596
pppdcap.Require128BitMppeOption="require-mppe-128";
597
pppdcap.RefuseMppeOption="nomppe";
598
pppdcap.Refuse40BitMppeOption="nomppe-40";
599
pppdcap.Refuse128BitMppeOption="nomppe-128";
601
pppdcap.RequireStatelessOption="nomppe-stateful";
602
pppdcap.RequireStatefulOption="";
603
pppdcap.MppeOptionsInALine = false;
604
pppdcap.RequireAuthChapOption="";
605
pppdcap.RequireAuthChapOption+="refuse-pap\n";
606
pppdcap.RequireAuthChapOption+="refuse-mschap\n";
607
pppdcap.RequireAuthChapOption+="refuse-mschap-v2\n";
608
pppdcap.RequireAuthChapOption+="refuse-eap";
609
pppdcap.RequireAuthMschapOption="";
610
pppdcap.RequireAuthMschapOption+="refuse-pap\n";
611
// pppdcap.RequireAuthMschapOption+="refuse-chap\n";
612
// pppdcap.RequireAuthMschapOption+="refuse-mschap-v2\n";
613
pppdcap.RequireAuthMschapOption+="refuse-eap";
614
pppdcap.RequireAuthMschapv2Option="";
615
pppdcap.RequireAuthMschapv2Option+="refuse-pap\n";
616
// pppdcap.RequireAuthMschapv2Option+="refuse-chap\n";
617
// pppdcap.RequireAuthMschapv2Option+="refuse-mschap\n";
618
pppdcap.RequireAuthMschapv2Option+="refuse-eap";
619
pppdcap.RequireAuthPapOption="";
620
pppdcap.RequireAuthPapOption+="refuse-mschap\n";
621
pppdcap.RequireAuthPapOption+="refuse-mschap-v2\n";
622
pppdcap.RequireAuthPapOption+="refuse-chap\n";
623
pppdcap.RequireAuthPapOption+="refuse-eap";
629
pppdcap.pppdHasMppeRequiredSupport=true;
630
pppdcap.pppdHasRequireMppeSupport=true;
631
pppdcap.pppdHasMppeSupport=true;
633
testOldPppdStyle = false;
634
testPppdRequireMppe=true;
635
testPppdMppeRequired=false;
636
TestPppdProcess = new Q3Process ( this );
637
TestPppdProcess->addArgument ( GlobalConfig->pathToPppd );
638
TestPppdProcess->addArgument ( "/dev/null" );
639
TestPppdProcess->addArgument ( "require-mppe" );
641
TestPppdProcess->setCommunication ( Q3Process::Stdin | Q3Process::Stdout | Q3Process::Stderr | Q3Process::DupStderr );
642
TestPppdProcess->closeStdin ();
644
connect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) );
645
// connect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) );
647
if ( !TestPppdProcess->start ( env ) )
649
GlobalConfig->appendLogEntry ( i18n ( "unable to start proc (%1)!" , QString( i18n ( "Test require-mppe support of pppd" )) ) , KVpncConfig::error );
650
pppdcap.pppdOk=false;
655
while ( TestPppdProcess->isRunning() )
656
GlobalConfig->appPointer->processEvents();
659
if (pppdcap.pppdHasRequireMppeSupport)
661
if ( GlobalConfig->KvpncDebugLevel > 0 )
662
GlobalConfig->appendLogEntry ( "pppdHasRequireMppeSupport: true", GlobalConfig->debug );
663
pppdcap.RequireMppeOption="require-mppe";
664
pppdcap.Require128BitMppeOption="require-mppe-128";
665
pppdcap.RefuseMppeOption="nomppe";
666
pppdcap.Refuse40BitMppeOption="nomppe-40";
667
pppdcap.Refuse128BitMppeOption="nomppe-128";
670
GlobalConfig->appendLogEntry ( "pppdHasRequireMppeSupport: false", GlobalConfig->debug );
672
disconnect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) );
673
disconnect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) );
676
delete TestPppdProcess;
677
testPppdRequireMppe=false;
678
testPppdMppeRequired=true;
681
TestPppdProcess = new Q3Process ( this );
682
TestPppdProcess->addArgument ( GlobalConfig->pathToPppd );
683
TestPppdProcess->addArgument ( "/dev/null" );
684
TestPppdProcess->addArgument ( "mppe");
685
TestPppdProcess->addArgument ( "required" );
687
TestPppdProcess->setCommunication ( Q3Process::Stdin | Q3Process::Stdout | Q3Process::Stderr | Q3Process::DupStderr );
688
TestPppdProcess->closeStdin ();
690
connect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) );
691
// connect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) );
693
if ( !TestPppdProcess->start ( env ) )
695
GlobalConfig->appendLogEntry ( i18n ( "unable to start proc (%1)!" , QString( i18n ( "Test mppe required support of pppd" )) ), KVpncConfig::error );
696
pppdcap.pppdOk=false;
701
while ( TestPppdProcess->isRunning() )
702
GlobalConfig->appPointer->processEvents();
704
if (pppdcap.pppdHasMppeRequiredSupport)
706
if ( GlobalConfig->KvpncDebugLevel > 0 )
707
GlobalConfig->appendLogEntry ( "PppdMppeRequired: true", GlobalConfig->debug );
709
pppdcap.MppeOptionsInALine = true;
711
pppdcap.RequireMppeOption="mppe required";
712
pppdcap.Require128BitMppeOption="";
713
pppdcap.RefuseMppeOption="nomppe";
714
pppdcap.Refuse40BitMppeOption=",no40";
715
pppdcap.Refuse128BitMppeOption=",no128";
716
pppdcap.RequireStatefulOption="";
717
pppdcap.RequireStatelessOption=",stateless";
721
GlobalConfig->appendLogEntry ( "PppdMppeRequired: false", GlobalConfig->debug );
724
disconnect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) );
725
disconnect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) );
729
delete TestPppdProcess;
730
testPppdMppeRequired=false;
735
if (pppdcap.pppdHasRequireMppeSupport || pppdcap.pppdHasMppeRequiredSupport)
737
pppdcap.pppdHasMppeSupport = true;
738
if ( GlobalConfig->KvpncDebugLevel > 0 )
739
GlobalConfig->appendLogEntry ( i18n ( " %1 has MPPE support." , QString( GlobalConfig->pathToPppd )), GlobalConfig->debug );
743
if ( GlobalConfig->KvpncDebugLevel > 0 )
744
GlobalConfig->appendLogEntry ( i18n ( " %1 has no MPPE support." , QString(GlobalConfig->pathToPppd )), GlobalConfig->debug );
749
/* defaultroute test */
750
//unrecognized option 'replacedefaultroute'
751
// test defaultroute support of pppd
752
testPppdReplacedefaultroute = false;
753
TestPppdProcess = new Q3Process ( this );
754
TestPppdProcess->addArgument ( GlobalConfig->pathToPppd );
755
TestPppdProcess->addArgument ( "replacedefaultroute" );
756
TestPppdProcess->setCommunication ( Q3Process::Stdin | Q3Process::Stdout | Q3Process::Stderr | Q3Process::DupStderr );
757
TestPppdProcess->closeStdin ();
759
connect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) );
760
// connect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) );
763
if ( !TestPppdProcess->start ( env ) )
765
GlobalConfig->appendLogEntry ( i18n ( "unable to start proc (%1)!" , QString( i18n ( "Test support of replacedefaultroute pppd" ) )) , GlobalConfig->error );
766
pppdcap.pppdOk=false;
770
while ( TestPppdProcess->isRunning() )
771
GlobalConfig->appPointer->processEvents();
773
disconnect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) );
774
disconnect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) );
776
if ( pppdcap.pppdHasReplacedefaultrouteSupport )
778
if ( GlobalConfig->KvpncDebugLevel > 1 )
779
GlobalConfig->appendLogEntry ( i18n ( "Test support of replacedefaultroute pppd: %1" , QString( i18n ( "succeded" ) )) , GlobalConfig->debug );
783
if ( GlobalConfig->KvpncDebugLevel > 1 )
784
GlobalConfig->appendLogEntry ( i18n ( "Test support of replacedefaultroute pppd: %1" , QString( i18n ( "failed" ) )) , GlobalConfig->debug );
405
792
QStringList Utils::getOpenvpnDigests()
407
794
OpenvpnDigests.clear();
783
void Utils::readStdOutRetriveOpenvpnDigests()
1238
void Utils::readStdOutRetrieveIpsecAlgos()
1240
while ( IpsecAlgosProcess->canReadLineStdout() ) {
1241
QString msg = QString( IpsecAlgosProcess->readLineStdout() );
1242
bool newIpsecAlgoFound=false;
1243
// std::cout << "[ipsec algos raw] "<< msg.ascii() << std::endl;
1244
if (msg.find ( "000 algorithm", 0, -1 ) > -1)
1246
std::cout << "[ipsec algos line] "<< msg.ascii() << std::endl;
1247
if (msg.find ( "000 algorithm ESP", 0, -1 ) > -1)
1250
QString Algo = msg.stripWhiteSpace().section(":",1,1).section(",",1,1).section("=",1,1);
1251
QString MinKeySize = msg.stripWhiteSpace().section(":",1,1).section(",",3,3).section("=",1,1);
1252
QString MaxKeySize = msg.stripWhiteSpace().section(":",1,1).section(",",4,4).section("=",1,1);
1253
std::cout << "IKE encryption algo found: \"" << qPrintable(Algo) << "\", Min: " << qPrintable(MinKeySize) << ", Max: " << qPrintable(MaxKeySize) << std::endl;
1254
// QStringList AlgoOptList = QStringList::split("-",AlgoOpt);
1255
// for (QStringList::Iterator it = AlgoOptList.begin(); it != AlgoOptList.end(); ++it)
1257
// std::cout << "IKE encryption algo subtypes found: \"" << qPrintable(Algo) << "-" << *it << "\"" << std::endl;
1265
void Utils::readStdErrRetrieveIpsecAlgos()
1267
while ( IpsecAlgosProcess->canReadLineStderr() ) {
1268
QString msg = QString( IpsecAlgosProcess->readLineStderr() );
1269
std::cout << "[ipsec algos raw err] "<< msg.ascii() << std::endl;
1273
void Utils::readPppdtestProcessOutput()
1276
msg += QString ( TestPppdProcess->readStdout() );
1277
// msg += QString ( TestPppdProcess->readStderr() );
1285
if (testPppdRequireMppe)
1287
if (GlobalConfig->KvpncDebugLevel > 2)
1288
GlobalConfig->appendLogEntry("Testing require-mppe",GlobalConfig->debug);
1290
if (GlobalConfig->KvpncDebugLevel > 4)
1291
GlobalConfig->appendLogEntry("[test pppd raw]: "+msg,GlobalConfig->debug);
1293
if ( msg.contains ( "unrecognized option 'require-mppe'" ) )
1295
pppdcap.oldPppdStyle = true;
1296
pppdcap.pppdHasMppeSupport = false;
1297
pppdcap.pppdHasRequireMppeSupport=false;
1299
if ( GlobalConfig->KvpncDebugLevel > 4 )
1300
GlobalConfig->appendLogEntry ( i18n ( "%1 has no MPPE support using \"require mppe\"." , QString( GlobalConfig->pathToPppd )), GlobalConfig->debug );
1304
if ( msg.contains ( "The remote system is required to authenticate itself" ) )
1307
pppdcap.oldPppdStyle = false;
1308
pppdcap.pppdHasMppeSupport = true;
1309
pppdcap.pppdHasRequireMppeSupport=true;
1311
if ( GlobalConfig->KvpncDebugLevel > 0 )
1312
GlobalConfig->appendLogEntry ( i18n ( "%1 has MPPE support and uses require mppe." , QString( GlobalConfig->pathToPppd )), GlobalConfig->debug );
1317
if ( testPppdMppeRequired)
1319
if (GlobalConfig->KvpncDebugLevel > 2)
1320
GlobalConfig->appendLogEntry("Testing mppe-required",GlobalConfig->debug);
1322
if (GlobalConfig->KvpncDebugLevel > 4)
1323
GlobalConfig->appendLogEntry("[test pppd raw]: "+msg,GlobalConfig->debug);
1326
if ( msg.contains ( "unrecognized option 'mppe'" ) )
1328
// no mppe support :(
1329
pppdcap.oldPppdStyle = false;
1330
pppdcap.pppdHasMppeSupport = false;
1331
pppdcap.pppdHasMppeRequiredSupport=false;
1332
if ( GlobalConfig->KvpncDebugLevel > 4 )
1333
GlobalConfig->appendLogEntry ( i18n ( "%1 has no MPPE support using \"mppe-required\"." , QString( GlobalConfig->pathToPppd )), GlobalConfig->debug );
1337
if ( msg.contains ( "The remote system is required to authenticate itself" ) )
1340
pppdcap.oldPppdStyle = true;
1341
pppdcap.pppdHasMppeSupport = true;
1342
pppdcap.pppdHasMppeRequiredSupport=true;
1344
if ( GlobalConfig->KvpncDebugLevel > 0 )
1345
GlobalConfig->appendLogEntry ( i18n ( "%1 has MPPE support and uses mppe-required." , QString( GlobalConfig->pathToPppd )), GlobalConfig->debug );
1351
/* default route test */
1352
if ( testPppdReplacedefaultroute )
1355
if (GlobalConfig->KvpncDebugLevel > 1)
1356
GlobalConfig->appendLogEntry("[test pppd raw]: "+msg,GlobalConfig->debug);
1358
if ( msg.contains ( "unrecognized option 'replacedefaultroute'" ) )
1360
pppdcap.pppdHasReplacedefaultrouteSupport = false;
1362
if (GlobalConfig->KvpncDebugLevel > 1)
1363
GlobalConfig->appendLogEntry(i18n("Testing %1: %2", QString("replacedefaultroute"), QString("failed")),GlobalConfig->debug);
1367
pppdcap.pppdHasReplacedefaultrouteSupport = true;
1368
if (GlobalConfig->KvpncDebugLevel > 1)
1369
GlobalConfig->appendLogEntry(i18n("Testing %1: %2", QString("replacedefaultroute"),i18n("succeded")),GlobalConfig->debug);
1376
void Utils::readStdOutRetrieveOpenvpnDigests()
785
1378
while ( OpenvpnDigestProcess->canReadLineStdout() ) {
786
1379
QString msg = QString( OpenvpnDigestProcess->readLineStdout() );
787
1380
OpenvpnDigestCount+=1;
788
1381
if ( OpenvpnDigestCount > 5 ) {
789
// std::cout << msg.simplifyWhiteSpace().ascii() << std::endl;
1382
// std::cout << qPrintable(msg.simplified()) << std::endl;
790
1383
OpenvpnDigestString += msg+"#";
795
void Utils::readStdErrRetriveOpenvpnDigests()
1388
void Utils::readStdErrRetrieveOpenvpnDigests()
797
1390
while ( OpenvpnDigestProcess->canReadLineStderr() ) {
798
1391
QString msg = QString( OpenvpnDigestProcess->readLineStderr() );