From 16ba0423ce265703e0b8a5c7e269310e8b88fc57 Mon Sep 17 00:00:00 2001 From: xwb Date: Fri, 9 Dec 2022 09:11:32 +0800 Subject: [PATCH] change included header in AES Signed-off-by: xwb --- frameworks/crypto_operation/cipher.c | 1 - .../crypto_operation/aes/inc/aes_openssl.h | 18 -------- .../aes/inc/aes_openssl_common.h | 43 ++++++++----------- 3 files changed, 18 insertions(+), 44 deletions(-) diff --git a/frameworks/crypto_operation/cipher.c b/frameworks/crypto_operation/cipher.c index 4a898f2..65674c1 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 77d24f0..5fcb3da 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 39dee96..112616a 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 -- Gitee