34
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* Control Panel QT UI for TLS ciphersuite configiration in EAP methods
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
/*
|
49
|
20 |
* %version: 9 %
|
34
|
21 |
*/
|
|
22 |
|
|
23 |
// System includes
|
|
24 |
#include <qlist.h>
|
|
25 |
#include <eapqtconfig.h>
|
|
26 |
|
|
27 |
// User includes
|
|
28 |
#include "cpeapciphersuiteui.h"
|
|
29 |
#include "cpeapciphersuiteui_p.h"
|
|
30 |
#include "eapuidefs.h"
|
|
31 |
|
|
32 |
/*!
|
|
33 |
* \class CpEapCiphersuiteUi
|
|
34 |
* \brief Control Panel QT UI for TLS ciphersuite configiration in EAP methods.
|
|
35 |
*/
|
|
36 |
|
|
37 |
// External function prototypes
|
|
38 |
|
|
39 |
// Local constants
|
|
40 |
|
|
41 |
// ======== LOCAL FUNCTIONS ========
|
|
42 |
|
|
43 |
// ======== MEMBER FUNCTIONS ========
|
|
44 |
|
|
45 |
/*!
|
|
46 |
* Constructor.
|
|
47 |
*
|
|
48 |
* @param suites List of selected cipher suites
|
|
49 |
*/
|
|
50 |
CpEapCiphersuiteUi::CpEapCiphersuiteUi( QVariant &suites ) :
|
|
51 |
CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId(
|
|
52 |
"txt_occ_subhead_cipher_suites"))
|
|
53 |
{
|
|
54 |
qDebug("CpEapCiphersuiteUi::CpEapCiphersuiteUi()");
|
|
55 |
d_ptr.reset(new CpEapCiphersuiteUiPrivate());
|
|
56 |
|
49
|
57 |
setContentWidgetData("objectName", "CpEapCipherSuiteUi");
|
|
58 |
|
|
59 |
appendChild(d_ptr->createGroupItem(
|
|
60 |
suites,
|
|
61 |
EapQtUiConstants::EapCipher_RSA_AES_SHA,
|
34
|
62 |
EapQtConfig::TLS_RSA_WITH_AES_128_CBC_SHA));
|
|
63 |
|
49
|
64 |
appendChild(d_ptr->createGroupItem(
|
|
65 |
suites,
|
|
66 |
EapQtUiConstants::EapCipher_DHE_RSA_AES_SHA,
|
34
|
67 |
EapQtConfig::TLS_DHE_RSA_WITH_AES_128_CBC_SHA));
|
|
68 |
|
49
|
69 |
appendChild(d_ptr->createGroupItem(
|
|
70 |
suites,
|
|
71 |
EapQtUiConstants::EapCipher_DHE_DSS_AES_SHA,
|
34
|
72 |
EapQtConfig::TLS_DHE_DSS_WITH_AES_128_CBC_SHA));
|
|
73 |
|
49
|
74 |
appendChild(d_ptr->createGroupItem(
|
|
75 |
suites,
|
|
76 |
EapQtUiConstants::EapCipher_RSA_3DES_SHA,
|
34
|
77 |
EapQtConfig::TLS_RSA_WITH_3DES_EDE_CBC_SHA));
|
|
78 |
|
49
|
79 |
appendChild(d_ptr->createGroupItem(
|
|
80 |
suites,
|
|
81 |
EapQtUiConstants::EapCipher_DHE_RSA_3DES_SHA,
|
34
|
82 |
EapQtConfig::TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA));
|
|
83 |
|
49
|
84 |
appendChild(d_ptr->createGroupItem(
|
|
85 |
suites,
|
|
86 |
EapQtUiConstants::EapCipher_DHE_DSS_3DES_SHA,
|
34
|
87 |
EapQtConfig::TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA));
|
|
88 |
|
49
|
89 |
appendChild(d_ptr->createGroupItem(
|
|
90 |
suites,
|
|
91 |
EapQtUiConstants::EapCipher_RSA_RC4_MD5,
|
34
|
92 |
EapQtConfig::TLS_RSA_WITH_RC4_128_MD5));
|
|
93 |
|
49
|
94 |
appendChild(d_ptr->createGroupItem(
|
|
95 |
suites,
|
|
96 |
EapQtUiConstants::EapCipher_RSA_RC4_SHA,
|
34
|
97 |
EapQtConfig::TLS_RSA_WITH_RC4_128_SHA));
|
|
98 |
|
|
99 |
qDebug("CpEapCiphersuiteUi::CpEapCiphersuiteUi() - complete");
|
|
100 |
}
|
|
101 |
|
|
102 |
/*!
|
|
103 |
* Destructor.
|
|
104 |
*/
|
|
105 |
CpEapCiphersuiteUi::~CpEapCiphersuiteUi()
|
|
106 |
{
|
|
107 |
|
|
108 |
}
|
|
109 |
|
|
110 |
/*!
|
|
111 |
* Creates list of selected cipher suites
|
|
112 |
*
|
|
113 |
* @return List of selected cipher suites
|
|
114 |
*/
|
|
115 |
QVariant CpEapCiphersuiteUi::ciphersuites()
|
|
116 |
{
|
|
117 |
QList<QVariant> suites;
|
|
118 |
|
|
119 |
for (int i = 0; i < childCount(); ++i) {
|
|
120 |
QVariant state(childAt(i)->contentWidgetData("checkState"));
|
|
121 |
if (state.toInt() == Qt::Checked) {
|
|
122 |
qDebug("Cipher suite selected: 0x%04x", d_ptr->mSuiteMapper[childAt(i)]);
|
|
123 |
suites.append(QVariant(d_ptr->mSuiteMapper[childAt(i)]));
|
|
124 |
}
|
|
125 |
else {
|
|
126 |
qDebug("Cipher suite not selected: 0x%04x", d_ptr->mSuiteMapper[childAt(i)]);
|
|
127 |
}
|
|
128 |
}
|
|
129 |
|
|
130 |
return QVariant(suites);
|
|
131 |
}
|