SET(CMAKE_VERBOSE_MAKEFILE OFF)
-IF(DEFINED USE_AUTOSTART)
- ADD_DEFINITIONS("-DUSE_AUTOSTART")
-ENDIF()
-
# make string from entire content of byte array
ADD_DEFINITIONS("-DTO_STRING_ALL")
ADD_DEFINITIONS("-DUSE_CYNARA")
ADD_SUBDIRECTORY(gtest)
ADD_DEFINITIONS(-DBUILD_GTEST)
ENDIF(BUILD_GTESTS)
-IF(DEFINED TEST_CLIENT)
- ADD_SUBDIRECTORY(test-client)
-ENDIF()
-
+++ /dev/null
-smartcard-service (0.1.0-3) unstable; urgency=low
-
- * add an exceptional case when is openning client channel (nfc-manager)
- * Git: slp/pkgs/s/smartcard-service
- * Tag: smartcard-service_0.1.0-3
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Fri, 20 Apr 2012 11:00:00 +0900
-
-smartcard-service (0.1.0-2) unstable; urgency=low
-
- * add helpers for openssl and package signature
- * Git: slp/pkgs/s/smartcard-service
- * Tag: smartcard-service_0.1.0-2
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Fri, 23 Mar 2012 12:40:00 +0900
-
-smartcard-service (0.1.0-1) unstable; urgency=low
-
- * Upload package
- * Git: slp/pkgs/s/smartcard-service
- * Tag: smartcard-service_0.1.0-1
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Wed, 14 Mar 2012 13:30:00 +0900
-
-smartcard-service (0.0.0-4) unstable; urgency=low
-
- * Upload package
- * Git: slp/pkgs/s/smartcard-service
- * Tag: smartcard-service_0.0.0-4
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Tue, 13 Mar 2012 13:10:00 +0900
-
-smartcard-service (0.0.0-3) unstable; urgency=low
-
- * namespace and macro name change
- * Git: slp/pkgs/s/smartcard-service
- * Tag: smartcard-service_0.0.0-3
-
- -- Sangsoo Lee <constant.lee@samsung.com> Wed, 07 Mar 2012 19:26:46 +0900
-
-smartcard-service (0.0.0-2) unstable; urgency=low
-
- * getChannelCount api add
- * Git: slp/pkgs/s/smartcard-service
- * Tag: smartcard-service_0.0.0-2
-
- -- Sangsoo Lee <constant.lee@samsung.com> Thu, 23 Feb 2012 21:10:42 +0900
-
-smartcard-service (0.0.0-1) unstable; urgency=low
-
- * Initial release
- * Git: slp/pkgs/s/smartcard-service
- * Tag: smartcard-service_0.0.0-1
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Thu, 31 Jan 2012 00:00:00 +0900
+++ /dev/null
-Source: smartcard-service
-Priority: extra
-Maintainer: Wonkyu Kwon <wonkyu.kwon@samsung.com>, Sangsoo Lee <constant.lee@samsung.com>, Sungjae Lim <sungjae.lim@samsung.com>, Junyong Sim <junyong.sim@samsung.com>, Sechang Sohn <sc.sohn@samsung.com>
-Build-Depends: debhelper (>= 8.0.0), libglib2.0-dev, libvconf-dev, libsecurity-server-client-dev, dlog-dev, wrt-commons-dev, libaul-1-dev, libssl-dev
-#Build-Depends: debhelper (>= 8.0.0), libglib2.0-dev, libvconf-dev, libsecurity-server-client-dev, dlog-dev, libpkcs11-helper1-dev, wrt-commons, libaul-dev, libssl-dev
-#Standards-Version: 3.9.2
-Section: mixed
-Homepage: <insert the upstream URL, if relevant>
-#Vcs-Git: git://git.debian.org/collab-maint/smartcard-service.git
-#Vcs-Browser: http://git.debian.org/?p=collab-maint/smartcard-service.git;a=summary
-
-Package: smartcard-service-common
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Common library of Smart card service
- Common library of Smart card service
-
-Package: smartcard-service-common-dev
-Section: libdevel
-Architecture: any
-Depends: smartcard-service-common (= ${binary:Version})
-Description: Common library of Smart card service
- Common library of Smart card service
-
-Package: smartcard-service-common-dbg
-Section: debug
-Architecture: any
-Depends: smartcard-service-common (= ${binary:Version})
-Description: Common library of Smart card service (unstripped)
- Common library of Smart card service (unstripped)
-
-Package: smartcard-service-server
-Architecture: any
-Depends: smartcard-service-common-dev (= ${binary:Version})
-Description: Main process of Smart card service
- Main process of Smart card service
-
-Package: smartcard-service-server-dbg
-Section: debug
-Architecture: any
-Depends: smartcard-service-server (= ${binary:Version})
-Description: Main process of Smart card service (unstripped)
- Main process of Smart card service (unstripped)
-
-Package: smartcard-service
-Section: libs
-Architecture: any
-Depends: smartcard-service-common-dev (= ${binary:Version})
-Description: User library of Smart card service
- User library of Smart card service
-
-Package: smartcard-service-dev
-Section: libdevel
-Architecture: any
-Depends: smartcard-service (= ${binary:Version})
-Description: User library of Smart card service
- User library of Smart card service
-
-Package: smartcard-service-dbg
-Section: debug
-Architecture: any
-Depends: smartcard-service (= ${binary:Version})
-Description: User library of Smart card service (unstripped)
- User library of Smart card service (unstripped)
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-override_dh_auto_build:
-
- cd $(CMAKE_BINARY_DIR)
- dh_auto_build
-
-override_dh_install:
-
- mkdir -p $(CURDIR)/debian/tmp/etc/init.d
- mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/
- mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/
-
- cp -af $(CURDIR)/debian/smartcard-service-server.init $(CURDIR)/debian/tmp/etc/init.d/smartcard-service-server
- ln -s ../init.d/smartcard-service-server $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S79smartcard-service-server
- ln -s ../init.d/smartcard-service-server $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S79smartcard-service-server
-
- dh_install
-
-override_dh_installinit:
-
-%:
- dh $@
-
+++ /dev/null
-usr/lib
-usr/include
+++ /dev/null
-usr/include/smartcard-service-common/*
-#usr/lib/lib*.a
-usr/lib/libsmartcard-service-common.so
-usr/lib/pkgconfig/smartcard-service-common.pc
-#usr/share/pkgconfig/*
+++ /dev/null
-usr/lib/libsmartcard-service-common.so.*
+++ /dev/null
-usr/lib
-usr/include
+++ /dev/null
-usr/include/smartcard-service/*
-#usr/lib/lib*.a
-usr/lib/libsmartcard-service.so
-usr/lib/pkgconfig/smartcard-service.pc
-#usr/share/pkgconfig/*
+++ /dev/null
-usr/bin
-etc
\ No newline at end of file
+++ /dev/null
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides: smartcard-service-server
-# Required-Start: $network $local_fs
-# Required-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: <Enter a short description of the sortware>
-# Description: <Enter a long description of the software>
-# <...>
-# <...>
-### END INIT INFO
-
-# Author: Wonkyu Kwon <wonkyu.kwon@samsung.com>
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/usr/bin
-DESC=smartcard-daemon # Introduce a short description here
-NAME=smartcard-daemon # Introduce the short server's name here
-DAEMON=/usr/bin/smartcard-daemon # Introduce the server's location here
-DAEMON_ARGS="" # Arguments to run the daemon with
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
-
-# Exit if the package is not installed
-[ -x $DAEMON ] || exit 0
-
-$DAEMON $DAEMON_ARGS &
\ No newline at end of file
+++ /dev/null
-usr/bin/smartcard-daemon
-etc/*
\ No newline at end of file
+++ /dev/null
-usr/lib/libsmartcard-service.so.*
+++ /dev/null
-Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
- Apache License\r
- Version 2.0, January 2004\r
- http://www.apache.org/licenses/\r
-\r
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
- 1. Definitions.\r
-\r
- "License" shall mean the terms and conditions for use, reproduction,\r
- and distribution as defined by Sections 1 through 9 of this document.\r
-\r
- "Licensor" shall mean the copyright owner or entity authorized by\r
- the copyright owner that is granting the License.\r
-\r
- "Legal Entity" shall mean the union of the acting entity and all\r
- other entities that control, are controlled by, or are under common\r
- control with that entity. For the purposes of this definition,\r
- "control" means (i) the power, direct or indirect, to cause the\r
- direction or management of such entity, whether by contract or\r
- otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
- outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
- "You" (or "Your") shall mean an individual or Legal Entity\r
- exercising permissions granted by this License.\r
-\r
- "Source" form shall mean the preferred form for making modifications,\r
- including but not limited to software source code, documentation\r
- source, and configuration files.\r
-\r
- "Object" form shall mean any form resulting from mechanical\r
- transformation or translation of a Source form, including but\r
- not limited to compiled object code, generated documentation,\r
- and conversions to other media types.\r
-\r
- "Work" shall mean the work of authorship, whether in Source or\r
- Object form, made available under the License, as indicated by a\r
- copyright notice that is included in or attached to the work\r
- (an example is provided in the Appendix below).\r
-\r
- "Derivative Works" shall mean any work, whether in Source or Object\r
- form, that is based on (or derived from) the Work and for which the\r
- editorial revisions, annotations, elaborations, or other modifications\r
- represent, as a whole, an original work of authorship. For the purposes\r
- of this License, Derivative Works shall not include works that remain\r
- separable from, or merely link (or bind by name) to the interfaces of,\r
- the Work and Derivative Works thereof.\r
-\r
- "Contribution" shall mean any work of authorship, including\r
- the original version of the Work and any modifications or additions\r
- to that Work or Derivative Works thereof, that is intentionally\r
- submitted to Licensor for inclusion in the Work by the copyright owner\r
- or by an individual or Legal Entity authorized to submit on behalf of\r
- the copyright owner. For the purposes of this definition, "submitted"\r
- means any form of electronic, verbal, or written communication sent\r
- to the Licensor or its representatives, including but not limited to\r
- communication on electronic mailing lists, source code control systems,\r
- and issue tracking systems that are managed by, or on behalf of, the\r
- Licensor for the purpose of discussing and improving the Work, but\r
- excluding communication that is conspicuously marked or otherwise\r
- designated in writing by the copyright owner as "Not a Contribution."\r
-\r
- "Contributor" shall mean Licensor and any individual or Legal Entity\r
- on behalf of whom a Contribution has been received by Licensor and\r
- subsequently incorporated within the Work.\r
-\r
- 2. Grant of Copyright License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- copyright license to reproduce, prepare Derivative Works of,\r
- publicly display, publicly perform, sublicense, and distribute the\r
- Work and such Derivative Works in Source or Object form.\r
-\r
- 3. Grant of Patent License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- (except as stated in this section) patent license to make, have made,\r
- use, offer to sell, sell, import, and otherwise transfer the Work,\r
- where such license applies only to those patent claims licensable\r
- by such Contributor that are necessarily infringed by their\r
- Contribution(s) alone or by combination of their Contribution(s)\r
- with the Work to which such Contribution(s) was submitted. If You\r
- institute patent litigation against any entity (including a\r
- cross-claim or counterclaim in a lawsuit) alleging that the Work\r
- or a Contribution incorporated within the Work constitutes direct\r
- or contributory patent infringement, then any patent licenses\r
- granted to You under this License for that Work shall terminate\r
- as of the date such litigation is filed.\r
-\r
- 4. Redistribution. You may reproduce and distribute copies of the\r
- Work or Derivative Works thereof in any medium, with or without\r
- modifications, and in Source or Object form, provided that You\r
- meet the following conditions:\r
-\r
- (a) You must give any other recipients of the Work or\r
- Derivative Works a copy of this License; and\r
-\r
- (b) You must cause any modified files to carry prominent notices\r
- stating that You changed the files; and\r
-\r
- (c) You must retain, in the Source form of any Derivative Works\r
- that You distribute, all copyright, patent, trademark, and\r
- attribution notices from the Source form of the Work,\r
- excluding those notices that do not pertain to any part of\r
- the Derivative Works; and\r
-\r
- (d) If the Work includes a "NOTICE" text file as part of its\r
- distribution, then any Derivative Works that You distribute must\r
- include a readable copy of the attribution notices contained\r
- within such NOTICE file, excluding those notices that do not\r
- pertain to any part of the Derivative Works, in at least one\r
- of the following places: within a NOTICE text file distributed\r
- as part of the Derivative Works; within the Source form or\r
- documentation, if provided along with the Derivative Works; or,\r
- within a display generated by the Derivative Works, if and\r
- wherever such third-party notices normally appear. The contents\r
- of the NOTICE file are for informational purposes only and\r
- do not modify the License. You may add Your own attribution\r
- notices within Derivative Works that You distribute, alongside\r
- or as an addendum to the NOTICE text from the Work, provided\r
- that such additional attribution notices cannot be construed\r
- as modifying the License.\r
-\r
- You may add Your own copyright statement to Your modifications and\r
- may provide additional or different license terms and conditions\r
- for use, reproduction, or distribution of Your modifications, or\r
- for any such Derivative Works as a whole, provided Your use,\r
- reproduction, and distribution of the Work otherwise complies with\r
- the conditions stated in this License.\r
-\r
- 5. Submission of Contributions. Unless You explicitly state otherwise,\r
- any Contribution intentionally submitted for inclusion in the Work\r
- by You to the Licensor shall be under the terms and conditions of\r
- this License, without any additional terms or conditions.\r
- Notwithstanding the above, nothing herein shall supersede or modify\r
- the terms of any separate license agreement you may have executed\r
- with Licensor regarding such Contributions.\r
-\r
- 6. Trademarks. This License does not grant permission to use the trade\r
- names, trademarks, service marks, or product names of the Licensor,\r
- except as required for reasonable and customary use in describing the\r
- origin of the Work and reproducing the content of the NOTICE file.\r
-\r
- 7. Disclaimer of Warranty. Unless required by applicable law or\r
- agreed to in writing, Licensor provides the Work (and each\r
- Contributor provides its Contributions) on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
- implied, including, without limitation, any warranties or conditions\r
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
- PARTICULAR PURPOSE. You are solely responsible for determining the\r
- appropriateness of using or redistributing the Work and assume any\r
- risks associated with Your exercise of permissions under this License.\r
-\r
- 8. Limitation of Liability. In no event and under no legal theory,\r
- whether in tort (including negligence), contract, or otherwise,\r
- unless required by applicable law (such as deliberate and grossly\r
- negligent acts) or agreed to in writing, shall any Contributor be\r
- liable to You for damages, including any direct, indirect, special,\r
- incidental, or consequential damages of any character arising as a\r
- result of this License or out of the use or inability to use the\r
- Work (including but not limited to damages for loss of goodwill,\r
- work stoppage, computer failure or malfunction, or any and all\r
- other commercial damages or losses), even if such Contributor\r
- has been advised of the possibility of such damages.\r
-\r
- 9. Accepting Warranty or Additional Liability. While redistributing\r
- the Work or Derivative Works thereof, You may choose to offer,\r
- and charge a fee for, acceptance of support, warranty, indemnity,\r
- or other liability obligations and/or rights consistent with this\r
- License. However, in accepting such obligations, You may act only\r
- on Your own behalf and on Your sole responsibility, not on behalf\r
- of any other Contributor, and only if You agree to indemnify,\r
- defend, and hold each Contributor harmless for any liability\r
- incurred by, or claims asserted against, such Contributor by reason\r
- of your accepting any such warranty or additional liability.\r
-\r
- END OF TERMS AND CONDITIONS\r
-\r
- APPENDIX: How to apply the Apache License to your work.\r
-\r
- To apply the Apache License to your work, attach the following\r
- boilerplate notice, with the fields enclosed by brackets "[]"\r
- replaced with your own identifying information. (Don't include\r
- the brackets!) The text should be enclosed in the appropriate\r
- comment syntax for the file format. We also recommend that a\r
- file or class name and description of purpose be included on the\r
- same "printed page" as the copyright notice for easier\r
- identification within third-party archives.\r
-\r
- Copyright [yyyy] [name of copyright owner]\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-\r
-\r
+++ /dev/null
-Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
- Apache License\r
- Version 2.0, January 2004\r
- http://www.apache.org/licenses/\r
-\r
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
- 1. Definitions.\r
-\r
- "License" shall mean the terms and conditions for use, reproduction,\r
- and distribution as defined by Sections 1 through 9 of this document.\r
-\r
- "Licensor" shall mean the copyright owner or entity authorized by\r
- the copyright owner that is granting the License.\r
-\r
- "Legal Entity" shall mean the union of the acting entity and all\r
- other entities that control, are controlled by, or are under common\r
- control with that entity. For the purposes of this definition,\r
- "control" means (i) the power, direct or indirect, to cause the\r
- direction or management of such entity, whether by contract or\r
- otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
- outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
- "You" (or "Your") shall mean an individual or Legal Entity\r
- exercising permissions granted by this License.\r
-\r
- "Source" form shall mean the preferred form for making modifications,\r
- including but not limited to software source code, documentation\r
- source, and configuration files.\r
-\r
- "Object" form shall mean any form resulting from mechanical\r
- transformation or translation of a Source form, including but\r
- not limited to compiled object code, generated documentation,\r
- and conversions to other media types.\r
-\r
- "Work" shall mean the work of authorship, whether in Source or\r
- Object form, made available under the License, as indicated by a\r
- copyright notice that is included in or attached to the work\r
- (an example is provided in the Appendix below).\r
-\r
- "Derivative Works" shall mean any work, whether in Source or Object\r
- form, that is based on (or derived from) the Work and for which the\r
- editorial revisions, annotations, elaborations, or other modifications\r
- represent, as a whole, an original work of authorship. For the purposes\r
- of this License, Derivative Works shall not include works that remain\r
- separable from, or merely link (or bind by name) to the interfaces of,\r
- the Work and Derivative Works thereof.\r
-\r
- "Contribution" shall mean any work of authorship, including\r
- the original version of the Work and any modifications or additions\r
- to that Work or Derivative Works thereof, that is intentionally\r
- submitted to Licensor for inclusion in the Work by the copyright owner\r
- or by an individual or Legal Entity authorized to submit on behalf of\r
- the copyright owner. For the purposes of this definition, "submitted"\r
- means any form of electronic, verbal, or written communication sent\r
- to the Licensor or its representatives, including but not limited to\r
- communication on electronic mailing lists, source code control systems,\r
- and issue tracking systems that are managed by, or on behalf of, the\r
- Licensor for the purpose of discussing and improving the Work, but\r
- excluding communication that is conspicuously marked or otherwise\r
- designated in writing by the copyright owner as "Not a Contribution."\r
-\r
- "Contributor" shall mean Licensor and any individual or Legal Entity\r
- on behalf of whom a Contribution has been received by Licensor and\r
- subsequently incorporated within the Work.\r
-\r
- 2. Grant of Copyright License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- copyright license to reproduce, prepare Derivative Works of,\r
- publicly display, publicly perform, sublicense, and distribute the\r
- Work and such Derivative Works in Source or Object form.\r
-\r
- 3. Grant of Patent License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- (except as stated in this section) patent license to make, have made,\r
- use, offer to sell, sell, import, and otherwise transfer the Work,\r
- where such license applies only to those patent claims licensable\r
- by such Contributor that are necessarily infringed by their\r
- Contribution(s) alone or by combination of their Contribution(s)\r
- with the Work to which such Contribution(s) was submitted. If You\r
- institute patent litigation against any entity (including a\r
- cross-claim or counterclaim in a lawsuit) alleging that the Work\r
- or a Contribution incorporated within the Work constitutes direct\r
- or contributory patent infringement, then any patent licenses\r
- granted to You under this License for that Work shall terminate\r
- as of the date such litigation is filed.\r
-\r
- 4. Redistribution. You may reproduce and distribute copies of the\r
- Work or Derivative Works thereof in any medium, with or without\r
- modifications, and in Source or Object form, provided that You\r
- meet the following conditions:\r
-\r
- (a) You must give any other recipients of the Work or\r
- Derivative Works a copy of this License; and\r
-\r
- (b) You must cause any modified files to carry prominent notices\r
- stating that You changed the files; and\r
-\r
- (c) You must retain, in the Source form of any Derivative Works\r
- that You distribute, all copyright, patent, trademark, and\r
- attribution notices from the Source form of the Work,\r
- excluding those notices that do not pertain to any part of\r
- the Derivative Works; and\r
-\r
- (d) If the Work includes a "NOTICE" text file as part of its\r
- distribution, then any Derivative Works that You distribute must\r
- include a readable copy of the attribution notices contained\r
- within such NOTICE file, excluding those notices that do not\r
- pertain to any part of the Derivative Works, in at least one\r
- of the following places: within a NOTICE text file distributed\r
- as part of the Derivative Works; within the Source form or\r
- documentation, if provided along with the Derivative Works; or,\r
- within a display generated by the Derivative Works, if and\r
- wherever such third-party notices normally appear. The contents\r
- of the NOTICE file are for informational purposes only and\r
- do not modify the License. You may add Your own attribution\r
- notices within Derivative Works that You distribute, alongside\r
- or as an addendum to the NOTICE text from the Work, provided\r
- that such additional attribution notices cannot be construed\r
- as modifying the License.\r
-\r
- You may add Your own copyright statement to Your modifications and\r
- may provide additional or different license terms and conditions\r
- for use, reproduction, or distribution of Your modifications, or\r
- for any such Derivative Works as a whole, provided Your use,\r
- reproduction, and distribution of the Work otherwise complies with\r
- the conditions stated in this License.\r
-\r
- 5. Submission of Contributions. Unless You explicitly state otherwise,\r
- any Contribution intentionally submitted for inclusion in the Work\r
- by You to the Licensor shall be under the terms and conditions of\r
- this License, without any additional terms or conditions.\r
- Notwithstanding the above, nothing herein shall supersede or modify\r
- the terms of any separate license agreement you may have executed\r
- with Licensor regarding such Contributions.\r
-\r
- 6. Trademarks. This License does not grant permission to use the trade\r
- names, trademarks, service marks, or product names of the Licensor,\r
- except as required for reasonable and customary use in describing the\r
- origin of the Work and reproducing the content of the NOTICE file.\r
-\r
- 7. Disclaimer of Warranty. Unless required by applicable law or\r
- agreed to in writing, Licensor provides the Work (and each\r
- Contributor provides its Contributions) on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
- implied, including, without limitation, any warranties or conditions\r
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
- PARTICULAR PURPOSE. You are solely responsible for determining the\r
- appropriateness of using or redistributing the Work and assume any\r
- risks associated with Your exercise of permissions under this License.\r
-\r
- 8. Limitation of Liability. In no event and under no legal theory,\r
- whether in tort (including negligence), contract, or otherwise,\r
- unless required by applicable law (such as deliberate and grossly\r
- negligent acts) or agreed to in writing, shall any Contributor be\r
- liable to You for damages, including any direct, indirect, special,\r
- incidental, or consequential damages of any character arising as a\r
- result of this License or out of the use or inability to use the\r
- Work (including but not limited to damages for loss of goodwill,\r
- work stoppage, computer failure or malfunction, or any and all\r
- other commercial damages or losses), even if such Contributor\r
- has been advised of the possibility of such damages.\r
-\r
- 9. Accepting Warranty or Additional Liability. While redistributing\r
- the Work or Derivative Works thereof, You may choose to offer,\r
- and charge a fee for, acceptance of support, warranty, indemnity,\r
- or other liability obligations and/or rights consistent with this\r
- License. However, in accepting such obligations, You may act only\r
- on Your own behalf and on Your sole responsibility, not on behalf\r
- of any other Contributor, and only if You agree to indemnify,\r
- defend, and hold each Contributor harmless for any liability\r
- incurred by, or claims asserted against, such Contributor by reason\r
- of your accepting any such warranty or additional liability.\r
-\r
- END OF TERMS AND CONDITIONS\r
-\r
- APPENDIX: How to apply the Apache License to your work.\r
-\r
- To apply the Apache License to your work, attach the following\r
- boilerplate notice, with the fields enclosed by brackets "[]"\r
- replaced with your own identifying information. (Don't include\r
- the brackets!) The text should be enclosed in the appropriate\r
- comment syntax for the file format. We also recommend that a\r
- file or class name and description of purpose be included on the\r
- same "printed page" as the copyright notice for easier\r
- identification within third-party archives.\r
-\r
- Copyright [yyyy] [name of copyright owner]\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-\r
-\r
-# FOR COMMENTING DEFINITION, MUST USE %% instead of %
-%global use_autostart "-DUSE_AUTOSTART=1"
-#%%global test_client "-DTEST_CLIENT=1"
-%global bindir /usr/apps/%{name}
-
-################################################################################
-# package : smartcard-service #
-################################################################################
Name: smartcard-service
Summary: Smartcard Service FW
-Version: 0.1.57
+Version: 0.1.58
Release: 0
Group: Network & Connectivity
-Requires: %{name}-common = %{version}-%{release}
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires: %{name}-common = %{version}-%{release}
-Requires: security-config
%if 0%{?gtests:1}
BuildRequires: pkgconfig(gmock)
%description
Smartcard Service FW.
-
-%files
-%manifest %{name}.manifest
-%license LICENSE.APLv2
-%defattr(-,root,root,-)
-%{bindir}/bin/smartcard-daemon
-%if 0%{?test_client:1}
- %{bindir}/bin/smartcard-test-client
-%endif
-%if 0%{?use_autostart:1}
- %{_datadir}/dbus-1/system-services/org.tizen.SmartcardService.service
-%endif
-%{bindir}/%{name}
-/etc/dbus-1/system.d/org.tizen.SmartcardService.conf
-%if 0%{?gtests:1}
-%{_bindir}/gtest*
-%endif
-
-%post
-ln -sf /usr/apps/%{name}/bin/smartcard-daemon /usr/bin/smartcard-daemon
-%if 0%{?test_client:1}
- ln -sf /usr/apps/%{name}/bin/smartcard-test-client /usr/bin/smartcard-test-client
-%endif
-
-%postun
-rm -f /usr/bin/smartcard-daemon
-
-
-################################################################################
-# package : smartcard-service-common #
-################################################################################
%package common
Summary: common smartcard service
Group: Development/Libraries
%description common
common smartcard service.
-
-%files common
-%manifest %{name}-common.manifest
-%license LICENSE.APLv2
-%defattr(-,root,root,-)
-%{_libdir}/lib%{name}-common.so.*
-
-
-################################################################################
-# package : smartcard-service-common-devel #
-################################################################################
%package common-devel
Summary: common smartcard service
Group: Development/Libraries
%description common-devel
common smartcard service.
-
-%files common-devel
-%manifest %{name}-common-devel.manifest
-%defattr(-,root,root,-)
-%{_includedir}/%{name}-common/*
-%{_libdir}/lib%{name}-common.so
-%{_libdir}/pkgconfig/%{name}-common.pc
-
-###
-
-################################################################################
-# common... #
-################################################################################
%prep
%setup -q
export LDFLAGS+=" -lgcov "
%endif
-%if 0%{?sec_build_binary_debug_enable}
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-%endif
-export LDFLAGS+="-Wl,-Bsymbolic-functions"
-
-
-mkdir obj-arm-limux-qnueabi
-cd obj-arm-limux-qnueabi
-%cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} %{?use_autostart} %{?use_gdbus} %{?test_client} \
- -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
-DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
%install
-cd obj-arm-limux-qnueabi
%make_install
mkdir -p %{buildroot}/etc/dbus-1/system.d/
-cp -af %{_builddir}/%{name}-%{version}/packaging/%{name} %{buildroot}%{bindir}
cp -af %{_builddir}/%{name}-%{version}/packaging/org.tizen.SmartcardService.conf %{buildroot}/etc/dbus-1/system.d/
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_bindir}/smartcard-daemon
+%{_sysconfdir}/dbus-1/system.d/org.tizen.SmartcardService.conf
+%{_datadir}/dbus-1/system-services/org.tizen.SmartcardService.service
+%if 0%{?gtests:1}
+%{_bindir}/gtest*
+%endif
+%license LICENSE.APLv2
+
+%files common
+%manifest %{name}-common.manifest
+%defattr(-,root,root,-)
+%{_libdir}/lib%{name}-common.so.*
+%license LICENSE.APLv2
+
+%files common-devel
+%manifest %{name}-common-devel.manifest
+%defattr(-,root,root,-)
+%{_includedir}/%{name}-common/*
+%{_libdir}/lib%{name}-common.so
+%{_libdir}/pkgconfig/%{name}-common.pc
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ SRCS)
-### for private
-ADD_DEFINITIONS("-D__PRIVATE")
-
IF(BUILD_GTESTS)
ADD_DEFINITIONS(-DBUILD_GTEST)
ENDIF(BUILD_GTESTS)
-FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
-EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
- " \\
- --generate-c-code ${CMAKE_CURRENT_SOURCE_DIR}/private/access-control-gdbus \\
- --c-namespace SmartcardService\\
- --interface-prefix org.tizen.SmartcardService. \\
- ${CMAKE_CURRENT_SOURCE_DIR}/private/access-control-gdbus.xml \\
- ")
-
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/private SRCS)
-##############
-
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
SET(CMAKE_BUILD_TYPE "Release")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
ENDIF()
-ADD_DEFINITIONS("-DPREFIX=\"/usr/apps/smartcard-service\"")
+ADD_DEFINITIONS("-DPREFIX=\"/usr\"")
ADD_DEFINITIONS("-DLOG_TAG=\"SMARTCARD_SERVICE\"")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-L../common" "-lsmartcard-service-common" "-pie -ldl")
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/smartcard-service/bin)
-IF("${USE_AUTOSTART}" STREQUAL "1")
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.SmartcardService.service DESTINATION share/dbus-1/system-services)
-ENDIF()
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.SmartcardService.service DESTINATION share/dbus-1/system-services)
[D-BUS Service]
Name=org.tizen.SmartcardService
-Exec=/usr/apps/smartcard-service/bin/smartcard-daemon
+Exec=/usr/bin/smartcard-daemon
MemoryLimit=10M
User=network_fw
Group=network_fw
+++ /dev/null
-/*
- * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-/* standard library header */
-#include <glib.h>
-#include <gio/gio.h>
-#include <map>
-
-/* local header */
-#include "Debug.h"
-#include "APDUHelper.h"
-#include "ServerResource.h"
-#include "SignatureHelper.h"
-#include "ServerGDBus.h"
-#include "PKCS15CDFACL.h"
-#include "access-control-gdbus.h"
-
-using namespace std;
-using namespace smartcard_service_api;
-
-static SmartcardServiceAccessControl *access_control;
-static map<string, ByteArray> mapGranted;
-static PKCS15CDFACL cdfAcl;
-
-static void _load_granted_package_info()
-{
- mapGranted.clear();
-
- /* TODO : load information form file */
- mapGranted.insert(make_pair("nfc-manager", ByteArray::EMPTY));
-}
-
-/* LCOV_EXCL_START */
-static gboolean _compare_hash(char *package, ByteArray &hash)
-{
- gboolean result = false;
- vector<ByteArray> hashes;
-
- /* get certificate hashes by pid */
- if (SignatureHelper::getCertificationHashes(package, hashes) == true) {
- vector<ByteArray>::iterator item;
-
- for (item = hashes.begin(); item != hashes.end(); item++) {
- if (*item == hash) {
- result = true;
- break;
- }
- }
- } else {
- _ERR("getCertificationHashes failed, [%s]", package);
- }
-
- return result;
-}
-
-static gboolean _check_permission(pid_t pid)
-{
-#if (BUILD_GTEST != 0)
- return true;
-#endif
-
- gboolean result = false;
- char package[1024];
-
- if (SignatureHelper::getPackageName(pid,
- package, sizeof(package)) == 0) {
- map<string, ByteArray>::iterator item;
-
- item = mapGranted.find(package);
- if (item != mapGranted.end()) {
- /* TODO : check privilege */
- if (false) {
- result = _compare_hash(package, item->second);
- } else {
- result = true;
- }
- }
- } else {
- _ERR("aul_app_get_pkgname_bypid failed");
- }
-
- return result;
-}
-
-static bool _get_se_name(unsigned int se_type, char *buf, size_t len)
-{
-
- bool result = false;
-
- switch ((se_type >> 4) & 0x0F) {
- case 1 :
- snprintf(buf, len, "SIM%d", (se_type & 0x0F) + 1);
- result = true;
- break;
-
- case 2 :
- snprintf(buf, len, "eSE");
- result = true;
- break;
-
- default :
- break;
- }
-
- return result;
-}
-
-static bool _is_authorized_request(GDBusMethodInvocation *invocation,
- const char *rights)
-{
- bool result = true;
-
- return result;
-}
-
-static gboolean __process_is_authorized_nfc_access(
- SmartcardServiceAccessControl *object,
- GDBusMethodInvocation *invocation,
- guint se_type,
- const gchar *package,
- GVariant *aid,
- void *user_data)
-{
- bool result = false;
- const char *error;
- const char *name;
- char se[10];
- pid_t pid;
-
- ByteArray temp;
- Terminal *terminal;
- vector<ByteArray> hashes;
-
- _INFO("[MSG_IS_AUTHORIZED_NFC_ACCESS]");
-
- ServerResource &resource = ServerResource::getInstance();
-
- name = g_dbus_method_invocation_get_sender(invocation);
-
- pid = ServerGDBus::getInstance().getPID(name);
-
- _INFO("service requested, pid [%d]", pid);
-
- if (pid < 0) {
- error = "invalid pid";
-
- _ERR("%s, [%d]", error, pid);
-
- goto ERR;
- }
-
- /* check process permission */
- if (_check_permission(pid) == false) {
- error = "permission denied";
-
- _ERR("%s, [%d]", error, pid);
-
- goto ERR;
- }
-
- /* load secure elements */
- resource.loadSecureElements();
-
- if (_get_se_name(se_type, se, sizeof(se)) == false) {
- error = "unknown SE type";
-
- _ERR("%s, [%d]", error, se_type);
-
- goto ERR;
- }
-
- _INFO("SE : [%s]", se);
-
- terminal = resource.getTerminal(se);
- if (terminal == NULL) {
- error = "failed getting terminal";
-
- _ERR("%s, [%d]", error, se_type);
-
- goto ERR;
- }
-
- if (terminal->isSecureElementPresence() == false) {
- error = "terminal is not available now";
-
- _ERR("%s, [%d]", error, se_type);
-
- goto ERR;
- }
-
- /* get certificate hashes */
- if (SignatureHelper::getCertificationHashes(package, hashes) == false) {
- error = "failed getting certificates";
-
- _ERR("%s, [%s]", error, package);
-
- goto ERR;
- }
-
- /* convert AID */
- GDBusHelper::convertVariantToByteArray(aid, temp);
-
- result = resource.isAuthorizedNFCAccess(terminal, temp, hashes);
-
- /* response to client */
- smartcard_service_access_control_complete_is_authorized_nfc_access(
- object, invocation, result);
-
- return true;
-
-ERR :
- g_dbus_method_invocation_return_dbus_error(
- invocation,
- "org.tizen.SmartcardService.AccessControl.Error",
- error);
-
- return false;
-}
-
-static void _process_is_authorized_nfc_access(vector<void *> ¶ms)
-{
- SmartcardServiceAccessControl *object;
- GDBusMethodInvocation *invocation;
- guint se_type;
- gchar *package;
- GVariant *aid;
- void *user_data;
-
- if (params.size() != 6) {
- _ERR("invalid parameter");
-
- return;
- }
-
- object = (SmartcardServiceAccessControl *)params[0];
- invocation = (GDBusMethodInvocation *)params[1];
- se_type = (gulong)params[2];
- package = (gchar *)params[3];
- aid = (GVariant *)params[4];
- user_data = params[5];
-
- __process_is_authorized_nfc_access(object, invocation, se_type,
- package, aid, user_data);
-
- g_variant_unref(aid);
-
- g_free(package);
-
- g_object_unref(invocation);
- g_object_unref(object);
-
- /* FIXME : disable killing process code */
-// ServerResource::getInstance().finish();
-}
-
-static gboolean _handle_is_authorized_nfc_access(
- SmartcardServiceAccessControl *object,
- GDBusMethodInvocation *invocation,
- guint se_type,
- const gchar *package,
- GVariant *aid,
- void *user_data)
-{
- vector<void *> params;
-
- /* apply user space smack */
- if (_is_authorized_request(invocation, "r") == true) {
- g_object_ref(object);
- params.push_back((void *)object);
-
- g_object_ref(invocation);
- params.push_back((void *)invocation);
-
- params.push_back((void *)se_type);
- params.push_back((void *)g_strdup(package));
-
- g_variant_ref(aid);
- params.push_back((void *)aid);
-
- params.push_back((void *)user_data);
-
- GDBusDispatcher::getInstance().push(
- _process_is_authorized_nfc_access,
- params);
- } else {
- _ERR("access denied");
-
- g_dbus_method_invocation_return_dbus_error(
- invocation,
- "org.tizen.SmartcardService.AccessControl.Error",
- "access denied");
-
- /* FIXME : disable killing process code */
-// ServerResource::getInstance().finish();
- }
-
- return true;
-}
-
-static bool __load_cdf_acl(Terminal *terminal)
-{
- bool result = false;
- ServerResource &resource = ServerResource::getInstance();
- ServerChannel *channel;
-
- if (terminal == NULL) {
- return result;
- }
-
-// if (terminal->open() == SCARD_ERROR_OK) {
- channel = resource.createInternalChannel(terminal, 1);
- if (channel != NULL) {
- int ret;
-
- ret = cdfAcl.updateACL(channel);
- if (ret == 0) {
- result = true;
- } else {
- _ERR("acl is null");
- result = false;
- }
-
- delete channel;
- } else {
- _ERR("alloc failed");
- }
-//
-// terminal->close();
-// } else {
-// _ERR("terminal open failed");
-// }
-
- return result;
-}
-
-static gboolean __process_is_authorized_extra_access(
- SmartcardServiceAccessControl *object,
- GDBusMethodInvocation *invocation,
- guint se_type,
- const gchar *package,
- void *user_data)
-{
- bool result = false;
- const char *error;
- const char *name;
- char se[10];
- pid_t pid;
-
- ByteArray temp;
- Terminal *terminal;
- vector<ByteArray> hashes;
-
- _INFO("[MSG_IS_AUTHORIZED_EXTRA_ACCESS]");
-
- ServerResource &resource = ServerResource::getInstance();
-
- name = g_dbus_method_invocation_get_sender(invocation);
-
- pid = ServerGDBus::getInstance().getPID(name);
-
- _INFO("service requested, pid [%d]", pid);
-
- if (pid < 0) {
- error = "invalid pid";
-
- _ERR("%s, [%d]", error, pid);
-
- goto ERR;
- }
-
- /* check process permission */
- if (_check_permission(pid) == false) {
- error = "permission denied";
-
- _ERR("%s, [%d]", error, pid);
-
- goto ERR;
- }
-
- /* load secure elements */
- resource.loadSecureElements();
-
- if (_get_se_name(se_type, se, sizeof(se)) == false) {
- error = "unknown SE type";
-
- _ERR("%s, [%d]", error, se_type);
-
- goto ERR;
- }
-
- _INFO("SE : [%s]", se);
-
- terminal = resource.getTerminal(se);
- if (terminal == NULL) {
- error = "failed getting terminal";
-
- _ERR("%s, [%d]", error, se_type);
-
- goto ERR;
- }
-
- if (terminal->isSecureElementPresence() == false) {
- error = "terminal is not available now";
-
- _ERR("%s, [%d]", error, se_type);
-
- goto ERR;
- }
-
- /* get certificate hashes */
- if (SignatureHelper::getCertificationHashes(package, hashes) == false) {
- error = "failed getting certificates";
-
- _ERR("%s, [%s]", error, package);
-
- goto ERR;
- }
-
- if ((se_type & 0xF0) == 0x10/* SIM */) {
- /* load CDF */
- if (cdfAcl.hasConditions() == false) {
- _ERR("cdf rule doesn't be load");
- __load_cdf_acl(terminal);
- }
-
- /* check access */
- result = cdfAcl.isAuthorizedAccess(
- AccessControlList::ALL_SE_APPS, hashes);
- } else if ((se_type & 0xF0) == 0x20/* eSE */) {
- if (terminal->open() == true) {
- result = resource.isAuthorizedAccess(terminal,
- AccessControlList::ALL_SE_APPS, hashes);
-
- terminal->close();
- }
- }
-
- /* response to client */
- smartcard_service_access_control_complete_is_authorized_extra_access(
- object, invocation, result);
-
- return true;
-
-ERR :
- g_dbus_method_invocation_return_dbus_error(
- invocation,
- "org.tizen.SmartcardService.AccessControl.Error",
- error);
-
- return false;
-}
-
-static void _process_is_authorized_extra_access(vector<void *> ¶ms)
-{
- SmartcardServiceAccessControl *object;
- GDBusMethodInvocation *invocation;
- guint se_type;
- gchar *package;
- void *user_data;
-
- if (params.size() != 5) {
- _ERR("invalid parameter");
-
- return;
- }
-
- object = (SmartcardServiceAccessControl *)params[0];
- invocation = (GDBusMethodInvocation *)params[1];
- se_type = (gulong)params[2];
- package = (gchar *)params[3];
- user_data = params[4];
-
- __process_is_authorized_extra_access(object, invocation, se_type,
- package, user_data);
-
- g_free(package);
-
- g_object_unref(invocation);
- g_object_unref(object);
-
- /* FIXME : disable killing process code */
-// ServerResource::getInstance().finish();
-}
-
-static gboolean _handle_is_authorized_extra_access(
- SmartcardServiceAccessControl *object,
- GDBusMethodInvocation *invocation,
- guint se_type,
- const gchar *package,
- void *user_data)
-{
- vector<void *> params;
-
- /* apply user space smack */
- if (_is_authorized_request(invocation, "r") == true) {
- g_object_ref(object);
- params.push_back((void *)object);
-
- g_object_ref(invocation);
- params.push_back((void *)invocation);
-
- params.push_back((void *)se_type);
- params.push_back((void *)g_strdup(package));
-
- params.push_back((void *)user_data);
-
- GDBusDispatcher::getInstance().push(
- _process_is_authorized_extra_access,
- params);
- } else {
- _ERR("access denied");
-
- g_dbus_method_invocation_return_dbus_error(
- invocation,
- "org.tizen.SmartcardService.AccessControl.Error",
- "access denied");
-
- /* FIXME : disable killing process code */
-// ServerResource::getInstance().finish();
- }
-
- return true;
-}
-/* LCOV_EXCL_STOP */
-
-static bool _init_access_control(void *connection)
-{
- GError *error = NULL;
-
- access_control = smartcard_service_access_control_skeleton_new();
-
- g_signal_connect(access_control,
- "handle-is-authorized-nfc-access",
- G_CALLBACK(_handle_is_authorized_nfc_access),
- NULL);
-
- g_signal_connect(access_control,
- "handle-is-authorized-extra-access",
- G_CALLBACK(_handle_is_authorized_extra_access),
- NULL);
-
- if (g_dbus_interface_skeleton_export(
- G_DBUS_INTERFACE_SKELETON(access_control),
- (GDBusConnection *)connection,
- "/org/tizen/SmartcardService/AccessControl",
- &error) == false)
- {
- /* LCOV_EXCL_START */
- _ERR("Can not skeleton_export %s", error->message);
-
- g_error_free(error);
- g_object_unref(access_control);
- access_control = NULL;
-
- return false;
- /* LCOV_EXCL_STOP */
- }
-
- return true;
-}
-
-static void _deinit_access_control()
-{
- if (access_control != NULL) {
- g_object_unref(access_control);
- access_control = NULL;
- }
-}
-
-extern "C" bool smartcard_service_init_access_control(void *connection)
-{
- _load_granted_package_info();
-
- return _init_access_control(connection);
-}
-
-extern "C" void smartcard_service_deinit_access_control()
-{
- _deinit_access_control();
-}
+++ /dev/null
-/*
- * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-/* standard library header */
-
-/* SLP library header */
-
-/* local header */
-#include "Debug.h"
-#include "PKCS15CDFACL.h"
-#include "PKCS15ODF.h"
-#include "OpensslHelper.h"
-#include "AccessCondition.h"
-
-#ifndef EXTERN_API
-#define EXTERN_API __attribute__((visibility("default")))
-#endif
-
-namespace smartcard_service_api
-{
- PKCS15CDFACL::PKCS15CDFACL() : AccessControlList()
- {
- }
-
- PKCS15CDFACL::~PKCS15CDFACL()
- {
- }
-
- /* LCOV_EXCL_START */
- int PKCS15CDFACL::loadACL(Channel *channel)
- {
- int result = SCARD_ERROR_OK;
-
- _BEGIN();
-
- if (channel == NULL)
- {
- return SCARD_ERROR_ILLEGAL_PARAM;
- }
-
- releaseACL();
-
- PKCS15 pkcs15(channel);
-
- result = pkcs15.select();
- if (result >= SCARD_ERROR_OK)
- {
- PKCS15ODF *odf;
-
- result = SCARD_ERROR_OK;
-
- if ((odf = pkcs15.getODF()) != NULL)
- {
- PKCS15CDF *cdf;
-
- cdf = odf->getCDF();
- if (cdf != NULL)
- {
- result = loadRules(channel, cdf);
- if (result == SCARD_ERROR_OK) {
- printAccessControlList();
- } else {
- result = SCARD_ERROR_OK;
- }
- } else {
- _ERR("dodf null, every request will be denied.");
- }
- } else {
- _ERR("odf null, every request will be denied.");
- }
- } else {
- _ERR("failed to open PKCS#15, every request will be denied.");
- }
-
- _END();
-
- return result;
- }
-
- int PKCS15CDFACL::loadRules(Channel *channel, PKCS15CDF *cdf)
- {
- int result = 0;
- size_t i;
- ByteArray hash;
- const CertificateType *type;
- AccessCondition condition;
-
- condition.setAID(AccessControlList::ALL_SE_APPS);
-
- for (i = 0; i < cdf->getCount(); i++) {
- type = cdf->getCertificateType(i);
- if(type == NULL)
- continue;
-
- OpensslHelper::digestBuffer("SHA1", type->certificate, hash);
-
- _INFO("cdf[%zu] = %s", i, hash.toString().c_str());
-
- condition.addAccessRule(hash);
- }
-
- pair<ByteArray, AccessCondition> newItem(
- AccessControlList::ALL_SE_APPS, condition);
-
- mapConditions.insert(newItem);
-
- return result;
- }
- /* LCOV_EXCL_STOP */
-} /* namespace smartcard_service_api */
+++ /dev/null
-/*
- * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#ifndef PKCS15CDFACL_H_
-#define PKCS15CDFACL_H_
-
-/* standard library header */
-
-/* SLP library header */
-
-/* local header */
-#include "smartcard-types.h"
-#ifdef __cplusplus
-#include "AccessControlList.h"
-#include "PKCS15.h"
-#endif /* __cplusplus */
-
-#ifdef __cplusplus
-namespace smartcard_service_api
-{
- class PKCS15CDFACL : public AccessControlList
- {
- private:
- int loadRules(Channel *channel, PKCS15CDF *cdf);
-
- public:
- PKCS15CDFACL();
- ~PKCS15CDFACL();
-
- int loadACL(Channel *channel);
- };
-
-} /* namespace smartcard_service_api */
-#endif /* __cplusplus */
-#endif /* PKCS15CDFACL_H_ */
+++ /dev/null
-<!--
- org.tizen.SmartcardService
--->
-
-<node>
- <interface name="org.tizen.SmartcardService.AccessControl">
- <!--
- isAuthorizedExtraAccess
- -->
- <method name="isAuthorizedExtraAccess">
- <arg type="u" name="se_type" direction="in" />
- <arg type="s" name="package" direction="in" />
- <arg type="b" name="result" direction="out" />
- </method>
-
- <!--
- isAuthorizedNfcAccess
- -->
- <method name="isAuthorizedNfcAccess">
- <arg type="u" name="se_type" direction="in" />
- <arg type="s" name="package" direction="in" />
- <arg type="a(y)" name="aid" direction="in" />
- <arg type="b" name="result" direction="out" />
- </method>
- </interface>
-</node>
+++ /dev/null
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
-PROJECT(smartcard-test-client CXX)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../client/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-#AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ SRCS)
-SET(SRCS "${CMAKE_CURRENT_SOURCE_DIR}/test-client-sync.cpp")
-#SET(SRCS "${CMAKE_CURRENT_SOURCE_DIR}/test-client.cpp")
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
- SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs_test_client REQUIRED glib-2.0 dlog)
-
-FOREACH(flag ${pkgs_test_client_CFLAGS})
- SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-MESSAGE("CHECK MODULE in ${PROJECT_NAME} ${pkgs_test_client_LDFLAGS}")
-
-# this for NFC flag
-
-SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden -std=c++0x")
-SET(ARM_CXXFLAGS "${ARM_CXXLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}")
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
-
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
- ADD_DEFINITIONS("-DTARGET")
- MESSAGE("add -DTARGET")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARM_CXXFLAGS}")
-ENDIF()
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-#ADD_DEFINITIONS("-DSLP_DEBUG")
-ADD_DEFINITIONS("-DLOG_TAG=\"SMARTCARD_SERVICE_TEST\"")
-
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_test_client_LDFLAGS} "-L../common" "-lsmartcard-service-common" "-L../client" "-lsmartcard-service" "-pie -ldl")
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/smartcard-service/bin)
+++ /dev/null
-/*
- * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-
-#include "Debug.h"
-#include "SEService.h"
-#include "Reader.h"
-#include "Session.h"
-#include "APDUHelper.h"
-#include "ClientChannel.h"
-
-using namespace smartcard_service_api;
-
-typedef struct _user_context_t
-{
- Session *clientSession;
- SEServiceHelper *clientService;
- Channel *clientChannel;
-}
-user_context_t;
-
-/* global variable */
-GMainLoop *loop = NULL;
-user_context_t user_context = { 0, };
-
-void testCloseCallback(int error, void *userData);
-void testTransmitCallback(unsigned char *buffer, unsigned int length, int error, void *userData);
-void testOpenChannelCallback(Channel *channel, int error, void *userData);
-void testGetATRCallback(unsigned char *atr, unsigned int length, int error, void *userData);
-void testCloseSessionCallback(int error, void *userData);
-void testOpenSessionCallback(SessionHelper *session, int error, void *userData);
-void testConnectedCallback(SEServiceHelper *service, void *context);
-
-class TestEventHandler : public SEServiceListener
-{
- void serviceConnected(SEServiceHelper *service, void *userData)
- {
- _BEGIN();
- testConnectedCallback(service, userData);
- _END();
- }
-
- void eventHandler(SEServiceHelper *service, char *seName, int event, void *userData)
- {
- _BEGIN();
-
- _INFO("event occurred service [%p], seName[%p], event [%d]", service, seName, event);
-
- _END();
- }
-
- void errorHandler(SEServiceHelper *service, int error, void *userData)
- {
- _BEGIN();
-
- _ERR("error occurred service [%p], error [%d]", service, error);
-
- _END();
- }
-};
-
-TestEventHandler testEventHandler;
-
-void testConnectedCallback(SEServiceHelper *service, void *userData)
-{
- vector<ReaderHelper *> readers;
- user_context_t *context = (user_context_t *)userData;
- uint8_t buffer[] = { 0xA0, 0x00, 0x00, 0x00, 0x63, 0x50, 0x4B, 0x43, 0x53, 0x2D, 0x31, 0x35 };
-// uint8_t buffer[] = { 0xA0, 0x00, 0x00, 0x00, 0x63, 0x50, 0x4B, 0x43, 0x53, 0x2D, 0x31, 0x35 };
-
- _BEGIN();
-
- if (service != NULL) {
- _DBG("callback called, service [%p]", service);
-
- context->clientService = service;
-
- readers = service->getReaders();
-
- size_t i;
- for (i = 0; i < readers.size(); i++) {
- Reader *reader = NULL;
-
- reader = (Reader *)readers[i];
-
- _DBG("reader [%p]", reader);
-
- Session *session = (Session *)reader->openSessionSync();
- if (session != NULL) {
- _DBG("session [%p]", session);
-
- ByteArray temp;
- try
- {
- temp = session->getATRSync();
- }
- catch (...)
- {
- _ERR("exception....");
- }
- _DBG("atr[%d] : %s", temp.size(), temp.toString().c_str());
-
- ByteArray aid;
-
- aid.assign(buffer, sizeof(buffer));
- try
- {
- ClientChannel *channel = (ClientChannel *)session->openLogicalChannelSync(aid);
- if (channel != NULL) {
- _DBG("channel [%p]", channel);
- ByteArray response;
- ByteArray data, command;
- int fid = 0x00003150;
-
- response = channel->getSelectResponse();
- _INFO("response : %s", response.toString().c_str());
-
- _DBG("isBasicChannel() = %s", channel->isBasicChannel() ? "Basic" : "Logical");
- _DBG("isClosed() = %s", channel->isClosed() ? "Closed" : "Opened");
-
- data.assign((unsigned char *)&fid, 2);
- command = APDUHelper::generateAPDU(APDUHelper::COMMAND_SELECT_BY_ID, 0, data);
- int error = channel->transmitSync(command, response);
-
- _INFO("error : %d, response : %s", error, response.toString().c_str());
-
- channel->closeSync();
- } else {
- _ERR("openLogicalChannelSync failed");
- }
- }
- catch (...)
- {
- _ERR("exception....");
- }
-
- session->closeSync();
- } else {
- _ERR("openSessionSync failed");
- }
- }
-
- ((SEService *)service)->shutdownSync();
- } else {
- _ERR("service is NULL");
- }
-
- g_main_loop_quit(loop);
-
- _END();
-}
-
-int main(int argv, char *args[])
-{
- SEService *service = new SEService((void *)&user_context, &testEventHandler);
-
- loop = g_main_new(TRUE);
- g_main_loop_run(loop);
-
- if (service != NULL)
- delete service;
-
- return 0;
-}
+++ /dev/null
-/*
- * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-
-#include "Debug.h"
-#include "SEService.h"
-#include "Reader.h"
-#include "Session.h"
-#include "APDUHelper.h"
-
-using namespace smartcard_service_api;
-
-typedef struct _user_context_t
-{
- Session *clientSession;
- SEServiceHelper *clientService;
- Channel *clientChannel;
-}
-user_context_t;
-
-/* global variable */
-GMainLoop *loop = NULL;
-user_context_t user_context = { 0, };
-
-void testCloseCallback(int error, void *userData);
-void testTransmitCallback(unsigned char *buffer, unsigned int length, int error, void *userData);
-void testOpenChannelCallback(Channel *channel, int error, void *userData);
-void testGetATRCallback(unsigned char *atr, unsigned int length, int error, void *userData);
-void testCloseSessionCallback(int error, void *userData);
-void testOpenSessionCallback(SessionHelper *session, int error, void *userData);
-void testConnectedCallback(SEServiceHelper *service, void *context);
-
-class TestEventHandler : public SEServiceListener
-{
- void serviceConnected(SEServiceHelper *service, void *userData)
- {
- _BEGIN();
- testConnectedCallback(service, userData);
- _END();
- }
-
- void eventHandler(SEServiceHelper *service, char *seName, int event, void *userData)
- {
-// user_context_t *context = (user_context_t *)userData;
- vector<ReaderHelper *> readers;
- size_t i;
-
- _BEGIN();
-
- _INFO("event occurred service [%p], seName[%s], event [%d], userData [%p]", service, seName, event, userData);
-
- readers = service->getReaders();
-
- for (i = 0; i < readers.size(); i++)
- {
- _DBG("Reader[%d] : name [%s], %s", i, readers[i]->getName(), readers[i]->isSecureElementPresent() ? "available" : "unavailable");
- }
-
- if (event == 1)
- {
- testConnectedCallback(service, userData);
- }
-
- _END();
- }
-
- void errorHandler(SEServiceHelper *service, int error, void *userData)
- {
- _BEGIN();
-
- _ERR("error occurred service [%p], error [%d]", service, error);
-
- _END();
- }
-};
-
-TestEventHandler testEventHandler;
-
-void testCloseCallback(int error, void *userData)
-{
- user_context_t *context = (user_context_t *)userData;
-
- _DBG("result [%d], userData [%p]", error, userData);
-
- context->clientService->shutdown();
-}
-
-void testTransmitCallback(unsigned char *buffer, unsigned int length, int error, void *userData)
-{
- ByteArray response(buffer, length);
- user_context_t *context = (user_context_t *)userData;
-
- _DBG("buffer [%p], length [%d], error [%d], userData [%p]", buffer, length, error, userData);
-
- context->clientChannel->close(testCloseCallback, userData);
-}
-
-void testOpenChannelCallback(Channel *channel, int error, void *userData)
-{
- _DBG("channel [%p]", channel);
-
- if (error == 0 && channel != NULL) {
- ByteArray response;
- ByteArray data, command;
- int fid = 0x00003150;
- user_context_t *context = (user_context_t *)userData;
-
- context->clientChannel = channel;
-
- response = channel->getSelectResponse();
-
- _INFO("response : %s", response.toString().c_str());
-
- _DBG("isBasicChannel() = %s", channel->isBasicChannel() ? "Basic" : "Logical");
- _DBG("isClosed() = %s", channel->isClosed() ? "Closed" : "Opened");
-
- data.assign((unsigned char *)&fid, 2);
- command = APDUHelper::generateAPDU(APDUHelper::COMMAND_SELECT_BY_ID, 0, data);
- context->clientChannel->transmit(command, testTransmitCallback, userData);
- } else {
- _ERR("openBasicChannel failed");
- }
-}
-
-void testGetATRCallback(unsigned char *atr, unsigned int length, int error, void *userData)
-{
-// unsigned char MF[] = { 0x3F, 0x00 };
- unsigned char MF[] = { 0xA0, 0x00, 0x00, 0x00, 0x63, 0x50, 0x4B, 0x43, 0x53, 0x2D, 0x31, 0x35 };
- ByteArray aid, result(atr, length);
- user_context_t *context = (user_context_t *)userData;
-
- _DBG("atr[%d] : %s", result.size(), result.toString().c_str());
-
- aid.assign(MF, sizeof(MF));
- context->clientSession->openLogicalChannel(aid, testOpenChannelCallback, userData);
-}
-
-void testCloseSessionCallback(int error, void *userData)
-{
-}
-
-void testOpenSessionCallback(SessionHelper *session, int error, void *userData)
-{
- _DBG("session [%p]", session);
-
- if (session != NULL) {
- user_context_t *context = (user_context_t *)userData;
-
- context->clientSession = (Session *)session;
- context->clientSession->getATR(testGetATRCallback, userData);
- } else {
- _ERR("openSession failed");
- }
-}
-
-void testConnectedCallback(SEServiceHelper *service, void *userData)
-{
- vector<ReaderHelper *> readers;
- user_context_t *context = (user_context_t *)userData;
-
- _BEGIN();
-
- if (service != NULL) {
- _DBG("callback called, service [%p]", service);
-
- context->clientService = service;
-
- readers = service->getReaders();
-
- if (readers.size() > 0) {
- Reader *reader = NULL;
-
- reader = (Reader *)readers[0];
-
- _DBG("reader [%p]", reader);
-
- reader->openSession(testOpenSessionCallback, userData);
- } else {
- _ERR("reader is empty");
- }
- } else {
- _ERR("service is NULL");
- }
-
- _END();
-}
-
-int main(int argv, char *args[])
-{
- SEService *service = NULL;
-
- try
- {
- service = new SEService((void *)&user_context, &testEventHandler);
- }
- catch (...)
- {
- _ERR("exception raised!!!");
- }
-
- if (service != NULL)
- {
- loop = g_main_new(TRUE);
- g_main_loop_run(loop);
-
- if (service != NULL)
- delete service;
- }
-
- return 0;
-}