1 /* |
|
2 * Copyright (c) 2006-2007 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: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 inline THssCertificateEntry::THssCertificateEntry() |
|
21 : iSubjectNamePresent(EFalse) |
|
22 , iIssuerNamePresent(EFalse) |
|
23 , iSerialNumberPresent(EFalse) |
|
24 , iSubjectKeyIDPresent(EFalse) |
|
25 , iThumbprintPresent(EFalse) |
|
26 { |
|
27 } |
|
28 |
|
29 inline THssEapSettings::THssEapSettings() |
|
30 : iUsernamePresent(EFalse) |
|
31 , iPasswordPresent(EFalse) |
|
32 , iRealmPresent(EFalse) |
|
33 , iVerifyServerRealmPresent(EFalse) |
|
34 , iRequireClientAuthenticationPresent(EFalse) |
|
35 , iSessionValidityTimePresent(EFalse) |
|
36 , iCipherSuitesPresent(EFalse) |
|
37 , iCipherSuites(1) |
|
38 , iPEAPVersionsPresent(EFalse) |
|
39 , iCertificatesPresent(EFalse) |
|
40 , iCertificates(1) |
|
41 , iEncapsulatedEAPTypesPresent(EFalse) |
|
42 , iEncapsulatedEAPTypes(1) |
|
43 , iEncapsulatedInside( EEapNone ) |
|
44 { |
|
45 } |
|
46 |
|
47 inline void THssEapSettings::ExternalizeL( RWriteStream& aStream ) const |
|
48 { |
|
49 aStream.WriteInt32L( iEAPType ); |
|
50 aStream.WriteUint32L( iUsernamePresent ); |
|
51 aStream << iUsername; |
|
52 aStream.WriteUint32L( iPasswordPresent ); |
|
53 aStream << iPassword; |
|
54 aStream.WriteUint32L( iRealmPresent ); |
|
55 aStream << iRealm; |
|
56 aStream.WriteUint32L( iUsePseudonymsPresent ); |
|
57 aStream.WriteUint32L( iUsePseudonyms ); |
|
58 aStream.WriteUint32L( iVerifyServerRealmPresent ); |
|
59 aStream.WriteUint32L( iVerifyServerRealm ); |
|
60 aStream.WriteUint32L( iRequireClientAuthenticationPresent ); |
|
61 aStream.WriteUint32L( iRequireClientAuthentication ); |
|
62 aStream.WriteUint32L( iSessionValidityTimePresent ); |
|
63 aStream.WriteUint32L( iSessionValidityTime ); |
|
64 aStream.WriteUint32L( iCipherSuitesPresent ); |
|
65 aStream.WriteUint32L( iCipherSuitesCount); |
|
66 for( TInt i = 0; i < iCipherSuitesCount; i++ ) |
|
67 { |
|
68 aStream.WriteUint32L(iCipherSuites[i]); |
|
69 } |
|
70 aStream.WriteUint32L( iPEAPVersionsPresent ); |
|
71 aStream.WriteUint32L( iPEAPv0Allowed ); |
|
72 aStream.WriteUint32L( iPEAPv1Allowed ); |
|
73 aStream.WriteUint32L( iPEAPv2Allowed ); |
|
74 aStream.WriteUint32L( iCertificatesPresent ); |
|
75 aStream.WriteUint32L( iCertificatesCount); |
|
76 for( TInt i = 0; i < iCertificatesCount; i++ ) |
|
77 { |
|
78 aStream.WriteInt32L( iCertificates[i]->iCertType ); |
|
79 aStream.WriteUint32L( iCertificates[i]->iSubjectNamePresent ); |
|
80 aStream << iCertificates[i]->iSubjectName; |
|
81 aStream.WriteUint32L( iCertificates[i]->iIssuerNamePresent ); |
|
82 aStream << iCertificates[i]->iIssuerName; |
|
83 aStream.WriteUint32L( iCertificates[i]->iSerialNumberPresent ); |
|
84 aStream << iCertificates[i]->iSerialNumber; |
|
85 aStream.WriteUint32L( iCertificates[i]->iSubjectKeyIDPresent ); |
|
86 aStream << iCertificates[i]->iSubjectKeyID; |
|
87 aStream.WriteUint32L( iCertificates[i]->iThumbprintPresent ); |
|
88 aStream << iCertificates[i]->iThumbprint; |
|
89 } |
|
90 aStream.WriteUint32L( iEncapsulatedEAPTypesPresent ); |
|
91 aStream.WriteUint32L( iEncapsulatedEAPTypesCount ); |
|
92 for( TInt i = 0; i < iEncapsulatedEAPTypesCount; i++ ) |
|
93 { |
|
94 aStream.WriteUint32L( iEncapsulatedEAPTypes[i] ); |
|
95 } |
|
96 } |
|
97 |
|
98 inline void THssEapSettings::InternalizeL( RReadStream& aStream ) |
|
99 { |
|
100 iEAPType = static_cast<THssEapSettings::THssEapType>(aStream.ReadInt32L()); |
|
101 iUsernamePresent = aStream.ReadUint32L(); |
|
102 aStream >>iUsername; |
|
103 iPasswordPresent = aStream.ReadUint32L(); |
|
104 aStream >>iPassword; |
|
105 iRealmPresent = aStream.ReadUint32L(); |
|
106 aStream >>iRealm; |
|
107 iUsePseudonymsPresent = aStream.ReadUint32L(); |
|
108 iUsePseudonyms = aStream.ReadUint32L(); |
|
109 iVerifyServerRealmPresent = aStream.ReadUint32L(); |
|
110 iVerifyServerRealm = aStream.ReadUint32L(); |
|
111 iRequireClientAuthenticationPresent = aStream.ReadUint32L(); |
|
112 iRequireClientAuthentication = aStream.ReadUint32L(); |
|
113 iSessionValidityTimePresent = aStream.ReadUint32L(); |
|
114 iSessionValidityTime = aStream.ReadUint32L(); |
|
115 iCipherSuitesPresent = aStream.ReadUint32L(); |
|
116 iCipherSuitesCount = aStream.ReadUint32L(); |
|
117 for( TInt i = 0; i < iCipherSuitesCount; i++ ) |
|
118 { |
|
119 iCipherSuites.Append(aStream.ReadUint32L()); |
|
120 } |
|
121 iPEAPVersionsPresent = aStream.ReadUint32L(); |
|
122 iPEAPv0Allowed = aStream.ReadUint32L(); |
|
123 iPEAPv1Allowed = aStream.ReadUint32L(); |
|
124 iPEAPv2Allowed = aStream.ReadUint32L(); |
|
125 iCertificatesPresent = aStream.ReadUint32L(); |
|
126 iCertificatesCount = aStream.ReadUint32L(); |
|
127 for( TInt i = 0; i < iCertificatesCount; i++ ) |
|
128 { |
|
129 THssCertificateEntry* entry = new (ELeave) THssCertificateEntry(); |
|
130 |
|
131 entry->iCertType = static_cast<THssCertificateEntry::THssCertType>(aStream.ReadInt32L()); |
|
132 entry->iSubjectNamePresent = aStream.ReadUint32L(); |
|
133 aStream >> entry->iSubjectName; |
|
134 entry->iIssuerNamePresent = aStream.ReadUint32L(); |
|
135 aStream >> entry->iIssuerName; |
|
136 entry->iSerialNumberPresent= aStream.ReadUint32L(); |
|
137 aStream >> entry->iSerialNumber; |
|
138 entry->iSubjectKeyIDPresent = aStream.ReadUint32L(); |
|
139 aStream >> entry->iSubjectKeyID; |
|
140 entry->iThumbprintPresent = aStream.ReadUint32L(); |
|
141 aStream >> entry->iThumbprint; |
|
142 iCertificates.Insert(entry, i); |
|
143 } |
|
144 iEncapsulatedEAPTypesPresent = aStream.ReadUint32L(); |
|
145 iEncapsulatedEAPTypesCount = aStream.ReadUint32L(); |
|
146 for( TInt i = 0; i < iEncapsulatedEAPTypesCount; i++ ) |
|
147 { |
|
148 iEncapsulatedEAPTypes.Append(aStream.ReadUint32L()); |
|
149 } |
|
150 |
|
151 } |
|
152 |
|
153 inline THssIapSettings::THssIapSettings() |
|
154 : iConnectionMode(EHssInfrastructure) |
|
155 , iSecurityMode( EHssAllowUnsecure ) |
|
156 , iAuthenticationMode(EHssOpen) |
|
157 , iEapDataArray(1) |
|
158 { |
|
159 } |
|
160 |
|
161 // end of file |
|