%global watchdog_enabled 1
%global watchdog_timeout_sec 60
%global watchdog_notify_sec 20
+%global tz_backend_enabled %{?tz_backend:%tz_backend}%{!?tz_backend:OFF}
Name: key-manager
Summary: Central Key Manager and utilities
-Version: 0.1.26
+Version: 0.1.33
Release: 1
Group: Security/Secure Storage
License: Apache-2.0 and BSD-3-Clause
BuildRequires: cmake
BuildRequires: zip
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(openssl)
+BuildRequires: pkgconfig(openssl1.1)
BuildRequires: libattr-devel
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(pkgmgr)
+BuildRequires: pkgconfig(vconf)
%if 0%{?watchdog_enabled}
BuildRequires: pkgconfig(argos_watchdog)
%endif
BuildRequires: boost-devel
BuildRequires: ca-certificates-devel
-#Requires(pre): tizen-platform-config-tools
+%if %{tz_backend_enabled} == ON
+BuildRequires: key-manager-ta-devel
+BuildRequires: key-manager-ta-serialization-devel
+BuildRequires: pkgconfig(tef-libteec)
+%endif
Requires: libkey-manager-common = %{version}-%{release}
+
%{?systemd_requires}
%global user_name key-manager
-%global group_name key-manager
+%global group_name security_fw
+%global supplementary_group_names key-manager
%global service_name key-manager
%global smack_domain_name System
%global old_rw_data_dir /opt/data/ckm
%global sbin_dir /sbin
%global ro_etc_dir %{?TZ_SYS_RO_ETC:%TZ_SYS_RO_ETC}%{!?TZ_SYS_RO_ETC:/etc}
%global run_dir %{?TZ_SYS_RUN:%TZ_SYS_RUN}%{!?TZ_SYS_RUN:/var/run}
-%global initial_values_dir %{rw_data_dir}/initial_values
+%global initial_values_dir_ro %{ro_data_dir}/initial_values
+%global initial_values_dir_rw %{rw_data_dir}/initial_values
%global ca_certs_dir %{?TZ_SYS_CA_CERTS:%TZ_SYS_CA_CERTS}%{!?TZ_SYS_CA_CERTS:%ro_etc_dir/ssl/certs}
-%global upgrade_dir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:%_datadir}/upgrade
-%global upgrade_script_dir %{upgrade_dir}/scripts
-%global upgrade_data_dir %{upgrade_dir}/data
-
%description
Central Key Manager daemon could be used as secure storage
for certificate and private/public keys. It gives API for
CKM login/password module to PAM. Used to monitor user login/logout
and password change events from PAM
+%package -n key-manager-initial-values
+Summary: CKM initial values tool
+Group: Security/Libraries
+License: Apache-2.0
+BuildRequires: cmake
+BuildRequires: pkgconfig(openssl1.1)
+BuildRequires: pkgconfig(libxml-2.0)
+Requires(post): %{sbin_dir}/ldconfig
+Requires(postun): %{sbin_dir}/ldconfig
+
+%description -n key-manager-initial-values
+Includes ckm_initial_values tool for initial values XML generation
%prep
%setup -q
-cp -a %{SOURCE1001} .
-cp -a %{SOURCE1002} .
-cp -a %{SOURCE1003} .
-cp -a %{SOURCE1004} .
%build
%if 0%{?sec_build_binary_debug_enable}
-DSERVICE_NAME=%{service_name} \
-DUSER_NAME=%{user_name} \
-DGROUP_NAME=%{group_name} \
+ -DSUPPLEMENTARY_GROUP_NAMES="%{supplementary_group_names}" \
-DSMACK_DOMAIN_NAME=%{smack_domain_name} \
-DOLD_RW_DATA_DIR=%{old_rw_data_dir} \
-DRW_DATA_DIR=%{rw_data_dir} \
-DRW_ETC_DIR=%{rw_etc_dir} \
-DRO_ETC_DIR=%{ro_etc_dir} \
-DBIN_DIR=%{bin_dir} \
- -DINITIAL_VALUES_DIR=%{initial_values_dir} \
- -DTEST_DIR=%{test_dir} \
+ -DINITIAL_VALUES_DIR_RW=%{initial_values_dir_rw} \
+ -DINITIAL_VALUES_DIR_RO=%{initial_values_dir_ro} \
-DCA_CERTS_DIR=%{ca_certs_dir} \
%if 0%{?watchdog_enabled}
-DWATCHDOG_ENABLED=%{watchdog_enabled} \
-DWATCHDOG_TIMEOUT_SEC=%{watchdog_timeout_sec} \
-DWATCHDOG_NOTIFY_SEC=%{watchdog_notify_sec} \
%endif
- -DUPGRADE_DATA_DIR=%{upgrade_data_dir} \
- -DUPGRADE_SCRIPT_DIR=%{upgrade_script_dir}
+%if %{tz_backend_enabled} == ON
+ -DTZ_BACKEND_ENABLED=ON \
+%else
+ -DTZ_BACKEND_ENABLED=OFF \
+%endif
+ -DTEST_DIR=%{test_dir}
make %{?jobs:-j%jobs}
%install_service sockets.target.wants central-key-manager-api-storage.socket
%install_service sockets.target.wants central-key-manager-api-ocsp.socket
%install_service sockets.target.wants central-key-manager-api-encryption.socket
+cp -a %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} %{buildroot}%{_datadir}/
%pre
# tzplatform-get sync breaked because of on-development situation. comment out just for temporary
%{bin_dir}/key-manager
%{_unitdir}/multi-user.target.wants/central-key-manager.service
%{_unitdir}/central-key-manager.service
-%{_unitdir}/central-key-manager.target
%{_unitdir}/sockets.target.wants/central-key-manager-api-control.socket
%{_unitdir}/central-key-manager-api-control.socket
%{_unitdir}/sockets.target.wants/central-key-manager-api-storage.socket
%dir %{ro_data_dir}
%{ro_data_dir}/*
%dir %attr(770, %{user_name}, %{group_name}) %{rw_data_dir}
-%dir %attr(770, %{user_name}, %{group_name}) %{initial_values_dir}
-
-%dir %{upgrade_data_dir}/key-manager/initial_values
-%{upgrade_script_dir}/230.key-manager-change-data-dir.patch.sh
-%{upgrade_script_dir}/231.key-manager-migrate-dkek.patch.sh
-%{upgrade_script_dir}/232.key-manager-change-user.patch.sh
-%{upgrade_script_dir}/233.key-manager-move-ss-migratable-data.patch.sh
-%{upgrade_script_dir}/234.key-manager-move-certsvc-migratable-data.patch.sh
-%{upgrade_script_dir}/235.key-manager-move-rw-from-upgrade-dir.patch.sh
+%dir %attr(550, %{user_name}, %{group_name}) %{initial_values_dir_ro}
+%dir %attr(770, %{user_name}, %{group_name}) %{initial_values_dir_rw}
+%attr(755,root,root) /usr/share/upgrade/scripts/295.key-manager_upgrade.sh
+
%{ro_etc_dir}/gumd/userdel.d/10_key-manager.post
%{bin_dir}/ckm_tool
%files -n key-manager-pam-plugin
-%manifest key-manager-pam-plugin.manifest
+%manifest %{_datadir}/key-manager-pam-plugin.manifest
%license LICENSE
%{_libdir}/security/pam_key_manager_plugin.so*
%files -n libkey-manager-common
-%manifest libkey-manager-common.manifest
+%manifest %{_datadir}/libkey-manager-common.manifest
%license LICENSE
%{_libdir}/libkey-manager-common.so.*
%files -n libkey-manager-client
-%manifest libkey-manager-client.manifest
+%manifest %{_datadir}/libkey-manager-client.manifest
%license LICENSE
%{_libdir}/libkey-manager-client.so.*
%{_libdir}/libkey-manager-control-client.so.*
%files -n libkey-manager-client-devel
-%manifest libkey-manager-client-devel.manifest
+%manifest %{_datadir}/libkey-manager-client-devel.manifest
%license LICENSE
%{_libdir}/libkey-manager-client.so
%{_libdir}/libkey-manager-control-client.so
%{_includedir}/ckm/ckm/ckm-pkcs12.h
%{_includedir}/ckm/ckm/ckm-raw-buffer.h
%{_includedir}/ckm/ckm/ckm-type.h
+%{_includedir}/ckm/ckm/ckm-zero-memory.h
%{_includedir}/ckm/ckmc/ckmc-manager.h
%{_includedir}/ckm/ckmc/ckmc-control.h
%{_includedir}/ckm/ckmc/ckmc-error.h
%{bin_dir}/ckm-tests-internal
%{bin_dir}/ckm_so_loader
%{bin_dir}/ckm_db_tool
+%{bin_dir}/ckm_db_merge
%{bin_dir}/ckm_generate_db
%test_dir
+
+%files -n key-manager-initial-values
+%license LICENSE
+%{bin_dir}/ckm_initial_values