|
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 /* |
|
20 * %version: 8 % |
|
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 |
|
57 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_RSA_AES_SHA, |
|
58 EapQtConfig::TLS_RSA_WITH_AES_128_CBC_SHA)); |
|
59 |
|
60 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_DHE_RSA_AES_SHA, |
|
61 EapQtConfig::TLS_DHE_RSA_WITH_AES_128_CBC_SHA)); |
|
62 |
|
63 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_DHE_DSS_AES_SHA, |
|
64 EapQtConfig::TLS_DHE_DSS_WITH_AES_128_CBC_SHA)); |
|
65 |
|
66 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_RSA_3DES_SHA, |
|
67 EapQtConfig::TLS_RSA_WITH_3DES_EDE_CBC_SHA)); |
|
68 |
|
69 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_DHE_RSA_3DES_SHA, |
|
70 EapQtConfig::TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA)); |
|
71 |
|
72 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_DHE_DSS_3DES_SHA, |
|
73 EapQtConfig::TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA)); |
|
74 |
|
75 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_RSA_RC4_MD5, |
|
76 EapQtConfig::TLS_RSA_WITH_RC4_128_MD5)); |
|
77 |
|
78 appendChild(d_ptr->createGroupItem(suites, EapQtUiConstants::EapCipher_RSA_RC4_SHA, |
|
79 EapQtConfig::TLS_RSA_WITH_RC4_128_SHA)); |
|
80 |
|
81 qDebug("CpEapCiphersuiteUi::CpEapCiphersuiteUi() - complete"); |
|
82 } |
|
83 |
|
84 /*! |
|
85 * Destructor. |
|
86 */ |
|
87 CpEapCiphersuiteUi::~CpEapCiphersuiteUi() |
|
88 { |
|
89 |
|
90 } |
|
91 |
|
92 /*! |
|
93 * Creates list of selected cipher suites |
|
94 * |
|
95 * @return List of selected cipher suites |
|
96 */ |
|
97 QVariant CpEapCiphersuiteUi::ciphersuites() |
|
98 { |
|
99 QList<QVariant> suites; |
|
100 |
|
101 for (int i = 0; i < childCount(); ++i) { |
|
102 QVariant state(childAt(i)->contentWidgetData("checkState")); |
|
103 if (state.toInt() == Qt::Checked) { |
|
104 qDebug("Cipher suite selected: 0x%04x", d_ptr->mSuiteMapper[childAt(i)]); |
|
105 suites.append(QVariant(d_ptr->mSuiteMapper[childAt(i)])); |
|
106 } |
|
107 else { |
|
108 qDebug("Cipher suite not selected: 0x%04x", d_ptr->mSuiteMapper[childAt(i)]); |
|
109 } |
|
110 } |
|
111 |
|
112 return QVariant(suites); |
|
113 } |