|
|
|
@ -41,48 +41,52 @@
|
|
|
|
|
#include <kpassdlg.h>
|
|
|
|
|
|
|
|
|
|
/* knetworkmanager headers */
|
|
|
|
|
#include "knetworkmanager-accesspoint.h"
|
|
|
|
|
#include "knetworkmanager-wireless_device.h"
|
|
|
|
|
#include "knetworkmanager-device.h"
|
|
|
|
|
#include "knetworkmanager-connection.h"
|
|
|
|
|
#include "knetworkmanager-connection_setting_wireless_security_widget.h"
|
|
|
|
|
#include "knetworkmanager-connection_setting_wireless_security.h"
|
|
|
|
|
#include "knetworkmanager-connection_setting_wireless.h"
|
|
|
|
|
#include "knetworkmanager-connection_setting_8021x.h"
|
|
|
|
|
#include "sha1.h"
|
|
|
|
|
#include "md5.h"
|
|
|
|
|
#include "knetworkmanager-wireless_manager.h"
|
|
|
|
|
|
|
|
|
|
#define WPA_PMK_LEN 32
|
|
|
|
|
|
|
|
|
|
#define SET_FLAG_IF_TRUE_CLEAR_IF_FALSE(x,y,z) { \
|
|
|
|
|
if (z) { \
|
|
|
|
|
x |= y; \
|
|
|
|
|
} \
|
|
|
|
|
else { \
|
|
|
|
|
x &= (~y); \
|
|
|
|
|
} \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
using namespace ConnectionSettings;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityWEPImpl
|
|
|
|
|
*/
|
|
|
|
|
WirelessSecurityWEPImpl::WirelessSecurityWEPImpl(WirelessSecurity* sec, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityWEPImpl::WirelessSecurityWEPImpl(TDEWiFiConnection* sec, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: ConnectionSettingWirelessSecurityWEP(parent, name, fl)
|
|
|
|
|
, _security_setting(sec)
|
|
|
|
|
, _wepKeyType( WEPKEY_TYPE_HEX )
|
|
|
|
|
{
|
|
|
|
|
cboAuthentication->insertItem(i18n("Open System"), 0);
|
|
|
|
|
cboAuthentication->insertItem(i18n("Shared Key"), 1);
|
|
|
|
|
if (_security_setting->getAuthAlg() == WirelessSecurity::AUTH_ALG_OPEN)
|
|
|
|
|
if (_security_setting->securitySettings.authType == TDENetworkWiFiAuthType::Open) {
|
|
|
|
|
cboAuthentication->setCurrentItem(0);
|
|
|
|
|
else if (_security_setting->getAuthAlg() == WirelessSecurity::AUTH_ALG_SHARED)
|
|
|
|
|
}
|
|
|
|
|
else if (_security_setting->securitySettings.authType == TDENetworkWiFiAuthType::Shared) {
|
|
|
|
|
cboAuthentication->setCurrentItem(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cbKeyType->insertItem(i18n("WEP 40/128-bit ASCII"), WEPKEY_TYPE_ASCII);
|
|
|
|
|
cbKeyType->insertItem(i18n("WEP 40/128-bit Hexadecimal"), WEPKEY_TYPE_HEX);
|
|
|
|
|
cbKeyType->insertItem(i18n("WEP 128-bit passphrase"), WEPKEY_TYPE_PASSPHRASE);
|
|
|
|
|
cbKeyType->setCurrentItem(_wepKeyType );
|
|
|
|
|
|
|
|
|
|
txtWEPKey0->setText(_security_setting->getWepKey(0));
|
|
|
|
|
txtWEPKey1->setText(_security_setting->getWepKey(1));
|
|
|
|
|
txtWEPKey2->setText(_security_setting->getWepKey(2));
|
|
|
|
|
txtWEPKey3->setText(_security_setting->getWepKey(3));
|
|
|
|
|
txtWEPKey0->setText(_security_setting->securitySettings.wepKey0);
|
|
|
|
|
txtWEPKey1->setText(_security_setting->securitySettings.wepKey1);
|
|
|
|
|
txtWEPKey2->setText(_security_setting->securitySettings.wepKey2);
|
|
|
|
|
txtWEPKey3->setText(_security_setting->securitySettings.wepKey3);
|
|
|
|
|
|
|
|
|
|
switch(_security_setting->getWepTxidx())
|
|
|
|
|
switch(_security_setting->securitySettings.wepKeyIndex)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
rbKeyIdx0->setChecked(true);
|
|
|
|
@ -116,10 +120,12 @@ WirelessSecurityWEPImpl::WirelessSecurityWEPImpl(WirelessSecurity* sec, TQWidget
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotAuthAlgChanged(int index)
|
|
|
|
|
{
|
|
|
|
|
if (index == 0)
|
|
|
|
|
_security_setting->setAuthAlg(WirelessSecurity::AUTH_ALG_OPEN);
|
|
|
|
|
else if (index == 1)
|
|
|
|
|
_security_setting->setAuthAlg(WirelessSecurity::AUTH_ALG_SHARED);
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
_security_setting->securitySettings.authType =TDENetworkWiFiAuthType::Open;
|
|
|
|
|
}
|
|
|
|
|
else if (index == 1) {
|
|
|
|
|
_security_setting->securitySettings.authType = TDENetworkWiFiAuthType::Shared;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotKeyTypeChanged(int index)
|
|
|
|
@ -132,49 +138,53 @@ void WirelessSecurityWEPImpl::slotKeyTypeChanged(int index)
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepKey0Changed(const TQString &key)
|
|
|
|
|
{
|
|
|
|
|
TQCString hashed = getHashedWEPKey(key, _wepKeyType);
|
|
|
|
|
_security_setting->setWepKey(0, hashed);
|
|
|
|
|
_security_setting->securitySettings.wepKey0 = hashed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepKey1Changed(const TQString &key)
|
|
|
|
|
{
|
|
|
|
|
TQCString hashed = getHashedWEPKey(key, _wepKeyType);
|
|
|
|
|
_security_setting->setWepKey(1, hashed);
|
|
|
|
|
_security_setting->securitySettings.wepKey1 = hashed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepKey2Changed(const TQString &key)
|
|
|
|
|
{
|
|
|
|
|
TQCString hashed = getHashedWEPKey(key, _wepKeyType);
|
|
|
|
|
_security_setting->setWepKey(2, hashed);
|
|
|
|
|
_security_setting->securitySettings.wepKey2 = hashed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepKey3Changed(const TQString& key)
|
|
|
|
|
{
|
|
|
|
|
TQCString hashed = getHashedWEPKey(key, _wepKeyType);
|
|
|
|
|
_security_setting->setWepKey(3, hashed);
|
|
|
|
|
_security_setting->securitySettings.wepKey3 = hashed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepIdx0Checked(bool check)
|
|
|
|
|
{
|
|
|
|
|
if (check)
|
|
|
|
|
_security_setting->setWepTxidx(0);
|
|
|
|
|
if (check) {
|
|
|
|
|
_security_setting->securitySettings.wepKeyIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepIdx1Checked(bool check)
|
|
|
|
|
{
|
|
|
|
|
if (check)
|
|
|
|
|
_security_setting->setWepTxidx(1);
|
|
|
|
|
if (check) {
|
|
|
|
|
_security_setting->securitySettings.wepKeyIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepIdx2Checked(bool check)
|
|
|
|
|
{
|
|
|
|
|
if (check)
|
|
|
|
|
_security_setting->setWepTxidx(2);
|
|
|
|
|
if (check) {
|
|
|
|
|
_security_setting->securitySettings.wepKeyIndex = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityWEPImpl::slotWepIdx3Checked(bool check)
|
|
|
|
|
{
|
|
|
|
|
if (check)
|
|
|
|
|
_security_setting->setWepTxidx(3);
|
|
|
|
|
if (check) {
|
|
|
|
|
_security_setting->securitySettings.wepKeyIndex = 3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQCString
|
|
|
|
@ -243,7 +253,7 @@ WirelessSecurityWEPImpl::String2Hex(TQByteArray bytes, int final_len) const
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityWEPEncryptionImpl
|
|
|
|
|
*/
|
|
|
|
|
WirelessSecurityWEPEncryptionImpl::WirelessSecurityWEPEncryptionImpl(WirelessSecurity* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityWEPEncryptionImpl::WirelessSecurityWEPEncryptionImpl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: ConnectionSettingWirelessSecurityWEPEncryption(parent, name, fl)
|
|
|
|
|
, _security_setting(security_setting)
|
|
|
|
|
{
|
|
|
|
@ -255,12 +265,12 @@ WirelessSecurityWEPEncryptionImpl::WirelessSecurityWEPEncryptionImpl(WirelessSec
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityWPAVersionImpl
|
|
|
|
|
*/
|
|
|
|
|
WirelessSecurityWPAVersionImpl::WirelessSecurityWPAVersionImpl(WirelessSecurity* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityWPAVersionImpl::WirelessSecurityWPAVersionImpl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: ConnectionSettingWirelessSecurityWPAVersion(parent, name, fl)
|
|
|
|
|
, _security_setting(security_setting)
|
|
|
|
|
{
|
|
|
|
|
cbWPA->setChecked(_security_setting->getProto() & WirelessSecurity::PROTO_WPA);
|
|
|
|
|
cbRSN->setChecked(_security_setting->getProto() & WirelessSecurity::PROTO_RSN);
|
|
|
|
|
cbWPA->setChecked(_security_setting->securitySettings.wpaVersion & TDENetworkWiFiWPAVersionFlags::WPA);
|
|
|
|
|
cbRSN->setChecked(_security_setting->securitySettings.wpaVersion & TDENetworkWiFiWPAVersionFlags::RSN);
|
|
|
|
|
|
|
|
|
|
connect(cbWPA, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotWPA1(bool)));
|
|
|
|
|
connect(cbRSN, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotWPA2(bool)));
|
|
|
|
@ -271,45 +281,39 @@ WirelessSecurityWPAVersionImpl::WirelessSecurityWPAVersionImpl(WirelessSecurity*
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPAVersionImpl::slotAuto(bool on)
|
|
|
|
|
{
|
|
|
|
|
if (!on)
|
|
|
|
|
{
|
|
|
|
|
if (!on) {
|
|
|
|
|
// auto-select proto
|
|
|
|
|
_security_setting->setProto(WirelessSecurity::PROTO_AUTO);
|
|
|
|
|
_security_setting->securitySettings.wpaVersion = TDENetworkWiFiWPAVersionFlags::Any;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
else {
|
|
|
|
|
// use selected wpa-version
|
|
|
|
|
TQ_UINT32 proto = WirelessSecurity::PROTO_NONE;
|
|
|
|
|
if (cbWPA->isChecked())
|
|
|
|
|
proto |= WirelessSecurity::PROTO_WPA;
|
|
|
|
|
if (cbRSN->isChecked())
|
|
|
|
|
proto |= WirelessSecurity::PROTO_RSN;
|
|
|
|
|
_security_setting->setProto(proto);
|
|
|
|
|
TDENetworkWiFiWPAVersionFlags::TDENetworkWiFiWPAVersionFlags proto = TDENetworkWiFiWPAVersionFlags::None;
|
|
|
|
|
if (cbWPA->isChecked()) {
|
|
|
|
|
proto |= TDENetworkWiFiWPAVersionFlags::WPA;
|
|
|
|
|
}
|
|
|
|
|
if (cbRSN->isChecked()) {
|
|
|
|
|
proto |= TDENetworkWiFiWPAVersionFlags::RSN;
|
|
|
|
|
}
|
|
|
|
|
_security_setting->securitySettings.wpaVersion = proto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPAVersionImpl::slotWPA1(bool on)
|
|
|
|
|
{
|
|
|
|
|
if (on)
|
|
|
|
|
_security_setting->addProto(WirelessSecurity::PROTO_WPA);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->delProto(WirelessSecurity::PROTO_WPA);
|
|
|
|
|
SET_FLAG_IF_TRUE_CLEAR_IF_FALSE(_security_setting->securitySettings.wpaVersion, TDENetworkWiFiWPAVersionFlags::WPA, on);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPAVersionImpl::slotWPA2(bool on)
|
|
|
|
|
{
|
|
|
|
|
if (on)
|
|
|
|
|
_security_setting->addProto(WirelessSecurity::PROTO_RSN);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->delProto(WirelessSecurity::PROTO_RSN);
|
|
|
|
|
SET_FLAG_IF_TRUE_CLEAR_IF_FALSE(_security_setting->securitySettings.wpaVersion, TDENetworkWiFiWPAVersionFlags::RSN, on);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityWPACipherImpl
|
|
|
|
|
*/
|
|
|
|
|
WirelessSecurityWPACipherImpl::WirelessSecurityWPACipherImpl(WirelessSecurity* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityWPACipherImpl::WirelessSecurityWPACipherImpl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: ConnectionSettingWirelessSecurityWPACipher(parent, name, fl)
|
|
|
|
|
, _security_setting(security_setting)
|
|
|
|
|
{
|
|
|
|
@ -323,13 +327,13 @@ WirelessSecurityWPACipherImpl::WirelessSecurityWPACipherImpl(WirelessSecurity* s
|
|
|
|
|
connect(chkPairwiseCipherTKIP, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPairwiseCipherChangedTKIP(bool)));
|
|
|
|
|
connect(chkPairwiseCipherCCMP, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPairwiseCipherChangedCCMP(bool)));
|
|
|
|
|
|
|
|
|
|
chkPairwiseCipherCCMP->setChecked(_security_setting->getPairwiseCiphers() & WirelessSecurity::CIPHER_CCMP);
|
|
|
|
|
chkPairwiseCipherTKIP->setChecked(_security_setting->getPairwiseCiphers() & WirelessSecurity::CIPHER_TKIP);
|
|
|
|
|
chkPairwiseCipherCCMP->setChecked(_security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP));
|
|
|
|
|
chkPairwiseCipherTKIP->setChecked(_security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP));
|
|
|
|
|
|
|
|
|
|
chkGroupCipherCCMP->setChecked(_security_setting->getGroupCiphers() & WirelessSecurity::CIPHER_CCMP);
|
|
|
|
|
chkGroupCipherTKIP->setChecked(_security_setting->getGroupCiphers() & WirelessSecurity::CIPHER_TKIP);
|
|
|
|
|
chkGroupCipherWEP40->setChecked(_security_setting->getGroupCiphers() & WirelessSecurity::CIPHER_WEP40);
|
|
|
|
|
chkGroupCipherWEP104->setChecked(_security_setting->getGroupCiphers() & WirelessSecurity::CIPHER_WEP104);
|
|
|
|
|
chkGroupCipherCCMP->setChecked(_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP));
|
|
|
|
|
chkGroupCipherTKIP->setChecked(_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP));
|
|
|
|
|
chkGroupCipherWEP40->setChecked(_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP40));
|
|
|
|
|
chkGroupCipherWEP104->setChecked(_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP104));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -339,32 +343,40 @@ WirelessSecurityWPACipherImpl::slotCipherChangedAuto(bool checked)
|
|
|
|
|
if (!checked)
|
|
|
|
|
{
|
|
|
|
|
// select auto for both ciphers
|
|
|
|
|
_security_setting->setGroupCiphers(WirelessSecurity::CIPHER_AUTO);
|
|
|
|
|
_security_setting->setPairwiseCiphers(WirelessSecurity::CIPHER_AUTO);
|
|
|
|
|
_security_setting->securitySettings.allowedGroupWiseCiphers.clear();
|
|
|
|
|
_security_setting->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::Any);
|
|
|
|
|
_security_setting->securitySettings.allowedPairWiseCiphers.clear();
|
|
|
|
|
_security_setting->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::Any);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// use the already selected ciphers
|
|
|
|
|
|
|
|
|
|
// group cipher
|
|
|
|
|
TQ_UINT32 cipher = WirelessSecurity::CIPHER_NONE;
|
|
|
|
|
if (chkGroupCipherTKIP->isChecked())
|
|
|
|
|
cipher |= WirelessSecurity::CIPHER_TKIP;
|
|
|
|
|
if (chkGroupCipherCCMP->isChecked())
|
|
|
|
|
cipher |= WirelessSecurity::CIPHER_CCMP;
|
|
|
|
|
if (chkGroupCipherWEP40->isChecked())
|
|
|
|
|
cipher |= WirelessSecurity::CIPHER_WEP40;
|
|
|
|
|
if (chkGroupCipherWEP104->isChecked())
|
|
|
|
|
cipher |= WirelessSecurity::CIPHER_WEP104;
|
|
|
|
|
_security_setting->setGroupCiphers(cipher);
|
|
|
|
|
TDENetworkWiFiConnectionCipherList cipher;
|
|
|
|
|
if (chkGroupCipherTKIP->isChecked()) {
|
|
|
|
|
cipher.append(TDENetworkWiFiConnectionCipher::CipherTKIP);
|
|
|
|
|
}
|
|
|
|
|
if (chkGroupCipherCCMP->isChecked()) {
|
|
|
|
|
cipher.append(TDENetworkWiFiConnectionCipher::CipherCCMP);
|
|
|
|
|
}
|
|
|
|
|
if (chkGroupCipherWEP40->isChecked()) {
|
|
|
|
|
cipher.append(TDENetworkWiFiConnectionCipher::CipherWEP40);
|
|
|
|
|
}
|
|
|
|
|
if (chkGroupCipherWEP104->isChecked()) {
|
|
|
|
|
cipher.append(TDENetworkWiFiConnectionCipher::CipherWEP104);
|
|
|
|
|
}
|
|
|
|
|
_security_setting->securitySettings.allowedGroupWiseCiphers = cipher;
|
|
|
|
|
|
|
|
|
|
// pairwise cipher
|
|
|
|
|
cipher = WirelessSecurity::CIPHER_NONE;
|
|
|
|
|
if (chkPairwiseCipherTKIP->isChecked())
|
|
|
|
|
cipher |= WirelessSecurity::CIPHER_TKIP;
|
|
|
|
|
if (chkPairwiseCipherCCMP->isChecked())
|
|
|
|
|
cipher |= WirelessSecurity::CIPHER_CCMP;
|
|
|
|
|
_security_setting->setPairwiseCiphers(cipher);
|
|
|
|
|
cipher.clear();
|
|
|
|
|
if (chkPairwiseCipherTKIP->isChecked()) {
|
|
|
|
|
cipher.append(TDENetworkWiFiConnectionCipher::CipherTKIP);
|
|
|
|
|
}
|
|
|
|
|
if (chkPairwiseCipherCCMP->isChecked()) {
|
|
|
|
|
cipher.append(TDENetworkWiFiConnectionCipher::CipherCCMP);
|
|
|
|
|
}
|
|
|
|
|
_security_setting->securitySettings.allowedPairWiseCiphers = cipher;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -372,66 +384,80 @@ WirelessSecurityWPACipherImpl::slotCipherChangedAuto(bool checked)
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPACipherImpl::slotGroupCipherChangedTKIP(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (checked)
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() | WirelessSecurity::CIPHER_TKIP);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() & (!WirelessSecurity::CIPHER_TKIP));
|
|
|
|
|
if (checked) {
|
|
|
|
|
if (!_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP)) _security_setting->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherTKIP);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_security_setting->securitySettings.allowedGroupWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherTKIP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPACipherImpl::slotGroupCipherChangedCCMP(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (checked)
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() | WirelessSecurity::CIPHER_CCMP);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() & (!WirelessSecurity::CIPHER_CCMP));
|
|
|
|
|
if (checked) {
|
|
|
|
|
if (!_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP)) _security_setting->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherCCMP);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_security_setting->securitySettings.allowedGroupWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherCCMP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPACipherImpl::slotGroupCipherChangedWEP40(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (checked)
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() | WirelessSecurity::CIPHER_WEP40);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() & (!WirelessSecurity::CIPHER_WEP40));
|
|
|
|
|
if (checked) {
|
|
|
|
|
if (!_security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP40)) _security_setting->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP40);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherWEP40);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPACipherImpl::slotGroupCipherChangedWEP104(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (checked)
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() | WirelessSecurity::CIPHER_WEP104);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->setGroupCiphers(_security_setting->getGroupCiphers() & (!WirelessSecurity::CIPHER_WEP104));
|
|
|
|
|
if (checked) {
|
|
|
|
|
if (!_security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP104)) _security_setting->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP104);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherWEP104);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPACipherImpl::slotPairwiseCipherChangedTKIP(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (checked)
|
|
|
|
|
_security_setting->setPairwiseCiphers(_security_setting->getPairwiseCiphers() | WirelessSecurity::CIPHER_TKIP);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->setPairwiseCiphers(_security_setting->getPairwiseCiphers() & (!WirelessSecurity::CIPHER_TKIP));
|
|
|
|
|
if (checked) {
|
|
|
|
|
if (!_security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP)) _security_setting->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherTKIP);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherTKIP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWPACipherImpl::slotPairwiseCipherChangedCCMP(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (checked)
|
|
|
|
|
_security_setting->setPairwiseCiphers(_security_setting->getPairwiseCiphers() | WirelessSecurity::CIPHER_CCMP);
|
|
|
|
|
else
|
|
|
|
|
_security_setting->setPairwiseCiphers(_security_setting->getPairwiseCiphers() & (!WirelessSecurity::CIPHER_CCMP));
|
|
|
|
|
if (checked) {
|
|
|
|
|
if (!_security_setting->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP)) _security_setting->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherCCMP);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherCCMP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityWPAPSK
|
|
|
|
|
*/
|
|
|
|
|
WirelessSecurityWPAPSKImpl::WirelessSecurityWPAPSKImpl(WirelessSecurity* security_setting, Wireless* wireless_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityWPAPSKImpl::WirelessSecurityWPAPSKImpl(TDEWiFiConnection* security_setting, TDEWiFiConnection* wireless_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: ConnectionSettingWirelessSecurityWPAPSK(parent, name, fl)
|
|
|
|
|
, _security_setting(security_setting)
|
|
|
|
|
, _wireless_setting(wireless_setting)
|
|
|
|
|
{
|
|
|
|
|
txtPSK->setText(_security_setting->getPSK());
|
|
|
|
|
if (_security_setting->securitySettings.secretsValid) {
|
|
|
|
|
txtPSK->setText(_security_setting->securitySettings.psk);
|
|
|
|
|
}
|
|
|
|
|
connect(txtPSK, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotPSKChanged(const TQString&)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -440,7 +466,8 @@ WirelessSecurityWPAPSKImpl::slotPSKChanged(const TQString& psk)
|
|
|
|
|
{
|
|
|
|
|
if (_wireless_setting)
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setPSK(psk);
|
|
|
|
|
_security_setting->securitySettings.psk = psk;
|
|
|
|
|
_security_setting->securitySettings.secretsValid = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -464,7 +491,7 @@ WirelessSecurityWPAPSKImpl::String2Hex(TQByteArray bytes, int final_len) const
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityEAPImpl
|
|
|
|
|
*/
|
|
|
|
|
WirelessSecurityEAPImpl::WirelessSecurityEAPImpl(IEEE8021x* security_setting, WirelessSecurityPhase2Impl* phase2_widget, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityEAPImpl::WirelessSecurityEAPImpl(TDEWiFiConnection* security_setting, WirelessSecurityPhase2Impl* phase2_widget, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: ConnectionSettingWirelessSecurityEAP(parent, name, fl)
|
|
|
|
|
, _security_setting(security_setting)
|
|
|
|
|
, _phase2_widget(phase2_widget)
|
|
|
|
@ -472,42 +499,44 @@ WirelessSecurityEAPImpl::WirelessSecurityEAPImpl(IEEE8021x* security_setting, Wi
|
|
|
|
|
// insert all EAP-Methods
|
|
|
|
|
int index = 0;
|
|
|
|
|
cboMethod->insertItem(i18n("None"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_NONE;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::None;
|
|
|
|
|
|
|
|
|
|
cboMethod->insertItem(i18n("TTLS"), ++index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_TTLS;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::TTLS;
|
|
|
|
|
|
|
|
|
|
cboMethod->insertItem(i18n("PEAP"), ++index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_PEAP;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::PEAP;
|
|
|
|
|
|
|
|
|
|
cboMethod->insertItem(i18n("TLS"), ++index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_TLS;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::TLS;
|
|
|
|
|
|
|
|
|
|
cboMethod->insertItem(i18n("Leap"), ++index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_LEAP;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::LEAP;
|
|
|
|
|
|
|
|
|
|
cboMethod->insertItem(i18n("MD5"), ++index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_MD5;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::MD5;
|
|
|
|
|
|
|
|
|
|
cboMethod->insertItem(i18n("FAST"), ++index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_FAST;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::Fast;
|
|
|
|
|
|
|
|
|
|
cboMethod->insertItem(i18n("SIM"), ++index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE1_SIM;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::SIM;
|
|
|
|
|
|
|
|
|
|
// preselect the correct method
|
|
|
|
|
TQBiDirectionalMap<int, IEEE8021x::EAP_PHASE1>::Iterator it = _eapIndexMap.findData(_security_setting->getEAP());
|
|
|
|
|
TQBiDirectionalMap<int, TDENetworkIEEE8021xType::TDENetworkIEEE8021xType>::Iterator it = _eapIndexMap.findData(_security_setting->eapConfig.type);
|
|
|
|
|
cboMethod->setCurrentItem(it.key());
|
|
|
|
|
|
|
|
|
|
// update phase2 combobox
|
|
|
|
|
_phase2_widget->setAllowedPhase2Methods(_security_setting->getAllowedPhase2Methods());
|
|
|
|
|
_phase2_widget->setAllowedPhase2Methods(_security_setting->eapConfig.allowedPhase2EAPMethods);
|
|
|
|
|
|
|
|
|
|
txtIdentity->setText(_security_setting->getIdentity());
|
|
|
|
|
txtAnonIdentity->setText(_security_setting->getAnonIdentity());
|
|
|
|
|
txtPassword->setText(_security_setting->getPassword());
|
|
|
|
|
txtIdentity->setText(_security_setting->eapConfig.userName);
|
|
|
|
|
txtAnonIdentity->setText(_security_setting->eapConfig.anonymousUserName);
|
|
|
|
|
if (_security_setting->eapConfig.secretsValid) {
|
|
|
|
|
txtPassword->setText(_security_setting->eapConfig.password);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chkCAStore->setChecked(_security_setting->getUseSystemCaCert());
|
|
|
|
|
kURLCACert->setEnabled(!_security_setting->getUseSystemCaCert());
|
|
|
|
|
chkCAStore->setChecked(_security_setting->eapConfig.forceSystemCaCertificates);
|
|
|
|
|
kURLCACert->setEnabled(!_security_setting->eapConfig.forceSystemCaCertificates);
|
|
|
|
|
|
|
|
|
|
// get notified if the method changes
|
|
|
|
|
connect(cboMethod, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotMethodChanged(int)));
|
|
|
|
@ -519,42 +548,43 @@ WirelessSecurityEAPImpl::WirelessSecurityEAPImpl(IEEE8021x* security_setting, Wi
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityEAPImpl::slotUseSystemCaCertChanged(bool on)
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setUseSystemCaCert(on);
|
|
|
|
|
_security_setting->eapConfig.forceSystemCaCertificates = on;
|
|
|
|
|
kURLCACert->setEnabled(!on);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityEAPImpl::slotMethodChanged(int index)
|
|
|
|
|
{
|
|
|
|
|
// new method choosen
|
|
|
|
|
IEEE8021x::EAP_PHASE1 eap = _eapIndexMap[index];
|
|
|
|
|
_security_setting->setEAP(eap);
|
|
|
|
|
TDENetworkIEEE8021xType::TDENetworkIEEE8021xType eap = _eapIndexMap[index];
|
|
|
|
|
_security_setting->eapConfig.type = eap;
|
|
|
|
|
|
|
|
|
|
_phase2_widget->setAllowedPhase2Methods(_security_setting->getAllowedPhase2Methods());
|
|
|
|
|
_phase2_widget->setAllowedPhase2Methods(_security_setting->eapConfig.allowedPhase2EAPMethods);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityEAPImpl::slotIdentityChanged(const TQString& identity)
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setIdentity(identity);
|
|
|
|
|
_security_setting->eapConfig.userName = identity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityEAPImpl::slotAnonIdentityChanged(const TQString& identity)
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setAnonIdentity(identity);
|
|
|
|
|
_security_setting->eapConfig.anonymousUserName = identity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityEAPImpl::slotPasswordChanged(const TQString& pwd)
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setPassword(TQString(txtPassword->password()));
|
|
|
|
|
_security_setting->eapConfig.password = TQString(txtPassword->password());
|
|
|
|
|
_security_setting->eapConfig.secretsValid = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityPhase2Impl
|
|
|
|
|
*/
|
|
|
|
|
WirelessSecurityPhase2Impl::WirelessSecurityPhase2Impl(IEEE8021x* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityPhase2Impl::WirelessSecurityPhase2Impl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: ConnectionSettingWirelessSecurityPhase2(parent, name, fl)
|
|
|
|
|
, _security_setting(security_setting)
|
|
|
|
|
{
|
|
|
|
|
_allowed_methods.append(IEEE8021x::EAP_PHASE2_AUTH_NONE);
|
|
|
|
|
_allowed_methods.append(TDENetworkIEEE8021xType::None);
|
|
|
|
|
updateMethodComboBox();
|
|
|
|
|
|
|
|
|
|
connect(cboPhase2Method, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPhase2MethodChanged(int)));
|
|
|
|
@ -567,79 +597,79 @@ void WirelessSecurityPhase2Impl::updateMethodComboBox()
|
|
|
|
|
cboPhase2Method->clear();
|
|
|
|
|
_eapIndexMap.clear();
|
|
|
|
|
|
|
|
|
|
for (TQValueList<IEEE8021x::EAP_PHASE2>::Iterator it = _allowed_methods.begin(); it != _allowed_methods.end(); ++it)
|
|
|
|
|
for (TQValueList<TDENetworkIEEE8021xType::TDENetworkIEEE8021xType>::Iterator it = _allowed_methods.begin(); it != _allowed_methods.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_NONE)
|
|
|
|
|
if ((*it) == TDENetworkIEEE8021xType::None)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("None"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_NONE;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::None;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_MSCHAPV2)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::MSCHAPV2)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("MSCHAPv2"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_MSCHAPV2;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::MSCHAPV2;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_PAP)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::PAP)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("PAP"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_PAP;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::PAP;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_CHAP)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::CHAP)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("CHAP"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_CHAP;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::CHAP;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_MSCHAP)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::MSCHAP)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("MSCHAP"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_MSCHAP;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::MSCHAP;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_GTC)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::GTC)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("GTC"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_GTC;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::GTC;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_OTP)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::OTP)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("OTP"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_OTP;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::OTP;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_MD5)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::MD5)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("MD5"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_MD5;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::MD5;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
else if ((*it) == IEEE8021x::EAP_PHASE2_AUTH_TLS)
|
|
|
|
|
else if ((*it) == TDENetworkIEEE8021xType::TLS)
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->insertItem(i18n("TLS"), index);
|
|
|
|
|
_eapIndexMap[index] = IEEE8021x::EAP_PHASE2_AUTH_TLS;
|
|
|
|
|
_eapIndexMap[index] = TDENetworkIEEE8021xType::TLS;
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// preselect the correct method
|
|
|
|
|
TQBiDirectionalMap<int, IEEE8021x::EAP_PHASE2>::Iterator it = _eapIndexMap.findData(_security_setting->getPhase2EAP());
|
|
|
|
|
TQBiDirectionalMap<int, TDENetworkIEEE8021xType::TDENetworkIEEE8021xType>::Iterator it = _eapIndexMap.findData(_security_setting->eapConfig.phase2EAPAuthMethod);
|
|
|
|
|
if (it != _eapIndexMap.end())
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->setCurrentItem(it.key());
|
|
|
|
|
_security_setting->setPhase2EAP(it.data());
|
|
|
|
|
_security_setting->eapConfig.phase2EAPAuthMethod = it.data();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cboPhase2Method->setCurrentItem(0);
|
|
|
|
|
_security_setting->setPhase2EAP(_eapIndexMap[0]);
|
|
|
|
|
_security_setting->eapConfig.phase2EAPAuthMethod = _eapIndexMap[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessSecurityPhase2Impl::setAllowedPhase2Methods(const TQValueList<IEEE8021x::EAP_PHASE2>& list)
|
|
|
|
|
void WirelessSecurityPhase2Impl::setAllowedPhase2Methods(const TQValueList<TDENetworkIEEE8021xType::TDENetworkIEEE8021xType>& list)
|
|
|
|
|
{
|
|
|
|
|
_allowed_methods = list;
|
|
|
|
|
updateMethodComboBox();
|
|
|
|
@ -648,20 +678,20 @@ void WirelessSecurityPhase2Impl::setAllowedPhase2Methods(const TQValueList<IEEE8
|
|
|
|
|
void WirelessSecurityPhase2Impl::slotPhase2MethodChanged(int index)
|
|
|
|
|
{
|
|
|
|
|
// new method choosen
|
|
|
|
|
IEEE8021x::EAP_PHASE2 eap = _eapIndexMap[index];
|
|
|
|
|
_security_setting->setPhase2EAP(eap);
|
|
|
|
|
TDENetworkIEEE8021xType::TDENetworkIEEE8021xType eap = _eapIndexMap[index];
|
|
|
|
|
_security_setting->eapConfig.phase2EAPAuthMethod = eap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
class WirelessSecurityWidgetImpl
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
WirelessSecurityWidgetImpl::WirelessSecurityWidgetImpl(Connection* conn, bool new_conn, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
WirelessSecurityWidgetImpl::WirelessSecurityWidgetImpl(TDENetworkConnection* conn, bool new_conn, TQWidget* parent, const char* name, WFlags fl)
|
|
|
|
|
: WidgetInterface(parent, name, fl)
|
|
|
|
|
{
|
|
|
|
|
_security_setting = dynamic_cast<WirelessSecurity*> (conn->getSetting(NM_SETTING_WIRELESS_SECURITY_SETTING_NAME));
|
|
|
|
|
_wireless_setting = dynamic_cast<Wireless*> (conn->getSetting(NM_SETTING_WIRELESS_SETTING_NAME));
|
|
|
|
|
_ieee8021x_setting = dynamic_cast<IEEE8021x*> (conn->getSetting(NM_SETTING_802_1X_SETTING_NAME));
|
|
|
|
|
_security_setting = dynamic_cast<TDEWiFiConnection*> (conn);
|
|
|
|
|
_wireless_setting = dynamic_cast<TDEWiFiConnection*> (conn);
|
|
|
|
|
_ieee8021x_setting = dynamic_cast<TDEWiFiConnection*> (conn);
|
|
|
|
|
_new_conn = new_conn;
|
|
|
|
|
|
|
|
|
|
TQVBoxLayout* layout = new TQVBoxLayout(this, 1, 1);
|
|
|
|
@ -737,41 +767,41 @@ WirelessSecurityWidgetImpl::comboSecurityInit()
|
|
|
|
|
|
|
|
|
|
// TODO: Preselect the right security method
|
|
|
|
|
// We should have an Essid already, fetch all possible APs
|
|
|
|
|
TQValueList<AccessPoint *> aps;
|
|
|
|
|
if (_new_conn && !_wireless_setting->getEssid().isEmpty())
|
|
|
|
|
{
|
|
|
|
|
aps = WirelessManager::getAccessPointsForEssid(_wireless_setting->getEssid());
|
|
|
|
|
TQValueList<TDENetworkWiFiAPInfo*> aps;
|
|
|
|
|
if (_new_conn && !_wireless_setting->SSID.isEmpty()) {
|
|
|
|
|
aps = WirelessManager::getAccessPointsForEssid(_wireless_setting->SSID);
|
|
|
|
|
#if 0
|
|
|
|
|
kdDebug() << "Hugo " << TQString(TQCString(_wireless_setting->getEssid())).ascii() << endl;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
if (!aps.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
if (!aps.isEmpty()) {
|
|
|
|
|
// if at least one AP has this security setting show the entry in the combobox
|
|
|
|
|
for (TQValueList<AccessPoint*>::Iterator it = aps.begin(); it != aps.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
if((*it)->isEncrypted())
|
|
|
|
|
{
|
|
|
|
|
kdDebug() << "AP " << (*it)->getDisplaySsid().ascii() << " is encrypted" << endl;
|
|
|
|
|
if ((*it)->getRsnFlags() != NM_802_11_AP_SEC_NONE || (*it)->getWpaFlags() != NM_802_11_AP_SEC_NONE)
|
|
|
|
|
{
|
|
|
|
|
for (TQValueList<TDENetworkWiFiAPInfo*>::Iterator it = aps.begin(); it != aps.end(); ++it) {
|
|
|
|
|
if (((*it)->wpaFlags & TDENetworkWiFiAPFlags::PrivacySupport) || ((*it)->rsnFlags & TDENetworkWiFiAPFlags::PrivacySupport)) {
|
|
|
|
|
kdDebug() << "AP " << (*it)->friendlySSID().ascii() << " is encrypted" << endl;
|
|
|
|
|
if ((((*it)->rsnFlags & TDENetworkWiFiAPFlags::EncryptionFlagsMask) != TDENetworkWiFiAPFlags::None) || (((*it)->wpaFlags & TDENetworkWiFiAPFlags::EncryptionFlagsMask) != TDENetworkWiFiAPFlags::None)) {
|
|
|
|
|
// WPA or RSN
|
|
|
|
|
if ((*it)->getRsnFlags() & NM_802_11_AP_SEC_KEY_MGMT_PSK || (*it)->getWpaFlags() & NM_802_11_AP_SEC_KEY_MGMT_PSK)
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_WPA_PSK))
|
|
|
|
|
if ((*it)->rsnFlags & TDENetworkWiFiAPFlags::KeyManagementPSK || (*it)->wpaFlags & TDENetworkWiFiAPFlags::KeyManagementPSK) {
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_WPA_PSK)) {
|
|
|
|
|
allowed_methods.append(SECURITY_WPA_PSK);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((*it)->getRsnFlags() & NM_802_11_AP_SEC_KEY_MGMT_802_1X || (*it)->getWpaFlags() & NM_802_11_AP_SEC_KEY_MGMT_802_1X)
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_WPA_EAP))
|
|
|
|
|
if ((*it)->rsnFlags & TDENetworkWiFiAPFlags::KeyManagement80211 || (*it)->wpaFlags & TDENetworkWiFiAPFlags::KeyManagement80211) {
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_WPA_EAP)) {
|
|
|
|
|
allowed_methods.append(SECURITY_WPA_EAP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// No WPA & RSN => WEP or dynamic WEP with 802.1x authentication
|
|
|
|
|
// TODO: an AP can provide WEP in addition to WPA
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_WEP))
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_WEP)) {
|
|
|
|
|
allowed_methods.append(SECURITY_WEP);
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_IEEE8021X))
|
|
|
|
|
allowed_methods.append(SECURITY_IEEE8021X);
|
|
|
|
|
}
|
|
|
|
|
if (!allowed_methods.contains(SECURITY_IEEE8021X)) {
|
|
|
|
|
allowed_methods.append(SECURITY_IEEE8021X);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -815,14 +845,14 @@ WirelessSecurityWidgetImpl::comboSecurityInit()
|
|
|
|
|
|
|
|
|
|
if (!_new_conn)
|
|
|
|
|
{
|
|
|
|
|
switch(_security_setting->getKeyMgmt())
|
|
|
|
|
switch(_security_setting->securitySettings.keyType)
|
|
|
|
|
{
|
|
|
|
|
case WirelessSecurity::KEY_MGMT_NONE:
|
|
|
|
|
if (_security_setting->getAuthAlg() == WirelessSecurity::AUTH_ALG_SHARED ||
|
|
|
|
|
!_security_setting->getWepKey(0).isEmpty() ||
|
|
|
|
|
!_security_setting->getWepKey(1).isEmpty() ||
|
|
|
|
|
!_security_setting->getWepKey(2).isEmpty() ||
|
|
|
|
|
!_security_setting->getWepKey(3).isEmpty() )
|
|
|
|
|
case TDENetworkWiFiKeyType::WEP:
|
|
|
|
|
if (_security_setting->securitySettings.authType == TDENetworkWiFiAuthType::Shared ||
|
|
|
|
|
!_security_setting->securitySettings.wepKey0.isEmpty() ||
|
|
|
|
|
!_security_setting->securitySettings.wepKey1.isEmpty() ||
|
|
|
|
|
!_security_setting->securitySettings.wepKey2.isEmpty() ||
|
|
|
|
|
!_security_setting->securitySettings.wepKey3.isEmpty() )
|
|
|
|
|
{
|
|
|
|
|
_mainWid->groupUseEncryption->setChecked(true);
|
|
|
|
|
_mainWid->cboSecurity->setCurrentItem(SECURITY_WEP);
|
|
|
|
@ -831,17 +861,17 @@ WirelessSecurityWidgetImpl::comboSecurityInit()
|
|
|
|
|
else
|
|
|
|
|
_mainWid->groupUseEncryption->setChecked(false);
|
|
|
|
|
break;
|
|
|
|
|
case WirelessSecurity::KEY_MGMT_WPA_PSK:
|
|
|
|
|
case TDENetworkWiFiKeyType::WPAInfrastructure:
|
|
|
|
|
_mainWid->groupUseEncryption->setChecked(true);
|
|
|
|
|
_mainWid->cboSecurity->setCurrentItem(SECURITY_WPA_PSK);
|
|
|
|
|
slotComboSecurityActivated(_securityComboMap[SECURITY_WPA_PSK]);
|
|
|
|
|
break;
|
|
|
|
|
case WirelessSecurity::KEY_MGMT_WPA_EAP:
|
|
|
|
|
case TDENetworkWiFiKeyType::WPAEnterprise:
|
|
|
|
|
_mainWid->groupUseEncryption->setChecked(true);
|
|
|
|
|
_mainWid->cboSecurity->setCurrentItem(SECURITY_WPA_EAP);
|
|
|
|
|
slotComboSecurityActivated(_securityComboMap[SECURITY_WPA_EAP]);
|
|
|
|
|
break;
|
|
|
|
|
case WirelessSecurity::KEY_MGMT_IEEE8021X:
|
|
|
|
|
case TDENetworkWiFiKeyType::DynamicWEP:
|
|
|
|
|
_mainWid->groupUseEncryption->setChecked(true);
|
|
|
|
|
_mainWid->cboSecurity->setCurrentItem(SECURITY_IEEE8021X);
|
|
|
|
|
slotComboSecurityActivated(_securityComboMap[SECURITY_IEEE8021X]);
|
|
|
|
@ -872,7 +902,7 @@ WirelessSecurityWidgetImpl::comboSecurityInit()
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWidgetImpl::slotUseEncryptionToggled(bool on)
|
|
|
|
|
{
|
|
|
|
|
_wireless_setting->setSecurity(on ? _security_setting->getType() : NULL);
|
|
|
|
|
_wireless_setting->securityRequired = on;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -968,28 +998,28 @@ WirelessSecurityWidgetImpl::slotExtraSettingsToggled(bool on)
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWidgetImpl::configureForWEP()
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setKeyMgmt(WirelessSecurity::KEY_MGMT_NONE);
|
|
|
|
|
_security_setting->securitySettings.keyType = TDENetworkWiFiKeyType::WEP;
|
|
|
|
|
configureWidgets(SECURITY_WEP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWidgetImpl::configureForWPAPSK()
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setKeyMgmt(WirelessSecurity::KEY_MGMT_WPA_PSK);
|
|
|
|
|
_security_setting->securitySettings.keyType = TDENetworkWiFiKeyType::WPAInfrastructure;
|
|
|
|
|
configureWidgets(SECURITY_WPA_PSK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWidgetImpl::configureForWPAEAP()
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setKeyMgmt(WirelessSecurity::KEY_MGMT_WPA_EAP);
|
|
|
|
|
_security_setting->securitySettings.keyType = TDENetworkWiFiKeyType::WPAEnterprise;
|
|
|
|
|
configureWidgets(SECURITY_WPA_EAP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WirelessSecurityWidgetImpl::configureForIEEE8021X()
|
|
|
|
|
{
|
|
|
|
|
_security_setting->setKeyMgmt(WirelessSecurity::KEY_MGMT_IEEE8021X);
|
|
|
|
|
_security_setting->securitySettings.keyType = TDENetworkWiFiKeyType::DynamicWEP;
|
|
|
|
|
configureWidgets(SECURITY_IEEE8021X);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|