Generate fingerprint list f rom certificates 85/38885/4 tizen_3.0.2015.q2_common accepted/tizen/common/20150430.095158 accepted/tizen/mobile/20150430.124838 accepted/tizen/tv/20150430.124042 accepted/tizen/wearable/20150430.124511 submit/tizen/20150430.015022
authorkyungwook tak <k.tak@samsung.com>
Wed, 29 Apr 2015 16:11:44 +0000 (01:11 +0900)
committerDongsun Lee <ds73.lee@samsung.com>
Thu, 30 Apr 2015 01:40:55 +0000 (10:40 +0900)
Change-Id: I8bd9d8709fdf588ba8b5375895b17a9330ebc100
Signed-off-by: kyungwook tak <k.tak@samsung.com>
28 files changed:
CMakeLists.txt [new file with mode: 0644]
certificates/CMakeLists.txt [new file with mode: 0644]
certificates/developer/CMakeLists.txt [new file with mode: 0644]
certificates/developer/tizen-developer-root-ca.pem [moved from certificates/tizen-developer-root-ca.pem with 100% similarity]
certificates/developer/tizen-developers-root.pem [moved from certificates/tizen-developers-root.pem with 100% similarity]
certificates/partner/CMakeLists.txt [new file with mode: 0644]
certificates/partner/tizen-distributor-root-ca-partner-manufacturer.pem [moved from certificates/tizen-distributor-root-ca-partner-manufacturer.pem with 100% similarity]
certificates/partner/tizen-distributor-root-ca-partner-operator.pem [moved from certificates/tizen-distributor-root-ca-partner-operator.pem with 100% similarity]
certificates/partner/tizen-distributor-root-ca-partner.pem [moved from certificates/tizen-distributor-root-ca-partner.pem with 100% similarity]
certificates/partner/tizen-partner-class-developer-root.pem [moved from certificates/tizen-partner-class-developer-root.pem with 100% similarity]
certificates/partner/tizen-partner-class-root-authority.pem [moved from certificates/tizen-partner-class-root-authority.pem with 100% similarity]
certificates/platform/CMakeLists.txt [new file with mode: 0644]
certificates/platform/tizen-platform-class-developer-root.pem [moved from certificates/tizen-platform-class-developer-root.pem with 100% similarity]
certificates/platform/tizen-platform-class-root-authority.pem [moved from certificates/tizen-platform-class-root-authority.pem with 100% similarity]
certificates/public/CMakeLists.txt [new file with mode: 0644]
certificates/public/tizen-distributor-root-ca-public.pem [moved from certificates/tizen-distributor-root-ca-public.pem with 100% similarity]
certificates/public/tizen-public-class-developer-root.pem [moved from certificates/tizen-public-class-developer-root.pem with 100% similarity]
certificates/public/tizen-public-class-root-authority.pem [moved from certificates/tizen-public-class-root-authority.pem with 100% similarity]
certificates/public/tizen.root.preproduction.cert.pem [moved from certificates/tizen.root.preproduction.cert.pem with 100% similarity]
certificates/wac/CMakeLists.txt [new file with mode: 0644]
certificates/wac/wac.publisherid.pem [moved from certificates/wac.publisherid.pem with 100% similarity]
certificates/wac/wac.root.preproduction.pem [moved from certificates/wac.root.preproduction.pem with 100% similarity]
certificates/wac/wac.root.production.pem [moved from certificates/wac.root.production.pem with 100% similarity]
packaging/ca-certificates-tizen.spec
tools/CMakeLists.txt [new file with mode: 0644]
tools/add-fingerprint.sh [new file with mode: 0755]
tools/fingerprint_list.xml [new file with mode: 0644]
tools/fingerprint_list.xsd [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d6a3307
--- /dev/null
@@ -0,0 +1,4 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+ADD_SUBDIRECTORY(certificates)
+ADD_SUBDIRECTORY(tools)
diff --git a/certificates/CMakeLists.txt b/certificates/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d7d43c5
--- /dev/null
@@ -0,0 +1,5 @@
+ADD_SUBDIRECTORY(developer)
+ADD_SUBDIRECTORY(public)
+ADD_SUBDIRECTORY(partner)
+ADD_SUBDIRECTORY(platform)
+ADD_SUBDIRECTORY(wac)
diff --git a/certificates/developer/CMakeLists.txt b/certificates/developer/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e61a30a
--- /dev/null
@@ -0,0 +1,11 @@
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-developer-root-ca.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-developers-root.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
diff --git a/certificates/partner/CMakeLists.txt b/certificates/partner/CMakeLists.txt
new file mode 100644 (file)
index 0000000..443c59c
--- /dev/null
@@ -0,0 +1,29 @@
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-distributor-root-ca-partner-manufacturer.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-distributor-root-ca-partner-operator.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-distributor-root-ca-partner.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-partner-class-developer-root.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-partner-class-root-authority.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
diff --git a/certificates/platform/CMakeLists.txt b/certificates/platform/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d789cf6
--- /dev/null
@@ -0,0 +1,11 @@
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-platform-class-developer-root.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-platform-class-root-authority.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
diff --git a/certificates/public/CMakeLists.txt b/certificates/public/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6e5d9eb
--- /dev/null
@@ -0,0 +1,23 @@
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-distributor-root-ca-public.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-public-class-developer-root.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-public-class-root-authority.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen.root.preproduction.cert.pem
+        DESTINATION ${TIZEN_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
diff --git a/certificates/wac/CMakeLists.txt b/certificates/wac/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f610998
--- /dev/null
@@ -0,0 +1,17 @@
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wac.publisherid.pem
+        DESTINATION ${WAC_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wac.root.preproduction.pem
+        DESTINATION ${WAC_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wac.root.production.pem
+        DESTINATION ${WAC_DIR}
+        PERMISSIONS OWNER_READ
+                    GROUP_READ
+                    WORLD_READ)
index 5235465..3ffde72 100644 (file)
@@ -8,8 +8,12 @@ License:       Apache-2.0
 Source:        %{name}-%{version}.tar.gz
 Source1001:    %{name}.manifest
 BuildArch:     noarch
-%define tizen_dir /usr/share/ca-certificates/tizen
-%define wac_dir /usr/share/ca-certificates/wac
+BuildRequires: cmake
+BuildRequires: openssl
+
+%define tizen_dir       /usr/share/ca-certificates/tizen
+%define wac_dir         /usr/share/ca-certificates/wac
+%define fingerprint_dir /usr/share/ca-certificates/fingerprint
 
 %description
 Used for the installation of Tizen-specific CA certificates.
@@ -19,19 +23,23 @@ Used for the installation of Tizen-specific CA certificates.
 cp %{SOURCE1001} .
 
 %build
+%cmake . -DTIZEN_DIR=%{tizen_dir} \
+         -DWAC_DIR=%{wac_dir} \
+         -DFINGERPRINT_DIR=%{fingerprint_dir}
 
 %install
 rm -fr %{buildroot}
-mkdir -p %{buildroot}/%{tizen_dir}
-mkdir -p %{buildroot}/%{wac_dir}
-cp -arf certificates/tizen*.pem %{buildroot}/%{tizen_dir}/
-cp -arf certificates/wac*.pem %{buildroot}/%{wac_dir}/
+%make_install
+mkdir -p %{buildroot}%{tizen_dir}
+mkdir -p %{buildroot}%{wac_dir}
+mkdir -p %{buildroot}%{fingerprint_dir}
 
 %files
+%defattr(-,root,root,-)
 %manifest %{name}.manifest
 %license LICENSE
-%defattr(-,root,root,-)
 %{tizen_dir}/*
 %{wac_dir}/*
+%{fingerprint_dir}/*
 
 %changelog
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ba1dda8
--- /dev/null
@@ -0,0 +1,25 @@
+GET_FILENAME_COMPONENT(
+       FINGERPRINT_LIST_XML
+       ${CMAKE_CURRENT_SOURCE_DIR}/fingerprint_list.xml
+       REALPATH
+       )
+GET_FILENAME_COMPONENT(
+       FINGERPRINT_LIST_XSD
+       ${CMAKE_CURRENT_SOURCE_DIR}/fingerprint_list.xsd
+       REALPATH
+       )
+
+EXECUTE_PROCESS(
+       COMMAND
+       ${CMAKE_CURRENT_SOURCE_DIR}/add-fingerprint.sh
+       ${CMAKE_SOURCE_DIR}/certificates
+       ${FINGERPRINT_LIST_XML}
+       RESULT_VARIABLE ERROR_CODE
+)
+IF(ERROR_CODE)
+       MESSAGE(FATAL_ERROR "Failed to generate fingerprint list")
+ENDIF(ERROR_CODE)
+
+INSTALL(FILES ${FINGERPRINT_LIST_XML}
+              ${FINGERPRINT_LIST_XSD}
+        DESTINATION ${FINGERPRINT_DIR})
diff --git a/tools/add-fingerprint.sh b/tools/add-fingerprint.sh
new file mode 100755 (executable)
index 0000000..9bde6b2
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+CERT_ROOT=$1
+XML_PATH=$2
+
+if [ -z "$2" ]
+then
+       echo "usage: `basename $0` certificate_root_path fingerprint_xml_path"
+       exit 2
+fi
+
+for CATEGORY in developer public partner platform
+do
+       if [ -d "$CERT_ROOT/$CATEGORY" ]
+       then
+               echo
+               echo " <<$CATEGORY>>"
+               for CERT_PATH in `ls $CERT_ROOT/$CATEGORY/*.pem`
+               do
+                       FINGERPRINT=`/usr/bin/openssl x509 -noout -fingerprint -in $CERT_PATH | cut -d '=' -f 2`
+                       echo "  ${CERT_PATH##*/}:"
+                       echo "   $FINGERPRINT"
+                       ##################################################################
+                       # Find "<CertificateDomain name="tizen-xxxxxxx">"                #
+            # then add the fingerprint into the next line                    #
+                       ##################################################################
+                       #        <FingerprintSHA1>[...fingerprints...]</FingerprintSHA1> #
+                       ##################################################################
+                       /bin/sed -i "s#<CertificateDomain name=\"tizen-$CATEGORY\">.*#&\n        <FingerprintSHA1>$FINGERPRINT</FingerprintSHA1><!-- ${CERT_PATH##*/} -->#" $XML_PATH
+               done
+       fi
+done
+echo
diff --git a/tools/fingerprint_list.xml b/tools/fingerprint_list.xml
new file mode 100644 (file)
index 0000000..8fefc3d
--- /dev/null
@@ -0,0 +1,10 @@
+<CertificateSet>
+    <CertificateDomain name="tizen-developer"><!-- used to verify tizen widgets -->
+    </CertificateDomain>
+    <CertificateDomain name="tizen-public">
+    </CertificateDomain>
+    <CertificateDomain name="tizen-partner">
+    </CertificateDomain>
+    <CertificateDomain name="tizen-platform">
+    </CertificateDomain>
+</CertificateSet>
diff --git a/tools/fingerprint_list.xsd b/tools/fingerprint_list.xsd
new file mode 100644 (file)
index 0000000..b0fab23
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+<xs:element name="CertificateSet" type="CertificateSetType" />
+<xs:complexType name="CertificateSetType">
+  <xs:sequence>
+    <xs:element ref="CertificateDomain" minOccurs="0" maxOccurs="unbounded" />
+  </xs:sequence>
+</xs:complexType>
+
+<xs:element name="CertificateDomain" type="CertificateDomainType" />
+<xs:complexType name="CertificateDomainType">
+  <xs:sequence>
+    <xs:element ref="FingerprintSHA1" minOccurs="0" maxOccurs="unbounded" />
+  </xs:sequence>
+  <xs:attribute name="name" type="xs:string" use="required" />
+</xs:complexType>
+
+<xs:element name="FingerprintSHA1" type="xs:string"/>
+
+</xs:schema>