--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET (this_target drm-intel)
+
+CONFIGURE_FILE(drm-service-core-intel.pc.in ${CMAKE_SOURCE_DIR}/drm-service-core-intel.pc @ONLY)
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/drm-service-core-intel.pc DESTINATION lib/pkgconfig)
+
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/${this_target} FILES_MATCHING PATTERN "*.h")
+
+IF("${ARCH}" MATCHES "arm")
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/arm/ DESTINATION lib FILES_MATCHING PATTERN "*"
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+ GROUP_EXECUTE GROUP_READ
+ WORLD_EXECUTE WORLD_READ)
+ELSE("${ARCH}" MATCHES "arm")
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/ix86/ DESTINATION lib FILES_MATCHING PATTERN "*"
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+ GROUP_EXECUTE GROUP_READ
+ WORLD_EXECUTE WORLD_READ)
+ENDIF("${ARCH}" MATCHES "arm")
--- /dev/null
+Flora License
+
+Version 1.0, May, 2012
+
+http://floralicense.org/license/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and
+all other entities that control, are controlled by, or are
+under common control with that entity. For the purposes of
+this definition, "control" means (i) the power, direct or indirect,
+to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
+or more of the outstanding shares, or (iii) beneficial ownership of
+such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form,
+made available under the License, as indicated by a copyright notice
+that is included in or attached to the work (an example is provided
+in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this License,
+Derivative Works shall not include works that remain separable from,
+or merely link (or bind by name) to the interfaces of, the Work and
+Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner.
+For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or
+its representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor
+for the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated
+in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies
+with the standards set forth in the Compatibility Definition Document
+and passes the Compatibility Test Suite as defined from time to time
+by the Tizen Technical Steering Group and certified by the Tizen
+Association or its designated agent.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work
+solely as incorporated into a Tizen Certified Platform, where such
+license applies only to those patent claims licensable by such
+Contributor that are necessarily infringed by their Contribution(s)
+alone or by combination of their Contribution(s) with the Work solely
+as incorporated into a Tizen Certified Platform to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim
+in a lawsuit) alleging that the Work or a Contribution incorporated
+within the Work constitutes direct or contributory patent infringement,
+then any patent licenses granted to You under this License for that
+Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+Work or Derivative Works thereof pursuant to the copyright license
+above, in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+ 1. You must give any other recipients of the Work or Derivative Works
+ a copy of this License; and
+ 2. You must cause any modified files to carry prominent notices stating
+ that You changed the files; and
+ 3. You must retain, in the Source form of any Derivative Works that
+ You distribute, all copyright, patent, trademark, and attribution
+ notices from the Source form of the Work, excluding those notices
+ that do not pertain to any part of the Derivative Works; and
+ 4. If the Work includes a "NOTICE" text file as part of its distribution,
+ then any Derivative Works that You distribute must include a readable
+ copy of the attribution notices contained within such NOTICE file,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works, in at least one of the following places:
+ within a NOTICE text file distributed as part of the Derivative Works;
+ within the Source form or documentation, if provided along with the
+ Derivative Works; or, within a display generated by the Derivative Works,
+ if and wherever such third-party notices normally appear.
+ The contents of the NOTICE file are for informational purposes only
+ and do not modify the License.
+
+You may add Your own attribution notices within Derivative Works
+that You distribute, alongside or as an addendum to the NOTICE text
+from the Work, provided that such additional attribution notices
+cannot be construed as modifying the License. You may add Your own
+copyright statement to Your modifications and may provide additional or
+different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works
+as a whole, provided Your use, reproduction, and distribution of
+the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "[]"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Flora License, Version 1.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://floralicense.org/license/
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
--- /dev/null
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Flora License, Version 1.
+Please, see the LICENSE.Flora file for Flora License, Version 1 terms and conditions.
+
+libdrm-service-core-intel.so file is licensed under Flora License, Version 1.
+Please, see the LICENSE.Flora file for Flora License, Version 1 terms and conditions.
--- /dev/null
+libdir=/usr/lib
+includedir=/usr/include/drm-intel
+
+Name: drm-service-core-intel
+Description: DRM package for Tizen store
+Version: @VERSION@
+Requires: openssl
+Libs: -L${libdir} -ldrm-service-core-intel
+Cflags: -I${includedir}
--- /dev/null
+\r
+/********************************************************************************\r
+* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
+* All rights reserved. * \r
+* * \r
+* No parts of this source code may be in any way copied, reproduced, modified *\r
+* or distributed without the prior written consent of INKA Entworks, Inc. *\r
+* CPointerArray.h: interface for the CPointerArray class. *\r
+*********************************************************************************/ \r
+\r
+#ifndef __CPOINTERARRAY_H__\r
+#define __CPOINTERARRAY_H__\r
+\r
+\r
+#if !defined(AFX_CPOINTERARRAY_H__AB67E4BE_A233_4E3E_B257_9830D90326EE__INCLUDED_)\r
+#define AFX_CPOINTERARRAY_H__AB67E4BE_A233_4E3E_B257_9830D90326EE__INCLUDED_\r
+\r
+#if _MSC_VER > 1000\r
+#pragma once\r
+#endif // _MSC_VER > 1000\r
+\r
+//#include "Shp.h"\r
+#include "InkaTypes.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+class CPointerArray \r
+{\r
+protected:\r
+ LPVOID* m_ppData;\r
+ int m_nMaxSize;\r
+ int m_nNumOfData;\r
+\r
+public:\r
+ CPointerArray();\r
+ virtual ~CPointerArray();\r
+\r
+ int Add( LPVOID pData );\r
+ int Remove( int nIndex );\r
+ LPVOID Get( int nIndex );\r
+ inline int GetCount() { return m_nNumOfData; }\r
+ inline void RemoveAll() { m_nNumOfData = 0; }\r
+};\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif // !defined(AFX_CPOINTERARRAY_H__AB67E4BE_A233_4E3E_B257_9830D90326EE__INCLUDED_)\r
+#endif /* __CPOINTERARRAY_H__ */\r
--- /dev/null
+\r
+/********************************************************************************\r
+* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
+* All rights reserved. * \r
+* * \r
+* No parts of this source code may be in any way copied, reproduced, modified *\r
+* or distributed without the prior written consent of INKA Entworks, Inc. *\r
+* CXMLAttribute.h: interface for the CXMLAttribute class. *\r
+*********************************************************************************/ \r
+#include "InkaTypes.h"\r
+\r
+#if !defined(AFX_CXMLATTRIBUTE_H__2B925786_3613_47B0_B85D_CAF2053F46DB__INCLUDED_)\r
+#define AFX_CXMLATTRIBUTE_H__2B925786_3613_47B0_B85D_CAF2053F46DB__INCLUDED_\r
+\r
+#if _MSC_VER > 1000\r
+#pragma once\r
+#endif // _MSC_VER > 1000\r
+\r
+class CXMLAttribute \r
+{\r
+protected:\r
+ LPTSTR m_pszName;\r
+ LPTSTR m_pszValue;\r
+\r
+public:\r
+ CXMLAttribute();\r
+ virtual ~CXMLAttribute();\r
+\r
+ int SetName( LPCTSTR pszName );\r
+ int SetValue( LPCTSTR pszValue );\r
+\r
+ inline LPCTSTR GetName() { return m_pszName; }\r
+ inline LPCTSTR GetValue() { return m_pszValue; }\r
+};\r
+\r
+#endif // !defined(AFX_CXMLATTRIBUTE_H__2B925786_3613_47B0_B85D_CAF2053F46DB__INCLUDED_)\r
--- /dev/null
+\r
+/********************************************************************************\r
+* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
+* All rights reserved. * \r
+* * \r
+* No parts of this source code may be in any way copied, reproduced, modified *\r
+* or distributed without the prior written consent of INKA Entworks, Inc. *\r
+* CXMLElement.h: interface for the CXMLElement class. *\r
+*********************************************************************************/ \r
+\r
+#if !defined(AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_)\r
+#define AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_\r
+\r
+#include "InkaTypes.h"\r
+#include "CXMLAttribute.h"\r
+#include "CPointerArray.h"\r
+\r
+\r
+#if _MSC_VER > 1000\r
+#pragma once\r
+#endif // _MSC_VER > 1000\r
+\r
+class CXMLElement \r
+{\r
+protected:\r
+ LPTSTR m_pszName;\r
+ LPTSTR m_pszValue;\r
+ \r
+ CPointerArray m_pChilds;\r
+ CPointerArray m_pAttributes;\r
+ \r
+ int _SearchNodes( CPointerArray* ppaChildNodes, CXMLElement* pCurrent, LPCTSTR pszTagName, va_list args );\r
+\r
+public:\r
+ CXMLElement();\r
+ virtual ~CXMLElement();\r
+\r
+ int SetName( LPCTSTR pszName );\r
+ int SetValue( LPCTSTR pszValue );\r
+ int AddAttribute( LPCTSTR pszName, LPCTSTR pszValue );\r
+\r
+ inline LPCTSTR GetName() { return m_pszName; }\r
+ inline LPCTSTR GetValue() { return m_pszValue; }\r
+\r
+ int AddChild( CXMLElement* pChild );\r
+ LPCTSTR GetAttribute( LPCTSTR pszName );\r
+\r
+ inline int GetChildCount() { return m_pChilds.GetCount(); }\r
+ inline int GetAttributeCount() { return m_pAttributes.GetCount(); }\r
+ inline CXMLElement* GetChild( int nIndex ) { return (CXMLElement*)m_pChilds.Get( nIndex ); }\r
+ inline CXMLAttribute* GetAttribute( int nIndex ) { return (CXMLAttribute*)m_pAttributes.Get( nIndex ); }\r
+\r
+ int Find( CPointerArray* pSearchedChild, LPCTSTR pszChildName, ... );\r
+};\r
+\r
+#endif // !defined(AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_)\r
--- /dev/null
+/********************************************************************************\r
+* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
+* All rights reserved. * \r
+* * \r
+* No parts of this source code may be in any way copied, reproduced, modified *\r
+* or distributed without the prior written consent of INKA Entworks, Inc. *\r
+* CXMLFile.h: interface for the CXMLFile class. *\r
+*********************************************************************************/ \r
+\r
+#if !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)\r
+#define AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_\r
+\r
+#include "InkaTypes.h"\r
+#include "CXMLElement.h"\r
+\r
+#if _MSC_VER > 1000\r
+#pragma once\r
+#endif // _MSC_VER > 1000\r
+\r
+#ifndef IN\r
+ #define IN\r
+#endif\r
+\r
+#ifndef OUT\r
+ #define OUT\r
+#endif\r
+\r
+#define ELEMENT_QUEUE_MAX 2048\r
+class CXMLFile \r
+{\r
+protected:\r
+ LPCTSTR m_pszXML;\r
+ CXMLElement* m_paElementQueue[ ELEMENT_QUEUE_MAX ];\r
+ int m_nQueueIndex;\r
+ CXMLElement* m_pRoot;\r
+ \r
+ int _Parse();\r
+ int _GetElementName( LPTSTR pszElementName );\r
+ CXMLElement* _Pop();\r
+ int _Push( CXMLElement* p );\r
+ int _GetAttributeNameAndValue( LPTSTR pszName, LPTSTR pszValue );\r
+\r
+public:\r
+ CXMLFile();\r
+ virtual ~CXMLFile();\r
+\r
+ int LoadFromStream( LPCTSTR pszXML );\r
+ int LoadFromFile( LPCTSTR pszFileName );\r
+ inline CXMLElement* GetRoot() { return m_pRoot; }\r
+};\r
+\r
+#endif // !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)\r
--- /dev/null
+/** \r
+ * @file InkaTypes.h\r
+ * @brief This file includes definitions of constants, \r
+ * enumerations, and datastructures for DRM service.\r
+# @author sunggun.jung(sunggun.jung@samsung.com)\r
+ * @version 1.0\r
+ */\r
+\r
+#ifndef INKA_DRM_TYPES_H\r
+#define INKA_DRM_TYPES_H\r
+\r
+#include <stdio.h>\r
+#include <stdarg.h>\r
+\r
+#define _T\r
+#define IF_ERROR_GOTO( error ) if( FAILED( HRESULT_FROM_WIN32( error ) ) ) { nResult = ERRORMSG( error, NULL ); goto finish; }\r
+#define IF_TRUE_GOTO( cond, error ) if( cond ) { nResult = -1; goto finish; }\r
+\r
+#if defined(_WIN32) || defined(_WIN64) \r
+ #define snprintf _snprintf \r
+ #define vsnprintf _vsnprintf \r
+ #define strcasecmp _stricmp \r
+ #define strncasecmp _strnicmp \r
+#endif\r
+\r
+#ifndef _SHP_SIMUL\r
+typedef void* LPVOID;\r
+typedef const char* LPCTSTR;\r
+typedef unsigned char* LPBYTE;\r
+typedef char TCHAR;\r
+typedef char* LPTSTR;\r
+typedef LPTSTR LPSTR;\r
+typedef LPCTSTR LPCTSTR;\r
+typedef LPCTSTR LPCSTR;\r
+\r
+#define DWORD unsigned long\r
+#define LPBYTE unsigned char*\r
+#define BYTE unsigned char\r
+#define UINT unsigned int\r
+#define ULONG unsigned long\r
+#define INT32 long\r
+#define INT64 long long\r
+#define TRUE 1\r
+#define FALSE 0\r
+\r
+typedef char CHAR;\r
+typedef bool BOOL;\r
+\r
+#define ERROR_INVALID_DATA 13L\r
+#define ERROR_INSUFFICIENT_BUFFER 122L // dderror\r
+//#define CopyMemory AcMemcpy\r
+#define INVALID_HOBJ NULL\r
+\r
+#endif\r
+#endif //INKA_DRM_TYPES_H\r
--- /dev/null
+typedef struct t_cek\r
+{\r
+ char *CID;\r
+ char *CEK;\r
+ char *EncryptionMethod;\r
+}T_CEK;\r
+\r
+typedef struct t_dro\r
+{\r
+ char *CID;\r
+ char *deviceId;\r
+ char *digestValue;\r
+ char *signedValue;\r
+ char *cert;\r
+ int Count;\r
+ char *CreatedTimestamp;\r
+ char *ExpiredTimeStamp;\r
+ char *ExpirationDate;\r
+}T_DRO;\r
+\r
+typedef struct t_dcf_file_header\r
+{\r
+ unsigned char Version;\r
+ unsigned char ContentTypeLen;\r
+ unsigned char ContentURILen;\r
+ char *ContentType;\r
+ char *ContentURI;\r
+ unsigned int HeadersLen;\r
+ unsigned int DataLen;\r
+ char *Headers;\r
+ unsigned int DataOffset;\r
+}T_DCF_FILE_HEADER;\r
+\r
+// DRO Value size\r
+#define APPID_SIZE 16\r
+#define CEK_SIZE 512\r
+#define ENCRYPTION_METHOD_SIZE 512\r
+#define DEVICEID_SIZE 256\r
+#define TIMESTAMP_SIZE 256\r
+#define DIGESTVALUE_SIZE 256\r
+#define SIGNATUREVALUE_SIZE 1024\r
+#define CERT_SIZE 1024 * 4\r
+#define AES_BLOCK_SIZE 16\r
--- /dev/null
+#include "InkaTypes.h"\r
+#include "stdlib.h"\r
+#include "string.h"\r
+#include "stdio.h"\r
+\r
+#define AES_BLOCK_SIZE 16\r
+\r
+LPSTR Base64Encode(LPBYTE pbData, int nLength);\r
+LPBYTE Base64Decode(LPCSTR pszString, int* pnLength);\r
+\r
+int decrypt_block(unsigned char *iv, unsigned char *cipherText, int cipherTextLen, unsigned char *cek, int cekLen, unsigned char *plainText);\r
--- /dev/null
+#include "CPointerArray.h"\r
+#include "CXMLAttribute.h"\r
+#include "CXMLElement.h"\r
+#include "CXMLFile.h"\r
+#include "InkaTypes.h"\r
+#include "IntelDrm_Core.h"\r
+#include "drm-intel-crypto-util.h"\r
+\r
+#include "stdlib.h"\r
+#include "string.h"\r
+#include "stdio.h"\r
+\r
+/** \r
+ * An application can parse CEK XML Foramt.\r
+ * \r
+ * @param[in] pszXML Data String of the CEK information\r
+ * @param[out] t_cek parsing result to be saved\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int parse_intel_cek(const char* pszXML, T_CEK* t_cek);\r
+\r
+/** \r
+ * An application can parse DRO XML Foramt.\r
+ * \r
+ * @param[in] pszXML Data String of the DRO information\r
+ * @param[out] t_cek parsing result to be saved\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int parse_intel_dro(const char* pszXML, T_DRO* t_RO);\r
+\r
+int parse_intel_dro2(const char* pszXML, T_DRO* t_RO);\r
+\r
+int parse_intel_dro3(const char* pszXML, T_DRO* t_RO);\r
+\r
+/** \r
+ * An application can parse stored dro.\r
+ * \r
+ * @param[in] pFilepath file path of the internal dro\r
+ * @param[out] t_ro parsing result to be saved\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int get_internal_dro(char *pFilepath, T_DRO* t_ro);\r
+\r
+/** \r
+ * An application can parse stored cek.\r
+ * \r
+ * @param[in] pFilepath file path of the internal cek\r
+ * @param[out] t_cek parsing result to be saved\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int get_internal_cek(char *pFilepath, T_CEK* t_cek);\r
+\r
+int delete_internal_cek(char *pAppId);\r
+\r
+int get_dcf_header_info(char *pFilePath, T_DCF_FILE_HEADER *pTdcfHeader);\r
+\r
+bool get_Uintvar(unsigned int *nValue, FILE *pFile);\r
+\r
+int decrypt_package(char *pDcfPath, char *pDecryptedFilePath, unsigned char *pCEK, int cekLen, T_DCF_FILE_HEADER *t_dcf_header);\r
--- /dev/null
+/*\r
+ * drm-service-core-intel\r
+ *\r
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: Sunggun Jung <sunggun.jung@samsung.com>\r
+ * \r
+ * This library is free software; you can redistribute it and/or modify it under\r
+ * the terms of the GNU Lesser General Public License as published by the\r
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)\r
+ * any later version.\r
+ * \r
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY\r
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\r
+ * License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51\r
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+ *\r
+ */\r
+\r
+/**\r
+* @internal\r
+* @defgroup DRM-INTEL drm-intel\r
+* @{ \r
+*/\r
+#include "drm-intel-util.h"\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <string.h>\r
+\r
+/** \r
+ * An application can install Intel DRM license(DRO).\r
+ * \r
+ * @param[in] pDroXML Data String of the Rights Request\r
+ * @param[in] droBufLen pDroXML Length\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int drm_oem_intel_install_license(char *pDroXML, int droBufLen);\r
+\r
+/** \r
+ * An application can uninstall Intel DRM license(DRO).\r
+ * \r
+ * @param[in] pAppId App-id of the rigths which want to un-install\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int drm_oem_intel_uninstall_license(char *pAppId);\r
+\r
+/** \r
+ * An application can install CEK(Contents Encryption Key).\r
+ * \r
+ * @param[in] pCekXML Data String of the Rights Request\r
+ * @param[in] cekBufLen pDroXML Length\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int drm_oem_intel_install_cek(char *pCekXML, int cekBufLen);\r
+\r
+/** \r
+ * An application can get decrypted contents(Apps) which is encrypted\r
+ * \r
+ * @param[in] pDcfPath Intel DRM Package File Path \r
+ * @param[in] pDecryptedFile Decrypted File Path\r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see\r
+ * @since\r
+ */\r
+int drm_oem_intel_decrypt_package(char *pDcfPath, char *pDecryptedFile);\r
+\r
+/** \r
+ * An application can get informations of rights (DRO).\r
+ * \r
+ * @param[in] pAppId App-id of the rights which want to know\r
+ * @param[out] pDro The rights information about the app-id\r
+ * @return This function can return any of the following codes\r
+ * DRM_INTEL_SUCCESS = 0 <success \r
+ * DRM_INTEL_LIC_VALID = 1 <License is valid \r
+ * DRM_INTEL_LIC_SUSPEND = 2 <License is valid but for future use \r
+ * DRM_INTEL_INVALID_ARG = -1000 <invalid argument\r
+ * DRM_INTEL_PARSING_ERROR = -999 <parsing contents or rights error\r
+ * DRM_INTEL_DB_ERROR = -998 <data base error \r
+ * DRM_INTEL_INSUFFICIENT_MEMORY = -997 <memory error \r
+ * DRM_INTEL_INTERNAL_ERROR = -996 <processing error\r
+ * DRM_INTEL_FILE_ERROR = -995 <file error\r
+ * DRM_INTEL_LIC_EXPIRED_DATETIME = -994 <Datetime License is expired\r
+ * DRM_INTEL_LIC_EXPIRED_COUNT = -993 <Count License is expired \r
+ * DRM_INTEL_LIC_NO_LICENCE = -992 <No License\r
+ * DRM_INTEL_LIC_IMEI_MISMATCH = -991 <IMEI is mismatching \r
+ * DRM_INTEL_LIC_PNUM_MISMATCH = -990 <PNUM is mismatching \r
+ * DRM_INTEL_UNKNOWN_ERROR = -1 <dummy error value\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int drm_oem_intel_getLicenseInfo(char *pAppId, T_DRO *pDro);\r
+\r
+/** \r
+ * An application can get informations of rights (DRO).\r
+ * \r
+ * @param[in] pAppId App-id of the rights which want to know\r
+ * @return This function can return any of the following codes\r
+ * DRM_INTEL_SUCCESS = 0 <success \r
+ * DRM_INTEL_LIC_VALID = 1 <License is valid \r
+ * DRM_INTEL_LIC_SUSPEND = 2 <License is valid but for future use \r
+ * DRM_INTEL_INVALID_ARG = -1000 <invalid argument\r
+ * DRM_INTEL_PARSING_ERROR = -999 <parsing contents or rights error\r
+ * DRM_INTEL_DB_ERROR = -998 <data base error \r
+ * DRM_INTEL_INSUFFICIENT_MEMORY = -997 <memory error \r
+ * DRM_INTEL_INTERNAL_ERROR = -996 <processing error\r
+ * DRM_INTEL_FILE_ERROR = -995 <file error\r
+ * DRM_INTEL_LIC_EXPIRED_DATETIME = -994 <Datetime License is expired\r
+ * DRM_INTEL_LIC_EXPIRED_COUNT = -993 <Count License is expired \r
+ * DRM_INTEL_LIC_NO_LICENCE = -992 <No License\r
+ * DRM_INTEL_LIC_IMEI_MISMATCH = -991 <IMEI is mismatching \r
+ * DRM_INTEL_LIC_PNUM_MISMATCH = -990 <PNUM is mismatching \r
+ * DRM_INTEL_UNKNOWN_ERROR = -1 <dummy error value \r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int drm_oem_intel_consume_license(char *pAppID);\r
+\r
+/** \r
+ * An application can veify the app's rights.\r
+ * \r
+ * @param[in] pAppId App-id of the rights which want to know\r
+ * @return This function can return any of the following codes\r
+ * DRM_INTEL_SUCCESS = 0 <success \r
+ * DRM_INTEL_LIC_VALID = 1 <License is valid \r
+ * DRM_INTEL_LIC_SUSPEND = 2 <License is valid but for future use \r
+ * DRM_INTEL_INVALID_ARG = -1000 <invalid argument\r
+ * DRM_INTEL_PARSING_ERROR = -999 <parsing contents or rights error\r
+ * DRM_INTEL_DB_ERROR = -998 <data base error \r
+ * DRM_INTEL_INSUFFICIENT_MEMORY = -997 <memory error \r
+ * DRM_INTEL_INTERNAL_ERROR = -996 <processing error\r
+ * DRM_INTEL_FILE_ERROR = -995 <file error\r
+ * DRM_INTEL_LIC_EXPIRED_DATETIME = -994 <Datetime License is expired\r
+ * DRM_INTEL_LIC_EXPIRED_COUNT = -993 <Count License is expired \r
+ * DRM_INTEL_LIC_NO_LICENCE = -992 <No License\r
+ * DRM_INTEL_LIC_IMEI_MISMATCH = -991 <IMEI is mismatching \r
+ * DRM_INTEL_LIC_PNUM_MISMATCH = -990 <PNUM is mismatching \r
+ * DRM_INTEL_UNKNOWN_ERROR = -1 <dummy error value \r
+\r
+ * @remarks \r
+ * @see \r
+ * @since \r
+ */\r
+int drm_oem_intel_has_valid_license(char *pAppID);\r
+\r
+/** \r
+ * An application can check the file is drm enabled or not\r
+ * \r
+ * @param[in] pDcfPath The file path which want to check \r
+ * @return This function returns 1 on success or 0 on failure.\r
+ * @remarks \r
+ * @see\r
+ * @since\r
+ */\r
+int drm_oem_intel_isDrmFile(char *pDcfPath);\r
--- /dev/null
+* Wed May 29 2013 Rusty Lynch <rusty.lynch@intel.com> submit/tizen/20130517.045130@9c6e8cc
+- initial code
+
--- /dev/null
+Name: drm-service-core-intel
+Summary: The plugin library for installing drm-service-core-intel.so
+Version: 0.1.0
+Release: 0
+Group: TO_BE/FILLED_IN
+License: Flora
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: cmake
+
+Provides: libdrm-service-core-intel.so.0
+
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description
+The plugin library for installing drm-service-core-intel.so
+
+%package devel
+Summary: The plugin library for drm-service-core-intel(Development)
+Group: TO_BE/FILLED_IN
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+The plugin library for installing drm-service-core-intel.so and header files.
+
+%prep
+%setup -q
+
+%build
+%ifarch %{arm}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=arm
+%else
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=ix86
+%endif
+make
+#make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+
+%make_install
+
+%post
+/bin/rm -f /etc/ld.so.cache
+/sbin/ldconfig
+
+mkdir -p /opt/var/drm/inteldrm
+chown 0:5000 /opt/var/drm/inteldrm
+chmod 775 /opt/var/drm/inteldrm
+
+ln -s -f %{_libdir}/libdrm-service-core-intel.so.0.1.0 %{_libdir}/libdrm-service-core-intel.so.0
+ln -s -f %{_libdir}/libdrm-service-core-intel.so.0 %{_libdir}/libdrm-service-core-intel.so
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/libdrm-service-core-intel.so*
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/drm-intel/*.h
+%{_libdir}/pkgconfig/drm-service-core-intel.pc
+