From e025d7d94583fe2ab83b68358f1399ed5f834c21 Mon Sep 17 00:00:00 2001
From: Ooohui <zhanghui160@huawei.com>
Date: Wed, 4 Dec 2024 17:34:42 +0800
Subject: [PATCH 06/10] Rename/Refactor some code

---
 bsl/sal/src/sal_dl.c                          | 14 +++---
 bsl/usrdata/src/usr_data.c                    |  2 +-
 crypto/eal/src/eal_cipher.c                   |  2 +-
 crypto/eal/src/eal_drbg_local.h               |  2 +-
 crypto/eal/src/eal_kdf.c                      |  2 +-
 crypto/eal/src/eal_mac.c                      |  2 +-
 crypto/eal/src/eal_md.c                       |  2 +-
 crypto/eal/src/eal_pkey_gen.c                 | 11 ++---
 crypto/eal/src/eal_rand.c                     |  2 +-
 crypto/eal/src/eal_rand_method.c              |  2 +-
 crypto/include/crypt_local_types.h            |  2 -
 crypto/provider/include/crypt_provider.h      |  4 +-
 crypto/provider/src/mgr/crypt_provider.c      | 44 ++++++-------------
 .../provider/src/mgr/crypt_provider_common.c  | 17 ++++---
 .../provider/src/mgr/crypt_provider_compare.c |  7 ++-
 .../provider/src/mgr/crypt_provider_local.h   |  2 +-
 include/bsl/bsl_sal.h                         | 14 +++---
 include/bsl/bsl_user_data.h                   |  2 +-
 include/crypto/crypt_eal_implprovider.h       |  5 +--
 include/crypto/crypt_eal_provider.h           | 22 +++++-----
 include/pki/hitls_pki.h                       | 29 ++++++------
 pki/pkcs12/src/hitls_pkcs12_common.c          |  4 +-
 pki/x509_cert/include/hitls_cert_local.h      |  2 +-
 pki/x509_cert/src/hitls_x509_cert.c           |  4 +-
 pki/x509_common/include/hitls_x509_local.h    |  4 +-
 pki/x509_common/src/hitls_x509_attrs.c        |  4 +-
 pki/x509_common/src/hitls_x509_common.c       |  9 ++--
 pki/x509_common/src/hitls_x509_ctrl.c         |  6 +--
 pki/x509_common/src/hitls_x509_ext.c          |  3 +-
 pki/x509_crl/include/hitls_crl_local.h        |  2 +-
 pki/x509_crl/src/hitls_x509_crl.c             |  6 +--
 pki/x509_csr/src/hitls_x509_csr.c             |  6 +--
 pki/x509_verify/src/hitls_x509_verify.c       | 18 +++-----
 testcode/framework/crypto/crypto_test_util.h  |  2 +-
 testcode/framework/include/test.h             |  2 +-
 testcode/framework/stub/stub_replace.h        |  2 +-
 .../tls/func_wrapper/src/rec_wrapper.c        |  2 +-
 .../framework/tls/resource/src/channel_res.c  |  2 +-
 testcode/framework/tls/resource/src/tls_res.c |  4 +-
 .../test_suite_sdv_eal_provider_load.c        | 30 ++++++-------
 .../test_suite_sdv_eal_provider_load.data     |  2 +-
 .../hitls_x509_adapt/hitls_x509_cert_magr.c   |  1 -
 42 files changed, 134 insertions(+), 170 deletions(-)

diff --git a/bsl/sal/src/sal_dl.c b/bsl/sal/src/sal_dl.c
index b9b4006..876c15e 100644
--- a/bsl/sal/src/sal_dl.c
+++ b/bsl/sal/src/sal_dl.c
@@ -35,7 +35,7 @@ static BSL_SAL_DlCallback g_dlCallback = {0};
 #define BSL_SAL_PATH_MAX 4095
 #define BSL_SAL_NAME_MAX 255
 
-int32_t BSL_SAL_LibNameFormat(BSL_SAL_ConverterCmd cmd, const char *fileName, char **name)
+int32_t BSL_SAL_LibNameFormat(BSL_SAL_LibFmtCmd cmd, const char *fileName, char **name)
 {
     if (fileName == NULL || name == NULL) {
         BSL_ERR_PUSH_ERROR(BSL_SAL_ERR_BAD_PARAM);
@@ -53,23 +53,23 @@ int32_t BSL_SAL_LibNameFormat(BSL_SAL_ConverterCmd cmd, const char *fileName, ch
         return BSL_MALLOC_FAIL;
     }
     switch (cmd) {
-        case BSL_SAL_CONVERTER_SO:
+        case BSL_SAL_LIB_FMT_SO:
             ret = snprintf_s(tempName, dlPathLen, dlPathLen, "%s.so", fileName);
             break;
-        case BSL_SAL_CONVERTER_LIBSO:
+        case BSL_SAL_LIB_FMT_LIBSO:
             ret = snprintf_s(tempName, dlPathLen, dlPathLen, "lib%s.so", fileName);
             break;
-        case BSL_SAL_CONVERTER_LIBDLL:
+        case BSL_SAL_LIB_FMT_LIBDLL:
             ret = snprintf_s(tempName, dlPathLen, dlPathLen, "lib%s.dll", fileName);
             break;
-        case BSL_SAL_CONVERTER_DLL:
+        case BSL_SAL_LIB_FMT_DLL:
             ret = snprintf_s(tempName, dlPathLen, dlPathLen, "%s.dll", fileName);
             break;
-        case BSL_SAL_CONVERTER_OFF:
+        case BSL_SAL_LIB_FMT_OFF:
             ret = snprintf_s(tempName, dlPathLen, dlPathLen, "%s", fileName);
             break;
         default:
-            // Default to the first(BSL_SAL_CONVERTER_SO) conversion
+            // Default to the first(BSL_SAL_LIB_FMT_SO) conversion
             BSL_SAL_Free(tempName);
             BSL_ERR_PUSH_ERROR(BSL_SAL_ERR_BAD_PARAM);
             return BSL_SAL_ERR_BAD_PARAM;
diff --git a/bsl/usrdata/src/usr_data.c b/bsl/usrdata/src/usr_data.c
index baa6144..8977819 100644
--- a/bsl/usrdata/src/usr_data.c
+++ b/bsl/usrdata/src/usr_data.c
@@ -31,7 +31,7 @@ typedef struct {
 
 BSL_EX_CALLBACK g_exCallBack[BSL_MAX_EX_TYPE][BSL_MAX_EX_DATA];
 
-int BSL_USER_GetExDataNewIndex(int32_t index, int64_t argl, const void *argp, void *newFunc, void *dupFunc,
+int BSL_USER_GetExDataNewIndex(int32_t index, int64_t argl, const void *argp, const void *newFunc, const void *dupFunc,
     void *freeFunc)
 {
     if (index < 0 || index >= BSL_MAX_EX_TYPE) {
diff --git a/crypto/eal/src/eal_cipher.c b/crypto/eal/src/eal_cipher.c
index 4dffd00..d232cfc 100644
--- a/crypto/eal/src/eal_cipher.c
+++ b/crypto/eal/src/eal_cipher.c
@@ -128,7 +128,7 @@ CRYPT_EAL_CipherCtx *CRYPT_EAL_ProviderCipherNewCtx(CRYPT_EAL_LibCtx *libCtx, in
 {
     const CRYPT_EAL_Func *funcs = NULL;
     void *provCtx = NULL;
-    int32_t ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_SYMMCIPHER, algId, attrName,
+    int32_t ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_SYMMCIPHER, algId, attrName,
         &funcs, &provCtx);
     if (ret != CRYPT_SUCCESS) {
         EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_CIPHER, algId, ret);
diff --git a/crypto/eal/src/eal_drbg_local.h b/crypto/eal/src/eal_drbg_local.h
index f4dab74..9476bfa 100644
--- a/crypto/eal/src/eal_drbg_local.h
+++ b/crypto/eal/src/eal_drbg_local.h
@@ -51,7 +51,7 @@ typedef struct {
 
 const DrbgIdMap *GetDrbgIdMap(CRYPT_RAND_AlgId id);
 
-EAL_RandUnitaryMethod* EAL_RandGetMethod();
+EAL_RandUnitaryMethod* EAL_RandGetMethod(void);
 
 int32_t EAL_RandFindMethod(CRYPT_RAND_AlgId id, EAL_RandMethLookup *lu);
 
diff --git a/crypto/eal/src/eal_kdf.c b/crypto/eal/src/eal_kdf.c
index 86edcff..5f73d25 100644
--- a/crypto/eal/src/eal_kdf.c
+++ b/crypto/eal/src/eal_kdf.c
@@ -119,7 +119,7 @@ CRYPT_EAL_KdfCTX *CRYPT_EAL_ProviderKdfNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_t
 {
     const CRYPT_EAL_Func *funcs = NULL;
     void *provCtx = NULL;
-    int32_t ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_KDF, algId, attrName,
+    int32_t ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_KDF, algId, attrName,
         &funcs, &provCtx);
     if (ret != CRYPT_SUCCESS) {
         EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_KDF, algId, ret);
diff --git a/crypto/eal/src/eal_mac.c b/crypto/eal/src/eal_mac.c
index 0efaf08..ee4370a 100644
--- a/crypto/eal/src/eal_mac.c
+++ b/crypto/eal/src/eal_mac.c
@@ -96,7 +96,7 @@ CRYPT_EAL_MacCtx *CRYPT_EAL_ProviderMacNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_t
 {
     const CRYPT_EAL_Func *funcs = NULL;
     void *provCtx = NULL;
-    int32_t ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_MAC, algId, attrName,
+    int32_t ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_MAC, algId, attrName,
         &funcs, &provCtx);
     if (ret != CRYPT_SUCCESS) {
         EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_MAC, algId, ret);
diff --git a/crypto/eal/src/eal_md.c b/crypto/eal/src/eal_md.c
index 58fa179..7eb61d6 100644
--- a/crypto/eal/src/eal_md.c
+++ b/crypto/eal/src/eal_md.c
@@ -144,7 +144,7 @@ CRYPT_EAL_MdCTX *CRYPT_EAL_ProviderMdNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_t al
 {
     const CRYPT_EAL_Func *funcs = NULL;
     void *provCtx = NULL;
-    int32_t ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, algId, attrName,
+    int32_t ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, algId, attrName,
         &funcs, &provCtx);
     if (ret != CRYPT_SUCCESS) {
         BSL_ERR_PUSH_ERROR(ret);
diff --git a/crypto/eal/src/eal_pkey_gen.c b/crypto/eal/src/eal_pkey_gen.c
index 8b1af7c..d13e00f 100644
--- a/crypto/eal/src/eal_pkey_gen.c
+++ b/crypto/eal/src/eal_pkey_gen.c
@@ -1044,9 +1044,6 @@ static int32_t CRYPT_EAL_SetSignMethod(const CRYPT_EAL_Func *funcSign, EAL_PkeyU
                 case CRYPT_EAL_IMPLPKEYSIGN_VERIFYDATA:
                     method->verifyData = funcSign[index].func;
                     break;
-                case CRYPT_EAL_IMPLPKEYSIGN_RECOVER:
-                    method->recover = funcSign[index].func;
-                    break;
                 case CRYPT_EAL_IMPLPKEYSIGN_CTRL:
                     method->ctrl = funcSign[index].func;
                     break;
@@ -1106,14 +1103,14 @@ CRYPT_EAL_PkeyCtx *CRYPT_EAL_ProviderPkeyNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_
     const CRYPT_EAL_Func *funcSign = NULL;
     void *provCtx = NULL;
     int32_t ret;
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_KEYMGMT, algId, attrName,
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_KEYMGMT, algId, attrName,
         &funcsKeyMgmt, &provCtx);
     if (ret != CRYPT_SUCCESS) {
         EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_PKEY, algId, ret);
         return NULL;
     }
     if ((pkeyOperType & CRYPT_EAL_PKEY_CIPHER_OPERATE) == CRYPT_EAL_PKEY_CIPHER_OPERATE) {
-        ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_ASYMCIPHER, algId, attrName,
+        ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_ASYMCIPHER, algId, attrName,
             &funcsAsyCipher, &provCtx);
         if (ret != CRYPT_SUCCESS) {
             EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_PKEY, algId, ret);
@@ -1121,7 +1118,7 @@ CRYPT_EAL_PkeyCtx *CRYPT_EAL_ProviderPkeyNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_
         }
     }
     if ((pkeyOperType & CRYPT_EAL_PKEY_EXCH_OPERATE) == CRYPT_EAL_PKEY_EXCH_OPERATE) {
-        ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_KEYEXCH, algId, attrName,
+        ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_KEYEXCH, algId, attrName,
             &funcsExch, &provCtx);
         if (ret != CRYPT_SUCCESS) {
             EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_PKEY, algId, ret);
@@ -1129,7 +1126,7 @@ CRYPT_EAL_PkeyCtx *CRYPT_EAL_ProviderPkeyNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_
         }
     }
     if ((pkeyOperType & CRYPT_EAL_PKEY_SIGN_OPERATE) == CRYPT_EAL_PKEY_SIGN_OPERATE) {
-        ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_SIGN, algId, attrName,
+        ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_SIGN, algId, attrName,
             &funcSign, &provCtx);
         if (ret != CRYPT_SUCCESS) {
             EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_PKEY, algId, ret);
diff --git a/crypto/eal/src/eal_rand.c b/crypto/eal/src/eal_rand.c
index ddc0115..7bd7c5b 100644
--- a/crypto/eal/src/eal_rand.c
+++ b/crypto/eal/src/eal_rand.c
@@ -357,7 +357,7 @@ static CRYPT_EAL_RndCtx *EAL_ProvRandInitDrbg(CRYPT_EAL_LibCtx *libCtx, CRYPT_RA
 {
     const CRYPT_EAL_Func *funcs = NULL;
     void *provCtx = NULL;
-    int32_t ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_RAND, id, attrName,
+    int32_t ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_RAND, id, attrName,
         &funcs, &provCtx);
     if (ret != CRYPT_SUCCESS) {
         EAL_ERR_REPORT(CRYPT_EVENT_ERR, CRYPT_ALGO_RAND, id, ret);
diff --git a/crypto/eal/src/eal_rand_method.c b/crypto/eal/src/eal_rand_method.c
index 41e4439..7cc3fd7 100644
--- a/crypto/eal/src/eal_rand_method.c
+++ b/crypto/eal/src/eal_rand_method.c
@@ -89,7 +89,7 @@ const DrbgIdMap *GetDrbgIdMap(CRYPT_RAND_AlgId id)
     return NULL;
 }
 
-EAL_RandUnitaryMethod* EAL_RandGetMethod()
+EAL_RandUnitaryMethod* EAL_RandGetMethod(void)
 {
     return &g_randMethod;
 }
diff --git a/crypto/include/crypt_local_types.h b/crypto/include/crypt_local_types.h
index 1ed48a1..63faa45 100644
--- a/crypto/include/crypt_local_types.h
+++ b/crypto/include/crypt_local_types.h
@@ -109,7 +109,6 @@ typedef int32_t (*PkeyCrypt)(const void *key, const uint8_t *data, uint32_t data
 typedef int32_t (*PkeyCheck)(const void *prv, const void *pub);
 typedef int32_t (*PkeyCmp)(const void *key1, const void *key2);
 typedef int32_t (*PkeyGetSecBits)(const void *key);
-typedef int32_t (*PkeyRecover)(const void *ctx, uint8_t *sign, uint32_t signLen, uint8_t *data, uint32_t *dataLen);
 /**
 * @ingroup  EAL
 *
@@ -162,7 +161,6 @@ typedef struct EAL_PkeyUnitaryMethod {
     PkeyCrypt decrypt;                      // Decrypt.
     PkeyCheck check;                        // Check the consistency of the key pair.
     PkeyCmp cmp;                            // Compare keys and parameters.
-    PkeyRecover recover;
 } EAL_PkeyUnitaryMethod;
 /**
  * @ingroup  sym_algid
diff --git a/crypto/provider/include/crypt_provider.h b/crypto/provider/include/crypt_provider.h
index 2150fa7..5203814 100644
--- a/crypto/provider/include/crypt_provider.h
+++ b/crypto/provider/include/crypt_provider.h
@@ -30,8 +30,8 @@ extern "C" {
 // Maximum length of provider name
 #define DEFAULT_PROVIDER_NAME_LEN_MAX 255
 
-int32_t CRYPT_EAL_InitPreDefinedProviders();
-void CRYPT_EAL_FreePreDefinedProviders();
+int32_t CRYPT_EAL_InitPreDefinedProviders(void);
+void CRYPT_EAL_FreePreDefinedProviders(void);
 
 int32_t CRYPT_EAL_DefaultProvInit(CRYPT_EAL_ProvMgrCtx *mgrCtx, BSL_Param *param,
     CRYPT_EAL_Func *capFuncs, CRYPT_EAL_Func **outFuncs, void **provCtx);
diff --git a/crypto/provider/src/mgr/crypt_provider.c b/crypto/provider/src/mgr/crypt_provider.c
index a1184dd..9ba0808 100644
--- a/crypto/provider/src/mgr/crypt_provider.c
+++ b/crypto/provider/src/mgr/crypt_provider.c
@@ -60,7 +60,6 @@ void CRYPT_EAL_LibCtxFree(CRYPT_EAL_LibCtx *libCtx)
     BSL_SAL_Free(libCtx);
 }
 
-
 // Write a function to search for providers according to BSL_LIST_Search requirements,
 // comparing the input providerName with the providerName in EAL_ProviderMgrCtx for an exact match
 static int32_t ListCompareProvider(const void *a, const void *b)
@@ -109,12 +108,7 @@ static int32_t MountEalProviderMgrCtxParams(CRYPT_EAL_LibCtx *libCtx, void *hand
     }
 
     // Call the initialization function
-    ret = CRYPT_EAL_InitProviderMethod(ctx, param, ctx->provInitFunc);
-    if (ret != CRYPT_SUCCESS) {
-        return ret;
-    }
-
-    return CRYPT_SUCCESS;
+    return CRYPT_EAL_InitProviderMethod(ctx, param, ctx->provInitFunc);
 }
 
 static int32_t CheckProviderLoaded(CRYPT_EAL_LibCtx *libCtx,
@@ -136,7 +130,7 @@ static int32_t CheckProviderLoaded(CRYPT_EAL_LibCtx *libCtx,
         ret = BSL_SAL_AtomicUpReferences(&tempProviderMgr->ref, &tempCount);
         if (ret != BSL_SUCCESS) {
             BSL_ERR_PUSH_ERROR(ret);
-            BSL_SAL_ThreadUnlock(libCtx->lock);
+            (void)BSL_SAL_ThreadUnlock(libCtx->lock);
             return ret;
         }
     }
@@ -158,21 +152,18 @@ static int32_t AddProviderToList(CRYPT_EAL_LibCtx *libCtx, CRYPT_EAL_ProvMgrCtx
     }
 
     ret = BSL_LIST_AddElement(libCtx->providers, providerMgr, BSL_LIST_POS_END);
+    (void)BSL_SAL_ThreadUnlock(libCtx->lock);
     if (ret != BSL_SUCCESS) {
-        BSL_SAL_ThreadUnlock(libCtx->lock);
         BSL_ERR_PUSH_ERROR(ret);
-        return ret;
     }
 
-    (void)BSL_SAL_ThreadUnlock(libCtx->lock);
-
-    return CRYPT_SUCCESS;
+    return ret;
 }
 
 static bool IsEalPreDefinedProvider(const char *providerName)
 {
     const char *preProvider[] = {CRYPT_EAL_DEFAULT_PROVIDER};
-    for (size_t i = 0; i < sizeof(preProvider)/sizeof(preProvider[0]); i++) {
+    for (size_t i = 0; i < sizeof(preProvider) / sizeof(preProvider[0]); i++) {
         if (strcmp(preProvider[i], providerName) == 0) {
             return true;
         }
@@ -235,7 +226,7 @@ static int32_t EalProviderMgrCtxNew(CRYPT_EAL_LibCtx *libCtx, char *providerName
 }
 
 // Load provider dynamic library
-int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_ConverterCmd cmd,
+int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd,
     const char *providerName, BSL_Param *param, CRYPT_EAL_ProvMgrCtx **mgrCtx)
 {
     if (providerName == NULL) {
@@ -250,11 +241,10 @@ int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_ConverterCmd cm
         BSL_ERR_PUSH_ERROR(CRYPT_PROVIDER_INVALID_LIB_CTX);
         return CRYPT_PROVIDER_INVALID_LIB_CTX;
     }
-    
-    int32_t ret = CRYPT_SUCCESS;
+
     CRYPT_EAL_ProvMgrCtx *providerMgr = NULL;
     char *providerFullName = NULL;
-    ret = BSL_SAL_LibNameFormat(cmd, providerName, &providerFullName);
+    int32_t ret = BSL_SAL_LibNameFormat(cmd, providerName, &providerFullName);
     if (ret != BSL_SUCCESS) {
         BSL_ERR_PUSH_ERROR(ret);
         return ret;
@@ -283,21 +273,19 @@ int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_ConverterCmd cm
     }
     // Create and initialize EAL_ProviderMgrCtx
     ret = EalProviderMgrCtxNew(localCtx, providerFullName, param, &providerMgr);
+    BSL_SAL_Free(providerFullName);
     if (ret != CRYPT_SUCCESS) {
-        BSL_SAL_Free(providerFullName);
         return ret;
     }
 
     // Add provider to the list
     ret = AddProviderToList(localCtx, providerMgr);
     if (ret != CRYPT_SUCCESS) {
-        BSL_SAL_Free(providerFullName);
         CRYPT_EAL_ProviderMgrCtxFree(providerMgr);
         providerMgr = NULL;
         return ret;
     }
 
-    BSL_SAL_Free(providerFullName);
     if (mgrCtx != NULL) {
         *mgrCtx = providerMgr;
     }
@@ -319,8 +307,7 @@ static void RemoveAndFreeProvider(BslList *providers, CRYPT_EAL_ProvMgrCtx *prov
 }
 
 // Unload provider
-int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_ConverterCmd cmd,
-    const char *providerName)
+int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd, const char *providerName)
 {
     int32_t ret = CRYPT_SUCCESS;
     CRYPT_EAL_ProvMgrCtx *providerMgr = NULL;
@@ -353,18 +340,17 @@ int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_ConverterCmd
     }
     providerMgr =
         (CRYPT_EAL_ProvMgrCtx *)BSL_LIST_Search(localCtx->providers, providerFullName, ListCompareProvider, NULL);
+    BSL_SAL_FREE(providerFullName);
     if (providerMgr == NULL) {
-        BSL_SAL_ThreadUnlock(localCtx->lock);
-        BSL_SAL_FREE(providerFullName);
+        (void)BSL_SAL_ThreadUnlock(localCtx->lock);
         return CRYPT_SUCCESS;
     }
     // Decrease reference count
     int refCount = 0;
     ret = BSL_SAL_AtomicDownReferences(&providerMgr->ref, &refCount);
     if (ret != BSL_SUCCESS) {
-        BSL_SAL_FREE(providerFullName);
         BSL_ERR_PUSH_ERROR(ret);
-        BSL_SAL_ThreadUnlock(localCtx->lock);
+        (void)BSL_SAL_ThreadUnlock(localCtx->lock);
         return ret;
     }
 
@@ -372,7 +358,6 @@ int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_ConverterCmd
         RemoveAndFreeProvider(localCtx->providers, providerMgr);
     }
     (void)BSL_SAL_ThreadUnlock(localCtx->lock);
-    BSL_SAL_FREE(providerFullName);
     return CRYPT_SUCCESS;
 }
 
@@ -394,8 +379,7 @@ int32_t CRYPT_EAL_ProviderSetLoadPath(CRYPT_EAL_LibCtx *libCtx, const char *sear
     
     char *tempPath = NULL;
     if (searchPath != NULL) {
-        tempPath = BSL_SAL_Dump(searchPath,
-            BSL_SAL_Strnlen(searchPath, DEFAULT_PROVIDER_PATH_LEN_MAX) + 1);
+        tempPath = BSL_SAL_Dump(searchPath, BSL_SAL_Strnlen(searchPath, DEFAULT_PROVIDER_PATH_LEN_MAX) + 1);
         if (tempPath == NULL) {
             BSL_ERR_PUSH_ERROR(CRYPT_MEM_ALLOC_FAIL);
             return CRYPT_MEM_ALLOC_FAIL;
diff --git a/crypto/provider/src/mgr/crypt_provider_common.c b/crypto/provider/src/mgr/crypt_provider_common.c
index 1bb5d00..f583d7a 100644
--- a/crypto/provider/src/mgr/crypt_provider_common.c
+++ b/crypto/provider/src/mgr/crypt_provider_common.c
@@ -30,7 +30,7 @@ CRYPT_EAL_LibCtx* CRYPT_EAL_GetGlobalLibCtx(void)
     return g_libCtx;
 }
 
-int32_t CRYPT_EAL_ProviderGetFuncsFrom(CRYPT_EAL_LibCtx *libCtx, int32_t operaId, int32_t algId,
+int32_t CRYPT_EAL_ProviderGetFuncs(CRYPT_EAL_LibCtx *libCtx, int32_t operaId, int32_t algId,
     const char *attribute, const CRYPT_EAL_Func **funcs, void **provCtx)
 {
     if (funcs == NULL) {
@@ -46,11 +46,9 @@ int32_t CRYPT_EAL_ProviderGetFuncsFrom(CRYPT_EAL_LibCtx *libCtx, int32_t operaId
         BSL_ERR_PUSH_ERROR(CRYPT_NULL_INPUT);
         return CRYPT_NULL_INPUT;
     }
-    if (attribute != NULL) {
-        if (strlen(attribute) > (INT32_MAX/2)) {
-            BSL_ERR_PUSH_ERROR(CRYPT_NULL_INPUT);
-            return CRYPT_NULL_INPUT;
-        }
+    if (attribute != NULL && strlen(attribute) > (INT32_MAX >> 1)) {
+        BSL_ERR_PUSH_ERROR(CRYPT_INVALID_ARG);
+        return CRYPT_INVALID_ARG;
     }
 
     return CRYPT_EAL_CompareAlgAndAttr(localCtx, operaId, algId, attribute, funcs, provCtx);
@@ -135,7 +133,7 @@ int32_t CRYPT_EAL_InitProviderMethod(CRYPT_EAL_ProvMgrCtx *ctx, BSL_Param *param
     return CRYPT_SUCCESS;
 }
 
-CRYPT_EAL_LibCtx *CRYPT_EAL_LibCtxNewInternal()
+CRYPT_EAL_LibCtx *CRYPT_EAL_LibCtxNewInternal(void)
 {
     CRYPT_EAL_LibCtx *libCtx = (CRYPT_EAL_LibCtx *)BSL_SAL_Calloc(1, sizeof(CRYPT_EAL_LibCtx));
     if (libCtx == NULL) {
@@ -170,6 +168,7 @@ void CRYPT_EAL_ProviderMgrCtxFree(CRYPT_EAL_ProvMgrCtx  *ctx)
     }
     if (ctx->provFreeCb != NULL) {
         ctx->provFreeCb(ctx->provCtx);
+        ctx->provCtx = NULL;
     }
     BSL_SAL_FREE(ctx->providerName);
     BSL_SAL_FREE(ctx->providerPath);
@@ -222,7 +221,7 @@ int32_t CRYPT_EAL_LoadPreDefinedProvider(CRYPT_EAL_LibCtx *libCtx, const char* p
     return ret;
 }
 
-int32_t CRYPT_EAL_InitPreDefinedProviders()
+int32_t CRYPT_EAL_InitPreDefinedProviders(void)
 {
     int32_t ret;
     CRYPT_EAL_LibCtx *libCtx = CRYPT_EAL_LibCtxNewInternal();
@@ -241,7 +240,7 @@ int32_t CRYPT_EAL_InitPreDefinedProviders()
     return ret;
 }
 
-void CRYPT_EAL_FreePreDefinedProviders()
+void CRYPT_EAL_FreePreDefinedProviders(void)
 {
     CRYPT_EAL_LibCtx *libCtx = g_libCtx;
     if (libCtx == NULL) {
diff --git a/crypto/provider/src/mgr/crypt_provider_compare.c b/crypto/provider/src/mgr/crypt_provider_compare.c
index 3345b92..3c4b405 100644
--- a/crypto/provider/src/mgr/crypt_provider_compare.c
+++ b/crypto/provider/src/mgr/crypt_provider_compare.c
@@ -91,8 +91,8 @@ static void *ValueDupFunc(void *ptr, size_t size)
         goto ERR;
     }
 
-    newValue->judgeStr = BSL_SAL_Dump(srcValue->judgeStr, BSL_SAL_Strnlen(srcValue->judgeStr, UINT32_MAX)+1);
-    newValue->valueStr = BSL_SAL_Dump(srcValue->valueStr, BSL_SAL_Strnlen(srcValue->valueStr, UINT32_MAX)+1);
+    newValue->judgeStr = BSL_SAL_Dump(srcValue->judgeStr, BSL_SAL_Strnlen(srcValue->judgeStr, UINT32_MAX) + 1);
+    newValue->valueStr = BSL_SAL_Dump(srcValue->valueStr, BSL_SAL_Strnlen(srcValue->valueStr, UINT32_MAX) + 1);
 
     if (newValue->judgeStr == NULL || newValue->valueStr == NULL) {
         BSL_ERR_PUSH_ERROR(CRYPT_MEM_ALLOC_FAIL);
@@ -217,14 +217,13 @@ static int32_t GetAttributePositions(const char *attribute, int32_t start, int32
 
 static int32_t ParseAttributeValue(const char *attribute, int32_t *startPos, char **key, AttributeValue **value)
 {
-    int32_t ret;
     int32_t start = *startPos;
     char *tempKey = NULL;
     AttributeValue *tempValue = NULL;
 
     // Call the sub-function to get key-value pair positions
     int32_t keyStart, keyEnd, judgeStart, judgeEnd, valueStart, valueEnd;
-    ret = GetAttributePositions(attribute, start, &keyStart, &keyEnd, &judgeStart, &judgeEnd, &valueStart, &valueEnd);
+    int32_t ret = GetAttributePositions(attribute, start, &keyStart, &keyEnd, &judgeStart, &judgeEnd, &valueStart, &valueEnd);
     if (ret != CRYPT_SUCCESS) {
         return ret;
     }
diff --git a/crypto/provider/src/mgr/crypt_provider_local.h b/crypto/provider/src/mgr/crypt_provider_local.h
index 408fc7d..18a370c 100644
--- a/crypto/provider/src/mgr/crypt_provider_local.h
+++ b/crypto/provider/src/mgr/crypt_provider_local.h
@@ -56,7 +56,7 @@ struct EAL_ProviderMgrCtx {
 
 int32_t CRYPT_EAL_InitProviderMethod(CRYPT_EAL_ProvMgrCtx *ctx, BSL_Param *param,
     CRYPT_EAL_ImplProviderInit providerInit);
-CRYPT_EAL_LibCtx *CRYPT_EAL_LibCtxNewInternal();
+CRYPT_EAL_LibCtx *CRYPT_EAL_LibCtxNewInternal(void);
 int32_t CRYPT_EAL_CompareAlgAndAttr(CRYPT_EAL_LibCtx *localCtx, int32_t operaId,
     int32_t algId, const char *attribute, const CRYPT_EAL_Func **funcs, void **provCtx);
 
diff --git a/include/bsl/bsl_sal.h b/include/bsl/bsl_sal.h
index baf1b34..0a94ec1 100644
--- a/include/bsl/bsl_sal.h
+++ b/include/bsl/bsl_sal.h
@@ -1246,12 +1246,12 @@ int32_t BSL_SAL_GetFuncAddress(void *handle, const char *funcName, void **func);
 
 // Define command enumeration
 typedef enum {
-    BSL_SAL_CONVERTER_OFF = 0, /* Do not enable named conversion */
-    BSL_SAL_CONVERTER_SO = 1,
-    BSL_SAL_CONVERTER_LIBSO = 2,
-    BSL_SAL_CONVERTER_LIBDLL = 3,
-    BSL_SAL_CONVERTER_DLL = 4
-} BSL_SAL_ConverterCmd;
+    BSL_SAL_LIB_FMT_OFF = 0, /* Do not enable named conversion */
+    BSL_SAL_LIB_FMT_SO = 1,
+    BSL_SAL_LIB_FMT_LIBSO = 2,
+    BSL_SAL_LIB_FMT_LIBDLL = 3,
+    BSL_SAL_LIB_FMT_DLL = 4
+} BSL_SAL_LibFmtCmd;
 
 /**
  * @ingroup bsl_sal
@@ -1266,7 +1266,7 @@ typedef enum {
  * @retval If the operation is successful, BSL_OK is returned;
  * Otherwise, an error code is returned.
  */
-int32_t BSL_SAL_LibNameFormat(BSL_SAL_ConverterCmd cmd, const char *fileName, char **name);
+int32_t BSL_SAL_LibNameFormat(BSL_SAL_LibFmtCmd cmd, const char *fileName, char **name);
 
 /**
  * @ingroup bsl_sal
diff --git a/include/bsl/bsl_user_data.h b/include/bsl/bsl_user_data.h
index 608b0f6..df0d6e2 100644
--- a/include/bsl/bsl_user_data.h
+++ b/include/bsl/bsl_user_data.h
@@ -55,7 +55,7 @@ int BSL_USER_SetExData(BSL_USER_ExData *ad, int32_t idx, void *val);
 
 void *BSL_USER_GetExData(const BSL_USER_ExData *ad, int32_t idx);
 
-int BSL_USER_GetExDataNewIndex(int32_t index, int64_t argl, const void *argp, void *newFunc, void *dupFunc,
+int BSL_USER_GetExDataNewIndex(int32_t index, int64_t argl, const void *argp, const void *newFunc, const void *dupFunc,
     void *freeFunc);
 
 void BSL_USER_FreeExDataIndex(int32_t index, void *obj, BSL_USER_ExData *ad);
diff --git a/include/crypto/crypt_eal_implprovider.h b/include/crypto/crypt_eal_implprovider.h
index 6d0377b..3cc7ef1 100644
--- a/include/crypto/crypt_eal_implprovider.h
+++ b/include/crypto/crypt_eal_implprovider.h
@@ -154,8 +154,7 @@ typedef void (*CRYPT_EAL_ImplPkeyMgmtFreeCtx)(void *ctx);
 #define CRYPT_EAL_IMPLPKEYSIGN_SIGNDATA   2
 #define CRYPT_EAL_IMPLPKEYSIGN_VERIFY     3
 #define CRYPT_EAL_IMPLPKEYSIGN_VERIFYDATA 4
-#define CRYPT_EAL_IMPLPKEYSIGN_RECOVER    5
-#define CRYPT_EAL_IMPLPKEYSIGN_CTRL       6
+#define CRYPT_EAL_IMPLPKEYSIGN_CTRL       5
 
 typedef int32_t (*CRYPT_EAL_ImplPkeySign)(const void *ctx, int32_t mdAlgId, const uint8_t *data, uint32_t dataLen,
     uint8_t *sign, uint32_t *signLen);
@@ -165,8 +164,6 @@ typedef int32_t (*CRYPT_EAL_ImplPkeyVerify)(const void *ctx, int32_t mdAlgId, co
     uint8_t *sign, uint32_t signLen);
 typedef int32_t (*CRYPT_EAL_ImplPkeyVerifyData)(const void *ctx, const uint8_t *data, uint32_t dataLen,
     uint8_t *sign, uint32_t signLen);
-typedef int32_t (*CRYPT_EAL_ImplPkeyRecover)(const void *ctx, const uint8_t *sign, uint32_t signLen,
-    uint8_t *data, uint32_t *dataLen);
 typedef int32_t (*CRYPT_EAL_ImplPkeyCtrl)(void *ctx, int32_t cmd, void *val, uint32_t valLen);
 
 // CRYPT_EAL_OPERAID_ASYMCIPHER
diff --git a/include/crypto/crypt_eal_provider.h b/include/crypto/crypt_eal_provider.h
index 068ee2f..c8e18bd 100644
--- a/include/crypto/crypt_eal_provider.h
+++ b/include/crypto/crypt_eal_provider.h
@@ -66,17 +66,17 @@ void CRYPT_EAL_LibCtxFree(CRYPT_EAL_LibCtx *libCtx);
  * @param cmd [IN] Command specifying the conversion format for the provider library name.
  *                 This parameter is used to determine how the provider library name should be
  *                 converted or formatted. Possible values are:
- *                 - BSL_SAL_CONVERTER_SO: Convert to .so format
- *                 - BSL_SAL_CONVERTER_LIBSO: Convert to lib*.so format
- *                 - BSL_SAL_CONVERTER_LIBDLL: Convert to lib*.dll format
- *                 - BSL_SAL_CONVERTER_DLL: Convert to .dll format
+ *                 - BSL_SAL_LIB_FMT_SO: Convert to .so format
+ *                 - BSL_SAL_LIB_FMT_LIBSO: Convert to lib*.so format
+ *                 - BSL_SAL_LIB_FMT_LIBDLL: Convert to lib*.dll format
+ *                 - BSL_SAL_LIB_FMT_DLL: Convert to .dll format
  *                 The specific conversion is handled by the BSL_SAL_LibNameFormat function.
  * @param mgrCtx [OUT] Provider context
  *
  * @retval #CRYPT_SUCCESS, if success.
  *         Other error codes see the crypt_errno.h
 */
-int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_ConverterCmd cmd,
+int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd,
     const char *providerName, BSL_Param *param, CRYPT_EAL_ProvMgrCtx **mgrCtx);
 
 /**
@@ -101,17 +101,17 @@ int32_t CRYPT_EAL_ProviderCtrl(CRYPT_EAL_ProvMgrCtx *ctx, int32_t cmd, void *val
  * @param cmd [IN] Command specifying the conversion format for the provider library name.
  *                 This parameter is used to determine how the provider library name should be
  *                 converted or formatted. Possible values are:
- *                 - BSL_SAL_CONVERTER_SO: Convert to .so format
- *                 - BSL_SAL_CONVERTER_LIBSO: Convert to lib*.so format
- *                 - BSL_SAL_CONVERTER_LIBDLL: Convert to lib*.dll format
- *                 - BSL_SAL_CONVERTER_DLL: Convert to .dll format
+ *                 - BSL_SAL_LIB_FMT_SO: Convert to .so format
+ *                 - BSL_SAL_LIB_FMT_LIBSO: Convert to lib*.so format
+ *                 - BSL_SAL_LIB_FMT_LIBDLL: Convert to lib*.dll format
+ *                 - BSL_SAL_LIB_FMT_DLL: Convert to .dll format
  *                 The specific conversion is handled by the BSL_SAL_LibNameFormat function.
  * @param providerName [IN] provider name
  *
  * @retval #CRYPT_SUCCESS, if success.
  *         Other error codes see the crypt_errno.h
 */
-int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libctx, BSL_SAL_ConverterCmd cmd, const char *providerName);
+int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libctx, BSL_SAL_LibFmtCmd cmd, const char *providerName);
 
 
 /**
@@ -141,7 +141,7 @@ int32_t CRYPT_EAL_ProviderSetLoadPath(CRYPT_EAL_LibCtx *libCtx, const char *sear
  * @retval #CRYPT_SUCCESS, if success.
  *         Other error codes see the crypt_errno.h
 */
-int32_t CRYPT_EAL_ProviderGetFuncsFrom(CRYPT_EAL_LibCtx *libCtx, int32_t operaId, int32_t algId,
+int32_t CRYPT_EAL_ProviderGetFuncs(CRYPT_EAL_LibCtx *libCtx, int32_t operaId, int32_t algId,
     const char *attribute, const CRYPT_EAL_Func **funcs, void **provCtx);
 
 #ifdef __cplusplus
diff --git a/include/pki/hitls_pki.h b/include/pki/hitls_pki.h
index 1235978..a570e6d 100644
--- a/include/pki/hitls_pki.h
+++ b/include/pki/hitls_pki.h
@@ -417,7 +417,7 @@ void HITLS_X509_ClearAuthorityKeyId(HITLS_X509_ExtAki *aki);
  * @return #HITLS_X509_SUCCESS, success.
  *         Error codes can be found in hitls_pki_errno.h
  */
-int32_t HITLS_X509_CertParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_Cert **cert);
+int32_t HITLS_X509_CertParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Cert **cert);
 
 /**
  * @ingroup pki
@@ -556,7 +556,7 @@ int32_t HITLS_X509_CrlCtrl(HITLS_X509_Crl *crl, int32_t cmd, void *val, int32_t
  * @param crl           [OUT] CRL after parse.
  * @return Error code
  */
-int32_t HITLS_X509_CrlParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_Crl **crl);
+int32_t HITLS_X509_CrlParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Crl **crl);
 
 /**
  * @ingroup pki
@@ -729,16 +729,17 @@ void HITLS_X509_StoreCtxFree(HITLS_X509_StoreCtx *storeCtx);
  * @brief Generic function to process StoreCtx.
  *
  * @param storeCtx [IN] StoreCtx.
- * @param cmd [IN] HITLS_X509_Cmd                       data type
- *        HITLS_X509_STORECTX_SET_PARAM_DEPTH           int32_t
- *        HITLS_X509_STORECTX_SET_PARAM_FLAGS           int64_t
- *        HITLS_X509_STORECTX_SET_TIME                  int64_t
- *        HITLS_X509_STORECTX_SET_SECBITS               uint32_t
- *        HITLS_X509_STORECTX_CLR_PARAM_FLAGS           int64_t
- *        HITLS_X509_STORECTX_DEEP_COPY_SET_CA          HITLS_X509_Cert
- *        HITLS_X509_STORECTX_SHALLOW_COPY_SET_CA       HITLS_X509_Cert
- *        HITLS_X509_STORECTX_SET_CRL                   HITLS_X509_Crl
- *        HITLS_X509_STORECTX_REF_UP                    int
+ * @param cmd [IN] HITLS_X509_Cmd                       data type           data length
+ *        HITLS_X509_STORECTX_SET_PARAM_DEPTH           int32_t             sizeof(int32_t)
+ *        HITLS_X509_STORECTX_SET_PARAM_FLAGS           uint64_t            sizeof(uint64_t)
+ *        HITLS_X509_STORECTX_SET_TIME                  int64_t             sizeof(int64_t)
+ *        HITLS_X509_STORECTX_SET_SECBITS               uint32_t            sizeof(uint32_t)
+ *        HITLS_X509_STORECTX_CLR_PARAM_FLAGS           uint64_t            sizeof(uint64_t)
+ *        HITLS_X509_STORECTX_DEEP_COPY_SET_CA          HITLS_X509_Cert     -
+ *        HITLS_X509_STORECTX_SHALLOW_COPY_SET_CA       HITLS_X509_Cert     -
+ *        HITLS_X509_STORECTX_SET_CRL                   HITLS_X509_Crl      -
+ *        HITLS_X509_STORECTX_REF_UP                    int                 sizeof(int)
+ *        HITLS_X509_STORECTX_SET_VEY_SM2_USERID        buffer              > 0
  * @param val [IN/OUT] input and output value.
  * @param valLen [IN] value length.
  * @retval #HITLS_X509_SUCCESS, success.
@@ -857,7 +858,7 @@ int32_t HITLS_X509_CsrCtrl(HITLS_X509_Csr *csr, int32_t cmd, void *val, int32_t
  * @retval #HITLS_X509_SUCCESS, success.
  *         Error codes can be found in hitls_pki_errno.h
  */
-int32_t HITLS_X509_CsrParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_Csr **csr);
+int32_t HITLS_X509_CsrParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Csr **csr);
 
 /**
  * @ingroup pki
@@ -1022,7 +1023,7 @@ int32_t HITLS_PKCS12_Ctrl(HITLS_PKCS12 *p12, int32_t cmd, void *val, int32_t val
  * @retval #HITLS_X509_SUCCESS, success.
  *         Error codes can be found in hitls_pki_errno.h
  */
-int32_t HITLS_PKCS12_ParseBuff(int32_t format, BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam,
+int32_t HITLS_PKCS12_ParseBuff(int32_t format, const BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam,
     HITLS_PKCS12 **p12, bool needMacVerify);
 
 /**
diff --git a/pki/pkcs12/src/hitls_pkcs12_common.c b/pki/pkcs12/src/hitls_pkcs12_common.c
index e748d1c..0f43793 100644
--- a/pki/pkcs12/src/hitls_pkcs12_common.c
+++ b/pki/pkcs12/src/hitls_pkcs12_common.c
@@ -714,7 +714,7 @@ static int32_t ParseMacDataAndVerify(BSL_Buffer *initData, BSL_Buffer *macData,
     return HITLS_X509_SUCCESS;
 }
 
-static int32_t ParseAsn1PKCS12(BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam,
+static int32_t ParseAsn1PKCS12(const BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam,
     HITLS_PKCS12 *p12, bool needMacVerify)
 {
     uint32_t version = 0;
@@ -763,7 +763,7 @@ static int32_t ParseAsn1PKCS12(BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *
     return HITLS_X509_SUCCESS;
 }
 
-int32_t HITLS_PKCS12_ParseBuff(int32_t format, BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam,
+int32_t HITLS_PKCS12_ParseBuff(int32_t format, const BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam,
     HITLS_PKCS12 **p12, bool needMacVerify)
 {
     if (encode == NULL || encode->data == NULL || encode->dataLen == 0 ||
diff --git a/pki/x509_cert/include/hitls_cert_local.h b/pki/x509_cert/include/hitls_cert_local.h
index d2f3ed4..fcd3fa6 100644
--- a/pki/x509_cert/include/hitls_cert_local.h
+++ b/pki/x509_cert/include/hitls_cert_local.h
@@ -64,7 +64,7 @@ typedef struct _HITLS_X509_Cert {
 
 int32_t HITLS_X509_CheckIssued(HITLS_X509_Cert *issue, HITLS_X509_Cert *subject, bool *res);
 bool HITLS_X509_CertIsCA(HITLS_X509_Cert *cert);
-int32_t HITLS_X509_CertMulParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_List **certlist);
+int32_t HITLS_X509_CertMulParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_List **certlist);
 
 #ifdef __cplusplus
 }
diff --git a/pki/x509_cert/src/hitls_x509_cert.c b/pki/x509_cert/src/hitls_x509_cert.c
index e09d031..707341b 100644
--- a/pki/x509_cert/src/hitls_x509_cert.c
+++ b/pki/x509_cert/src/hitls_x509_cert.c
@@ -354,7 +354,7 @@ ERR:
 }
 
 
-int32_t HITLS_X509_CertMulParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_List **certlist)
+int32_t HITLS_X509_CertMulParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_List **certlist)
 {
     int32_t ret;
     if (encode == NULL || encode->data == NULL || encode->dataLen == 0 || certlist == NULL) {
@@ -382,7 +382,7 @@ int32_t HITLS_X509_CertMulParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X5
     return ret;
 }
 
-int32_t HITLS_X509_CertParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_Cert **cert)
+int32_t HITLS_X509_CertParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Cert **cert)
 {
     HITLS_X509_List *list = NULL;
     if (cert == NULL || *cert != NULL) {
diff --git a/pki/x509_common/include/hitls_x509_local.h b/pki/x509_common/include/hitls_x509_local.h
index 8b6bc54..db5aa70 100644
--- a/pki/x509_common/include/hitls_x509_local.h
+++ b/pki/x509_common/include/hitls_x509_local.h
@@ -201,7 +201,7 @@ int32_t HITLS_X509_AddListItemDefault(void *item, uint32_t len, BSL_ASN1_List *l
 
 int32_t HITLS_X509_ParseTime(BSL_ASN1_Buffer *before, BSL_ASN1_Buffer *after, HITLS_X509_ValidTime *time);
 
-int32_t HITLS_X509_ParseX509(int32_t format, BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun,
+int32_t HITLS_X509_ParseX509(int32_t format, const BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun,
     HITLS_X509_List *list);
 int32_t HITLS_X509_CmpNameNode(BSL_ASN1_List *nameOri, BSL_ASN1_List *name);
 
@@ -248,7 +248,7 @@ int32_t HITLS_X509_ExtReplace(HITLS_X509_Ext *dest, HITLS_X509_Ext *src);
 
 int32_t HITLS_X509_SetSerial(BSL_ASN1_Buffer *serial, const void *val, int32_t valLen);
 
-int32_t HITLS_X509_GetSerial(BSL_ASN1_Buffer *serial, const void *val, int32_t valLen);
+int32_t HITLS_X509_GetSerial(BSL_ASN1_Buffer *serial, void *val, int32_t valLen);
 
 typedef int32_t (*EncodeExtCb)(void *, HITLS_X509_ExtEntry *, const void *);
 
diff --git a/pki/x509_common/src/hitls_x509_attrs.c b/pki/x509_common/src/hitls_x509_attrs.c
index 221e7c7..94c153b 100644
--- a/pki/x509_common/src/hitls_x509_attrs.c
+++ b/pki/x509_common/src/hitls_x509_attrs.c
@@ -225,9 +225,7 @@ int32_t HITLS_X509_ParseAttrList(BSL_ASN1_Buffer *attrBuff, HITLS_X509_Attrs *at
 static int32_t CmpAttrEntryByCid(const void *attrEntry, const void *cid)
 {
     const HITLS_X509_AttrEntry *node = attrEntry;
-    const BslCid *oid = cid;
-
-    return node->cid == *(const BslCid *)oid ? 0 : 1;
+    return node->cid == *(const BslCid *)cid ? 0 : 1;
 }
 
 typedef int32_t (*EncodeAttrCb)(HITLS_X509_Attrs *attributes, void *val, int32_t valLen, BSL_ASN1_Buffer *attrValue);
diff --git a/pki/x509_common/src/hitls_x509_common.c b/pki/x509_common/src/hitls_x509_common.c
index 1730c81..656239a 100644
--- a/pki/x509_common/src/hitls_x509_common.c
+++ b/pki/x509_common/src/hitls_x509_common.c
@@ -350,7 +350,7 @@ static int32_t X509_ParseAndAddRes(BSL_Buffer *asn1Buf, X509_ParseFuncCbk *parse
     return HITLS_X509_SUCCESS;
 }
 
-static int32_t HITLS_X509_ParseAsn1(BSL_Buffer *encode, X509_ParseFuncCbk *parsefun, HITLS_X509_List *list)
+static int32_t HITLS_X509_ParseAsn1(const BSL_Buffer *encode, X509_ParseFuncCbk *parsefun, HITLS_X509_List *list)
 {
     uint8_t *data = encode->data;
     uint32_t dataLen = encode->dataLen;
@@ -376,7 +376,8 @@ static int32_t HITLS_X509_ParseAsn1(BSL_Buffer *encode, X509_ParseFuncCbk *parse
     return HITLS_X509_SUCCESS;
 }
 
-static int32_t HITLS_X509_ParsePem(BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun, HITLS_X509_List *list)
+static int32_t HITLS_X509_ParsePem(const BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun,
+    HITLS_X509_List *list)
 {
     char *nextEncode = (char *)(encode->data);
     uint32_t nextEncodeLen = encode->dataLen;
@@ -402,7 +403,7 @@ static int32_t HITLS_X509_ParsePem(BSL_Buffer *encode, bool isCert, X509_ParseFu
     return HITLS_X509_SUCCESS;
 }
 
-static int32_t HITLS_X509_ParseUnknown(BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun,
+static int32_t HITLS_X509_ParseUnknown(const BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun,
     HITLS_X509_List *list)
 {
     bool isPem = BSL_PEM_IsPemFormat((char *)(encode->data), encode->dataLen);
@@ -413,7 +414,7 @@ static int32_t HITLS_X509_ParseUnknown(BSL_Buffer *encode, bool isCert, X509_Par
     }
 }
 
-int32_t HITLS_X509_ParseX509(int32_t format, BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun,
+int32_t HITLS_X509_ParseX509(int32_t format, const BSL_Buffer *encode, bool isCert, X509_ParseFuncCbk *parsefun,
     HITLS_X509_List *list)
 {
     switch (format) {
diff --git a/pki/x509_common/src/hitls_x509_ctrl.c b/pki/x509_common/src/hitls_x509_ctrl.c
index a04fbb8..cb509ef 100644
--- a/pki/x509_common/src/hitls_x509_ctrl.c
+++ b/pki/x509_common/src/hitls_x509_ctrl.c
@@ -390,7 +390,7 @@ static int32_t X509AddDnNamesToList(BslList *list, BslList *dnNameList)
     return ret;
 }
 
-BslList *HITLS_X509_DnListNew()
+BslList *HITLS_X509_DnListNew(void)
 {
     return BSL_LIST_New(sizeof(HITLS_X509_NameNode));
 }
@@ -455,7 +455,7 @@ int32_t HITLS_X509_SetSerial(BSL_ASN1_Buffer *serial, const void *val, int32_t v
     return HITLS_X509_SUCCESS;
 }
 
-int32_t HITLS_X509_GetSerial(BSL_ASN1_Buffer *serial, const void *val, int32_t valLen)
+int32_t HITLS_X509_GetSerial(BSL_ASN1_Buffer *serial, void *val, int32_t valLen)
 {
     if (valLen != sizeof(BSL_Buffer)) {
         BSL_ERR_PUSH_ERROR(HITLS_X509_ERR_INVALID_PARAM);
@@ -465,7 +465,7 @@ int32_t HITLS_X509_GetSerial(BSL_ASN1_Buffer *serial, const void *val, int32_t v
         BSL_ERR_PUSH_ERROR(HITLS_X509_ERR_INVALID_PARAM);
         return HITLS_X509_ERR_INVALID_PARAM;
     }
-    BSL_Buffer *buff = (BSL_Buffer *)(uintptr_t)val;
+    BSL_Buffer *buff = (BSL_Buffer *)val;
     buff->data = serial->buff;
     buff->dataLen = serial->len;
     return HITLS_X509_SUCCESS;
diff --git a/pki/x509_common/src/hitls_x509_ext.c b/pki/x509_common/src/hitls_x509_ext.c
index f53eb6a..52d06b2 100644
--- a/pki/x509_common/src/hitls_x509_ext.c
+++ b/pki/x509_common/src/hitls_x509_ext.c
@@ -783,8 +783,7 @@ static int32_t SetExtBCons(HITLS_X509_Ext *ext, HITLS_X509_ExtEntry *entry, cons
      *   pathLenConstraint       INTEGER (0..MAX) OPTIONAL }
      */
     BSL_ASN1_Buffer asns[] = {
-        {BSL_ASN1_TAG_BOOLEAN, bCons->isCa ? sizeof(bool) : 0,
-            bCons->isCa ? (uint8_t *)(uintptr_t)&bCons->isCa : NULL},
+        {BSL_ASN1_TAG_BOOLEAN, bCons->isCa ? sizeof(bool) : 0, bCons->isCa ? (uint8_t *)(uintptr_t)&bCons->isCa : NULL},
         {BSL_ASN1_TAG_INTEGER, 0, NULL},
     };
     int32_t ret;
diff --git a/pki/x509_crl/include/hitls_crl_local.h b/pki/x509_crl/include/hitls_crl_local.h
index aff64df..90e8250 100644
--- a/pki/x509_crl/include/hitls_crl_local.h
+++ b/pki/x509_crl/include/hitls_crl_local.h
@@ -72,7 +72,7 @@ typedef struct _HITLS_X509_Crl {
     BSL_SAL_RefCount references;
 } HITLS_X509_Crl;
 
-int32_t HITLS_X509_CrlMulParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_List **crllist);
+int32_t HITLS_X509_CrlMulParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_List **crllist);
 #ifdef __cplusplus
 }
 #endif
diff --git a/pki/x509_crl/src/hitls_x509_crl.c b/pki/x509_crl/src/hitls_x509_crl.c
index d7f7e9a..05d39c9 100644
--- a/pki/x509_crl/src/hitls_x509_crl.c
+++ b/pki/x509_crl/src/hitls_x509_crl.c
@@ -134,7 +134,7 @@ void HITLS_X509_CrlFree(HITLS_X509_Crl *crl)
     return;
 }
 
-HITLS_X509_Crl *HITLS_X509_CrlNew()
+HITLS_X509_Crl *HITLS_X509_CrlNew(void)
 {
     HITLS_X509_Crl *crl = NULL;
     BSL_ASN1_List *issuerName = NULL;
@@ -811,7 +811,7 @@ ERR:
     return ret;
 }
 
-int32_t HITLS_X509_CrlMulParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_List **crllist)
+int32_t HITLS_X509_CrlMulParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_List **crllist)
 {
     if (encode == NULL || encode->data == NULL || encode->dataLen == 0 || crllist == NULL) {
         BSL_ERR_PUSH_ERROR(HITLS_X509_ERR_INVALID_PARAM);
@@ -838,7 +838,7 @@ int32_t HITLS_X509_CrlMulParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X50
     return HITLS_X509_SUCCESS;
 }
 
-int32_t HITLS_X509_CrlParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_Crl **crl)
+int32_t HITLS_X509_CrlParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Crl **crl)
 {
     HITLS_X509_List *list = NULL;
     if (crl == NULL || *crl != NULL) {
diff --git a/pki/x509_csr/src/hitls_x509_csr.c b/pki/x509_csr/src/hitls_x509_csr.c
index f35ced2..4fe7193 100644
--- a/pki/x509_csr/src/hitls_x509_csr.c
+++ b/pki/x509_csr/src/hitls_x509_csr.c
@@ -245,7 +245,7 @@ ERR:
     return ret;
 }
 
-static int32_t X509CsrAsn1Parse(bool isCopy, BSL_Buffer *encode, HITLS_X509_Csr *csr)
+static int32_t X509CsrAsn1Parse(bool isCopy, const BSL_Buffer *encode, HITLS_X509_Csr *csr)
 {
     uint8_t *data = encode->data;
     uint32_t dataLen = encode->dataLen;
@@ -271,7 +271,7 @@ static int32_t X509CsrAsn1Parse(bool isCopy, BSL_Buffer *encode, HITLS_X509_Csr
     return HITLS_X509_SUCCESS;
 }
 
-static int32_t X509CsrPemParse(BSL_Buffer *encode, HITLS_X509_Csr *csr)
+static int32_t X509CsrPemParse(const BSL_Buffer *encode, HITLS_X509_Csr *csr)
 {
     uint8_t *tmpBuf = encode->data;
     uint32_t tmpBufLen = encode->dataLen;
@@ -292,7 +292,7 @@ static int32_t X509CsrPemParse(BSL_Buffer *encode, HITLS_X509_Csr *csr)
     return ret;
 }
 
-int32_t HITLS_X509_CsrParseBuff(int32_t format, BSL_Buffer *encode, HITLS_X509_Csr **csr)
+int32_t HITLS_X509_CsrParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Csr **csr)
 {
     if (encode == NULL || csr == NULL || *csr != NULL || encode->data == NULL || encode->dataLen == 0) {
         BSL_ERR_PUSH_ERROR(HITLS_X509_ERR_INVALID_PARAM);
diff --git a/pki/x509_verify/src/hitls_x509_verify.c b/pki/x509_verify/src/hitls_x509_verify.c
index 3710f75..a9e7981 100644
--- a/pki/x509_verify/src/hitls_x509_verify.c
+++ b/pki/x509_verify/src/hitls_x509_verify.c
@@ -219,12 +219,8 @@ static int32_t X509_CheckCert(HITLS_X509_StoreCtx *storeCtx, HITLS_X509_Cert *ce
     return HITLS_X509_SUCCESS;
 }
 
-static int32_t X509_SetCA(HITLS_X509_StoreCtx *storeCtx, void *val, int32_t valLen, bool isCopy)
+static int32_t X509_SetCA(HITLS_X509_StoreCtx *storeCtx, void *val, bool isCopy)
 {
-    if (valLen != sizeof(HITLS_X509_Cert)) {
-        BSL_ERR_PUSH_ERROR(HITLS_X509_ERR_INVALID_PARAM);
-        return HITLS_X509_ERR_INVALID_PARAM;
-    }
     int32_t ret = X509_CheckCert(storeCtx, val);
     if (ret != HITLS_X509_SUCCESS) {
         return ret;
@@ -259,12 +255,8 @@ static int32_t X509_CheckCRL(HITLS_X509_StoreCtx *storeCtx, HITLS_X509_Crl *crl)
     return HITLS_X509_SUCCESS;
 }
 
-static int32_t X509_SetCRL(HITLS_X509_StoreCtx *storeCtx, void *val, int32_t valLen)
+static int32_t X509_SetCRL(HITLS_X509_StoreCtx *storeCtx, void *val)
 {
-    if (valLen != sizeof(HITLS_X509_Crl)) {
-        BSL_ERR_PUSH_ERROR(HITLS_X509_ERR_INVALID_PARAM);
-        return HITLS_X509_ERR_INVALID_PARAM;
-    }
     int32_t ret = X509_CheckCRL(storeCtx, val);
     if (ret != HITLS_X509_SUCCESS) {
         return ret;
@@ -310,11 +302,11 @@ int32_t HITLS_X509_StoreCtxCtrl(HITLS_X509_StoreCtx *storeCtx, int32_t cmd, void
         case HITLS_X509_STORECTX_CLR_PARAM_FLAGS:
             return X509_ClearParamFlag(storeCtx, val, valLen);
         case HITLS_X509_STORECTX_DEEP_COPY_SET_CA:
-            return X509_SetCA(storeCtx, val, valLen, true);
+            return X509_SetCA(storeCtx, val, true);
         case HITLS_X509_STORECTX_SHALLOW_COPY_SET_CA:
-            return X509_SetCA(storeCtx, val, valLen, false);
+            return X509_SetCA(storeCtx, val, false);
         case HITLS_X509_STORECTX_SET_CRL:
-            return X509_SetCRL(storeCtx, val, valLen);
+            return X509_SetCRL(storeCtx, val);
         case HITLS_X509_STORECTX_REF_UP:
             return X509_RefUp(storeCtx, val, valLen);
         case HITLS_X509_STORECTX_SET_VEY_SM2_USERID:
diff --git a/testcode/framework/crypto/crypto_test_util.h b/testcode/framework/crypto/crypto_test_util.h
index cef149b..3d1383d 100644
--- a/testcode/framework/crypto/crypto_test_util.h
+++ b/testcode/framework/crypto/crypto_test_util.h
@@ -34,7 +34,7 @@ bool IsDrbgHashAlgDisabled(int id);
 
 bool IsDrbgHmacAlgDisabled(int id);
 
-int GetAvailableRandAlgId();
+int GetAvailableRandAlgId(void);
 
 bool IsRandAlgDisabled(int id);
 
diff --git a/testcode/framework/include/test.h b/testcode/framework/include/test.h
index 61d2ece..dc00fea 100644
--- a/testcode/framework/include/test.h
+++ b/testcode/framework/include/test.h
@@ -129,7 +129,7 @@ typedef struct {
         return;             \
     } while (0)
 
-extern int *GetJmpAddress();
+extern int *GetJmpAddress(void);
 #define SUB_PROC 1
 #define SUB_PROC_BEGIN(parentAction)   if (fork() > 0) parentAction
 #define SUB_PROC_END() *GetJmpAddress() = SUB_PROC; return
diff --git a/testcode/framework/stub/stub_replace.h b/testcode/framework/stub/stub_replace.h
index 2947127..19bcd6e 100644
--- a/testcode/framework/stub/stub_replace.h
+++ b/testcode/framework/stub/stub_replace.h
@@ -46,7 +46,7 @@ typedef struct {
  * Initialize the dynamic stub change function. Invoke the function once.
  * return - 0:Success, non-zero:Error code
  */
-int STUB_Init();
+int STUB_Init(void);
 
 /*
  * Replaces the specified function with the specified stub function.
diff --git a/testcode/framework/tls/func_wrapper/src/rec_wrapper.c b/testcode/framework/tls/func_wrapper/src/rec_wrapper.c
index 8654b34..f1ba0f0 100644
--- a/testcode/framework/tls/func_wrapper/src/rec_wrapper.c
+++ b/testcode/framework/tls/func_wrapper/src/rec_wrapper.c
@@ -160,7 +160,7 @@ void RegisterWrapper(RecWrapper wrapper)
     g_recWrapper = wrapper;
 }
 
-void ClearWrapper()
+void ClearWrapper(void)
 {
     STUB_Reset(&g_stubRecFuncs);
     g_enableWrapper = false;
diff --git a/testcode/framework/tls/resource/src/channel_res.c b/testcode/framework/tls/resource/src/channel_res.c
index 51bb3c9..e1dda81 100644
--- a/testcode/framework/tls/resource/src/channel_res.c
+++ b/testcode/framework/tls/resource/src/channel_res.c
@@ -104,7 +104,7 @@ int InitControlChannelRes(char *srcDomainPath, int srcDomainPathLen, char *peerD
     return ret;
 }
 
-ControlChannelRes *GetControlChannelRes()
+ControlChannelRes *GetControlChannelRes(void)
 {
     return &g_channelRes;
 }
diff --git a/testcode/framework/tls/resource/src/tls_res.c b/testcode/framework/tls/resource/src/tls_res.c
index df42814..9a81d6b 100644
--- a/testcode/framework/tls/resource/src/tls_res.c
+++ b/testcode/framework/tls/resource/src/tls_res.c
@@ -145,12 +145,12 @@ int InsertSslToList(void *ctx, void *ssl)
     return InsertResToList(sslList, sslRes);
 }
 
-ResList *GetCtxList()
+ResList *GetCtxList(void)
 {
     return &g_ctxList;
 }
 
-ResList *GetSslList()
+ResList *GetSslList(void)
 {
     return &g_sslList;
 }
diff --git a/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.c b/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.c
index dd9d337..f7f4771 100644
--- a/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.c
+++ b/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.c
@@ -67,10 +67,10 @@ void SDV_CRYPTO_PROVIDER_LOAD_TC001(char *path, char *path2, char *test1, char *
     ASSERT_EQ(ret, CRYPT_SUCCESS);
 
     // Test CRYPT_EAL_ProviderLoad
-    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_CONVERTER_OFF, "default", NULL, NULL);
+    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_LIB_FMT_OFF, "default", NULL, NULL);
     ASSERT_EQ(ret, CRYPT_SUCCESS);
     // Test CRYPT_EAL_ProviderLoad
-    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_CONVERTER_OFF, "default", NULL, NULL);
+    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_LIB_FMT_OFF, "default", NULL, NULL);
     ASSERT_EQ(ret, CRYPT_SUCCESS);
 
     // Test loading the same provider consecutively
@@ -254,7 +254,7 @@ void SDV_CRYPTO_PROVIDER_LOAD_COMPARE_TC001(char *path, char *test1, char *test2
     const CRYPT_EAL_Func *funcs;
     void *provCtx;
     // Test if the corresponding funcs can be found based on the attribute
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, attribute, &funcs, &provCtx);
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, attribute, &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_SUCCESS);
     ASSERT_TRUE(funcs != NULL);
     CRYPT_EAL_ImplMdInitCtx mdInitCtx = (CRYPT_EAL_ImplMdInitCtx)(funcs[1].func);
@@ -305,40 +305,40 @@ void SDV_CRYPTO_PROVIDER_LOAD_COMPARE_TC002(char *path, char *test1, char *test2
     const CRYPT_EAL_Func *funcs;
     void *provCtx;
     // Demonstrate normal scenario
-    ASSERT_EQ(CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider=test1",
+    ASSERT_EQ(CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider=test1",
         &funcs, &provCtx), CRYPT_SUCCESS);
     CRYPT_EAL_ImplMdInitCtx mdInitCtx = (CRYPT_EAL_ImplMdInitCtx)(funcs[1].func);
     ASSERT_EQ(mdInitCtx(provCtx, NULL), RIGHT_RESULT);
-    ASSERT_EQ(CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5,
+    ASSERT_EQ(CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5,
         "provider=test1,provider!=test2", &funcs, &provCtx), CRYPT_SUCCESS);
     mdInitCtx = (CRYPT_EAL_ImplMdInitCtx)(funcs[1].func);
     ASSERT_EQ(mdInitCtx(provCtx, NULL), RIGHT_RESULT);
 
     // Test 1: Test when attribute is NULL
-    ASSERT_EQ(CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, NULL, &funcs, &provCtx),
+    ASSERT_EQ(CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, NULL, &funcs, &provCtx),
         CRYPT_SUCCESS);
     mdInitCtx = (CRYPT_EAL_ImplMdInitCtx)(funcs[1].func);
     ASSERT_EQ(mdInitCtx(provCtx, NULL), result);
     funcs = provCtx = NULL;
 
     // Test 2: Test when no provider can meet the attribute requirements
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "n_atr=test3", &funcs, &provCtx);
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "n_atr=test3", &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_NOT_SUPPORT);
     // Test 3: Test when both operaid and operaid are out of range
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, 0, CRYPT_MD_MD5, "provider=test1", &funcs, &provCtx);
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, 0, CRYPT_MD_MD5, "provider=test1", &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_NOT_SUPPORT);
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, 0, "provider=test1", &funcs, &provCtx);
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, 0, "provider=test1", &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_NOT_SUPPORT);
     // Test 4: Test when attribute format is non-standard
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider", &funcs, &provCtx);
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider", &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_PROVIDER_ERR_ATTRIBUTE);
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider=test1provider!=test2",
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider=test1provider!=test2",
         &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_NOT_SUPPORT);
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider!test2",
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "provider!test2",
         &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_PROVIDER_ERR_ATTRIBUTE);
-    ret = CRYPT_EAL_ProviderGetFuncsFrom(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "!=tesst2", &funcs, &provCtx);
+    ret = CRYPT_EAL_ProviderGetFuncs(libCtx, CRYPT_EAL_OPERAID_HASH, CRYPT_MD_MD5, "!=tesst2", &funcs, &provCtx);
     ASSERT_EQ(ret, CRYPT_PROVIDER_ERR_ATTRIBUTE);
 
 exit:
@@ -455,10 +455,10 @@ void SDV_CRYPTO_PROVIDER_LOAD_DEFAULT_TC001(char *path, char *test1, int cmd, He
     ASSERT_EQ(ret, CRYPT_SUCCESS);
 
     // Test CRYPT_EAL_ProviderLoad
-    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_CONVERTER_OFF, "default", NULL, NULL);
+    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_LIB_FMT_OFF, "default", NULL, NULL);
     ASSERT_EQ(ret, CRYPT_SUCCESS);
     // Test CRYPT_EAL_ProviderLoad
-    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_CONVERTER_OFF, "default", NULL, NULL);
+    ret = CRYPT_EAL_ProviderLoad(libCtx, BSL_SAL_LIB_FMT_OFF, "default", NULL, NULL);
     ASSERT_EQ(ret, CRYPT_SUCCESS);
 
     ctx = CRYPT_EAL_ProviderMdNewCtx(libCtx, CRYPT_MD_SHA224, "provider=default");
diff --git a/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.data b/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.data
index 660e756..a0186e6 100644
--- a/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.data
+++ b/testcode/sdv/testcase/crypto/provider/test_suite_sdv_eal_provider_load.data
@@ -3,7 +3,7 @@ SDV_CRYPTO_PROVIDER_LOAD_TC001:"../testdata/provider/path1":"../testdata/provide
 SDV_CRYPTO_PROVIDER_LOAD_TC002
 SDV_CRYPTO_PROVIDER_LOAD_TC002:
 SDV_CRYPTO_PROVIDER_LOAD_TC003
-SDV_CRYPTO_PROVIDER_LOAD_TC003:"../testdata/provider/path1":BSL_SAL_CONVERTER_LIBSO:"provider_load_test1":"provider=test1,compare1=one,cpmpare3=three"
+SDV_CRYPTO_PROVIDER_LOAD_TC003:"../testdata/provider/path1":BSL_SAL_LIB_FMT_LIBSO:"provider_load_test1":"provider=test1,compare1=one,cpmpare3=three"
 SDV_CRYPTO_PROVIDER_LOAD_COMPARE_TC001  #1
 SDV_CRYPTO_PROVIDER_LOAD_COMPARE_TC001:"../testdata/provider/path1":"provider_load_test1":"provider_load_test2":2:"provider=test1":1415926
 SDV_CRYPTO_PROVIDER_LOAD_COMPARE_TC001  #2
diff --git a/tls/cert/hitls_x509_adapt/hitls_x509_cert_magr.c b/tls/cert/hitls_x509_adapt/hitls_x509_cert_magr.c
index ae410a7..a9649c0 100644
--- a/tls/cert/hitls_x509_adapt/hitls_x509_cert_magr.c
+++ b/tls/cert/hitls_x509_adapt/hitls_x509_cert_magr.c
@@ -21,7 +21,6 @@
 #include "hitls_cert_type.h"
 #include "hitls_type.h"
 #include "hitls_pki.h"
-#include "hitls_cert_local.h"
 #include "hitls_error.h"
 #include "bsl_err_internal.h"
 
-- 
2.42.0.windows.2

