310 } |
310 } |
311 |
311 |
312 void UT_SRTPAuthentication_HMAC_SHA1::Teardown( ) |
312 void UT_SRTPAuthentication_HMAC_SHA1::Teardown( ) |
313 { |
313 { |
314 delete iAuthenticator; |
314 delete iAuthenticator; |
315 |
315 iAuthenticator = NULL; |
|
316 |
316 delete iRFC2202_Test1_Key_160bits; |
317 delete iRFC2202_Test1_Key_160bits; |
317 delete iRFC2202_Test1_Data_16bits; |
318 delete iRFC2202_Test1_Data_16bits; |
318 delete iRFC2202_Test1_Tag_80bits; |
319 delete iRFC2202_Test1_Tag_80bits; |
319 delete iRFC2202_Test1_Tag_32bits; |
320 delete iRFC2202_Test1_Tag_32bits; |
|
321 |
|
322 iRFC2202_Test1_Key_160bits = NULL; |
|
323 iRFC2202_Test1_Data_16bits = NULL; |
|
324 iRFC2202_Test1_Tag_80bits = NULL; |
|
325 iRFC2202_Test1_Tag_32bits = NULL; |
320 |
326 |
321 delete iRFC2202_Test2_Key; |
327 delete iRFC2202_Test2_Key; |
322 delete iRFC2202_Test2_Data_28bits; |
328 delete iRFC2202_Test2_Data_28bits; |
323 delete iRFC2202_Test2_Tag_80bits; |
329 delete iRFC2202_Test2_Tag_80bits; |
324 delete iRFC2202_Test2_Tag_32bits; |
330 delete iRFC2202_Test2_Tag_32bits; |
|
331 |
|
332 iRFC2202_Test2_Key = NULL; |
|
333 iRFC2202_Test2_Data_28bits = NULL; |
|
334 iRFC2202_Test2_Tag_80bits = NULL; |
|
335 iRFC2202_Test2_Tag_32bits = NULL; |
325 |
336 |
326 delete iRFC2202_Test3_Key_160bits; |
337 delete iRFC2202_Test3_Key_160bits; |
327 delete iRFC2202_Test3_Data_400bits; |
338 delete iRFC2202_Test3_Data_400bits; |
328 delete iRFC2202_Test3_Tag_80bits; |
339 delete iRFC2202_Test3_Tag_80bits; |
329 delete iRFC2202_Test3_Tag_32bits; |
340 delete iRFC2202_Test3_Tag_32bits; |
|
341 |
|
342 iRFC2202_Test3_Key_160bits = NULL; |
|
343 iRFC2202_Test3_Data_400bits = NULL; |
|
344 iRFC2202_Test3_Tag_80bits = NULL; |
|
345 iRFC2202_Test3_Tag_32bits = NULL; |
330 |
346 |
331 delete iRFC2202_Test4_Key_200bits; |
347 delete iRFC2202_Test4_Key_200bits; |
332 delete iRFC2202_Test4_Data_400bits; |
348 delete iRFC2202_Test4_Data_400bits; |
333 delete iRFC2202_Test4_Tag_80bits; |
349 delete iRFC2202_Test4_Tag_80bits; |
334 delete iRFC2202_Test4_Tag_32bits; |
350 delete iRFC2202_Test4_Tag_32bits; |
|
351 |
|
352 iRFC2202_Test4_Key_200bits = NULL; |
|
353 iRFC2202_Test4_Data_400bits = NULL; |
|
354 iRFC2202_Test4_Tag_80bits = NULL; |
|
355 iRFC2202_Test4_Tag_32bits = NULL; |
335 |
356 |
336 delete iRFC2202_Test5_Key_160bits; |
357 delete iRFC2202_Test5_Key_160bits; |
337 delete iRFC2202_Test5_Data; |
358 delete iRFC2202_Test5_Data; |
338 delete iRFC2202_Test5_Tag_80bits; |
359 delete iRFC2202_Test5_Tag_80bits; |
339 delete iRFC2202_Test5_Tag_32bits; |
360 delete iRFC2202_Test5_Tag_32bits; |
340 |
361 |
|
362 iRFC2202_Test5_Key_160bits = NULL; |
|
363 iRFC2202_Test5_Data = NULL; |
|
364 iRFC2202_Test5_Tag_80bits = NULL; |
|
365 iRFC2202_Test5_Tag_32bits = NULL; |
|
366 |
341 delete iRFC2202_Test6_Key_640bits; |
367 delete iRFC2202_Test6_Key_640bits; |
342 delete iRFC2202_Test6_Data_54bits; |
368 delete iRFC2202_Test6_Data_54bits; |
343 delete iRFC2202_Test6_Tag_80bits; |
369 delete iRFC2202_Test6_Tag_80bits; |
344 delete iRFC2202_Test6_Tag_32bits; |
370 delete iRFC2202_Test6_Tag_32bits; |
|
371 |
|
372 iRFC2202_Test6_Key_640bits = NULL; |
|
373 iRFC2202_Test6_Data_54bits = NULL; |
|
374 iRFC2202_Test6_Tag_80bits = NULL; |
|
375 iRFC2202_Test6_Tag_32bits = NULL; |
345 |
376 |
346 delete iRFC2202_Test7_Key_640bits; |
377 delete iRFC2202_Test7_Key_640bits; |
347 delete iRFC2202_Test7_Data_73bits; |
378 delete iRFC2202_Test7_Data_73bits; |
348 delete iRFC2202_Test7_Tag_80bits; |
379 delete iRFC2202_Test7_Tag_80bits; |
349 delete iRFC2202_Test7_Tag_32bits; |
380 delete iRFC2202_Test7_Tag_32bits; |
350 delete iTest8_Key_160bits; |
381 delete iTest8_Key_160bits; |
351 delete iTest8_Data_168bits; |
382 delete iTest8_Data_168bits; |
352 delete iTest8_Data2_32bits; |
383 delete iTest8_Data2_32bits; |
353 delete iTest8_Tag_80bits; |
384 delete iTest8_Tag_80bits; |
354 } |
385 |
355 |
386 iRFC2202_Test7_Key_640bits = NULL; |
356 |
387 iRFC2202_Test7_Data_73bits = NULL; |
357 void UT_SRTPAuthentication_HMAC_SHA1::UT_AuthenticateL_RFC2202_Test1_80L( ) |
388 iRFC2202_Test7_Tag_80bits = NULL; |
|
389 iRFC2202_Test7_Tag_32bits = NULL; |
|
390 iTest8_Key_160bits = NULL; |
|
391 iTest8_Data_168bits = NULL; |
|
392 iTest8_Data2_32bits = NULL; |
|
393 iTest8_Tag_80bits = NULL; |
|
394 } |
|
395 |
|
396 |
|
397 void UT_SRTPAuthentication_HMAC_SHA1::UT_AuthenticateL_RFC2202_Test1_EightyL( ) |
358 { |
398 { |
359 HBufC8* result = iAuthenticator->AuthenticateL(80, *iRFC2202_Test1_Key_160bits, |
399 HBufC8* result = iAuthenticator->AuthenticateL(80, *iRFC2202_Test1_Key_160bits, |
360 *iRFC2202_Test1_Data_16bits, |
400 *iRFC2202_Test1_Data_16bits, |
361 KNullDesC8); |
401 KNullDesC8); |
362 |
402 |
667 EUNIT_TEST( |
707 EUNIT_TEST( |
668 "AuthenticateL - 1 80 bits", |
708 "AuthenticateL - 1 80 bits", |
669 "SRTPAuthentication_HMAC_SHA1", |
709 "SRTPAuthentication_HMAC_SHA1", |
670 "AuthenticateL", |
710 "AuthenticateL", |
671 "FUNCTIONALITY", |
711 "FUNCTIONALITY", |
672 SetupL, UT_AuthenticateL_RFC2202_Test1_80L, Teardown) |
712 SetupL, UT_AuthenticateL_RFC2202_Test1_EightyL, Teardown) |
673 |
713 |
674 EUNIT_TEST( |
714 EUNIT_TEST( |
675 "AuthenticateL - 1 32 bits", |
715 "AuthenticateL - 1 32 bits", |
676 "SRTPAuthentication_HMAC_SHA1", |
716 "SRTPAuthentication_HMAC_SHA1", |
677 "AuthenticateL", |
717 "AuthenticateL", |
678 "FUNCTIONALITY", |
718 "FUNCTIONALITY", |
679 SetupL, UT_AuthenticateL_RFC2202_Test1_32L, Teardown) |
719 SetupL, UT_AuthenticateL_RFC2202_Test1_ThirtyTwoL, Teardown) |
680 |
720 |
681 EUNIT_TEST( |
721 EUNIT_TEST( |
682 "AuthenticateL - 2 80 bits", |
722 "AuthenticateL - 2 80 bits", |
683 "SRTPAuthentication_HMAC_SHA1", |
723 "SRTPAuthentication_HMAC_SHA1", |
684 "AuthenticateL", |
724 "AuthenticateL", |
685 "FUNCTIONALITY", |
725 "FUNCTIONALITY", |
686 SetupL, UT_AuthenticateL_RFC2202_Test2_80L, Teardown) |
726 SetupL, UT_AuthenticateL_RFC2202_Test2_EightyL, Teardown) |
687 |
727 |
688 EUNIT_TEST( |
728 EUNIT_TEST( |
689 "AuthenticateL - 2 32 bits", |
729 "AuthenticateL - 2 32 bits", |
690 "SRTPAuthentication_HMAC_SHA1", |
730 "SRTPAuthentication_HMAC_SHA1", |
691 "AuthenticateL", |
731 "AuthenticateL", |
692 "FUNCTIONALITY", |
732 "FUNCTIONALITY", |
693 SetupL, UT_AuthenticateL_RFC2202_Test2_32L, Teardown) |
733 SetupL, UT_AuthenticateL_RFC2202_Test2_ThirtyTwoL, Teardown) |
694 |
734 |
695 EUNIT_TEST( |
735 EUNIT_TEST( |
696 "AuthenticateL - 3 80 bits", |
736 "AuthenticateL - 3 80 bits", |
697 "SRTPAuthentication_HMAC_SHA1", |
737 "SRTPAuthentication_HMAC_SHA1", |
698 "AuthenticateL", |
738 "AuthenticateL", |
699 "FUNCTIONALITY", |
739 "FUNCTIONALITY", |
700 SetupL, UT_AuthenticateL_RFC2202_Test3_80L, Teardown) |
740 SetupL, UT_AuthenticateL_RFC2202_Test3_EightyL, Teardown) |
701 |
741 |
702 EUNIT_TEST( |
742 EUNIT_TEST( |
703 "AuthenticateL - 3 32 bits", |
743 "AuthenticateL - 3 32 bits", |
704 "SRTPAuthentication_HMAC_SHA1", |
744 "SRTPAuthentication_HMAC_SHA1", |
705 "AuthenticateL", |
745 "AuthenticateL", |
706 "FUNCTIONALITY", |
746 "FUNCTIONALITY", |
707 SetupL, UT_AuthenticateL_RFC2202_Test3_32L, Teardown) |
747 SetupL, UT_AuthenticateL_RFC2202_Test3_ThirtyTwoL, Teardown) |
708 |
748 |
709 EUNIT_TEST( |
749 EUNIT_TEST( |
710 "AuthenticateL - 4 80 bits", |
750 "AuthenticateL - 4 80 bits", |
711 "SRTPAuthentication_HMAC_SHA1", |
751 "SRTPAuthentication_HMAC_SHA1", |
712 "AuthenticateL", |
752 "AuthenticateL", |
713 "FUNCTIONALITY", |
753 "FUNCTIONALITY", |
714 SetupL, UT_AuthenticateL_RFC2202_Test4_80L, Teardown) |
754 SetupL, UT_AuthenticateL_RFC2202_Test4_EightyL, Teardown) |
715 |
755 |
716 EUNIT_TEST( |
756 EUNIT_TEST( |
717 "AuthenticateL - 4 32 bits", |
757 "AuthenticateL - 4 32 bits", |
718 "SRTPAuthentication_HMAC_SHA1", |
758 "SRTPAuthentication_HMAC_SHA1", |
719 "AuthenticateL", |
759 "AuthenticateL", |
720 "FUNCTIONALITY", |
760 "FUNCTIONALITY", |
721 SetupL, UT_AuthenticateL_RFC2202_Test4_32L, Teardown) |
761 SetupL, UT_AuthenticateL_RFC2202_Test4_ThirtyTwoL, Teardown) |
722 |
762 |
723 EUNIT_TEST( |
763 EUNIT_TEST( |
724 "AuthenticateL - 5 80 bits", |
764 "AuthenticateL - 5 80 bits", |
725 "SRTPAuthentication_HMAC_SHA1", |
765 "SRTPAuthentication_HMAC_SHA1", |
726 "AuthenticateL", |
766 "AuthenticateL", |
727 "FUNCTIONALITY", |
767 "FUNCTIONALITY", |
728 SetupL, UT_AuthenticateL_RFC2202_Test5_80L, Teardown) |
768 SetupL, UT_AuthenticateL_RFC2202_Test5_EightyL, Teardown) |
729 |
769 |
730 EUNIT_TEST( |
770 EUNIT_TEST( |
731 "AuthenticateL - 5 32 bits", |
771 "AuthenticateL - 5 32 bits", |
732 "SRTPAuthentication_HMAC_SHA1", |
772 "SRTPAuthentication_HMAC_SHA1", |
733 "AuthenticateL", |
773 "AuthenticateL", |
734 "FUNCTIONALITY", |
774 "FUNCTIONALITY", |
735 SetupL, UT_AuthenticateL_RFC2202_Test5_32L, Teardown) |
775 SetupL, UT_AuthenticateL_RFC2202_Test5_ThirtyTwoL, Teardown) |
736 |
776 |
737 EUNIT_TEST( |
777 EUNIT_TEST( |
738 "AuthenticateL - 6 80 bits", |
778 "AuthenticateL - 6 80 bits", |
739 "SRTPAuthentication_HMAC_SHA1", |
779 "SRTPAuthentication_HMAC_SHA1", |
740 "AuthenticateL", |
780 "AuthenticateL", |
741 "FUNCTIONALITY", |
781 "FUNCTIONALITY", |
742 SetupL, UT_AuthenticateL_RFC2202_Test6_80L, Teardown) |
782 SetupL, UT_AuthenticateL_RFC2202_Test6_EightyL, Teardown) |
743 |
783 |
744 EUNIT_TEST( |
784 EUNIT_TEST( |
745 "AuthenticateL - 6 32 bits", |
785 "AuthenticateL - 6 32 bits", |
746 "SRTPAuthentication_HMAC_SHA1", |
786 "SRTPAuthentication_HMAC_SHA1", |
747 "AuthenticateL", |
787 "AuthenticateL", |
748 "FUNCTIONALITY", |
788 "FUNCTIONALITY", |
749 SetupL, UT_AuthenticateL_RFC2202_Test6_32L, Teardown) |
789 SetupL, UT_AuthenticateL_RFC2202_Test6_ThirtyTwoL, Teardown) |
750 |
790 |
751 EUNIT_TEST( |
791 EUNIT_TEST( |
752 "AuthenticateL - 7 80 bits", |
792 "AuthenticateL - 7 80 bits", |
753 "SRTPAuthentication_HMAC_SHA1", |
793 "SRTPAuthentication_HMAC_SHA1", |
754 "AuthenticateL", |
794 "AuthenticateL", |
755 "FUNCTIONALITY", |
795 "FUNCTIONALITY", |
756 SetupL, UT_AuthenticateL_RFC2202_Test7_80L, Teardown) |
796 SetupL, UT_AuthenticateL_RFC2202_Test7_EightyL, Teardown) |
757 |
797 |
758 EUNIT_TEST( |
798 EUNIT_TEST( |
759 "AuthenticateL - 7 32 bits", |
799 "AuthenticateL - 7 32 bits", |
760 "SRTPAuthentication_HMAC_SHA1", |
800 "SRTPAuthentication_HMAC_SHA1", |
761 "AuthenticateL", |
801 "AuthenticateL", |
762 "FUNCTIONALITY", |
802 "FUNCTIONALITY", |
763 SetupL, UT_AuthenticateL_RFC2202_Test7_32L, Teardown) |
803 SetupL, UT_AuthenticateL_RFC2202_Test7_ThirtyTwoL, Teardown) |
764 EUNIT_TEST( |
804 EUNIT_TEST( |
765 "AuthenticateL - RealPacket", |
805 "AuthenticateL - RealPacket", |
766 "SRTPAuthentication_HMAC_SHA1", |
806 "SRTPAuthentication_HMAC_SHA1", |
767 "AuthenticateL with Real Packet", |
807 "AuthenticateL with Real Packet", |
768 "FUNCTIONALITY", |
808 "FUNCTIONALITY", |
769 SetupL, UT_AuthenticateL_Test8_32L, Teardown) |
809 SetupL, UT_AuthenticateL_Test8_ThirtyTwoL, Teardown) |
770 |
810 |
771 EUNIT_TEST( |
811 EUNIT_TEST( |
772 "AuthenticateL - KeyChanged", |
812 "AuthenticateL - KeyChanged", |
773 "SRTPAuthentication_HMAC_SHA1", |
813 "SRTPAuthentication_HMAC_SHA1", |
774 "AuthenticateL", |
814 "AuthenticateL", |