terminalsecurity/SCP/SCPServer/src/SCPSession.cpp
changeset 70 5237465237e3
parent 24 bf47f3b79154
equal deleted inserted replaced
66:08c8318ec9cb 70:5237465237e3
   577 void CSCPSession :: HandleGetPoliciesL(const RMessage2 &aMessage) {
   577 void CSCPSession :: HandleGetPoliciesL(const RMessage2 &aMessage) {
   578     #ifdef SCP_ENFORCE_SECURITY
   578     #ifdef SCP_ENFORCE_SECURITY
   579     // Check the access for this parameter
   579     // Check the access for this parameter
   580     if((aMessage.SecureId() != KSCPServerSIDTerminalControl) &&
   580     if((aMessage.SecureId() != KSCPServerSIDTerminalControl) &&
   581        (aMessage.SecureId() != KSCPServerSIDGeneralSettings) &&
   581        (aMessage.SecureId() != KSCPServerSIDGeneralSettings) &&
   582        (aMessage.SecureId() != KDevEncUiUid)) {
   582        (aMessage.SecureId() != KDevEncUiUid) && 
       
   583        (aMessage.SecureId() != KSCPSecuiDialogNotifierSrv) &&
       
   584        (aMessage.SecureId() != KSecUiTest )) {
   583        
   585        
   584         Dprint((_L("CSCPSession::HandleSetParamMessageL(): ERROR: Permission denied")));
   586         Dprint((_L("CSCPSession::HandleSetParamMessageL(): ERROR: Permission denied")));
   585         User :: Leave( KErrPermissionDenied);
   587         User :: Leave( KErrPermissionDenied);
   586     }
   588     }
   587     #endif // SCP_ENFORCE_SECURITY
   589     #endif // SCP_ENFORCE_SECURITY
   788 void CSCPSession::HandleGetParamMessageL( const RMessage2 &aMessage )
   790 void CSCPSession::HandleGetParamMessageL( const RMessage2 &aMessage )
   789     {
   791     {
   790     Dprint( (_L("--> CSCPSession::HandleGetParamMessageL()") ));
   792     Dprint( (_L("--> CSCPSession::HandleGetParamMessageL()") ));
   791     
   793     
   792 #ifdef SCP_ENFORCE_SECURITY
   794 #ifdef SCP_ENFORCE_SECURITY
   793 
       
   794     // Check the access for this parameter
   795     // Check the access for this parameter
   795     switch ( (TSCPParameterID)aMessage.Int0() )
   796     switch ( (TSCPParameterID)aMessage.Int0() ) {
   796         {
       
   797         default:        
   797         default:        
   798             // For the current parameters, we allow Gs and Terminal Control Server
   798             // For the current parameters, we allow Gs and Terminal Control Server
   799             if (    ( aMessage.SecureId() != KSCPServerSIDTerminalControl ) &&
   799             if(( aMessage.SecureId() != KSCPServerSIDTerminalControl ) &&
   800                     ( aMessage.SecureId() != KSCPServerSIDGeneralSettings ) &&
   800                ( aMessage.SecureId() != KSCPServerSIDGeneralSettings ) &&
   801                  ( aMessage.SecureId() != KDevEncUiUid ) )
   801                ( aMessage.SecureId() != KDevEncUiUid ) &&
   802                 {
   802                ( aMessage.SecureId() != KSCPSecuiDialogNotifierSrv ) &&
   803                 Dprint( (_L("CSCPSession::HandleSetParamMessageL(): ERROR:\
   803                ( aMessage.SecureId() != KSecUiTest ) ) {
   804                     Permission denied") ));
   804                     Dprint( (_L("CSCPSession::HandleSetParamMessageL(): ERROR:\
   805                 User::Leave( KErrPermissionDenied );
   805                         Permission denied") ));
   806                 }
   806                     User :: Leave( KErrPermissionDenied );
       
   807             }
   807         break;        
   808         break;        
   808         }
   809         }
   809 #endif // SCP_ENFORCE_SECURITY
   810 #endif // SCP_ENFORCE_SECURITY
   810     
   811     
   811     // Init a local buffer to store the return value
   812     // Init a local buffer to store the return value
   882         case KSCPServerSIDGeneralSettings:
   883         case KSCPServerSIDGeneralSettings:
   883         case KSCPServerSIDSysAp:
   884         case KSCPServerSIDSysAp:
   884         case KSCPServerSIDTerminalControl:
   885         case KSCPServerSIDTerminalControl:
   885         case KSCPServerSIDTelephone:
   886         case KSCPServerSIDTelephone:
   886         case KSCPServerSIDLog:
   887         case KSCPServerSIDLog:
       
   888         case KSCPSecuiDialogNotifierSrv:
       
   889         case KSecUiTest:
   887             break;
   890             break;
   888         default: {
   891         default: {
   889             Dprint( (_L("[CSCPSession]-> ERROR: Permission denied") ));
   892             Dprint( (_L("[CSCPSession]-> ERROR: Permission denied") ));
   890             User::Leave( KErrPermissionDenied );
   893             User::Leave( KErrPermissionDenied );
   891         }
   894         }