vpnengine/ikev1lib/src/ikev1crack.cpp
branchRCL_3
changeset 46 29c8f9bc68e1
parent 41 e06095241a65
child 49 5960d2d03390
equal deleted inserted replaced
44:735de8341ce4 46:29c8f9bc68e1
   190  *  and send message it to gateway.
   190  *  and send message it to gateway.
   191  *  
   191  *  
   192  *-------------------------------------------------------------------------*/
   192  *-------------------------------------------------------------------------*/
   193     if ( iState & WAITING_USER_RSP ) 
   193     if ( iState & WAITING_USER_RSP ) 
   194     {    
   194     {    
   195        iState &= ~(WAITING_USER_RSP + SECURID_NEXT_PIN_MODE);
   195        iState &= ~(WAITING_USER_RSP);
   196        delete iDialog;  /* delete dialog object */
   196        delete iDialog;  /* delete dialog object */
   197        iDialog = NULL;
   197        iDialog = NULL;
   198        
   198        
   199        TUint16 attr1 = 0;
   199        TUint16 attr1 = 0;
   200        TUint16 attr2 = 0; 
   200        TUint16 attr2 = 0; 
   209         *
   209         *
   210         *--------------------------------------------------------*/
   210         *--------------------------------------------------------*/
   211        switch ( iLAMType ) 
   211        switch ( iLAMType ) 
   212        {    
   212        {    
   213            case CRACK_PASSWORD:
   213            case CRACK_PASSWORD:
       
   214                
       
   215                if (iNegotiation->iHostData->iSoftToken && (iPluginSession->SoftToken() != NULL))
       
   216                    {
       
   217                    HBufC8* password = NULL;
       
   218                    TInt err;
       
   219                    if (iState & SECURID_NEXT_PIN_MODE)
       
   220                        {
       
   221                        iState &= ~(SECURID_NEXT_PIN_MODE);
       
   222                        err = iPluginSession->SoftToken()->CodeL(*aDialogInfo->iSecret, password, ETrue);
       
   223                        }
       
   224                    else
       
   225                        err = iPluginSession->SoftToken()->CodeL(*aDialogInfo->iSecret, password);
       
   226                    if (KErrNone != err)
       
   227                        {
       
   228                        DEBUG_LOG(_L("Failed to get OTP from SoftToken!"));
       
   229                        delete aDialogInfo;  /* release dialog info object */
       
   230                        iDialogInfo = NULL;  /* reset dialog info pointer  */
       
   231                        return CRACK_FAILED;
       
   232                        }
       
   233                    else
       
   234                        {
       
   235                        aDialogInfo->SetSecret(password);
       
   236                        }
       
   237                    }
       
   238                    
   214                /*--------------------------------------------------
   239                /*--------------------------------------------------
   215                 *  Possible attributes: User name, Secret, Domain
   240                 *  Possible attributes: User name, Secret, Domain
   216                 *-------------------------------------------------*/
   241                 *-------------------------------------------------*/
   217                 attr1 = CRACK_T_USERNAME;
   242                 attr1 = CRACK_T_USERNAME;
   218                 bfr1  = aDialogInfo->iUsername;
   243                 bfr1  = aDialogInfo->iUsername;
   274     iNegotiation->iRetryNum = 0;
   299     iNegotiation->iRetryNum = 0;
   275                   
   300                   
   276     switch ( iLAMType ) 
   301     switch ( iLAMType ) 
   277     {
   302     {
   278         case CRACK_PASSWORD:
   303         case CRACK_PASSWORD:
       
   304             /*--------------------------------------------------
       
   305              * Request User name and pin from user
       
   306              *-------------------------------------------------*/
       
   307              if (iNegotiation->iHostData->iSoftToken && (iPluginSession->SoftToken() != NULL))
       
   308                  iDialog->GetAsyncSecureidPinDialogL(iDialogInfo, static_cast<MIkeDialogComplete*>(this));
   279              /*--------------------------------------------------
   309              /*--------------------------------------------------
   280               * Request User name and password (domain) from user
   310               * Request User name and password (domain) from user
   281               *-------------------------------------------------*/
   311               *-------------------------------------------------*/
   282              iDialog->GetAsyncUNPWDialogL(iDialogInfo, (MIkeDialogComplete*)this);
   312              else
       
   313                  iDialog->GetAsyncUNPWDialogL(iDialogInfo, static_cast<MIkeDialogComplete*>(this));
   283              break;
   314              break;
   284 
   315 
   285         default:     
   316         default:     
   286              status = CRACK_FAILED;
   317              status = CRACK_FAILED;
   287              break;
   318              break;
   551  *  Store credential buffers to CAuthDialogInfo object and call engine
   582  *  Store credential buffers to CAuthDialogInfo object and call engine
   552  *  entry  
   583  *  entry  
   553  *  
   584  *  
   554  *-------------------------------------------------------------------------*/
   585  *-------------------------------------------------------------------------*/
   555     TUint32 obj_id = 1;
   586     TUint32 obj_id = 1;
   556     CAuthDialogInfo* info = (CAuthDialogInfo*)aUserInfo;
   587     CAuthDialogInfo* info = static_cast<CAuthDialogInfo*>(aUserInfo);
   557 	DEBUG_LOG1(_L("CIKECRACKNegotiation::DialogCompleteL(), aUserInfo =  %x"), aUserInfo);
   588 	DEBUG_LOG1(_L("CIKECRACKNegotiation::DialogCompleteL(), aUserInfo =  %x"), aUserInfo);
   558 			
   589 			
   559     if ( info )
   590     if ( info )
   560 	{
   591 	{
   561        obj_id = info->GetObjId();
   592        obj_id = info->GetObjId();
       
   593        info->iNegotiation = iNegotiation;
   562 	   DEBUG_LOG1(_L("Preparing to call AuthDialogCompletedL(), ObjId = %x"), obj_id);
   594 	   DEBUG_LOG1(_L("Preparing to call AuthDialogCompletedL(), ObjId = %x"), obj_id);
   563        if ( obj_id == DIALOG_INFO_ID )
   595        if ( obj_id == DIALOG_INFO_ID )
   564 	   {
   596 	   {
   565           info->SetUserName( aUsername );
   597           info->SetUserName( aUsername );
   566           info->SetSecret( aSecret );
   598           info->SetSecret( aSecret );