|
1 /* |
|
2 * Copyright (c) 2006 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // CLASS HEADER |
|
22 #include "UT_CMceSecureDesStream.h" |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <digia/eunit/eunitmacros.h> |
|
26 |
|
27 |
|
28 // INTERNAL INCLUDES |
|
29 #include <e32math.h> |
|
30 #include <SdpCodecStringConstants.h> |
|
31 #include <SdpCodecStringPool.h> |
|
32 #include <sdpdocument.h> |
|
33 #include <SdpOriginField.h> |
|
34 #include <SdpConnectionField.h> |
|
35 #include <SdpMediaField.h> |
|
36 #include <SdpAttributeField.h> |
|
37 #include <SdpFmtAttributeField.h> |
|
38 #include <SdpRtpmapValue.h> |
|
39 #include "CMccController_stub.h" |
|
40 #include "MceMediaManagerTestHelper.h" |
|
41 #include "mcemediamanager.h" |
|
42 #include "mcemediasdpcodec.h" |
|
43 #include "mmccinterface_stub.h" |
|
44 #include "cleanupresetanddestroy.h" |
|
45 #include "mcesecuredesstream.h" |
|
46 #include "mcevideosdpcodec.h" |
|
47 |
|
48 #include "mcemediadefs.h" |
|
49 #include "mcecomaudiocodec.h" |
|
50 |
|
51 // INTERNAL INCLUDES |
|
52 |
|
53 _LIT8( KSdpName, "audio" ); |
|
54 _LIT8( KMKI1, "1:4" ); |
|
55 _LIT8( KMLT1, "2^20" ); |
|
56 |
|
57 _LIT8( KMKI2, "1:1" ); |
|
58 _LIT8( KMLT2, "2^10" ); |
|
59 _LIT8( KEncodedKey, "WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz"); |
|
60 |
|
61 _LIT8( KCryptoLine, "AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^20|1:4"); |
|
62 |
|
63 _LIT8( KCryptoLine2, "AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|1:4"); |
|
64 _LIT8( KCryptoLine3, "1 AES_CM_128_HMAC_SHA1_80 inline:ejRFLWhTT2NmQ0V0WVZUdkV6TjdxYk9Sak5naWdI"); |
|
65 |
|
66 //testing with MKI & MasterKeyLT |
|
67 _LIT8( KSecAttrValue1, "1 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^20|1:4 FEC_ORDER=FEC_SRTP"); |
|
68 _LIT8( KSecAttrValue2, "2 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^20|1:4 FEC_ORDER=FEC_SRTP"); |
|
69 //not supported cryptosuite |
|
70 _LIT8( KSecAttrValue3, "2 F8_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^20|1:4 FEC_ORDER=FEC_SRTP"); |
|
71 _LIT8( KSecAttrValue4, "2 F8_128_HMAC_SHA1_80 inline:MTIzNDU2Nzg5QUJDREUwMTIzNDU2Nzg5QUJjZGVm|2^20|1:4;inline:QUJjZGVmMTIzNDU2Nzg5QUJDREUwMTIzNDU2Nzg5|2^20|2:4 FEC_ORDER=FEC_SRTP"); |
|
72 //not valid MKI length |
|
73 /* When using the MKI, the MKI length MUST be the same for all keys in a |
|
74 given crypto attribute. |
|
75 */ |
|
76 _LIT8( KSecAttrValue5, "2 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^10|1:1;inline:QUJjZGVmMTIzNDU2Nzg5QUJDREUwMTIzNDU2Nzg5bGVz|2^20|2:2 FEC_ORDER=FEC_SRTP"); |
|
77 //Only MasterKeyLifteTime |
|
78 _LIT8( KSecAttrValue6, "1 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^20"); |
|
79 //Only MKI |
|
80 _LIT8( KSecAttrValue7, "1 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|1:4"); |
|
81 //Only Session Param |
|
82 _LIT8( KSecAttrValue8, "1 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz FEC_ORDER=FEC_SRTP"); |
|
83 |
|
84 _LIT8( KSecAttrNotValidLength, "1 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGV"); |
|
85 _LIT8( KSecAttrNoInline, "1 AES_CM_128_HMAC_SHA1_80 WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVzinlinex"); |
|
86 _LIT8( KSecAttrNotValidKey, "1 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVzinlinex"); |
|
87 |
|
88 _LIT8( KSecAttrCryptoNotSupport, "a=crypto:2 F8_128_HMAC_SHA1_80 inline:MTIzNDU2Nzg5QUJDREUwMTIzNDU2Nzg5QUJjZGVm|2^20|1:4"); |
|
89 _LIT8( KSecAttrOnlyKey, "1 AES_CM_128_HMAC_SHA1_80 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz"); |
|
90 |
|
91 |
|
92 #define SRVSTREAM( n ) iSession->MccStreams()[ n ] |
|
93 |
|
94 _LIT8( KMceTestMeidaCryptoAVP, "\ |
|
95 m=audio 5006 RTP/AVP 0 96\r\n\ |
|
96 a=sendrecv\r\n\ |
|
97 a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:ZVNobHlzUGU2X0ZidG5TNDYtOXhZYWlSaEx3SVhU|2^5\r\n\ |
|
98 a=curr:qos local sendrecv\r\n\ |
|
99 a=curr:qos remote none\r\n\ |
|
100 a=des:qos mandatory local sendrecv\r\n\ |
|
101 a=des:qos none remote sendrecv\r\n\ |
|
102 a=rtpmap:96 AMR/8000\r\n\ |
|
103 a=ptime:20\r\n\ |
|
104 a=maxptime:400\r\n\ |
|
105 a=fmtp:96 octet-align=0; mode-set=0,1,2,3,4,5,6,7\r\n"); |
|
106 |
|
107 _LIT8( KMceTestMeidaNoCryptoAVP, "\ |
|
108 m=audio 5006 RTP/AVP 0 96\r\n\ |
|
109 a=sendrecv\r\n\ |
|
110 a=curr:qos local sendrecv\r\n\ |
|
111 a=curr:qos remote none\r\n\ |
|
112 a=des:qos mandatory local sendrecv\r\n\ |
|
113 a=des:qos none remote sendrecv\r\n\ |
|
114 a=rtpmap:96 AMR/8000\r\n\ |
|
115 a=ptime:20\r\n\ |
|
116 a=maxptime:400\r\n\ |
|
117 a=fmtp:96 octet-align=0; mode-set=0,1,2,3,4,5,6,7\r\n"); |
|
118 |
|
119 |
|
120 _LIT8( KMceTestMeidaCryptoSAVPF, "\ |
|
121 m=audio 5006 RTP/SAVPF 0 96\r\n\ |
|
122 a=sendrecv\r\n\ |
|
123 a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:ZVNobHlzUGU2X0ZidG5TNDYtOXhZYWlSaEx3SVhU|2^5\r\n\ |
|
124 a=curr:qos local sendrecv\r\n\ |
|
125 a=curr:qos remote none\r\n\ |
|
126 a=des:qos mandatory local sendrecv\r\n\ |
|
127 a=des:qos none remote sendrecv\r\n\ |
|
128 a=rtpmap:96 AMR/8000\r\n\ |
|
129 a=ptime:20\r\n\ |
|
130 a=maxptime:400\r\n\ |
|
131 a=fmtp:96 octet-align=0; mode-set=0,1,2,3,4,5,6,7\r\n"); |
|
132 |
|
133 _LIT8( KMceTestMeidaCryptoWrongProtocol, "\ |
|
134 m=audio 5006 RTP/AVP 0 96\r\n\ |
|
135 a=sendrecv\r\n\ |
|
136 a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:ZVNobHlzUGU2X0ZidG5TNDYtOXhZYWlSaEx3SVhU\r\n\ |
|
137 a=curr:qos local sendrecv\r\n\ |
|
138 a=curr:qos remote none\r\n\ |
|
139 a=des:qos mandatory local sendrecv\r\n\ |
|
140 a=des:qos none remote sendrecv\r\n\ |
|
141 a=rtpmap:96 AMR/8000\r\n\ |
|
142 a=ptime:20\r\n\ |
|
143 a=maxptime:400\r\n\ |
|
144 a=fmtp:96 octet-align=0; mode-set=0,1,2,3,4,5,6,7\r\n"); |
|
145 |
|
146 |
|
147 _LIT8( KMceTestMeidaCryptoMultiple, "\ |
|
148 m=audio 5006 RTP/SAVPF 0 96\r\n\ |
|
149 a=sendrecv\r\n\ |
|
150 a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:ZVNobHlzUGU2X0ZidG5TNDYtOXhZYWlSaEx3SVhU\r\n\ |
|
151 a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:ZVNobHlzUGU2X0ZidG5TNDYtOXhZYWlSaEx3SVhU\r\n\ |
|
152 a=curr:qos local sendrecv\r\n\ |
|
153 a=curr:qos remote none\r\n\ |
|
154 a=des:qos mandatory local sendrecv\r\n\ |
|
155 a=des:qos none remote sendrecv\r\n\ |
|
156 a=rtpmap:96 AMR/8000\r\n\ |
|
157 a=ptime:20\r\n\ |
|
158 a=maxptime:400\r\n\ |
|
159 a=fmtp:96 octet-align=0; mode-set=0,1,2,3,4,5,6,7\r\n"); |
|
160 |
|
161 _LIT8( KMceTestMeidaCryptoMultiple2, "\ |
|
162 m=audio 5006 RTP/SAVPF 0 96\r\n\ |
|
163 a=sendrecv\r\n\ |
|
164 a=curr:qos local sendrecv\r\n\ |
|
165 a=curr:qos remote none\r\n\ |
|
166 a=des:qos mandatory local sendrecv\r\n\ |
|
167 a=des:qos none remote sendrecv\r\n\ |
|
168 a=rtpmap:96 AMR/8000\r\n\ |
|
169 a=ptime:20\r\n\ |
|
170 a=maxptime:400\r\n\ |
|
171 a=fmtp:96 octet-align=0; mode-set=0,1,2,3,4,5,6,7\r\n\ |
|
172 a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:ZVNobHlzUGU2X0ZidG5TNDYtOXhZYWlSaEx3SVhU\r\n\ |
|
173 a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:hmEnUUhipdXlKqsom7YbO/3Zg61x39DV4oUiXq1O\r\n\ |
|
174 a=crypto:3 F8_128_HMAC_SHA1_80 inline:vJeiM7l17DrIkbCH8QLR8y8ZymcGVWnn/J/Pugrs\r\n"); |
|
175 |
|
176 _LIT8( KMceTestMeidaNoCrypto, "\ |
|
177 m=audio 5006 RTP/SAVPF 0 96\r\n\ |
|
178 a=sendrecv\r\n\ |
|
179 a=curr:qos local sendrecv\r\n\ |
|
180 a=curr:qos remote none\r\n\ |
|
181 a=des:qos mandatory local sendrecv\r\n\ |
|
182 a=des:qos none remote sendrecv\r\n\ |
|
183 a=rtpmap:96 AMR/8000\r\n\ |
|
184 a=ptime:20\r\n\ |
|
185 a=maxptime:400\r\n\ |
|
186 a=fmtp:96 octet-align=0; mode-set=0,1,2,3,4,5,6,7\r\n"); |
|
187 |
|
188 // CONSTRUCTION |
|
189 UT_CMceSecureDesStream* UT_CMceSecureDesStream::NewL() |
|
190 { |
|
191 UT_CMceSecureDesStream* self = UT_CMceSecureDesStream::NewLC(); |
|
192 CleanupStack::Pop(); |
|
193 |
|
194 return self; |
|
195 } |
|
196 |
|
197 UT_CMceSecureDesStream* UT_CMceSecureDesStream::NewLC() |
|
198 { |
|
199 UT_CMceSecureDesStream* self = new( ELeave ) UT_CMceSecureDesStream(); |
|
200 CleanupStack::PushL( self ); |
|
201 |
|
202 self->ConstructL(); |
|
203 |
|
204 return self; |
|
205 } |
|
206 |
|
207 // Destructor (virtual by CBase) |
|
208 UT_CMceSecureDesStream::~UT_CMceSecureDesStream() |
|
209 { |
|
210 } |
|
211 |
|
212 // Default constructor |
|
213 UT_CMceSecureDesStream::UT_CMceSecureDesStream() |
|
214 { |
|
215 } |
|
216 |
|
217 // Second phase construct |
|
218 void UT_CMceSecureDesStream::ConstructL() |
|
219 { |
|
220 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
221 // It generates the test case table. |
|
222 CEUnitTestSuiteClass::ConstructL(); |
|
223 } |
|
224 |
|
225 // METHODS |
|
226 |
|
227 |
|
228 |
|
229 void UT_CMceSecureDesStream::SetupL( ) |
|
230 { |
|
231 //Set up the basic |
|
232 iSession = MceMediaManagerTestHelper::CreateMultimediaOutSessionL(); |
|
233 RPointerArray<CMceComMediaStream>& streams = iSession->Streams(); |
|
234 |
|
235 TInt count=streams.Count(); |
|
236 if (count>0) |
|
237 { |
|
238 iStream1=streams[0]; |
|
239 } |
|
240 if (count>1) |
|
241 { |
|
242 iStream2=streams[1]; |
|
243 } |
|
244 |
|
245 iMcc = CMccControllerStub::Stub(); |
|
246 |
|
247 iManager = CMceMediaManager::NewL( *this ); |
|
248 |
|
249 RPointerArray<CMceComAudioCodec> audioCapabilities; |
|
250 RPointerArray<CMceComVideoCodec> videoCapabilities; |
|
251 MceCleanupResetAndDestroyPushL( audioCapabilities ); |
|
252 MceCleanupResetAndDestroyPushL( videoCapabilities ); |
|
253 iManager->GetCapabilitiesL( audioCapabilities ); |
|
254 iManager->GetCapabilitiesL( videoCapabilities ); |
|
255 CleanupStack::PopAndDestroy( 2 );//capas |
|
256 |
|
257 |
|
258 |
|
259 __ASSERT_ALWAYS( iManager->iSdpCodecs.Count() >= 2, User::Leave( KErrNotFound ) ); |
|
260 iAudioSdpCodec = static_cast<CMceMediaSdpCodec*>( iManager->iSdpCodecs[ 0 ] ); |
|
261 iVideoSdpCodec = static_cast<CMceMediaSdpCodec*>( iManager->iSdpCodecs[ 1 ] ); |
|
262 |
|
263 iAudio = SdpCodecStringPool::StringPoolL().StringF( |
|
264 SdpCodecStringConstants::EMediaAudio, |
|
265 SdpCodecStringPool::StringTableL()); |
|
266 |
|
267 iVideo = SdpCodecStringPool::StringPoolL().StringF( |
|
268 SdpCodecStringConstants::EMediaVideo, |
|
269 SdpCodecStringPool::StringTableL()); |
|
270 |
|
271 iProtocol = SdpCodecStringPool::StringPoolL().StringF( |
|
272 SdpCodecStringConstants::EProtocolRtpAvp, |
|
273 SdpCodecStringPool::StringTableL() ); |
|
274 |
|
275 // Create media line: m= This should correspond to the OFFER received! |
|
276 |
|
277 |
|
278 iMedia = CSdpMediaField::NewLC ( iVideo, 8000, iProtocol, _L8("96") ); |
|
279 |
|
280 // Note the sendrcv, this should create bound stream as well since it's two way. |
|
281 RStringF attribute = SdpCodecStringPool::StringPoolL().StringF |
|
282 ( SdpCodecStringConstants::EAttributeSendrecv, SdpCodecStringPool::StringTableL() ); |
|
283 CSdpAttributeField* mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
284 iMedia->AttributeFields().AppendL( mediaAttr ); |
|
285 attribute.Close(); |
|
286 CleanupStack::Pop( mediaAttr ); |
|
287 |
|
288 CleanupStack::Pop( iMedia ); |
|
289 TUint payloadType = 96; |
|
290 // Get the encoding name |
|
291 TPtrC8 codecName = _L8("HMMH"); |
|
292 TUint clockRate = 90000; |
|
293 |
|
294 // create rtpmap field for current codec |
|
295 CSdpFmtAttributeField* rtpmapAttribute = |
|
296 iVideoSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
297 codecName, |
|
298 clockRate, |
|
299 KMceSdpOptionalEncodingParam ); |
|
300 CleanupStack::PushL( rtpmapAttribute ); |
|
301 iMedia->FormatAttributeFields().AppendL( rtpmapAttribute ); |
|
302 CleanupStack::Pop( rtpmapAttribute ); |
|
303 |
|
304 |
|
305 iOffer = CSdpDocument::NewL(); |
|
306 CleanupStack::PushL( iOffer ); |
|
307 iOffer->MediaFields().AppendL( iMedia ); |
|
308 |
|
309 |
|
310 // Set session name: s= |
|
311 iOffer->SetSessionNameL( _L8("") ); |
|
312 |
|
313 const TUint32 KInetAddr = INET_ADDR(10,10,10,10); |
|
314 TInetAddr localIpAddress; |
|
315 localIpAddress.SetAddress(KInetAddr); |
|
316 |
|
317 CSdpOriginField* originField = CSdpOriginField::NewL( _L8("username"), |
|
318 55555, |
|
319 55555, |
|
320 localIpAddress ); |
|
321 iOffer->SetOriginField( originField ); |
|
322 |
|
323 // Create connection field: c= |
|
324 CSdpConnectionField* connectionField = CSdpConnectionField::NewL( localIpAddress ); |
|
325 iOffer->SetConnectionField( connectionField ); |
|
326 |
|
327 CleanupStack::Pop( iOffer ); |
|
328 |
|
329 iInterface = CMccInterface::NewL( *iManager ); |
|
330 |
|
331 iSecureInterface= CMccSecureInterface::NewL( *iInterface ); |
|
332 |
|
333 iSecureSession = |
|
334 CMceSecureMediaSession::NewL( *iSession, *iManager, *iSecureInterface ); |
|
335 |
|
336 iSecureStream = |
|
337 CMceSecureDesStream::NewL( *iSecureSession, *iMedia, |
|
338 *iSecureInterface, *iStream1 ); |
|
339 iSecureStream->AppendEmptyCryptoL( *iSecureStream->iCryptoOuts, KTotalCryptoAnswerCount ); |
|
340 } |
|
341 |
|
342 void UT_CMceSecureDesStream::Teardown( ) |
|
343 { |
|
344 delete iSecureStream; |
|
345 iAudio.Close(); |
|
346 iVideo.Close(); |
|
347 iProtocol.Close(); |
|
348 delete iSecureSession; |
|
349 delete iSecureInterface; |
|
350 delete iInterface; |
|
351 delete iOffer; |
|
352 delete iManager; |
|
353 SdpCodecStringPool::Close(); |
|
354 CMccControllerStub::Close(); |
|
355 iSession->iClientCryptoSuites.Reset(); |
|
356 delete iSession; |
|
357 } |
|
358 |
|
359 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_NewLL( ) |
|
360 { |
|
361 CMceSecureDesStream* iSecureStream= CMceSecureDesStream::NewL(*iSecureSession, |
|
362 *iMedia, |
|
363 *iSecureInterface, |
|
364 *iStream1); |
|
365 |
|
366 delete iSecureStream; |
|
367 |
|
368 CMceSecureDesStream* secureInStream= CMceSecureDesStream::NewL(*iSecureSession, |
|
369 *iMedia, |
|
370 *iSecureInterface, |
|
371 *iStream2); |
|
372 |
|
373 |
|
374 delete secureInStream; |
|
375 } |
|
376 |
|
377 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_EncodeSecureSdpLL( ) |
|
378 { |
|
379 /*=============Test case 1 ====================================================*/ |
|
380 //Test case 1 client crypto count = NULL |
|
381 CSdpMediaField* media = CSdpMediaField::NewLC ( iVideo, 8000, iProtocol, _L8("96") ); |
|
382 // Note the sendrcv, this should create bound stream as well since it's two way. |
|
383 RStringF attribute = SdpCodecStringPool::StringPoolL().StringF |
|
384 ( SdpCodecStringConstants::EAttributeSendrecv, SdpCodecStringPool::StringTableL() ); |
|
385 CSdpAttributeField* mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
386 |
|
387 media->AttributeFields().AppendL( mediaAttr ); |
|
388 CleanupStack::Pop( mediaAttr ); |
|
389 TUint payloadType = 96; |
|
390 // Get the encoding name |
|
391 TPtrC8 codecName = _L8("HMMH"); |
|
392 TUint clockRate = 90000; |
|
393 |
|
394 // create rtpmap field for current codec |
|
395 CSdpFmtAttributeField* rtpmapAttribute = |
|
396 iVideoSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
397 codecName, |
|
398 clockRate, |
|
399 KMceSdpOptionalEncodingParam ); |
|
400 CleanupStack::PushL( rtpmapAttribute ); |
|
401 media->FormatAttributeFields().AppendL( rtpmapAttribute ); |
|
402 CleanupStack::Pop( rtpmapAttribute ); |
|
403 |
|
404 iSecureSession->iCryptoContextUpdate = ETrue; |
|
405 iSecureStream->EncodeSecureSdpL(*media, EFalse); |
|
406 EUNIT_ASSERT( !iSecureStream->Session().iIsSecureSession); |
|
407 CleanupStack::PopAndDestroy(media); |
|
408 |
|
409 /*==============Test case 2 ========================================================*/ |
|
410 //Test case 2 if meadia type==audio |
|
411 iSession->iClientCryptoSuites.AppendL( EAES_CM_128_HMAC_SHA1_32 ); |
|
412 iSession->iClientCryptoSuites.AppendL( EAES_CM_128_HMAC_SHA1_80 ); |
|
413 media = CSdpMediaField::NewLC( iAudio, 8000, iProtocol, _L8("96") ); |
|
414 // Note the sendrcv, this should create bound stream as well since it's two way. |
|
415 mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
416 media->AttributeFields().AppendL( mediaAttr ); |
|
417 CleanupStack::Pop( mediaAttr ); |
|
418 |
|
419 // create rtpmap field for current codec |
|
420 rtpmapAttribute = |
|
421 iAudioSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
422 codecName, |
|
423 clockRate, |
|
424 KMceSdpOptionalEncodingParam ); |
|
425 CleanupStack::PushL( rtpmapAttribute); |
|
426 media->FormatAttributeFields().AppendL( rtpmapAttribute); |
|
427 CleanupStack::Pop( rtpmapAttribute ); |
|
428 iSecureStream->Session().iIsSecureSession = ETrue; |
|
429 iSecureSession->iCryptoContextUpdate = ETrue; |
|
430 iSecureStream->EncodeSecureSdpL(*media, EFalse); |
|
431 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
432 |
|
433 /*==============Test case 3 ========================================================*/ |
|
434 //Test case 3 |
|
435 //state ==ERefresh or Eupdate |
|
436 iSecureSession->iCryptoContextUpdate = EFalse; |
|
437 iSecureSession->iKeyNeedUpdated = EFalse; |
|
438 |
|
439 iSecureStream->iCryptoOut = iSecureStream->iCryptoOuts->At( 0 ); |
|
440 TMceSecureCryptoInfo oldCryptoNegotiated = iSecureStream->iCryptoOut; |
|
441 |
|
442 //Encode the SecureSDP and Ensure that crypto is reused not created again |
|
443 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
444 |
|
445 EUNIT_ASSERT( oldCryptoNegotiated.iEncodedKey == |
|
446 iSecureStream->iCryptoOuts->At( 0 ).iEncodedKey ); |
|
447 |
|
448 /*==============Test case 3a ========================================================*/ |
|
449 // Test Case 3a |
|
450 // Ensure that keys get change once keyUpdate is Required in offer/answer |
|
451 |
|
452 iSecureSession->iCryptoContextUpdate = ETrue; |
|
453 iSecureSession->iKeyNeedUpdated = ETrue; |
|
454 |
|
455 //Encode the SecureSDP and Ensure that crypto is recreated |
|
456 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
457 |
|
458 EUNIT_ASSERT( oldCryptoNegotiated.iEncodedKey != |
|
459 iSecureStream->iCryptoOuts->At( 0 ).iEncodedKey ); |
|
460 |
|
461 |
|
462 /*=================================================================================*/ |
|
463 |
|
464 // Reset everything for the rest of the test cases |
|
465 iSession->iClientCryptoSuites.Reset(); |
|
466 iSession->iClientCryptoSuites.AppendL( EAES_CM_128_HMAC_SHA1_32 ); |
|
467 CleanupStack::PopAndDestroy( media ); |
|
468 media = CSdpMediaField::NewLC( iAudio, 8000, iProtocol, _L8("96") ); |
|
469 delete iSecureStream; |
|
470 iSecureStream = NULL; |
|
471 iSecureStream = |
|
472 CMceSecureDesStream::NewL( *iSecureSession, *iMedia, |
|
473 *iSecureInterface, *iStream1 ); |
|
474 iSecureStream->GenerateRandomKeys( iSecureStream->iCryptoIn ); |
|
475 iSecureStream->GenerateRandomKeys( iSecureStream->iCryptoOut ); |
|
476 |
|
477 // Answer; |
|
478 // iSecureSession.iCryptoContextUpdate == EFalse |
|
479 media->AttributeFields().ResetAndDestroy(); |
|
480 iSecureSession->iKeyNeedUpdated = EFalse; |
|
481 iSecureSession->iCryptoContextUpdate = EFalse; |
|
482 iSecureStream->EncodeSecureSdpL( *media, ETrue ); |
|
483 EUNIT_ASSERT_EQUALS( 1, media->AttributeFields().Count() ) |
|
484 |
|
485 // Answer; |
|
486 // iSecureSession.iCryptoContextUpdate == ETrue |
|
487 media->AttributeFields().ResetAndDestroy(); |
|
488 iSecureSession->iKeyNeedUpdated = EFalse; |
|
489 iSecureSession->iCryptoContextUpdate = ETrue; |
|
490 iSecureStream->EncodeSecureSdpL( *media, ETrue ); |
|
491 EUNIT_ASSERT( !iSecureSession->iCryptoContextUpdate ) |
|
492 EUNIT_ASSERT_EQUALS( 1, media->AttributeFields().Count() ) |
|
493 |
|
494 // Offer; |
|
495 // iSecureSession.iKeyNeedUpdated == ETrue |
|
496 // iSecureSession.iCryptoContextUpdate == ETrue |
|
497 media->AttributeFields().ResetAndDestroy(); |
|
498 iSecureSession->iKeyNeedUpdated = ETrue; |
|
499 iSecureSession->iCryptoContextUpdate = ETrue; |
|
500 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
501 EUNIT_ASSERT( !iSecureSession->iCryptoContextUpdate ) |
|
502 EUNIT_ASSERT_EQUALS( 1, media->AttributeFields().Count() ) |
|
503 |
|
504 // Offer; |
|
505 // iSecureSession.iKeyNeedUpdated == EFalse |
|
506 // iSecureSession.iCryptoContextUpdate == EFalse |
|
507 media->AttributeFields().ResetAndDestroy(); |
|
508 iSecureSession->iKeyNeedUpdated = EFalse; |
|
509 iSecureSession->iCryptoContextUpdate = EFalse; |
|
510 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
511 EUNIT_ASSERT_EQUALS( 1, media->AttributeFields().Count() ) |
|
512 |
|
513 // Offer; |
|
514 // iSecureSession.iKeyNeedUpdated == ETrue |
|
515 // iSecureSession.iCryptoContextUpdate == EFalse |
|
516 media->AttributeFields().ResetAndDestroy(); |
|
517 iSecureSession->iKeyNeedUpdated = ETrue; |
|
518 iSecureSession->iCryptoContextUpdate = EFalse; |
|
519 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
520 EUNIT_ASSERT_EQUALS( 1, media->AttributeFields().Count() ) |
|
521 |
|
522 CleanupStack::PopAndDestroy( media ); |
|
523 } |
|
524 |
|
525 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_DecodeSecureSdpLL( ) |
|
526 { |
|
527 /*=============Test case 1 ====================================================*/ |
|
528 //Test case 1 happy cases |
|
529 CSdpMediaField* media = CSdpMediaField::NewLC ( iVideo, 8000, iProtocol, _L8("96") ); |
|
530 // Note the sendrcv, this should create bound stream as well since it's two way. |
|
531 RStringF attribute = SdpCodecStringPool::StringPoolL().StringF |
|
532 ( SdpCodecStringConstants::EAttributeSendrecv, SdpCodecStringPool::StringTableL() ); |
|
533 CSdpAttributeField* mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
534 |
|
535 media->AttributeFields().AppendL( mediaAttr ); |
|
536 CleanupStack::Pop( mediaAttr ); |
|
537 TUint payloadType = 96; |
|
538 // Get the encoding name |
|
539 TPtrC8 codecName = _L8("HMMH"); |
|
540 TUint clockRate = 90000; |
|
541 |
|
542 // create rtpmap field for current codec |
|
543 CSdpFmtAttributeField* rtpmapAttribute = |
|
544 iVideoSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
545 codecName, |
|
546 clockRate, |
|
547 KMceSdpOptionalEncodingParam ); |
|
548 CleanupStack::PushL( rtpmapAttribute ); |
|
549 media->FormatAttributeFields().AppendL( rtpmapAttribute ); |
|
550 CleanupStack::Pop( rtpmapAttribute ); |
|
551 |
|
552 iSecureStream->DecodeSecureSdpL( *media ); |
|
553 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
554 |
|
555 CleanupStack::PopAndDestroy(media); |
|
556 |
|
557 /*===========Test case 2=============================================*/ |
|
558 |
|
559 //Test case 2 if meadia no crypto |
|
560 |
|
561 media = CSdpMediaField::NewLC( iAudio, 8000, iProtocol, _L8("96") ); |
|
562 |
|
563 mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
564 |
|
565 media->AttributeFields().AppendL( mediaAttr ); |
|
566 CleanupStack::Pop( mediaAttr ); |
|
567 rtpmapAttribute = |
|
568 iAudioSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
569 codecName, |
|
570 clockRate, |
|
571 KMceSdpOptionalEncodingParam ); |
|
572 CleanupStack::PushL( rtpmapAttribute); |
|
573 media->FormatAttributeFields().AppendL( rtpmapAttribute); |
|
574 CleanupStack::Pop( rtpmapAttribute ); |
|
575 |
|
576 iSecureStream->DecodeSecureSdpL( *media); |
|
577 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
578 /*===========Test case 3 ==================================================*/ |
|
579 //state ==ERefresh or Eupdate Real Decode |
|
580 if ( !iSession->iClientCryptoSuites.Count() ) |
|
581 { |
|
582 iSession->iClientCryptoSuites.AppendL(EAES_CM_128_HMAC_SHA1_32); |
|
583 iSession->iClientCryptoSuites.AppendL(EAES_CM_128_HMAC_SHA1_80); |
|
584 } |
|
585 iSecureSession->iCryptoContextUpdate = ETrue; |
|
586 iSecureStream->EncodeSecureSdpL(*media, EFalse ); |
|
587 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
588 iSecureStream->DecodeSecureSdpL( *media ); |
|
589 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
590 iSecureStream->RemvoeSecureSdp(*media); |
|
591 |
|
592 iSecureSession->iCryptoContextUpdate = ETrue; |
|
593 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
594 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
595 iSecureStream->DecodeSecureSdpL( *media ); |
|
596 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
597 /*==========================================================================*/ |
|
598 CleanupStack::PopAndDestroy(media); |
|
599 |
|
600 /*===========Test case 4 ==================================================*/ |
|
601 |
|
602 CSdpMediaField* mediaAnswer1 = CSdpMediaField::DecodeL( KMceTestMeidaCryptoSAVPF ); |
|
603 CleanupStack::PushL( mediaAnswer1 ); |
|
604 iSecureStream->DecodeSecureSdpL( *mediaAnswer1 ); |
|
605 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
606 CleanupStack::PopAndDestroy(mediaAnswer1); |
|
607 |
|
608 /*===========Test case 5 ==================================================*/ |
|
609 |
|
610 CSdpMediaField* mediaAnswer2 = CSdpMediaField::DecodeL( KMceTestMeidaCryptoWrongProtocol ); |
|
611 CleanupStack::PushL( mediaAnswer2 ); |
|
612 iSecureStream->DecodeSecureSdpL(*mediaAnswer2 ); |
|
613 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
614 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ) |
|
615 CleanupStack::PopAndDestroy(mediaAnswer2); |
|
616 |
|
617 /*===========Test case 6 ==================================================*/ |
|
618 |
|
619 CSdpMediaField* mediaAnswer3 = CSdpMediaField::DecodeL( KMceTestMeidaCryptoMultiple2 ); |
|
620 CleanupStack::PushL( mediaAnswer3 ); |
|
621 iSecureStream->DecodeSecureSdpL(*mediaAnswer3 ); |
|
622 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
623 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ) |
|
624 EUNIT_ASSERT( iSecureStream->iCryptoIns->Count() == 2 ); |
|
625 CleanupStack::PopAndDestroy(mediaAnswer3); |
|
626 } |
|
627 |
|
628 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_DecodeSecureSdpAnswerLL( ) |
|
629 { |
|
630 /*===========Test case 1 ==================================================*/ |
|
631 //state ==ERefresh or Eupdate Real Decode |
|
632 if ( !iSession->iClientCryptoSuites.Count() ) |
|
633 { |
|
634 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_32)); |
|
635 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_80)); |
|
636 } |
|
637 CSdpMediaField* mediaOffer = CSdpMediaField::DecodeL( KMceTestMeidaNoCrypto ); |
|
638 CleanupStack::PushL( mediaOffer ); |
|
639 iSecureStream->Session().iIsSecureSession = ETrue; |
|
640 iSecureSession->iCryptoContextUpdate = ETrue; |
|
641 iSecureStream->EncodeSecureSdpL( *mediaOffer, EFalse ); |
|
642 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
643 CSdpMediaField* mediaAnswer1 = CSdpMediaField::DecodeL( KMceTestMeidaCryptoSAVPF ); |
|
644 CleanupStack::PushL( mediaAnswer1 ); |
|
645 iSecureStream->DecodeSecureSdpAnswerL( *mediaAnswer1 ); |
|
646 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
647 CleanupStack::PopAndDestroy(mediaAnswer1); |
|
648 CleanupStack::PopAndDestroy(mediaOffer); |
|
649 |
|
650 /*===========Test case 2 ==================================================*/ |
|
651 |
|
652 mediaOffer = CSdpMediaField::DecodeL( KMceTestMeidaNoCrypto ); |
|
653 CleanupStack::PushL( mediaOffer ); |
|
654 iSecureSession->iCryptoContextUpdate = ETrue; |
|
655 iSecureStream->EncodeSecureSdpL(*mediaOffer, EFalse); |
|
656 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
657 CSdpMediaField* mediaAnswer2 = CSdpMediaField::DecodeL( KMceTestMeidaCryptoWrongProtocol ); |
|
658 CleanupStack::PushL( mediaAnswer2 ); |
|
659 //iCryptoOut crypto is not set |
|
660 iSecureStream->DecodeSecureSdpAnswerL(*mediaAnswer2); |
|
661 EUNIT_ASSERT( !iSecureStream->Session().iIsSecureSession ); |
|
662 EUNIT_ASSERT( iSecureStream->iCryptoIn.iMKLifeTime == 32 ); |
|
663 EUNIT_ASSERT( iSecureStream->iCryptoOut.iMKLifeTime == KDefalutMaterKeysLifeTime ); |
|
664 CleanupStack::PopAndDestroy(mediaAnswer2); |
|
665 CleanupStack::PopAndDestroy(mediaOffer); |
|
666 |
|
667 /*===========Test case 3 ==================================================*/ |
|
668 |
|
669 mediaOffer = CSdpMediaField::DecodeL( KMceTestMeidaNoCrypto ); |
|
670 CleanupStack::PushL( mediaOffer ); |
|
671 iSecureSession->iCryptoContextUpdate = ETrue; |
|
672 iSecureStream->EncodeSecureSdpL(*mediaOffer, EFalse ); |
|
673 EUNIT_ASSERT( !iSecureStream->Session().iIsSecureSession ); |
|
674 |
|
675 CSdpMediaField* mediaAnswer3 = CSdpMediaField::DecodeL( KMceTestMeidaCryptoMultiple ); |
|
676 CleanupStack::PushL( mediaAnswer3 ); |
|
677 EUNIT_ASSERT_SPECIFIC_LEAVE ( iSecureStream->DecodeSecureSdpAnswerL(*mediaAnswer3), KErrArgument ); |
|
678 CleanupStack::PopAndDestroy(mediaAnswer3); |
|
679 CleanupStack::PopAndDestroy(mediaOffer); |
|
680 } |
|
681 |
|
682 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_RemvoeSecureSdpLL( ) |
|
683 { |
|
684 /*=============Test case 1 ====================================================*/ |
|
685 //Test case 1 check if media type!=audio |
|
686 CSdpMediaField* media = CSdpMediaField::NewLC ( iVideo, 8000, iProtocol, _L8("96") ); |
|
687 // Note the sendrcv, this should create bound stream as well since it's two way. |
|
688 RStringF attribute = SdpCodecStringPool::StringPoolL().StringF |
|
689 ( SdpCodecStringConstants::EAttributeSendrecv, SdpCodecStringPool::StringTableL() ); |
|
690 CSdpAttributeField* mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
691 |
|
692 media->AttributeFields().AppendL( mediaAttr ); |
|
693 CleanupStack::Pop( mediaAttr ); |
|
694 TUint payloadType = 96; |
|
695 // Get the encoding name |
|
696 TPtrC8 codecName = _L8("HMMH"); |
|
697 TUint clockRate = 90000; |
|
698 |
|
699 // create rtpmap field for current codec |
|
700 CSdpFmtAttributeField* rtpmapAttribute = |
|
701 iVideoSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
702 codecName, |
|
703 clockRate, |
|
704 KMceSdpOptionalEncodingParam ); |
|
705 CleanupStack::PushL( rtpmapAttribute ); |
|
706 media->FormatAttributeFields().AppendL( rtpmapAttribute ); |
|
707 CleanupStack::Pop( rtpmapAttribute ); |
|
708 |
|
709 iSecureStream->RemvoeSecureSdp( *media ); |
|
710 CleanupStack::Pop(media); |
|
711 delete media; |
|
712 media=NULL; |
|
713 |
|
714 /*===========Test case 2=============================================*/ |
|
715 |
|
716 //Test case 2 if meadia type==audio but no crypto |
|
717 |
|
718 media= CSdpMediaField::NewLC( iAudio, 8000, iProtocol, _L8("96") ); |
|
719 |
|
720 mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
721 |
|
722 media->AttributeFields().AppendL( mediaAttr ); |
|
723 CleanupStack::Pop( mediaAttr ); |
|
724 rtpmapAttribute = |
|
725 iAudioSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
726 codecName, |
|
727 clockRate, |
|
728 KMceSdpOptionalEncodingParam ); |
|
729 CleanupStack::PushL( rtpmapAttribute); |
|
730 media->FormatAttributeFields().AppendL( rtpmapAttribute); |
|
731 CleanupStack::Pop( rtpmapAttribute ); |
|
732 |
|
733 iSecureStream->RemvoeSecureSdp(*media); |
|
734 |
|
735 /*===========Test case 3 ==================================================*/ |
|
736 //Remove Sdp with crypto |
|
737 if ( !iSession->iClientCryptoSuites.Count() ) |
|
738 { |
|
739 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_32)); |
|
740 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_80)); |
|
741 } |
|
742 iSecureStream->Session().iIsSecureSession = ETrue; |
|
743 iSecureSession->iCryptoContextUpdate = ETrue; |
|
744 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
745 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
746 iSecureStream->RemvoeSecureSdp( *media ); |
|
747 |
|
748 /*=======================================================================*/ |
|
749 CleanupStack::PopAndDestroy(media); |
|
750 } |
|
751 |
|
752 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_SetCryptoContextL( ) |
|
753 { |
|
754 /*=============Test case 1 ====================================================*/ |
|
755 //key has not yet created |
|
756 iSecureStream->SetCryptoContextL(); |
|
757 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
758 |
|
759 /*=============Test case 2 ====================================================*/ |
|
760 //state is EFist but key is not created |
|
761 |
|
762 iSecureStream->SetCryptoContextL(); |
|
763 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
764 |
|
765 /*=============Test case 3 ====================================================*/ |
|
766 //state is EUpdate but key is not created |
|
767 iSecureStream->iCryptoUpdateNeeded = ETrue; |
|
768 iSecureStream->SetCryptoContextL(); |
|
769 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
770 |
|
771 /*=============Test case 4 ====================================================*/ |
|
772 //key created and the state is EFirst |
|
773 CSdpMediaField* media= CSdpMediaField::NewLC( iAudio, 8000, iProtocol, _L8("96") ); |
|
774 |
|
775 RStringF attribute = SdpCodecStringPool::StringPoolL().StringF |
|
776 ( SdpCodecStringConstants::EAttributeSendrecv, SdpCodecStringPool::StringTableL() ); |
|
777 CSdpAttributeField* mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
778 |
|
779 media->AttributeFields().AppendL( mediaAttr ); |
|
780 CleanupStack::Pop( mediaAttr );TUint payloadType = 96; |
|
781 // Get the encoding name |
|
782 TPtrC8 codecName = _L8("HMMH"); |
|
783 TUint clockRate = 90000; |
|
784 |
|
785 // create rtpmap field for current codec |
|
786 CSdpFmtAttributeField* rtpmapAttribute = |
|
787 iAudioSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
788 codecName, |
|
789 clockRate, |
|
790 KMceSdpOptionalEncodingParam ); |
|
791 CleanupStack::PushL( rtpmapAttribute); |
|
792 media->FormatAttributeFields().AppendL( rtpmapAttribute); |
|
793 CleanupStack::Pop( rtpmapAttribute ); |
|
794 if ( !iSession->iClientCryptoSuites.Count() ) |
|
795 { |
|
796 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_32)); |
|
797 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_80)); |
|
798 } |
|
799 |
|
800 iSecureStream->Session().iIsSecureSession = ETrue; |
|
801 iSecureSession->iCryptoContextUpdate = ETrue; |
|
802 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
803 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
804 iSecureStream->SetCryptoContextL(); |
|
805 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
806 |
|
807 /*=============Test case 5====================================================*/ |
|
808 //change state to EUpdate |
|
809 iSecureStream->iCryptoUpdateNeeded = ETrue; |
|
810 iSecureStream->SetCryptoContextL(); |
|
811 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
812 /*==========================================================================*/ |
|
813 CleanupStack::PopAndDestroy(media); |
|
814 } |
|
815 |
|
816 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_RemoveCryptoContextL( ) |
|
817 { |
|
818 /*=============Test case 1 ====================================================*/ |
|
819 //key created and the state is EFirst |
|
820 CSdpMediaField* media= CSdpMediaField::NewLC( iAudio, 8000, iProtocol, _L8("96") ); |
|
821 |
|
822 RStringF attribute = SdpCodecStringPool::StringPoolL().StringF |
|
823 ( SdpCodecStringConstants::EAttributeSendrecv, SdpCodecStringPool::StringTableL() ); |
|
824 CSdpAttributeField* mediaAttr = CSdpAttributeField::NewLC(attribute, _L8("")); |
|
825 |
|
826 media->AttributeFields().AppendL( mediaAttr ); |
|
827 CleanupStack::Pop( mediaAttr );TUint payloadType = 96; |
|
828 // Get the encoding name |
|
829 TPtrC8 codecName = _L8("HMMH"); |
|
830 TUint clockRate = 90000; |
|
831 |
|
832 // create rtpmap field for current codec |
|
833 CSdpFmtAttributeField* rtpmapAttribute = |
|
834 iAudioSdpCodec->EncodeRtpMapFieldsL( payloadType, |
|
835 codecName, |
|
836 clockRate, |
|
837 KMceSdpOptionalEncodingParam ); |
|
838 CleanupStack::PushL( rtpmapAttribute); |
|
839 media->FormatAttributeFields().AppendL( rtpmapAttribute); |
|
840 CleanupStack::Pop( rtpmapAttribute ); |
|
841 if ( !iSession->iClientCryptoSuites.Count() ) |
|
842 { |
|
843 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_32)); |
|
844 User::LeaveIfError ( iSession->iClientCryptoSuites.Append(EAES_CM_128_HMAC_SHA1_80)); |
|
845 } |
|
846 iSecureStream->Session().iIsSecureSession = ETrue; |
|
847 iSecureSession->iCryptoContextUpdate = ETrue; |
|
848 iSecureStream->EncodeSecureSdpL( *media, EFalse ); |
|
849 EUNIT_ASSERT( iSecureStream->Session().iIsSecureSession ); |
|
850 iSecureStream->SetCryptoContextL(); |
|
851 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
852 /*==========================================================================*/ |
|
853 CleanupStack::PopAndDestroy(media); |
|
854 } |
|
855 |
|
856 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_MediaStreamL( ) |
|
857 { |
|
858 EUNIT_ASSERT( iSecureStream->MediaStream().Direction() == iStream1->Direction() ) |
|
859 } |
|
860 |
|
861 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_MediaFieldL( ) |
|
862 { |
|
863 EUNIT_ASSERT( iSecureStream->iMediaField != NULL ) |
|
864 } |
|
865 |
|
866 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_ValidateOfferByAnswerLL( ) |
|
867 { |
|
868 /*=============Test case 1 ====================================================*/ |
|
869 iSecureStream->ValidateOfferByAnswerL( KSecAttrValue1 ); |
|
870 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
871 EUNIT_ASSERT( iSecureStream->iCryptoIns->At(0).iMKI == KMKI1 ); |
|
872 TUint64 mkiLiftTime = 1048576;//2^20 |
|
873 EUNIT_ASSERT( iSecureStream->iCryptoIns->At(0).iMKLifeTime == mkiLiftTime ); |
|
874 |
|
875 /*=============Test case 2 ====================================================*/ |
|
876 iSecureStream->ValidateOfferByAnswerL(KSecAttrValue5 ); |
|
877 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
878 EUNIT_ASSERT( iSecureStream->iCryptoIns->At(1).iMKI==KMKI2 ); |
|
879 TReal result = 0; |
|
880 Math::Pow( result, 2, 10 ); |
|
881 EUNIT_ASSERT( iSecureStream->iCryptoIns->At(1).iMKLifeTime == (TUint64 ) result); |
|
882 |
|
883 /*=============Test case 3 ====================================================*/ |
|
884 TRAPD( error, iSecureStream->ValidateOfferByAnswerL(KSecAttrNotValidLength) ); |
|
885 if ( error == KErrNoMemory ) |
|
886 { |
|
887 User::Leave( KErrNoMemory ); |
|
888 } |
|
889 EUNIT_ASSERT( error == KErrArgument ); |
|
890 |
|
891 //EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->ValidateOfferByAnswerL(KSecAttrNotValidLength), KErrArgument ); |
|
892 |
|
893 /*=============Test case 4 ====================================================*/ |
|
894 TRAP( error, iSecureStream->ValidateOfferByAnswerL(KSecAttrNoInline) ); |
|
895 if ( error == KErrNoMemory ) |
|
896 { |
|
897 User::Leave( KErrNoMemory ); |
|
898 } |
|
899 EUNIT_ASSERT( error == KErrArgument ); |
|
900 //EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->ValidateOfferByAnswerL( KSecAttrNoInline ), KErrArgument ); |
|
901 |
|
902 /*=============Test case 5 ====================================================*/ |
|
903 TRAP( error, iSecureStream->ValidateOfferByAnswerL(KSecAttrNotValidKey) ); |
|
904 if ( error == KErrNoMemory ) |
|
905 { |
|
906 User::Leave( KErrNoMemory ); |
|
907 } |
|
908 EUNIT_ASSERT( error == KErrArgument ); |
|
909 //EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->ValidateOfferByAnswerL( KSecAttrNotValidKey ), KErrArgument ); |
|
910 |
|
911 /*=============Test case 6 ====================================================*/ |
|
912 iSecureStream->ValidateOfferByAnswerL( KSecAttrCryptoNotSupport ); |
|
913 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
914 /*=============Test case 7 ====================================================*/ |
|
915 iSecureStream->iGnoreSdpMsg = EFalse; |
|
916 iSecureStream->ValidateOfferByAnswerL( KSecAttrOnlyKey ); |
|
917 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
918 } |
|
919 |
|
920 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_ValidateAnswerByOfferLL( ) |
|
921 { |
|
922 /*=============Test case 1 ====================================================*/ |
|
923 //no iCryptoOuts found |
|
924 iSecureStream->ValidateAnswerByOfferL( KSecAttrValue1 ); |
|
925 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
926 /*=============Test case 2 ====================================================*/ |
|
927 iSecureStream->SetPreferedCryptoL(); |
|
928 iSecureStream->iCryptoOuts->At(0).iMKIUsed=ETrue; |
|
929 iSecureStream->iCryptoOuts->At(1).iMKIUsed=ETrue; |
|
930 iSecureStream->ValidateAnswerByOfferL( KSecAttrValue1 ); |
|
931 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
932 EUNIT_ASSERT(iSecureStream->iCryptoIn.iMKIUsed==ETrue); |
|
933 EUNIT_ASSERT(iSecureStream->iCryptoIn.iMKI==KMKI1); |
|
934 TUint64 mkiLiftTime = 1048576;//2^20 |
|
935 EUNIT_ASSERT(iSecureStream->iCryptoIn.iMKLifeTime == mkiLiftTime); |
|
936 |
|
937 /*=============Test case 3 ====================================================*/ |
|
938 iSecureStream->ValidateAnswerByOfferL( KSecAttrValue5 ); |
|
939 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
940 EUNIT_ASSERT(iSecureStream->iCryptoIn.iMKI==KMKI2); |
|
941 TReal result = 0; |
|
942 Math::Pow(result, 2, 10); |
|
943 EUNIT_ASSERT( iSecureStream->iCryptoIn.iMKLifeTime == (TUint64 ) result); |
|
944 |
|
945 /*=============Test case 3 ====================================================*/ |
|
946 EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->ValidateAnswerByOfferL( KSecAttrNotValidLength ), KErrArgument ); |
|
947 |
|
948 /*=============Test case 4 ====================================================*/ |
|
949 EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->ValidateAnswerByOfferL( KSecAttrNoInline ), KErrArgument ); |
|
950 |
|
951 /*=============Test case 5 ====================================================*/ |
|
952 EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->ValidateAnswerByOfferL( KSecAttrNotValidKey ), KErrArgument ); |
|
953 |
|
954 /*=============Test case 6 ====================================================*/ |
|
955 iSecureStream->ValidateAnswerByOfferL( KSecAttrCryptoNotSupport ); |
|
956 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
957 /*=============Test case 7 ====================================================*/ |
|
958 iSecureStream->iGnoreSdpMsg = EFalse; |
|
959 iSecureStream->ValidateAnswerByOfferL( KSecAttrOnlyKey ); |
|
960 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
961 /*==========================================================================*/ |
|
962 } |
|
963 |
|
964 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_FormMKILL( ) |
|
965 { |
|
966 iSecureStream->SetPreferedCryptoL(); |
|
967 iSecureStream->iCryptoOuts->At(0).iMKIUsed=ETrue; |
|
968 iSecureStream->iCryptoOuts->At(1).iMKIUsed=ETrue; |
|
969 //iSecureStream->iCryptoOuts[0].iMKIValue = 1; |
|
970 //iSecureStream->iCryptoOuts[0].iMKILength = 4; |
|
971 //iSecureStream->iCryptoOuts[1].iMKIValue = 1; |
|
972 //iSecureStream->iCryptoOuts[1].iMKILength = 4; |
|
973 iSecureStream->ValidateAnswerByOfferL( KSecAttrValue1 ); |
|
974 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
975 EUNIT_ASSERT( iSecureStream->iCryptoIn.iMKIUsed==ETrue); |
|
976 EUNIT_ASSERT( iSecureStream->iCryptoIn.iMKI==KMKI1); |
|
977 TUint64 mkiLiftTime = 1048576;//2^20 |
|
978 EUNIT_ASSERT( iSecureStream->iCryptoIn.iMKLifeTime == mkiLiftTime); |
|
979 iSecureStream->CreateCryptoContextL( iSecureStream->iCryptoIn); |
|
980 } |
|
981 |
|
982 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_GenerateCryptoSuiteLineL() |
|
983 { |
|
984 TMceSecureCryptoInfo crypto; |
|
985 TBuf8< KCryptoLineMaxLength > cryptoLine; |
|
986 /*=============Test case 1 ====================================================*/ |
|
987 |
|
988 crypto.iEncAlgms = ESrtpNullAlg; |
|
989 iSecureStream->GenerateCryptoSuiteLineL( cryptoLine, crypto ); |
|
990 EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg ); |
|
991 cryptoLine.Zero(); |
|
992 iSecureStream->iGnoreSdpMsg = EFalse; |
|
993 /*=============Test case 2 ====================================================*/ |
|
994 crypto.iTagLen = KAuthTagLength80; |
|
995 crypto.iEncAlgms = ESrtpEncAES_CM; |
|
996 EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->GenerateCryptoSuiteLineL( cryptoLine, crypto ), KErrArgument); |
|
997 cryptoLine.Zero(); |
|
998 /*=============Test case 3 ====================================================*/ |
|
999 crypto.iTagLen = KAuthTagLength80; |
|
1000 crypto.iEncodedKey = KEncodedKey; |
|
1001 crypto.iMKIUsed = ETrue; |
|
1002 crypto.iMKI = KMKI1 ; |
|
1003 cryptoLine.Copy( KNullDesC8); |
|
1004 iSecureStream->GenerateCryptoSuiteLineL( cryptoLine, crypto ); |
|
1005 EUNIT_ASSERT ( cryptoLine.CompareF( KCryptoLine2 )==0 ); |
|
1006 EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg ); |
|
1007 cryptoLine.Zero(); |
|
1008 crypto.CryptoDestruct(); |
|
1009 } |
|
1010 |
|
1011 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_CopyStreamCryptoL() |
|
1012 { |
|
1013 CMceSecureDesStream* copy = CMceSecureDesStream::NewL(*iSecureSession, |
|
1014 iSecureStream->MediaField(), |
|
1015 *iSecureInterface, |
|
1016 *iStream1); |
|
1017 CleanupStack::PushL( copy); |
|
1018 copy->CopyStreamCryptoL(*iSecureStream); |
|
1019 CleanupStack::Pop( copy ); |
|
1020 EUNIT_ASSERT( copy->iCryptoOuts->Count()==KTotalCryptoAnswerCount ); |
|
1021 |
|
1022 delete copy; |
|
1023 } |
|
1024 |
|
1025 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_GenerateCryptoLineL() |
|
1026 { |
|
1027 TInt cryptoCount = 1; |
|
1028 TBuf8< KCryptoLineMaxLength > cryptoLine; |
|
1029 |
|
1030 /*=============Test case 1 ====================================================*/ |
|
1031 |
|
1032 |
|
1033 iSecureStream->GenerateCryptoLineL( cryptoLine, cryptoCount, EFalse ); |
|
1034 cryptoLine.Zero(); |
|
1035 |
|
1036 /*=============Test case 2 ====================================================*/ |
|
1037 |
|
1038 EUNIT_ASSERT_SPECIFIC_LEAVE ( iSecureStream->GenerateCryptoLineL( cryptoLine, cryptoCount, ETrue ), KErrArgument ); |
|
1039 cryptoLine.Zero(); |
|
1040 |
|
1041 /*=============Test case 3====================================================*/ |
|
1042 |
|
1043 iSecureStream->iCryptoOuts->At( 0 ).iTagLen = KAuthTagLength32; |
|
1044 iSecureStream->iCryptoOuts->At( 0 ).iEncAlgms = ESrtpEncAES_CM; |
|
1045 iSecureStream->iCryptoOuts->At( 0 ).iAuthAlgms = ESrtpAuthHMAC_SHA1; |
|
1046 iSecureStream->iCryptoOuts->At( 0 ).iCryptoSuite = KAES_SHA1_32; |
|
1047 TMceSecureCryptoInfo cryptoIn; |
|
1048 iSecureStream->iCryptoIns->AppendL( cryptoIn ); |
|
1049 iSecureStream->iCryptoIns->At( 0 ).Copy( iSecureStream->iCryptoOuts->At( 0 ) ); |
|
1050 iSecureStream->GenerateCryptoLineL( cryptoLine, cryptoCount, ETrue ); |
|
1051 |
|
1052 |
|
1053 cryptoLine.Zero(); |
|
1054 /*=============Test case 4 ====================================================*/ |
|
1055 iSecureStream->GenerateCryptoLineL( cryptoLine, cryptoCount, EFalse ); |
|
1056 cryptoLine.Zero(); |
|
1057 |
|
1058 /*=============Test case for iKeyNeedUpdated is true===========================*/ |
|
1059 iSecureStream->iCryptoOuts->At( 0 ).iTagLen = KAuthTagLength32; |
|
1060 iSecureStream->iCryptoOuts->At( 0 ).iEncAlgms = ESrtpEncAES_CM; |
|
1061 iSecureStream->iCryptoOuts->At( 0 ).iAuthAlgms = ESrtpAuthHMAC_SHA1; |
|
1062 iSecureStream->iCryptoOuts->At( 0 ).iCryptoSuite = KAES_SHA1_32; |
|
1063 TMceSecureCryptoInfo cryptoIn1; |
|
1064 iSecureStream->iCryptoIns->AppendL(cryptoIn1); |
|
1065 iSecureStream->iCryptoIns->At( 0 ).Copy(iSecureStream->iCryptoOuts->At( 0) ); |
|
1066 iSecureSession->iKeyNeedUpdated = ETrue; |
|
1067 iSecureStream->GenerateCryptoLineL(cryptoLine, cryptoCount, ETrue); |
|
1068 cryptoLine.Zero(); |
|
1069 |
|
1070 /*=============Test case for iKeyNeedUpdated is false===========================*/ |
|
1071 iSecureSession->iKeyNeedUpdated = EFalse; |
|
1072 iSecureStream->GenerateCryptoLineL(cryptoLine, cryptoCount, ETrue); |
|
1073 cryptoLine.Zero(); |
|
1074 |
|
1075 /*=============Test case 5====================================================*/ |
|
1076 |
|
1077 cryptoLine.Copy( KNullDesC8); |
|
1078 iSecureStream->GenerateCryptoLineL( cryptoLine, cryptoCount, EFalse ); |
|
1079 EUNIT_ASSERT ( cryptoLine.Length() == KCryptoLine3().Length() ); |
|
1080 cryptoLine.Zero(); |
|
1081 } |
|
1082 |
|
1083 void UT_CMceSecureDesStream::UT_CMceSecureDesStream_SetMediaProfileL() |
|
1084 { |
|
1085 /*=============Test case 1 ====================================================*/ |
|
1086 CSdpMediaField* mediaAnswercrytoAVP = CSdpMediaField::DecodeL( KMceTestMeidaCryptoAVP ); |
|
1087 CleanupStack::PushL( mediaAnswercrytoAVP ); |
|
1088 iSecureStream->SetMediaProfile( *mediaAnswercrytoAVP ); |
|
1089 EUNIT_ASSERT( KMceSecurePlainAVP == iSecureStream->Session().Modifier( KMceSecureSession ) ); |
|
1090 CleanupStack::PopAndDestroy(mediaAnswercrytoAVP); |
|
1091 |
|
1092 /*=============Test case 2 ====================================================*/ |
|
1093 CSdpMediaField* mediaAnswerNoCryptoAVP = CSdpMediaField::DecodeL( KMceTestMeidaNoCryptoAVP ); |
|
1094 CleanupStack::PushL( mediaAnswerNoCryptoAVP ); |
|
1095 iSecureStream->SetMediaProfile( *mediaAnswerNoCryptoAVP ); |
|
1096 EUNIT_ASSERT( KMceSecurePlainAVP == iSecureStream->Session().Modifier( KMceSecureSession ) ); |
|
1097 CleanupStack::PopAndDestroy(mediaAnswerNoCryptoAVP); |
|
1098 |
|
1099 /*=============Test case 3 ====================================================*/ |
|
1100 CSdpMediaField* mediaAnswerCryptoSAVP = CSdpMediaField::DecodeL( KMceTestMeidaCryptoSAVPF ); |
|
1101 CleanupStack::PushL( mediaAnswerCryptoSAVP ); |
|
1102 iSecureStream->SetMediaProfile( *mediaAnswerCryptoSAVP ); |
|
1103 EUNIT_ASSERT( KMceSecureNormal == iSecureStream->Session().Modifier( KMceSecureSession ) ); |
|
1104 CleanupStack::PopAndDestroy(mediaAnswerCryptoSAVP); |
|
1105 } |
|
1106 |
|
1107 // TEST TABLE |
|
1108 |
|
1109 EUNIT_BEGIN_TEST_TABLE( |
|
1110 UT_CMceSecureDesStream, |
|
1111 "CMceSecureDesStream", |
|
1112 "UNIT" ) |
|
1113 |
|
1114 EUNIT_TEST( |
|
1115 "NewL - test ", |
|
1116 "CMceSecureDesStream", |
|
1117 "NewL", |
|
1118 "FUNCTIONALITY", |
|
1119 SetupL, UT_CMceSecureDesStream_NewLL, Teardown) |
|
1120 |
|
1121 EUNIT_TEST( |
|
1122 "EncodeSecureSdpL - test ", |
|
1123 "CMceSecureDesStream", |
|
1124 "EncodeSecureSdpL", |
|
1125 "FUNCTIONALITY", |
|
1126 SetupL, UT_CMceSecureDesStream_EncodeSecureSdpLL, Teardown) |
|
1127 |
|
1128 EUNIT_TEST( |
|
1129 "DecodeSecureSdpL - test ", |
|
1130 "CMceSecureDesStream", |
|
1131 "DecodeSecureSdpL", |
|
1132 "FUNCTIONALITY", |
|
1133 SetupL, UT_CMceSecureDesStream_DecodeSecureSdpLL, Teardown) |
|
1134 |
|
1135 EUNIT_TEST( |
|
1136 "DecodeSecureSdpAnswerL - test ", |
|
1137 "CMceSecureDesStream", |
|
1138 "DecodeSecureSdpAnswerL", |
|
1139 "FUNCTIONALITY", |
|
1140 SetupL, UT_CMceSecureDesStream_DecodeSecureSdpAnswerLL, Teardown) |
|
1141 |
|
1142 |
|
1143 EUNIT_TEST( |
|
1144 "RemvoeSecureSdpL - test ", |
|
1145 "CMceSecureDesStream", |
|
1146 "RemvoeSecureSdpL", |
|
1147 "FUNCTIONALITY", |
|
1148 SetupL, UT_CMceSecureDesStream_RemvoeSecureSdpLL, Teardown) |
|
1149 |
|
1150 EUNIT_TEST( |
|
1151 "SetCryptoContext - test ", |
|
1152 "CMceSecureDesStream", |
|
1153 "SetCryptoContext", |
|
1154 "FUNCTIONALITY", |
|
1155 SetupL, UT_CMceSecureDesStream_SetCryptoContextL, Teardown) |
|
1156 |
|
1157 EUNIT_TEST( |
|
1158 "RemoveCryptoContext - test ", |
|
1159 "CMceSecureDesStream", |
|
1160 "RemoveCryptoContext", |
|
1161 "FUNCTIONALITY", |
|
1162 SetupL, UT_CMceSecureDesStream_RemoveCryptoContextL, Teardown) |
|
1163 |
|
1164 |
|
1165 EUNIT_TEST( |
|
1166 "MediaStream - test ", |
|
1167 "CMceSecureDesStream", |
|
1168 "MediaStream", |
|
1169 "FUNCTIONALITY", |
|
1170 SetupL, UT_CMceSecureDesStream_MediaStreamL, Teardown) |
|
1171 |
|
1172 EUNIT_TEST( |
|
1173 "MediaField - test ", |
|
1174 "CMceSecureDesStream", |
|
1175 "MediaField", |
|
1176 "FUNCTIONALITY", |
|
1177 SetupL, UT_CMceSecureDesStream_MediaFieldL, Teardown) |
|
1178 |
|
1179 EUNIT_TEST( |
|
1180 "ValidateOfferByAnswerL - test ", |
|
1181 "CMceSecureDesStream", |
|
1182 "ValidateOfferByAnswer", |
|
1183 "FUNCTIONALITY", |
|
1184 SetupL, UT_CMceSecureDesStream_ValidateOfferByAnswerLL, Teardown) |
|
1185 |
|
1186 EUNIT_TEST( |
|
1187 "ValidateAnswerByOfferL - test ", |
|
1188 "CMceSecureDesStream", |
|
1189 "ValidateAnswerByOffer", |
|
1190 "FUNCTIONALITY", |
|
1191 SetupL, UT_CMceSecureDesStream_ValidateAnswerByOfferLL, Teardown) |
|
1192 |
|
1193 EUNIT_TEST( |
|
1194 "FormMKILL - test ", |
|
1195 "CMceSecureDesStream", |
|
1196 "FormMKILL", |
|
1197 "FUNCTIONALITY", |
|
1198 SetupL, UT_CMceSecureDesStream_FormMKILL, Teardown) |
|
1199 |
|
1200 EUNIT_TEST( |
|
1201 "GenerateCryptoSuiteLine - test ", |
|
1202 "CMceSecureDesStream", |
|
1203 "GenerateCryptoSuiteLine", |
|
1204 "FUNCTIONALITY", |
|
1205 SetupL, UT_CMceSecureDesStream_GenerateCryptoSuiteLineL, Teardown) |
|
1206 |
|
1207 EUNIT_TEST( |
|
1208 "GenerateCryptoLineL - test ", |
|
1209 "CMceSecureDesStream", |
|
1210 "CryptoLineL", |
|
1211 "FUNCTIONALITY", |
|
1212 SetupL, UT_CMceSecureDesStream_GenerateCryptoLineL, Teardown) |
|
1213 |
|
1214 EUNIT_TEST( |
|
1215 "SetMediaProfileL - test ", |
|
1216 "CMceSecureDesStream", |
|
1217 "SetMediaProfileL", |
|
1218 "FUNCTIONALITY", |
|
1219 SetupL, UT_CMceSecureDesStream_SetMediaProfileL, Teardown) |
|
1220 |
|
1221 EUNIT_TEST( |
|
1222 "CopyStreamCryptoL - test ", |
|
1223 "CMceSecureDesStream", |
|
1224 "CopyStreamCryptoL", |
|
1225 "FUNCTIONALITY", |
|
1226 SetupL, UT_CMceSecureDesStream_CopyStreamCryptoL, Teardown) |
|
1227 |
|
1228 EUNIT_END_TEST_TABLE |
|
1229 |
|
1230 // END OF FILE |
|
1231 |