44 #include <hash.h> |
44 #include <hash.h> |
45 #include <x509certext.h> |
45 #include <x509certext.h> |
46 #include <TrustedSitesStore.h> |
46 #include <TrustedSitesStore.h> |
47 #include <mctwritablecertstore.h> |
47 #include <mctwritablecertstore.h> |
48 |
48 |
|
49 #include "SecQueryUi.h" // needed for password dialog |
|
50 |
|
51 #include <hbdevicemessageboxsymbian.h> // needed for Note dialogs |
|
52 #include <hbdevicenotificationdialogsymbian.h> |
|
53 |
49 // LOCAL CONSTANTS AND MACROS |
54 // LOCAL CONSTANTS AND MACROS |
50 const TInt KCertArrayGranularity = 3; |
55 const TInt KCertArrayGranularity = 3; |
51 const TInt KMaxLengthTextDetailsBody = 5000; |
56 const TInt KMaxLengthTextDetailsBody = 5000; |
52 // CertLabel, Issuer, Owner max visible length |
57 // CertLabel, Issuer, Owner max visible length |
53 const TInt KMaxLengthTextCertLabelVisible = 200; |
58 const TInt KMaxLengthTextCertLabelVisible = 200; |
560 void CCTSecurityDialogsAO::DoHandlePinOperationL() |
565 void CCTSecurityDialogsAO::DoHandlePinOperationL() |
561 { |
566 { |
562 if ( iRetry ) // Is this new try? |
567 if ( iRetry ) // Is this new try? |
563 { |
568 { |
564 // Previous attempt was failed |
569 // Previous attempt was failed |
|
570 // incorrect pin code |
565 DoHandleMessageL( EErrorPinCodeIncorrect, KNullDesC, KNullDesC, 0, 0 ); |
571 DoHandleMessageL( EErrorPinCodeIncorrect, KNullDesC, KNullDesC, 0, 0 ); |
566 } |
572 } |
567 // Ask the PIN code or PUK code |
573 // Ask the PIN code or PUK code |
568 if ( iPIN.iPINLabel == KKeyStoreEnterPwLabel ) |
574 if ( iPIN.iPINLabel == KKeyStoreEnterPwLabel ) |
569 { |
575 { |
570 HBufC* header = StringLoader::LoadLC( |
576 HBufC* header = StringLoader::LoadLC( |
571 R_QTN_CM_HEADING_PHONE_KEYSTORE, CEikonEnv::Static() ); |
577 R_QTN_CM_HEADING_PHONE_KEYSTORE, CEikonEnv::Static() ); |
572 iPIN.iMinLength = KMaxKeystorePwLength; |
578 iPIN.iMinLength = KMaxKeystorePwLength; |
573 DoHandleMessageL( EEnterKeyStorePw, KNullDesC, *header, |
579 DoHandleMessageL( EEnterKeyStorePw, KNullDesC, *header, |
574 iPIN.iMinLength, iPIN.iMaxLength ); |
580 iPIN.iMinLength, iPIN.iMaxLength ); |
575 iMultiLineDlgType = EEnterNewKeyStorePw; |
581 iMultiLineDlgType = EEnterNewKeyStorePw; |
576 CleanupStack::PopAndDestroy( header ); |
582 CleanupStack::PopAndDestroy( header ); |
|
583 RunL(); |
|
584 |
577 } |
585 } |
578 else if ( iPIN.iPINLabel == KKeyStoreImportKeyLabel ) |
586 else if ( iPIN.iPINLabel == KKeyStoreImportKeyLabel ) |
579 { |
587 { |
580 iPIN.iMinLength = KMaxKeystorePwLength; |
588 iPIN.iMinLength = KMaxKeystorePwLength; |
581 DoHandleMessageL( EImportKeyPw, KNullDesC, KNullDesC, |
589 DoHandleMessageL( EImportKeyPw, KNullDesC, KNullDesC, |
588 iNextStep = EVerifyPINs; |
596 iNextStep = EVerifyPINs; |
589 } |
597 } |
590 else if ( iPIN.iPINLabel == KKeyStoreCreatePwLabel ) |
598 else if ( iPIN.iPINLabel == KKeyStoreCreatePwLabel ) |
591 { |
599 { |
592 iPIN.iMinLength = KMaxKeystorePwLength; |
600 iPIN.iMinLength = KMaxKeystorePwLength; |
593 DoHandleMessageL( EInfoPwCreating, KNullDesC, KNullDesC, 0, 0 ); |
601 ShowInformationNoteL(R_QTN_CM_CREATING_KEYSTORE); |
594 DoHandleMultilinePinQueryL( EEnterNewKeyStorePw ); |
602 DoHandleMultilinePinQueryL( EEnterNewKeyStorePw ); |
595 iNextStep = EVerifyPINs; |
603 iNextStep = EVerifyPINs; |
596 } |
604 } |
597 else if ( iPIN.iTokenLabel == KPKCS12TokenLabel ) |
605 else if ( iPIN.iTokenLabel == KPKCS12TokenLabel ) |
598 { |
606 { |
622 HBufC* dlgText2 = NULL; |
630 HBufC* dlgText2 = NULL; |
623 CCTPinPinQueryDialog* dlg = NULL; |
631 CCTPinPinQueryDialog* dlg = NULL; |
624 TDialogType dlgType = ( TDialogType )aDlgType; |
632 TDialogType dlgType = ( TDialogType )aDlgType; |
625 if ( EEnterNewKeyStorePw == dlgType ) |
633 if ( EEnterNewKeyStorePw == dlgType ) |
626 { |
634 { |
627 dlgText1 = iNotifier->LoadResourceStringLC( dlgType, KNullDesC ); |
635 /* |
|
636 dlgText1 = iNotifier->LoadResourceStringLC( dlgType, KNullDesC ); |
628 dlgText2 = iNotifier->LoadResourceStringLC( EVerifyKeyStorePw, KNullDesC ); |
637 dlgText2 = iNotifier->LoadResourceStringLC( EVerifyKeyStorePw, KNullDesC ); |
629 dlg = CCTPinPinQueryDialog::NewL( *dlgText1, *dlgText2, iPINValue2, |
638 dlg = CCTPinPinQueryDialog::NewL( *dlgText1, *dlgText2, iPINValue2, |
630 iPINValueVerify, iPIN.iMinLength, iPIN.iMaxLength, iRetValue ); |
639 iPINValueVerify, iPIN.iMinLength, iPIN.iMaxLength, iRetValue ); |
631 dlg->RunDlgLD( iStatus, R_WIM_PWPW_QUERY_DIALOG ); |
640 dlg->RunDlgLD( iStatus, R_WIM_PWPW_QUERY_DIALOG ); |
632 CleanupStack::PopAndDestroy( 2, dlgText1 ); // dlgText1, dlgText2 |
641 CleanupStack::PopAndDestroy( 2, dlgText1 ); // dlgText1, dlgText2 |
|
642 */ |
|
643 dlgText1 = StringLoader::LoadLC( R_QTN_SN_NEW_PHONE_KEYSTORE ); |
|
644 dlgText2 = StringLoader::LoadLC( R_QTN_WIM_VERIFY_PIN ); |
|
645 HBufC* message = HBufC::NewLC( KMaxLengthTextCertLabelVisible ); |
|
646 message->Des().Append(dlgText1->Des()); |
|
647 message->Des().Append(_L("|")); |
|
648 message->Des().Append(dlgText2->Des()); |
|
649 CSecQueryUi* SecQueryUi = CSecQueryUi::NewL(); |
|
650 TInt queryAccepted = SecQueryUi->SecQueryDialog(message->Des(), iPINValueVerify, |
|
651 iPIN.iMinLength,iPIN.iMaxLength, |
|
652 ESecUiAlphaSupported | |
|
653 ESecUiCancelSupported | |
|
654 ESecUiSecretSupported | |
|
655 ESecUiEmergencyNotSupported); |
|
656 iRetValue=(queryAccepted==KErrNone); |
|
657 if(iRetValue) |
|
658 iPINValue2.Copy(iPINValueVerify); // dialog already does not OK with different pin codes |
|
659 delete SecQueryUi; |
|
660 SecQueryUi=NULL; |
|
661 CleanupStack::PopAndDestroy( message ); |
|
662 CleanupStack::PopAndDestroy( dlgText2 ); |
|
663 CleanupStack::PopAndDestroy( dlgText1 ); |
|
664 RunL(); // had to call it this way |
633 } |
665 } |
634 else if ( EExportKeyPw == dlgType ) |
666 else if ( EExportKeyPw == dlgType ) |
635 { |
667 { |
636 dlgText1 = iNotifier->LoadResourceStringLC( dlgType, KNullDesC ); |
668 dlgText1 = iNotifier->LoadResourceStringLC( dlgType, KNullDesC ); |
637 dlgText2 = iNotifier->LoadResourceStringLC( EVerifyKeyStorePw, KNullDesC ); |
669 dlgText2 = iNotifier->LoadResourceStringLC( EVerifyKeyStorePw, KNullDesC ); |
756 { |
788 { |
757 User::Panic(_L("CSecDlgNotifier"), 0); |
789 User::Panic(_L("CSecDlgNotifier"), 0); |
758 } |
790 } |
759 } |
791 } |
760 iPinQueryDialogDeleted = EFalse; |
792 iPinQueryDialogDeleted = EFalse; |
761 CCTPinQueryDialog::RunDlgLD( iStatus, |
793 if(aDlgType!=EEnterKeyStorePw) { |
762 *dlgText, |
794 CCTPinQueryDialog::RunDlgLD( iStatus, |
763 *pinValue, |
795 *dlgText, |
764 aMinLength, |
796 *pinValue, |
765 aMaxLength, |
797 aMinLength, |
766 iRetValue, |
798 aMaxLength, |
767 resource, |
799 iRetValue, |
768 iPinQueryDialog, |
800 resource, |
769 iPinQueryDialogDeleted ); |
801 iPinQueryDialog, |
|
802 iPinQueryDialogDeleted ); |
|
803 break; |
|
804 } |
|
805 else |
|
806 { |
|
807 iPIN.iMinLength = KMaxKeystorePwLength; |
|
808 CSecQueryUi* SecQueryUi = CSecQueryUi::NewL(); |
|
809 HBufC* header =StringLoader::LoadLC( R_QTN_SN_ENTER_PHONE_KEYSTORE); |
|
810 TInt queryAccepted = SecQueryUi->SecQueryDialog(header->Des(), *pinValue, |
|
811 aMinLength,aMaxLength, |
|
812 ESecUiAlphaSupported | |
|
813 ESecUiCancelSupported | |
|
814 ESecUiSecretSupported | |
|
815 ESecUiEmergencyNotSupported); |
|
816 delete SecQueryUi; |
|
817 SecQueryUi=NULL; |
|
818 iRetValue=(queryAccepted==KErrNone); |
|
819 CleanupStack::PopAndDestroy( header ); |
770 break; |
820 break; |
|
821 } |
771 } |
822 } |
772 default: |
823 default: |
773 { |
824 { |
774 break; |
825 break; |
775 } |
826 } |
776 |
827 |
777 } |
828 } |
778 |
829 if ( dlg && aDlgType!=EEnterKeyStorePw) |
779 if ( dlg ) |
830 { |
780 { |
831 |
781 dlg->ExecuteLD( *dlgText ); |
832 dlg->ExecuteLD( *dlgText ); |
782 dlg = NULL; |
833 dlg = NULL; |
783 } |
834 } |
784 |
835 |
785 CleanupStack::PopAndDestroy( dlgText ); // dlgText |
836 CleanupStack::PopAndDestroy( dlgText ); // dlgText |
786 } |
837 } |
787 |
838 |
788 // ----------------------------------------------------------------------------- |
839 // ----------------------------------------------------------------------------- |