diff --git a/frameworks/crypto_operation/cipher.c b/frameworks/crypto_operation/cipher.c index 4a898f2a10c376c535f13615fc51389436c73e68..65674c1a0b68b210a8d49342972412d1d132e1d9 100644 --- a/frameworks/crypto_operation/cipher.c +++ b/frameworks/crypto_operation/cipher.c @@ -16,7 +16,6 @@ #include "cipher.h" #include "aes_openssl.h" #include "config.h" -#include "aes_openssl_common.h" #include "securec.h" #include "result.h" #include "string.h" diff --git a/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl.h b/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl.h index 77d24f0b90c2bdb55ca42cd2e16e7d1d133c59f7..5fcb3da563c8fd8fd14044ea1f419059145b7c22 100644 --- a/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl.h +++ b/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl.h @@ -15,26 +15,8 @@ #ifndef HCF_AES_OPENSSL_H #define HCF_AES_OPENSSL_H -#include -#include -#include "params_parser.h" #include "cipher_factory_spi.h" -typedef struct { - EVP_CIPHER_CTX *ctx; - enum HcfCryptoMode enc; - /* EVP_CIPH_GCM_MODE, EVP_CIPH_CCM_MODE need AEAD */ - bool aead; - uint32_t updateLen; - unsigned char *iv; - uint32_t ivLen; - /* GCM, CCM only */ - unsigned char *aad; - uint32_t aadLen; - unsigned char *tag; - uint32_t tagLen; -} CipherData; - #ifdef __cplusplus extern "C" { #endif diff --git a/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl_common.h b/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl_common.h index 39dee96111f21c1397343139cc2e39ac15dc3ed4..112616a3a8658e6cafac3856216eba5213310c84 100644 --- a/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl_common.h +++ b/plugin/openssl_plugin/crypto_operation/aes/inc/aes_openssl_common.h @@ -13,35 +13,32 @@ * limitations under the License. */ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef HCF_AES_OPENSSL_COMMON_H #define HCF_AES_OPENSSL_COMMON_H +#include +#include +#include "aes_openssl.h" #include "detailed_iv_params.h" #include "detailed_ccm_params.h" #include "detailed_gcm_params.h" +typedef struct { + EVP_CIPHER_CTX *ctx; + enum HcfCryptoMode enc; + /* EVP_CIPH_GCM_MODE, EVP_CIPH_CCM_MODE ne + ed AEAD */ + bool aead; + uint32_t updateLen; + unsigned char *iv; + uint32_t ivLen; + /* GCM, CCM only */ + unsigned char *aad; + uint32_t aadLen; + unsigned char *tag; + uint32_t tagLen; +} CipherData; -#include "aes_openssl.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif const unsigned char *GetIv(HcfParamsSpec *params); int32_t GetCcmTagLen(HcfParamsSpec *params); @@ -52,8 +49,4 @@ void FreeCipherData(CipherData **data); void FreeRedundantOutput(HcfBlob *blob); -#ifdef __cplusplus -} -#endif - #endif