From d809178e1f11602965e98a9e78f8dc5df9e40f09 Mon Sep 17 00:00:00 2001 From: Krzysztof Jackiewicz Date: Tue, 27 Jan 2015 10:45:28 +0100 Subject: [PATCH] CKM:Add compilation flag for MDPP [Issue#] N/A [Feature/Bug] N/A [Problem] Failing CC mode tests [Cause] Compilation flag that disables MDPP logic has been introduced in key-manager [Solution] The same flag added to tests. When MDPP is disabled we expect reading private keys to succeed. [Verification] Compile and install key-manager and tests. Run: ckm-tests --group=CKM_CC_MODE Change-Id: I497c703108b6e2ee21599311beaa0d153c147d13 --- packaging/security-tests.spec | 3 +++ tests/ckm/CMakeLists.txt | 8 ++++++++ tests/ckm/cc-mode.cpp | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/packaging/security-tests.spec b/packaging/security-tests.spec index 0978f8d..00f4cc6 100644 --- a/packaging/security-tests.spec +++ b/packaging/security-tests.spec @@ -45,6 +45,9 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DDPL_LOG="ON" \ -DVERSION=%{version} \ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:DEBUG} \ +%if "%{sec_product_feature_security_mdfpp_enable}" == "1" + -DSECURITY_MDFPP_STATE_ENABLE=1 \ +%endif -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCYNARA_DB_DIR=%{_localstatedir}/cynara/db \ -DAPP_USER=security-tests-app diff --git a/tests/ckm/CMakeLists.txt b/tests/ckm/CMakeLists.txt index 66e51d8..d4c0c9f 100644 --- a/tests/ckm/CMakeLists.txt +++ b/tests/ckm/CMakeLists.txt @@ -20,6 +20,14 @@ INCLUDE(FindPkgConfig) +# mdpp flag +IF (DEFINED SECURITY_MDFPP_STATE_ENABLED) + MESSAGE("SECURITY_MDFPP_STATE_ENABLE ENABLED !") + ADD_DEFINITIONS("-DSECURITY_MDFPP_STATE_ENABLE") +ELSE (DEFINED SECURITY_MDFPP_STATE_ENABLE) + MESSAGE("SECURITY_MDFPP_STATE_ENABLE DISABLED !") +ENDIF (DEFINED SECURITY_MDFPP_STATE_ENABLE) + # Dependencies PKG_CHECK_MODULES(CKM_DEP libsmack diff --git a/tests/ckm/cc-mode.cpp b/tests/ckm/cc-mode.cpp index dd79f1d..d740e75 100644 --- a/tests/ckm/cc-mode.cpp +++ b/tests/ckm/cc-mode.cpp @@ -145,6 +145,10 @@ void read_key(ManagerShPtr& manager, const Alias& alias, int expected) { void read_keys(int expected) { +// if mdpp is disabled at compilation time we expect that read_key always succeeds +#ifndef DSECURITY_MDFPP_STATE_ENABLE + expected = CKM_API_SUCCESS; +#endif auto manager = Manager::create(); read_key(manager, rsa_pri_alias, expected); -- 2.7.4