201037_01 PDK_4.0.a
authorhgs
Tue, 28 Sep 2010 14:08:58 +0300
changeset 82 a117e284a2c6
parent 76 9cceb5cb3ee6
child 84 b09186059647
201037_01
commondrm/drmqtencryptor/drmencryptor.ui
commondrm/drmutility/group/DrmUtilityDmgrWrapper.mmp
commondrm/drmutility/group/qt/drmutilitydmgrwrapper.pro
commondrm/drmutility/src/DrmUtility.cpp
commondrm/drmutility/src/drmutilityconnection.cpp
drm_plat/drm_common_api/tsrc/data/mmc/DRM/content.dcf
drm_plat/drm_rights_api/tsrc/data/c/content.dcf
drm_pub/oma_drm_caf_agent_api/tsrc/bc/DRM_CAF/data/content.dcf
omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp
--- a/commondrm/drmqtencryptor/drmencryptor.ui	Mon Sep 06 16:28:07 2010 +0300
+++ b/commondrm/drmqtencryptor/drmencryptor.ui	Tue Sep 28 14:08:58 2010 +0300
@@ -1,5 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
 /*
-* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -14,8 +16,7 @@
 * Description:  DRM Encryption tool.
 *
 */
-
-<?xml version="1.0" encoding="UTF-8"?>
+-->
 <ui version="4.0">
  <class>mainWindow</class>
  <widget class="QDialog" name="mainWindow">
--- a/commondrm/drmutility/group/DrmUtilityDmgrWrapper.mmp	Mon Sep 06 16:28:07 2010 +0300
+++ b/commondrm/drmutility/group/DrmUtilityDmgrWrapper.mmp	Tue Sep 28 14:08:58 2010 +0300
@@ -45,7 +45,7 @@
 MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY        euser.lib
-LIBRARY        cmmanager.lib // RCmManager CCmApplicationSettingsUi
+LIBRARY        cmmanager.lib // RCmManager
 LIBRARY        esock.lib // RConnection, RSocketServ
 LIBRARY        extendedconnpref.lib netmeta.lib // TExtendedConnPref
 LIBRARY        downloadmgr.lib
--- a/commondrm/drmutility/group/qt/drmutilitydmgrwrapper.pro	Mon Sep 06 16:28:07 2010 +0300
+++ b/commondrm/drmutility/group/qt/drmutilitydmgrwrapper.pro	Tue Sep 28 14:08:58 2010 +0300
@@ -49,7 +49,7 @@
 	INCLUDEPATH += /epoc32/include/platform/mw/cwrt
 
 	LIBS += -leuser
-	LIBS += -lcmmanager // RCmManager CCmApplicationSettingsUi
+	LIBS += -lcmmanager // RCmManager
 	LIBS += -lesock // RConnection, RSocketServ
 	LIBS += -lextendedconnpref
 	LIBS += -lnetmeta // TExtendedConnPref
--- a/commondrm/drmutility/src/DrmUtility.cpp	Mon Sep 06 16:28:07 2010 +0300
+++ b/commondrm/drmutility/src/DrmUtility.cpp	Tue Sep 28 14:08:58 2010 +0300
@@ -215,6 +215,7 @@
     TInt64 headerSize( 0 );
     TBool isDrmFile( EFalse );
     TPtr8 headerPtr( NULL, 0 );
+    TInt dataLength = 0;
 
     aProtected = DRM::EUUnprotected;
     aAgent.Set( KNullDesC );
@@ -306,11 +307,17 @@
             {
             // set the mimetype from the buffer which is in the beginning
             // starting from byte 3 with the length specified at position 2
-            TPtrC8 mimeType( buffer->Des().Mid(3, (buffer->Des())[1]) );
-            if( !mimeType.CompareF( *iOmaBasedMimeType ) )
-                {
-                aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
-                isDrmFile = ETrue;
+            // also make sure the data length is greater or equal to the
+            // position + the 2nd byte of the content
+            dataLength = 3 + (buffer->Des())[1];
+            if( buffer->Length() >= dataLength )
+                {           
+                TPtrC8 mimeType( buffer->Des().Mid(3, (buffer->Des())[1]) );
+                if( !mimeType.CompareF( *iOmaBasedMimeType ) )
+                    {
+                    aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
+                    isDrmFile = ETrue;
+                    }
                 }
             }
         CleanupStack::PopAndDestroy( buffer );
@@ -333,6 +340,7 @@
     TPtr8 asfPtr( NULL, 0 );
     TBuf8< 32 > asfGuidHex;
     TBool isDrmFile( EFalse );
+    TInt dataLength = 0;
 
     aProtected = DRM::EUUnprotected;
     aAgent.Set( KNullDesC );
@@ -401,12 +409,18 @@
             {
             // set the mimetype from the buffer which is in the beginning
             // starting from byte 3 with the length specified at position 2
-            TPtrC8 mimeType( aContent.Mid(3, (aContent)[1]) );
-            if( !mimeType.CompareF( *iOmaBasedMimeType ) )
+            // also make sure the data length is greater or equal to the
+            // position + the 2nd byte of the content
+            dataLength = 3 + (aContent)[1];
+            if( aContent.Length() >= dataLength )
                 {
-                aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
-                isDrmFile = ETrue;
-                aProtected = DRM::EUProtected;
+                TPtrC8 mimeType( aContent.Mid(3, (aContent)[1]) );
+                if( !mimeType.CompareF( *iOmaBasedMimeType ) )
+                    {
+                    aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName );
+                    isDrmFile = ETrue;
+                    aProtected = DRM::EUProtected;
+                    }
                 }
             }
         }
--- a/commondrm/drmutility/src/drmutilityconnection.cpp	Mon Sep 06 16:28:07 2010 +0300
+++ b/commondrm/drmutility/src/drmutilityconnection.cpp	Tue Sep 28 14:08:58 2010 +0300
@@ -22,7 +22,6 @@
 #include <cmconnectionmethoddef.h>
 #include <cmmanager.h>
 #include <extendedconnpref.h>
-#include <cmapplicationsettingsui.h> // CCmApplicationSettingsUi
 #include <es_enum.h>
 #include <cdbcols.h> // IAP, COMMDB_ID
 #include "drmutilityconnection.h"
@@ -477,52 +476,9 @@
 //
 void DRM::CDrmUtilityConnection::ConnectUsingQueryL()
     {
-    // Create overrides
-    TConnPrefList prefList;
-    TExtendedConnPref prefs;
-
-    CCmApplicationSettingsUi* ui(CCmApplicationSettingsUi::NewLC());
-    TCmSettingSelection selectedConn;
-
-    TBool selected(ui->RunApplicationSettingsL(selectedConn));
-    CleanupStack::PopAndDestroy(ui);
-    ui=NULL;
-    if (selected)
-        {
-        if (selectedConn.iResult == CMManager::EConnectionMethod)
-            {
-            prefs.SetIapId(selectedConn.iId);
-            }
-        else if (selectedConn.iResult == CMManager::EDestination)
-            {
-            prefs.SetSnapId(selectedConn.iId);
-            }
-        else if (selectedConn.iResult != CMManager::EDefaultConnection)
-            {
-            selected=EFalse;
-            }
-        }
-    if (selected)
-        {
-        if (selectedConn.iResult != CMManager::EDefaultConnection)
-            {
-            prefList.AppendL(&prefs);
-            // For ensuring possibly stale connections get disconnected first;
-            iConnection.Close();
-            iConnection.Open(iSocketServ);
-            
-            iConnection.Start(prefList, iStatus);
-            }
-        else
-            {
-            iConnection.Start(iStatus);
-            }
-        SetActive();
-        }
-    else
-        {
-        CompleteSelf(KErrCancel);
-        }
+    // Implement according to the new Connection Settings
+    // QT API when possible to test the implementation
+    CompleteSelf(KErrCancel);
     }
 // ---------------------------------------------------------------------------
 // DRM::CDrmUtilityConnection::CompleteSelf
--- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp	Mon Sep 06 16:28:07 2010 +0300
+++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp	Tue Sep 28 14:08:58 2010 +0300
@@ -81,9 +81,6 @@
     DRM::EDrmAllowVideoMacroVision |
     DRM::EDrmAllowAudioUsb |   
     DRM::EDrmAllowAudioHdmiHdcpRequired |
-    DRM::EDrmAllowAudioHdmi |
-    DRM::EDrmAllowVideoHDMI  |
-    DRM::EDrmAllowVideoHdmiHdcpRequested |
     DRM::EDrmAllowVideoHdmiHdcpRequired;
 
 // ============================= LOCAL FUNCTIONS ===============================
@@ -471,7 +468,9 @@
                             DRM::EDrmAllowAudioBluetooth | 
                             DRM::EDrmAllowVideoMacroVision | 
                             DRM::EDrmAllowAudioFmTransmitter | 
-                            DRM::EDrmAllowAudioUsb;
+                            DRM::EDrmAllowAudioUsb |
+                            DRM::EDrmAllowAudioHdmiHdcpRequired |
+                            DRM::EDrmAllowVideoHdmiHdcpRequired;    
                     }
                 else
                     {
@@ -714,7 +713,9 @@
                             DRM::EDrmAllowAudioBluetooth | 
                             DRM::EDrmAllowVideoMacroVision | 
                             DRM::EDrmAllowAudioFmTransmitter | 
-                            DRM::EDrmAllowAudioUsb;
+                            DRM::EDrmAllowAudioUsb |
+                            DRM::EDrmAllowAudioHdmiHdcpRequired |
+                            DRM::EDrmAllowVideoHdmiHdcpRequired;    
                     }
                 else
                     {