update standard utils

Signed-off-by: lvyuanmin <lvyuanmin@huawei.com>
This commit is contained in:
lvyuanmin 2022-09-16 16:19:44 +08:00
parent 6e988550c6
commit 0ae057f72c
8 changed files with 112 additions and 133 deletions

View File

@ -1,15 +1,12 @@
/*
* 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.
*/
# 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.

View File

@ -11,32 +11,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
import("//base/security/crypto_framework/common/common.gni")
import("//build/ohos.gni")
ohos_static_library("crypto_plugin_common") {
subsystem_name = "security"
part_name = "crypto_framework"
include_dirs = [
"//utils/native/base/include",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
]
include_dirs += crypto_framwork_common_inc_path
subsystem_name = "security"
part_name = "crypto_framework"
include_dirs = [
"//commonlibrary/c_utils/base/include",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
]
include_dirs += crypto_framwork_common_inc_path
sources = crypto_framwork_common_files
sources = crypto_framwork_common_files
defines = [ "HILOG_ENABLE" ]
cflags = [
"-DHILOG_ENABLE",
"-fPIC",
"-Wall",
]
defines = [ "HILOG_ENABLE" ]
cflags = [
"-DHILOG_ENABLE",
"-fPIC",
"-Wall",
]
deps = [
"//utils/native/base:utils",
]
external_deps = [
external_deps = [
"c_utils:utils",
"hiviewdfx_hilog_native:libhilog",
]
}

View File

@ -26,4 +26,4 @@ framework_common_util_files = [
"//base/security/crypto_framework/common/src/params_parser.c",
]
crypto_framwork_common_files = framework_common_util_files
crypto_framwork_common_files = framework_common_util_files

View File

@ -11,9 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
import("//base/security/crypto_framework/frameworks/frameworks.gni")
import("//base/security/crypto_framework/common/common.gni")
import("//base/security/crypto_framework/frameworks/frameworks.gni")
import("//build/ohos.gni")
config("framework_config") {
include_dirs = [
@ -27,27 +27,26 @@ config("framework_config") {
}
ohos_shared_library("crypto_framework_lib") {
subsystem_name = "security"
part_name = "crypto_framework"
public_configs = [ ":framework_config" ]
include_dirs = [
"//utils/native/base/include",
]
include_dirs += framework_inc_path + crypto_framwork_common_inc_path
subsystem_name = "security"
part_name = "crypto_framework"
public_configs = [ ":framework_config" ]
include_dirs = [ "//commonlibrary/c_utils/base/include" ]
include_dirs += framework_inc_path + crypto_framwork_common_inc_path
sources = framework_files
sources = framework_files
cflags = [
"-fPIC",
"-Wall",
]
cflags = [
"-fPIC",
"-Wall",
]
deps = [
"//utils/native/base:utils",
"//third_party/openssl:libcrypto_shared",
"//base/security/crypto_framework:crypto_openssl_plugin_lib",
"//base/security/crypto_framework/common:crypto_plugin_common",
]
deps = [
"//base/security/crypto_framework:crypto_openssl_plugin_lib",
"//base/security/crypto_framework/common:crypto_plugin_common",
"//third_party/openssl:libcrypto_shared",
]
external_deps = [ "c_utils:utils" ]
}
ohos_shared_library("cryptoframework_napi") {
@ -57,7 +56,7 @@ ohos_shared_library("cryptoframework_napi") {
include_dirs = [
"//base/security/crypto_framework/interfaces/kits/js",
"//third_party/bounds_checking_function/include",
"//utils/native/base/include",
"//commonlibrary/c_utils/base/include",
"//base/security/crypto_framework/frameworks/js/napi/inc",
]
include_dirs += framework_inc_path
@ -68,26 +67,26 @@ ohos_shared_library("cryptoframework_napi") {
]
sources = [
"js/napi/src/napi_init.cpp",
"js/napi/src/napi_utils.cpp",
"js/napi/src/napi_key_pair.cpp",
"js/napi/src/napi_pri_key.cpp",
"js/napi/src/napi_pub_key.cpp",
"js/napi/src/napi_asy_key_generator.cpp",
"js/napi/src/napi_sign.cpp",
"js/napi/src/napi_verify.cpp",
"js/napi/src/napi_cert_chain_validator.cpp",
"js/napi/src/napi_cipher.cpp",
"js/napi/src/napi_init.cpp",
"js/napi/src/napi_key.cpp",
"js/napi/src/napi_key_agreement.cpp",
"js/napi/src/napi_x509_certificate.cpp",
"js/napi/src/napi_key_pair.cpp",
"js/napi/src/napi_mac.cpp",
"js/napi/src/napi_md.cpp",
"js/napi/src/napi_pri_key.cpp",
"js/napi/src/napi_pub_key.cpp",
"js/napi/src/napi_rand.cpp",
"js/napi/src/napi_sign.cpp",
"js/napi/src/napi_sym_key.cpp",
"js/napi/src/napi_sym_key_generator.cpp",
"js/napi/src/napi_utils.cpp",
"js/napi/src/napi_verify.cpp",
"js/napi/src/napi_x509_certificate.cpp",
"js/napi/src/napi_x509_crl.cpp",
"js/napi/src/napi_x509_crl_entry.cpp",
"js/napi/src/napi_sym_key_generator.cpp",
"js/napi/src/napi_cipher.cpp",
"js/napi/src/napi_key.cpp",
"js/napi/src/napi_sym_key.cpp",
"js/napi/src/napi_cert_chain_validator.cpp",
]
deps = [
@ -95,7 +94,5 @@ ohos_shared_library("cryptoframework_napi") {
"//third_party/bounds_checking_function:libsec_static",
]
external_deps = [
"napi:ace_napi",
]
external_deps = [ "napi:ace_napi" ]
}

View File

@ -44,35 +44,25 @@ framework_certificate_files = [
"${framework_path}/certificate/x509_crl.c",
]
framework_cipher_files = [
"${framework_path}/crypto_operation/cipher.c",
]
framework_cipher_files = [ "${framework_path}/crypto_operation/cipher.c" ]
framework_signature_files = [
"${framework_path}/crypto_operation/signature.c",
]
framework_signature_files = [ "${framework_path}/crypto_operation/signature.c" ]
framework_key_agreement_files = [
"${framework_path}/crypto_operation/key_agreement.c",
]
framework_key_agreement_files =
[ "${framework_path}/crypto_operation/key_agreement.c" ]
framework_key_files = [
"${framework_path}/key/asy_key_generator.c",
"${framework_path}/key/sym_key_generator.c",
]
framework_mac_files = [
"${framework_path}/crypto_operation/mac.c",
]
framework_mac_files = [ "${framework_path}/crypto_operation/mac.c" ]
framework_rand_files = [
"${framework_path}/rand/rand.c",
]
framework_rand_files = [ "${framework_path}/rand/rand.c" ]
framework_md_files = [
"${framework_path}/crypto_operation/md.c",
]
framework_md_files = [ "${framework_path}/crypto_operation/md.c" ]
framework_files = framework_certificate_files + framework_key_agreement_files +
framework_signature_files + framework_cipher_files + framework_key_files + framework_mac_files +
framework_rand_files + framework_md_files
framework_files =
framework_certificate_files + framework_key_agreement_files +
framework_signature_files + framework_cipher_files + framework_key_files +
framework_mac_files + framework_rand_files + framework_md_files

View File

@ -11,9 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
import("//base/security/crypto_framework/plugin/plugin.gni")
import("//base/security/crypto_framework/common/common.gni")
import("//base/security/crypto_framework/plugin/plugin.gni")
import("//build/ohos.gni")
config("plugin_config") {
include_dirs = [
@ -28,25 +28,26 @@ config("plugin_config") {
}
ohos_shared_library("crypto_openssl_plugin_lib") {
subsystem_name = "security"
part_name = "crypto_framework"
public_configs = [ ":plugin_config" ]
include_dirs = [
"//utils/native/base/include",
"//third_party/openssl/include/",
]
include_dirs += plugin_inc_path + crypto_framwork_common_inc_path
subsystem_name = "security"
part_name = "crypto_framework"
public_configs = [ ":plugin_config" ]
include_dirs = [
"//commonlibrary/c_utils/base/include",
"//third_party/openssl/include/",
]
include_dirs += plugin_inc_path + crypto_framwork_common_inc_path
sources = plugin_files
sources = plugin_files
cflags = [
"-fPIC",
"-Wall",
]
cflags = [
"-fPIC",
"-Wall",
]
deps = [
"//utils/native/base:utils",
"//third_party/openssl:libcrypto_shared",
"//base/security/crypto_framework/common:crypto_plugin_common",
]
}
deps = [
"//base/security/crypto_framework/common:crypto_plugin_common",
"//third_party/openssl:libcrypto_shared",
]
external_deps = [ "c_utils:utils" ]
}

View File

@ -47,9 +47,7 @@ plugin_asy_key_generator_files = [
"${plugin_path}/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c",
]
plugin_key_agreement_files = [
"${plugin_path}/openssl_plugin/crypto_operation/key_agreement/src/ecdh_openssl.c",
]
plugin_key_agreement_files = [ "${plugin_path}/openssl_plugin/crypto_operation/key_agreement/src/ecdh_openssl.c" ]
plugin_certificate_files = [
"${plugin_path}/openssl_plugin/certificate/src/x509_cert_chain_validator_openssl.c",
@ -69,18 +67,15 @@ plugin_cipher_files = [
"${plugin_path}/openssl_plugin/crypto_operation/aes/src/cipher_aes_common.c",
]
plugin_hmac_files = [
"${plugin_path}/openssl_plugin/crypto_operation/hmac/src/mac_openssl.c",
]
plugin_hmac_files =
[ "${plugin_path}/openssl_plugin/crypto_operation/hmac/src/mac_openssl.c" ]
plugin_rand_files = [
"${plugin_path}/openssl_plugin/rand/src/rand_openssl.c",
]
plugin_rand_files = [ "${plugin_path}/openssl_plugin/rand/src/rand_openssl.c" ]
plugin_md_files = [
"${plugin_path}/openssl_plugin/crypto_operation/md/src/md_openssl.c",
]
plugin_md_files =
[ "${plugin_path}/openssl_plugin/crypto_operation/md/src/md_openssl.c" ]
plugin_files = plugin_certificate_files + plugin_asy_key_generator_files + plugin_key_agreement_files +
plugin_sym_key_files + plugin_cipher_files + plugin_hmac_files + plugin_rand_files +
plugin_md_files + plugin_signature_files + plugin_common_files
plugin_files = plugin_certificate_files + plugin_asy_key_generator_files +
plugin_key_agreement_files + plugin_sym_key_files +
plugin_cipher_files + plugin_hmac_files + plugin_rand_files +
plugin_md_files + plugin_signature_files + plugin_common_files

View File

@ -23,7 +23,7 @@ ohos_unittest("crypto_framework_test") {
include_dirs = [ "./include" ]
include_dirs += [
"//utils/native/base/include",
"//commonlibrary/c_utils/base/include",
"//third_party/openssl/include/",
]
include_dirs += framework_inc_path + plugin_inc_path
@ -57,10 +57,12 @@ ohos_unittest("crypto_framework_test") {
"//base/security/crypto_framework:crypto_openssl_plugin_lib",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/openssl:libcrypto_shared",
"//utils/native/base:utils",
]
defines = [ "HILOG_ENABLE" ]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
external_deps = [
"c_utils:utils",
"hiviewdfx_hilog_native:libhilog",
]
}