ckmc API changed (ACR-392) 10/49010/5
authorKyungwook Tak <k.tak@samsung.com>
Mon, 5 Oct 2015 06:11:47 +0000 (15:11 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Tue, 13 Oct 2015 01:57:08 +0000 (10:57 +0900)
 * ckmc_param_list_s* -> ckmc_param_list_h
 * ckmc_generate_params's parameter changed
- ckmc_param_list_s *params -> ckmc_param_list_h *pparams
 * ckmc_param_list_add_XXX -> ckmc_param_list_set_XXX

Change-Id: Ia3b0831772e76cfdbe77c6d9a9d04961018a37e3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
src/ckm/CMakeLists.txt
src/ckm/algo-params.cpp
src/ckm/c-compilation.c
src/ckm/ckm-common.cpp
src/ckm/ckm-common.h
src/ckm/encryption-decryption-env.cpp
src/ckm/encryption-decryption-env.h
src/ckm/encryption-decryption.cpp

index 2aae5cd..40891fa 100644 (file)
@@ -23,9 +23,9 @@ INCLUDE(FindPkgConfig)
 IF (DEFINED SECURITY_MDFPP_STATE_ENABLED)
     MESSAGE("SECURITY_MDFPP_STATE_ENABLE ENABLED !")
     ADD_DEFINITIONS("-DSECURITY_MDFPP_STATE_ENABLE")
-ELSE (DEFINED SECURITY_MDFPP_STATE_ENABLE)
+ELSE (DEFINED SECURITY_MDFPP_STATE_ENABLED)
     MESSAGE("SECURITY_MDFPP_STATE_ENABLE DISABLED !")
-ENDIF (DEFINED SECURITY_MDFPP_STATE_ENABLE)
+ENDIF (DEFINED SECURITY_MDFPP_STATE_ENABLED)
 
 # Dependencies
 PKG_CHECK_MODULES(CKM_DEP
index 2c2aa5f..77919e0 100644 (file)
@@ -37,21 +37,21 @@ struct CryptoAlgorithmWrapper : public CKM::CryptoAlgorithm
     size_t count() const { return m_params.size(); }
 };
 
-ckmc_param_list_s** EMPTY_PLIST = NULL;
-ckmc_param_list_s* EMPTY_LIST = NULL;
+ckmc_param_list_h* EMPTY_PLIST = NULL;
+ckmc_param_list_h EMPTY_LIST = NULL;
 
 const size_t DEFAULT_IV_LEN = 16;
 const size_t DEFAULT_IV_LEN_BITS = 8*DEFAULT_IV_LEN;
 
 RawBufferPtr IV(createRandomBufferCAPI(DEFAULT_IV_LEN), ckmc_buffer_free);
 
-void assert_list_empty(const ckmc_param_list_s* list)
+void assert_list_empty(ckmc_param_list_h list)
 {
     const CryptoAlgorithmWrapper* caw = reinterpret_cast<const CryptoAlgorithmWrapper*>(list);
     RUNNER_ASSERT_MSG(caw->empty(), "Parameter list is not empty");
 }
 
-void check_int_param(const ckmc_param_list_s* list,
+void check_int_param(ckmc_param_list_h list,
                      ckmc_param_name_e name,
                      uint64_t expected)
 {
@@ -63,7 +63,7 @@ void check_int_param(const ckmc_param_list_s* list,
                       "Param " << name << " expected value: " << expected << " got: " << got);
 }
 
-void check_buffer_param(const ckmc_param_list_s* list,
+void check_buffer_param(ckmc_param_list_h list,
                         ckmc_param_name_e name,
                         const ckmc_raw_buffer_s& expected)
 {
@@ -74,7 +74,7 @@ void check_buffer_param(const ckmc_param_list_s* list,
     assert_buffers_equal(expected, *got);
 }
 
-void assert_param_count(const ckmc_param_list_s* list, size_t expected)
+void assert_param_count(ckmc_param_list_h list, size_t expected)
 {
     RUNNER_ASSERT_MSG(list, "List is NULL");
     const CryptoAlgorithmWrapper* caw = reinterpret_cast<const CryptoAlgorithmWrapper*>(list);
@@ -104,13 +104,13 @@ RUNNER_TEST(TAP_0030_new_free)
 
 RUNNER_TEST(TAP_0040_add_integer_invalid_param)
 {
-    assert_invalid_param(ckmc_param_list_add_integer,
+    assert_invalid_param(ckmc_param_list_set_integer,
                          EMPTY_LIST,
                          CKMC_PARAM_ALGO_TYPE,
                          CKMC_ALGO_AES_CTR);
 
     ParamListPtr list = createParamListPtr();
-    assert_invalid_param(ckmc_param_list_add_integer,
+    assert_invalid_param(ckmc_param_list_set_integer,
                          list.get(),
                          static_cast<ckmc_param_name_e>(-1),
                          CKMC_ALGO_AES_CTR);
@@ -119,13 +119,13 @@ RUNNER_TEST(TAP_0040_add_integer_invalid_param)
 
 RUNNER_TEST(TAP_0050_add_buffer_invalid_param)
 {
-    assert_invalid_param(ckmc_param_list_add_buffer,
+    assert_invalid_param(ckmc_param_list_set_buffer,
                          EMPTY_LIST,
                          CKMC_PARAM_ED_IV,
                          IV.get());
 
     ParamListPtr list = createParamListPtr();
-    assert_invalid_param(ckmc_param_list_add_buffer,
+    assert_invalid_param(ckmc_param_list_set_buffer,
                          list.get(),
                          CKMC_PARAM_ED_IV,
                          nullptr);
@@ -134,13 +134,13 @@ RUNNER_TEST(TAP_0050_add_buffer_invalid_param)
     ckmc_raw_buffer_s buffer;
     buffer.data = nullptr;
     buffer.size = 0;
-    assert_invalid_param(ckmc_param_list_add_buffer,
+    assert_invalid_param(ckmc_param_list_set_buffer,
                          list.get(),
                          CKMC_PARAM_ED_IV,
                          &buffer);
     assert_list_empty(list.get());
 
-    assert_invalid_param(ckmc_param_list_add_buffer,
+    assert_invalid_param(ckmc_param_list_set_buffer,
                          list.get(),
                          static_cast<ckmc_param_name_e>(-1),
                          IV.get());
@@ -150,7 +150,7 @@ RUNNER_TEST(TAP_0050_add_buffer_invalid_param)
 RUNNER_TEST(TAP_0060_add_param)
 {
     ParamListPtr list = createParamListPtr();
-    assert_positive(ckmc_param_list_add_integer,
+    assert_positive(ckmc_param_list_set_integer,
                     list.get(),
                     CKMC_PARAM_ALGO_TYPE,
                     CKMC_ALGO_AES_GCM);
@@ -158,7 +158,7 @@ RUNNER_TEST(TAP_0060_add_param)
     assert_param_count(list.get(),1);
 
     RawBufferPtr buffer(createRandomBufferCAPI(DEFAULT_IV_LEN), ckmc_buffer_free);
-    assert_positive(ckmc_param_list_add_buffer,
+    assert_positive(ckmc_param_list_set_buffer,
                     list.get(),
                     CKMC_PARAM_ED_IV,
                     buffer.get());
@@ -169,13 +169,14 @@ RUNNER_TEST(TAP_0060_add_param)
 
 RUNNER_TEST(TAP_0070_generate_invalid_param)
 {
-    assert_invalid_param(ckmc_generate_params, static_cast<ckmc_algo_type_e>(-1), EMPTY_LIST);
+    assert_invalid_param(ckmc_generate_new_params, static_cast<ckmc_algo_type_e>(-1), EMPTY_PLIST);
 }
 
 RUNNER_TEST(TAP_0080_generate)
 {
-    ParamListPtr list = createParamListPtr();
-    assert_positive(ckmc_generate_params, CKMC_ALGO_AES_CTR, list.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, CKMC_ALGO_AES_CTR, &handle);
+    ParamListPtr list = ParamListPtr(handle, ckmc_param_list_free);
     check_int_param(list.get(), CKMC_PARAM_ALGO_TYPE, CKMC_ALGO_AES_CTR);
     check_int_param(list.get(), CKMC_PARAM_ED_CTR_LEN, DEFAULT_IV_LEN_BITS);
 
index 89cf38a..3171868 100644 (file)
 static unsigned char iv[] = { "rewrewrewgegsrtbhns" };
 
 void algo_param() {
-    ckmc_param_list_s* list = NULL;
+    ckmc_param_list_h list = NULL;
     ckmc_raw_buffer_s* buffer = NULL;
 
     if(CKMC_ERROR_NONE != ckmc_param_list_new(&list))
         goto finish;
     if(CKMC_ERROR_NONE != ckmc_buffer_new(iv, sizeof(iv), &buffer))
         goto finish;
-    if(CKMC_ERROR_NONE != ckmc_param_list_add_integer(list, CKMC_PARAM_ALGO_TYPE, CKMC_ALGO_AES_GCM))
+    if(CKMC_ERROR_NONE != ckmc_param_list_set_integer(list, CKMC_PARAM_ALGO_TYPE, CKMC_ALGO_AES_GCM))
         goto finish;
-    if(CKMC_ERROR_NONE != ckmc_param_list_add_buffer(list, CKMC_PARAM_ED_IV, buffer))
+    if(CKMC_ERROR_NONE != ckmc_param_list_set_buffer(list, CKMC_PARAM_ED_IV, buffer))
         goto finish;
 
 finish:
index 75bfab3..1f35041 100644 (file)
@@ -546,7 +546,7 @@ void compare_AES_keys(ckmc_key_s *first, ckmc_key_s *second)
 
 ParamListPtr createParamListPtr()
 {
-    ckmc_param_list_s* list = NULL;
+    ckmc_param_list_h list = NULL;
     assert_positive(ckmc_param_list_new, &list);
     return ParamListPtr(list, ckmc_param_list_free);
 }
index 2e9ec6f..f5f83c5 100644 (file)
@@ -219,7 +219,7 @@ public:
 };
 
 typedef std::shared_ptr<ckmc_raw_buffer_s> RawBufferPtr;
-typedef std::shared_ptr<ckmc_param_list_s> ParamListPtr;
+typedef std::shared_ptr<struct __ckmc_param_list> ParamListPtr;
 
 ParamListPtr createParamListPtr();
 
index fb1aba6..03dc266 100644 (file)
@@ -23,7 +23,7 @@
 
 using namespace CKM;
 
-EncryptionError SyncApi::encrypt(const ckmc_param_list_s *params,
+EncryptionError SyncApi::encrypt(ckmc_param_list_h params,
                                  const char *key_alias,
                                  const char *password,
                                  const ckmc_raw_buffer_s& decrypted,
@@ -32,7 +32,7 @@ EncryptionError SyncApi::encrypt(const ckmc_param_list_s *params,
     return ckmcError2Result(ckmc_encrypt_data(params, key_alias, password, decrypted, ppencrypted));
 }
 
-EncryptionError SyncApi::decrypt(const ckmc_param_list_s *params,
+EncryptionError SyncApi::decrypt(ckmc_param_list_h params,
                                  const char *key_alias,
                                  const char *password,
                                  const ckmc_raw_buffer_s& encrypted,
@@ -79,7 +79,7 @@ void AsyncApi::Observer::Finished(int error)
 }
 
 EncryptionError AsyncApi::crypt(cryptoFn operation,
-                                const ckmc_param_list_s *params,
+                                ckmc_param_list_h params,
                                 const char *key_alias,
                                 const char *password,
                                 const ckmc_raw_buffer_s& in,
@@ -116,7 +116,7 @@ EncryptionError AsyncApi::crypt(cryptoFn operation,
     return EncryptionError::SUCCESS;
 }
 
-EncryptionError AsyncApi::encrypt(const ckmc_param_list_s *params,
+EncryptionError AsyncApi::encrypt(ckmc_param_list_h params,
                                   const char *key_alias,
                                   const char *password,
                                   const ckmc_raw_buffer_s& plain,
@@ -125,7 +125,7 @@ EncryptionError AsyncApi::encrypt(const ckmc_param_list_s *params,
     return crypt(&CKM::ManagerAsync::encrypt, params, key_alias, password, plain, ppencrypted);
 }
 
-EncryptionError AsyncApi::decrypt(const ckmc_param_list_s *params,
+EncryptionError AsyncApi::decrypt(ckmc_param_list_h params,
                                   const char *key_alias,
                                   const char *password,
                                   const ckmc_raw_buffer_s& encrypted,
index ca0ba0d..1af99e5 100644 (file)
@@ -40,13 +40,13 @@ enum EncryptionError{
 
 struct EncryptionApi
 {
-    virtual EncryptionError encrypt(const ckmc_param_list_s *params,
+    virtual EncryptionError encrypt(ckmc_param_list_h params,
                                     const char *key_alias,
                                     const char *password,
                                     const ckmc_raw_buffer_s& decrypted,
                                     ckmc_raw_buffer_s **ppencrypted) = 0;
 
-    virtual EncryptionError decrypt(const ckmc_param_list_s *params,
+    virtual EncryptionError decrypt(ckmc_param_list_h params,
                                     const char *key_alias,
                                     const char *password,
                                     const ckmc_raw_buffer_s& encrypted,
@@ -56,13 +56,13 @@ struct EncryptionApi
 class SyncApi : public EncryptionApi
 {
 public:
-    virtual EncryptionError encrypt(const ckmc_param_list_s *params,
+    virtual EncryptionError encrypt(ckmc_param_list_h params,
                                     const char *key_alias,
                                     const char *password,
                                     const ckmc_raw_buffer_s& decrypted,
                                     ckmc_raw_buffer_s **ppencrypted);
 
-    virtual EncryptionError decrypt(const ckmc_param_list_s *params,
+    virtual EncryptionError decrypt(ckmc_param_list_h params,
                                     const char *key_alias,
                                     const char *password,
                                     const ckmc_raw_buffer_s& encrypted,
@@ -91,13 +91,13 @@ private:
     };
 
 public:
-    EncryptionError encrypt(const ckmc_param_list_s *params,
+    EncryptionError encrypt(ckmc_param_list_h params,
                             const char *key_alias,
                             const char *password,
                             const ckmc_raw_buffer_s& decrypted,
                             ckmc_raw_buffer_s **ppencrypted);
 
-    EncryptionError decrypt(const ckmc_param_list_s *params,
+    EncryptionError decrypt(ckmc_param_list_h params,
                             const char *key_alias,
                             const char *password,
                             const ckmc_raw_buffer_s& encrypted,
@@ -110,7 +110,7 @@ private:
                                                 const CKM::RawBuffer&);
 
     EncryptionError crypt(cryptoFn operation,
-                          const ckmc_param_list_s *params,
+                          ckmc_param_list_h params,
                           const char *key_alias,
                           const char *password,
                           const ckmc_raw_buffer_s& in,
index 925870f..cc057b9 100644 (file)
@@ -49,7 +49,7 @@ AsyncApi g_asyncApi;
 
 EncryptionApi* g_api = &g_syncApi;
 
-EncryptionError apiEncrypt(const ckmc_param_list_s *params,
+EncryptionError apiEncrypt(ckmc_param_list_h params,
                         const char *key_alias,
                         const char *password,
                         const ckmc_raw_buffer_s decrypted,
@@ -58,7 +58,7 @@ EncryptionError apiEncrypt(const ckmc_param_list_s *params,
     return g_api->encrypt(params, key_alias, password, decrypted, ppencrypted);
 }
 
-EncryptionError apiDecrypt(const ckmc_param_list_s *params,
+EncryptionError apiDecrypt(ckmc_param_list_h params,
                         const char *key_alias,
                         const char *password,
                         const ckmc_raw_buffer_s encrypted,
@@ -267,14 +267,14 @@ std::map<Algorithm, AlgoBasePtr> g_algorithms = {
 
 void setParam(ParamListPtr& params, ckmc_param_name_e name, ckmc_raw_buffer_s* buffer)
 {
-    int ret = ckmc_param_list_add_buffer(params.get(), name, buffer);
+    int ret = ckmc_param_list_set_buffer(params.get(), name, buffer);
     RUNNER_ASSERT_MSG(ret == CKMC_ERROR_NONE,
                       "Failed to set param " << name << " error: " << CKMCErrorToString(ret));
 }
 
 void setParam(ParamListPtr& params, ckmc_param_name_e name, int integer)
 {
-    int ret = ckmc_param_list_add_integer(params.get(), name, integer);
+    int ret = ckmc_param_list_set_integer(params.get(), name, integer);
     RUNNER_ASSERT_MSG(ret == CKMC_ERROR_NONE,
                       "Failed to set param " << name << " error: " << CKMCErrorToString(ret));
 }
@@ -295,8 +295,9 @@ EncryptionResult encrypt(const AlgoBasePtr& algo,
     ckmc_raw_buffer_s* encrypted = nullptr;
     KeyAliasPair aliases = algo->keyGen(pass);
 
-    ret.params = createParamListPtr();
-    assert_positive(ckmc_generate_params, algo->m_type, ret.params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+    ret.params = ParamListPtr(handle, ckmc_param_list_free);
     setParam(ret.params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
     assert_crypto_positive(apiEncrypt,
@@ -375,8 +376,9 @@ void testInvalidIvEnc(Algorithm type)
     KeyAliasPair aliases = algo->keyGen();
 
     // setup params
-    ParamListPtr params = createParamListPtr();
-    assert_positive(ckmc_generate_params, algo->m_type, params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+    ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
 
     // invalid encryption
     auto test = [&](){
@@ -439,8 +441,10 @@ void encryptionWithCustomData(Algorithm type, ckmc_param_name_e name)
     KeyAliasPair aliases = algo->keyGen();
 
     // setup params
-    ParamListPtr params = createParamListPtr();
-    assert_positive(ckmc_generate_params, algo->m_type, params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+    ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
+
     setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
     // set AAD
@@ -494,8 +498,9 @@ void testGcmIvSize(size_t size,
     ckmc_raw_buffer_s* decryptedTmp = nullptr;
 
     // setup params
-    ParamListPtr params = createParamListPtr();
-    assert_positive(ckmc_generate_params, CKMC_ALGO_AES_GCM, params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, CKMC_ALGO_AES_GCM, &handle);
+    ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
     setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
     setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(size));
 
@@ -562,8 +567,9 @@ void testCtrEncryptionInvalidLength(Algorithm type)
     KeyAliasPair aliases = algo->keyGen();
 
     // setup params
-    ParamListPtr params = createParamListPtr();
-    assert_positive(ckmc_generate_params, algo->m_type, params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+    ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
     setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
     // encryption
@@ -598,8 +604,9 @@ void testCtrEncryptionValidLength(Algorithm type)
     KeyAliasPair aliases = algo->keyGen();
 
     // setup params
-    ParamListPtr params = createParamListPtr();
-    assert_positive(ckmc_generate_params, algo->m_type, params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+    ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
     setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
     // encryption
@@ -701,8 +708,9 @@ void testGcmEncryptionTagLen(Algorithm type)
     KeyAliasPair aliases = algo->keyGen();
 
     // setup params
-    ParamListPtr params = createParamListPtr();
-    assert_positive(ckmc_generate_params, algo->m_type, params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+    ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
     setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
     std::vector<TagTest> testData = {
@@ -824,7 +832,7 @@ void testGcmDifferentIvSizes(Algorithm type)
     // add AES GCM key
     KeyAliasPair aliases = algo->keyGen();
 
-    testGcmIvSize(11,   aliases, EncryptionError::SERVER_ERROR); // 12B is the smallest
+    testGcmIvSize(11,  aliases, EncryptionError::SERVER_ERROR); // 12B is the smallest
     testGcmIvSize(12,  aliases);
     testGcmIvSize(17,  aliases);
     testGcmIvSize(128, aliases);
@@ -927,8 +935,9 @@ void testRsaDataTooLong(Algorithm type, size_t dataSize)
     ckmc_raw_buffer_s* encrypted = nullptr;
     KeyAliasPair aliases = algo->keyGen();
 
-    ret.params = createParamListPtr();
-    assert_positive(ckmc_generate_params, algo->m_type, ret.params.get());
+    ckmc_param_list_h handle = NULL;
+    assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+    ret.params = ParamListPtr(handle, ckmc_param_list_free);
     assert_crypto_result(EncryptionError::SERVER_ERROR,
                          apiEncrypt,
                          ret.params.get(),
@@ -984,8 +993,9 @@ RUNNER_TEST_MULTIPLE(TED_0020_encrypt_missing_key, SyncEnv, AsyncEnv)
         ckmc_raw_buffer_s* encrypted = nullptr;
 
         // setup params
-        ParamListPtr params = createParamListPtr();
-        assert_positive(ckmc_generate_params, algo->m_type, params.get());
+        ckmc_param_list_h handle = NULL;
+        assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+        ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
         setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
         assert_crypto_result(EncryptionError::ALIAS_UNKNOWN,
@@ -1009,8 +1019,9 @@ RUNNER_TEST_MULTIPLE(TED_0030_encrypt_no_plain_text, SyncEnv, AsyncEnv)
         KeyAliasPair aliases = algo->keyGen();
 
         // setup params
-        ParamListPtr params = createParamListPtr();
-        assert_positive(ckmc_generate_params, algo->m_type, params.get());
+        ckmc_param_list_h handle = NULL;
+        assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+        ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
         setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
         assert_crypto_invalid_param(apiEncrypt,
@@ -1033,8 +1044,9 @@ RUNNER_TEST_MULTIPLE(TED_0040_encrypt_no_output_buffer, SyncEnv, AsyncEnv)
         KeyAliasPair aliases = algo->keyGen();
 
         // setup params
-        ParamListPtr params = createParamListPtr();
-        assert_positive(ckmc_generate_params, algo->m_type, params.get());
+        ckmc_param_list_h handle = NULL;
+        assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+        ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
         setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
         assert_crypto_invalid_param(apiEncrypt,
@@ -1110,8 +1122,9 @@ RUNNER_TEST_MULTIPLE(TED_0130_decrypt_no_encrypted_text, SyncEnv, AsyncEnv)
         KeyAliasPair aliases = algo->keyGen();
 
         // setup params
-        ParamListPtr params = createParamListPtr();
-        assert_positive(ckmc_generate_params, algo->m_type, params.get());
+        ckmc_param_list_h handle = NULL;
+        assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+        ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
         setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
         assert_crypto_invalid_param(apiDecrypt,
@@ -1161,30 +1174,6 @@ RUNNER_TEST_MULTIPLE(TED_0200_encrypt_decrypt_different_keys, SyncEnv, AsyncEnv)
     testEncryptDecryptDifferentKeys(RSA_OAEP_4096, false);
 }
 
-RUNNER_TEST_MULTIPLE(TED_0210_encrypt_decrypt_different_params, SyncEnv, AsyncEnv)
-{
-    testAllAlgorithms([](const AlgoBasePtr& algo){
-        // prepare buffers
-        RawBufferPtr plain = create_raw_buffer(createRandomBufferCAPI(BUF_LEN));
-        ckmc_raw_buffer_s* decrypted = nullptr;
-
-        // encrypt
-        auto ret = encrypt(algo, plain);
-
-        // setup different params
-        ParamListPtr params = createParamListPtr();
-        assert_positive(ckmc_generate_params, CKMC_ALGO_RSA_GEN, params.get());
-        setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
-
-        assert_crypto_invalid_param(apiDecrypt,
-                                    params.get(),
-                                    ret.prvKey.c_str(),
-                                    nullptr,
-                                    *ret.encrypted.get(),
-                                    &decrypted);
-    });
-}
-
 RUNNER_TEST_MULTIPLE(TED_0300_encrypt_decrypt, SyncEnv, AsyncEnv)
 {
     testAllAlgorithms([](const AlgoBasePtr& algo){
@@ -1475,8 +1464,9 @@ RUNNER_TEST(TED_2000_enc_no_observer_async, EncEnv)
         KeyAliasPair aliases = algo->keyGen(nullptr);
 
         // params
-        ParamListPtr params = createParamListPtr();
-        assert_positive(ckmc_generate_params, algo->m_type, params.get());
+        ckmc_param_list_h handle = NULL;
+        assert_positive(ckmc_generate_new_params, algo->m_type, &handle);
+        ParamListPtr params = ParamListPtr(handle, ckmc_param_list_free);
         setParam(params, CKMC_PARAM_ED_IV, createRandomBufferCAPI(DEFAULT_IV_LEN));
 
         // encrypt