313 } |
313 } |
314 |
314 |
315 void UT_CSrtpAuthentication_RCC::Teardown( ) |
315 void UT_CSrtpAuthentication_RCC::Teardown( ) |
316 { |
316 { |
317 delete iAuthenticator; |
317 delete iAuthenticator; |
|
318 iAuthenticator = NULL; |
318 |
319 |
319 delete iRFC2202_Test1_Key_160bits; |
320 delete iRFC2202_Test1_Key_160bits; |
320 delete iRFC2202_Test1_Data_16bits; |
321 delete iRFC2202_Test1_Data_16bits; |
321 delete iRFC2202_Test1_Tag_80bits; |
322 delete iRFC2202_Test1_Tag_80bits; |
322 delete iRFC2202_Test1_Tag_32bits; |
323 delete iRFC2202_Test1_Tag_32bits; |
|
324 |
|
325 iRFC2202_Test1_Key_160bits = NULL; |
|
326 iRFC2202_Test1_Data_16bits = NULL; |
|
327 iRFC2202_Test1_Tag_80bits = NULL; |
|
328 iRFC2202_Test1_Tag_32bits = NULL; |
323 |
329 |
324 delete iRFC2202_Test2_Key; |
330 delete iRFC2202_Test2_Key; |
325 delete iRFC2202_Test2_Data_28bits; |
331 delete iRFC2202_Test2_Data_28bits; |
326 delete iRFC2202_Test2_Tag_80bits; |
332 delete iRFC2202_Test2_Tag_80bits; |
327 delete iRFC2202_Test2_Tag_32bits; |
333 delete iRFC2202_Test2_Tag_32bits; |
|
334 |
|
335 iRFC2202_Test2_Key = NULL; |
|
336 iRFC2202_Test2_Data_28bits = NULL; |
|
337 iRFC2202_Test2_Tag_80bits = NULL; |
|
338 iRFC2202_Test2_Tag_32bits = NULL; |
328 |
339 |
329 delete iRFC2202_Test3_Key_160bits; |
340 delete iRFC2202_Test3_Key_160bits; |
330 delete iRFC2202_Test3_Data_400bits; |
341 delete iRFC2202_Test3_Data_400bits; |
331 delete iRFC2202_Test3_Tag_80bits; |
342 delete iRFC2202_Test3_Tag_80bits; |
332 delete iRFC2202_Test3_Tag_32bits; |
343 delete iRFC2202_Test3_Tag_32bits; |
|
344 |
|
345 iRFC2202_Test3_Key_160bits = NULL; |
|
346 iRFC2202_Test3_Data_400bits = NULL; |
|
347 iRFC2202_Test3_Tag_80bits = NULL; |
|
348 iRFC2202_Test3_Tag_32bits = NULL; |
333 |
349 |
334 delete iRFC2202_Test4_Key_200bits; |
350 delete iRFC2202_Test4_Key_200bits; |
335 delete iRFC2202_Test4_Data_400bits; |
351 delete iRFC2202_Test4_Data_400bits; |
336 delete iRFC2202_Test4_Tag_80bits; |
352 delete iRFC2202_Test4_Tag_80bits; |
337 delete iRFC2202_Test4_Tag_32bits; |
353 delete iRFC2202_Test4_Tag_32bits; |
|
354 |
|
355 iRFC2202_Test4_Key_200bits = NULL; |
|
356 iRFC2202_Test4_Data_400bits = NULL; |
|
357 iRFC2202_Test4_Tag_80bits = NULL; |
|
358 iRFC2202_Test4_Tag_32bits = NULL; |
338 |
359 |
339 delete iRFC2202_Test5_Key_160bits; |
360 delete iRFC2202_Test5_Key_160bits; |
340 delete iRFC2202_Test5_Data; |
361 delete iRFC2202_Test5_Data; |
341 delete iRFC2202_Test5_Tag_80bits; |
362 delete iRFC2202_Test5_Tag_80bits; |
342 delete iRFC2202_Test5_Tag_32bits; |
363 delete iRFC2202_Test5_Tag_32bits; |
|
364 |
|
365 iRFC2202_Test5_Key_160bits = NULL; |
|
366 iRFC2202_Test5_Data = NULL; |
|
367 iRFC2202_Test5_Tag_80bits = NULL; |
|
368 iRFC2202_Test5_Tag_32bits = NULL; |
343 |
369 |
344 delete iRFC2202_Test6_Key_640bits; |
370 delete iRFC2202_Test6_Key_640bits; |
345 delete iRFC2202_Test6_Data_54bits; |
371 delete iRFC2202_Test6_Data_54bits; |
346 delete iRFC2202_Test6_Tag_80bits; |
372 delete iRFC2202_Test6_Tag_80bits; |
347 delete iRFC2202_Test6_Tag_32bits; |
373 delete iRFC2202_Test6_Tag_32bits; |
|
374 |
|
375 iRFC2202_Test6_Key_640bits = NULL; |
|
376 iRFC2202_Test6_Data_54bits = NULL; |
|
377 iRFC2202_Test6_Tag_80bits = NULL; |
|
378 iRFC2202_Test6_Tag_32bits = NULL; |
348 |
379 |
349 delete iRFC2202_Test7_Key_640bits; |
380 delete iRFC2202_Test7_Key_640bits; |
350 delete iRFC2202_Test7_Data_73bits; |
381 delete iRFC2202_Test7_Data_73bits; |
351 delete iRFC2202_Test7_Tag_80bits; |
382 delete iRFC2202_Test7_Tag_80bits; |
352 delete iRFC2202_Test7_Tag_32bits; |
383 delete iRFC2202_Test7_Tag_32bits; |
|
384 |
|
385 iRFC2202_Test7_Key_640bits = NULL; |
|
386 iRFC2202_Test7_Data_73bits = NULL; |
|
387 iRFC2202_Test7_Tag_80bits = NULL; |
|
388 iRFC2202_Test7_Tag_32bits = NULL; |
|
389 |
353 delete iTest8_Key_160bits; |
390 delete iTest8_Key_160bits; |
354 delete iTest8_Data_168bits; |
391 delete iTest8_Data_168bits; |
355 delete iTest8_Data2_32bits; |
392 delete iTest8_Data2_32bits; |
356 delete iTest8_Tag_80bits; |
393 delete iTest8_Tag_80bits; |
357 } |
394 |
358 |
395 iTest8_Key_160bits = NULL; |
359 |
396 iTest8_Data_168bits = NULL; |
360 void UT_CSrtpAuthentication_RCC::UT_AuthenticateL_RFC2202_Test1_80L( ) |
397 iTest8_Data2_32bits = NULL; |
|
398 iTest8_Tag_80bits = NULL; |
|
399 } |
|
400 |
|
401 |
|
402 void UT_CSrtpAuthentication_RCC::UT_AuthenticateL_RFC2202_Test1_EightyL( ) |
361 { |
403 { |
362 HBufC8* result = iAuthenticator->AuthenticateL(80, *iRFC2202_Test1_Key_160bits, |
404 HBufC8* result = iAuthenticator->AuthenticateL(80, *iRFC2202_Test1_Key_160bits, |
363 *iRFC2202_Test1_Data_16bits, |
405 *iRFC2202_Test1_Data_16bits, |
364 KNullDesC8); |
406 KNullDesC8); |
365 |
407 |
628 EUNIT_TEST( |
670 EUNIT_TEST( |
629 "AuthenticateL - 1 80 bits", |
671 "AuthenticateL - 1 80 bits", |
630 "CSrtpAuthentication_RCC", |
672 "CSrtpAuthentication_RCC", |
631 "AuthenticateL", |
673 "AuthenticateL", |
632 "FUNCTIONALITY", |
674 "FUNCTIONALITY", |
633 SetupL, UT_AuthenticateL_RFC2202_Test1_80L, Teardown) |
675 SetupL, UT_AuthenticateL_RFC2202_Test1_EightyL, Teardown) |
634 |
676 |
635 EUNIT_TEST( |
677 EUNIT_TEST( |
636 "AuthenticateL - 1 32 bits", |
678 "AuthenticateL - 1 32 bits", |
637 "CSrtpAuthentication_RCC", |
679 "CSrtpAuthentication_RCC", |
638 "AuthenticateL", |
680 "AuthenticateL", |
639 "FUNCTIONALITY", |
681 "FUNCTIONALITY", |
640 SetupL, UT_AuthenticateL_RFC2202_Test1_32L, Teardown) |
682 SetupL, UT_AuthenticateL_RFC2202_Test1_ThirtyTwoL, Teardown) |
641 |
683 |
642 EUNIT_TEST( |
684 EUNIT_TEST( |
643 "AuthenticateL - 2 80 bits", |
685 "AuthenticateL - 2 80 bits", |
644 "CSrtpAuthentication_RCC", |
686 "CSrtpAuthentication_RCC", |
645 "AuthenticateL", |
687 "AuthenticateL", |
646 "FUNCTIONALITY", |
688 "FUNCTIONALITY", |
647 SetupL, UT_AuthenticateL_RFC2202_Test2_80L, Teardown) |
689 SetupL, UT_AuthenticateL_RFC2202_Test2_EightyL, Teardown) |
648 |
690 |
649 EUNIT_TEST( |
691 EUNIT_TEST( |
650 "AuthenticateL - 2 32 bits", |
692 "AuthenticateL - 2 32 bits", |
651 "CSrtpAuthentication_RCC", |
693 "CSrtpAuthentication_RCC", |
652 "AuthenticateL", |
694 "AuthenticateL", |
653 "FUNCTIONALITY", |
695 "FUNCTIONALITY", |
654 SetupL, UT_AuthenticateL_RFC2202_Test2_32L, Teardown) |
696 SetupL, UT_AuthenticateL_RFC2202_Test2_ThirtyTwoL, Teardown) |
655 |
697 |
656 EUNIT_TEST( |
698 EUNIT_TEST( |
657 "AuthenticateL - 3 80 bits", |
699 "AuthenticateL - 3 80 bits", |
658 "CSrtpAuthentication_RCC", |
700 "CSrtpAuthentication_RCC", |
659 "AuthenticateL", |
701 "AuthenticateL", |
660 "FUNCTIONALITY", |
702 "FUNCTIONALITY", |
661 SetupL, UT_AuthenticateL_RFC2202_Test3_80L, Teardown) |
703 SetupL, UT_AuthenticateL_RFC2202_Test3_EightyL, Teardown) |
662 |
704 |
663 EUNIT_TEST( |
705 EUNIT_TEST( |
664 "AuthenticateL - 3 32 bits", |
706 "AuthenticateL - 3 32 bits", |
665 "CSrtpAuthentication_RCC", |
707 "CSrtpAuthentication_RCC", |
666 "AuthenticateL", |
708 "AuthenticateL", |
667 "FUNCTIONALITY", |
709 "FUNCTIONALITY", |
668 SetupL, UT_AuthenticateL_RFC2202_Test3_32L, Teardown) |
710 SetupL, UT_AuthenticateL_RFC2202_Test3_ThirtyTwoL, Teardown) |
669 |
711 |
670 EUNIT_TEST( |
712 EUNIT_TEST( |
671 "AuthenticateL - 4 80 bits", |
713 "AuthenticateL - 4 80 bits", |
672 "CSrtpAuthentication_RCC", |
714 "CSrtpAuthentication_RCC", |
673 "AuthenticateL", |
715 "AuthenticateL", |
674 "FUNCTIONALITY", |
716 "FUNCTIONALITY", |
675 SetupL, UT_AuthenticateL_RFC2202_Test4_80L, Teardown) |
717 SetupL, UT_AuthenticateL_RFC2202_Test4_EightyL, Teardown) |
676 |
718 |
677 EUNIT_TEST( |
719 EUNIT_TEST( |
678 "AuthenticateL - 4 32 bits", |
720 "AuthenticateL - 4 32 bits", |
679 "CSrtpAuthentication_RCC", |
721 "CSrtpAuthentication_RCC", |
680 "AuthenticateL", |
722 "AuthenticateL", |
681 "FUNCTIONALITY", |
723 "FUNCTIONALITY", |
682 SetupL, UT_AuthenticateL_RFC2202_Test4_32L, Teardown) |
724 SetupL, UT_AuthenticateL_RFC2202_Test4_ThirtyTwoL, Teardown) |
683 |
725 |
684 EUNIT_TEST( |
726 EUNIT_TEST( |
685 "AuthenticateL - 5 80 bits", |
727 "AuthenticateL - 5 80 bits", |
686 "CSrtpAuthentication_RCC", |
728 "CSrtpAuthentication_RCC", |
687 "AuthenticateL", |
729 "AuthenticateL", |
688 "FUNCTIONALITY", |
730 "FUNCTIONALITY", |
689 SetupL, UT_AuthenticateL_RFC2202_Test5_80L, Teardown) |
731 SetupL, UT_AuthenticateL_RFC2202_Test5_EightyL, Teardown) |
690 |
732 |
691 EUNIT_TEST( |
733 EUNIT_TEST( |
692 "AuthenticateL - 5 32 bits", |
734 "AuthenticateL - 5 32 bits", |
693 "CSrtpAuthentication_RCC", |
735 "CSrtpAuthentication_RCC", |
694 "AuthenticateL", |
736 "AuthenticateL", |
695 "FUNCTIONALITY", |
737 "FUNCTIONALITY", |
696 SetupL, UT_AuthenticateL_RFC2202_Test5_32L, Teardown) |
738 SetupL, UT_AuthenticateL_RFC2202_Test5_ThirtyTwoL, Teardown) |
697 |
739 |
698 EUNIT_TEST( |
740 EUNIT_TEST( |
699 "AuthenticateL - 6 80 bits", |
741 "AuthenticateL - 6 80 bits", |
700 "CSrtpAuthentication_RCC", |
742 "CSrtpAuthentication_RCC", |
701 "AuthenticateL", |
743 "AuthenticateL", |
702 "FUNCTIONALITY", |
744 "FUNCTIONALITY", |
703 SetupL, UT_AuthenticateL_RFC2202_Test6_80L, Teardown) |
745 SetupL, UT_AuthenticateL_RFC2202_Test6_EightyL, Teardown) |
704 |
746 |
705 EUNIT_TEST( |
747 EUNIT_TEST( |
706 "AuthenticateL - 6 32 bits", |
748 "AuthenticateL - 6 32 bits", |
707 "CSrtpAuthentication_RCC", |
749 "CSrtpAuthentication_RCC", |
708 "AuthenticateL", |
750 "AuthenticateL", |
709 "FUNCTIONALITY", |
751 "FUNCTIONALITY", |
710 SetupL, UT_AuthenticateL_RFC2202_Test6_32L, Teardown) |
752 SetupL, UT_AuthenticateL_RFC2202_Test6_ThirtyTwoL, Teardown) |
711 |
753 |
712 EUNIT_TEST( |
754 EUNIT_TEST( |
713 "AuthenticateL - 7 80 bits", |
755 "AuthenticateL - 7 80 bits", |
714 "CSrtpAuthentication_RCC", |
756 "CSrtpAuthentication_RCC", |
715 "AuthenticateL", |
757 "AuthenticateL", |
716 "FUNCTIONALITY", |
758 "FUNCTIONALITY", |
717 SetupL, UT_AuthenticateL_RFC2202_Test7_80L, Teardown) |
759 SetupL, UT_AuthenticateL_RFC2202_Test7_EightyL, Teardown) |
718 |
760 |
719 EUNIT_TEST( |
761 EUNIT_TEST( |
720 "AuthenticateL - 7 32 bits", |
762 "AuthenticateL - 7 32 bits", |
721 "CSrtpAuthentication_RCC", |
763 "CSrtpAuthentication_RCC", |
722 "AuthenticateL", |
764 "AuthenticateL", |
723 "FUNCTIONALITY", |
765 "FUNCTIONALITY", |
724 SetupL, UT_AuthenticateL_RFC2202_Test7_32L, Teardown) |
766 SetupL, UT_AuthenticateL_RFC2202_Test7_ThirtyTwoL, Teardown) |
725 EUNIT_TEST( |
767 EUNIT_TEST( |
726 "AuthenticateL - RealPacket", |
768 "AuthenticateL - RealPacket", |
727 "CSrtpAuthentication_RCC", |
769 "CSrtpAuthentication_RCC", |
728 "AuthenticateL with Real Packet", |
770 "AuthenticateL with Real Packet", |
729 "FUNCTIONALITY", |
771 "FUNCTIONALITY", |
730 SetupL, UT_AuthenticateL_Test8_32L, Teardown) |
772 SetupL, UT_AuthenticateL_Test8_ThirtyTwoL, Teardown) |
731 |
773 |
732 EUNIT_TEST( |
774 EUNIT_TEST( |
733 "AuthenticateL - KeyChanged", |
775 "AuthenticateL - KeyChanged", |
734 "CSrtpAuthentication_RCC", |
776 "CSrtpAuthentication_RCC", |
735 "AuthenticateL", |
777 "AuthenticateL", |