增加bundle.json等编译相关文件

Signed-off-by: zeng-xiangshun <zengxiangshun2@huawei.com>
This commit is contained in:
zeng-xiangshun 2023-05-29 00:10:35 -07:00
parent 34acef5865
commit 2577a9609d
8 changed files with 119 additions and 14 deletions

View File

@ -31,8 +31,6 @@ group("certificate_framework_fuzztest") {
deps += [
"test/fuzztest/cfgetandcheck_fuzzer:fuzztest",
"test/fuzztest/cfcreate_fuzzer:fuzztest",
"test/fuzztest/v1.0/x509certificate_fuzzer:fuzztest",
"test/fuzztest/v1.0/x509crl_fuzzer:fuzztest",
]
}
}

66
bundle.json Normal file
View File

@ -0,0 +1,66 @@
{
"name": "@ohos/certificate_framework",
"version": "4.0",
"description": "Openharmony's certificate framework.",
"publishAs": "code-segment",
"segment": {
"destPath": "base/security/certificate_framework"
},
"dirs": {},
"scripts": {},
"author": {},
"repository": "",
"license": "Apache License 2.0",
"component": {
"name": "certificate_framework",
"subsystem": "security",
"syscap": [ "SystemCapability.Security.Cert" ],
"features": [],
"adapted_system_type": [ "standard" ],
"rom": "1024KB",
"ram": "5120KB",
"deps": {
"components": [
"c_utils",
"crypto_framework",
"hiviewdfx_hilog_native",
"huks",
"napi"
],
"third_party": [
"openssl",
]
},
"build": {
"sub_component": [
"//base/security/certificate_framework:certificate_framework_component"
],
"inner_kits": [
{
"name": "//base/security/certificate_framework/frameworks/core:certificate_framework_core",
"header": {
"header_files": [
"certificate/cert_chain_validator.h",
"certificate/certificate.h",
"certificate/crl.h",
"certificate/x509_certificate.h",
"certificate/x509_crl_entry.h",
"certificate/x509_crl.h",
"common/cf_blob.h",
"common/cf_object_base.h",
"common/cf_result.h",
"include/cf_api.h",
"include/cf_param.h",
"include/cf_type.h"
],
"header_base": "//base/security/certificate_framework/interfaces/innerkits"
}
}
],
"test": [
"//base/security/certificate_framework:certificate_framework_test",
"//base/security/certificate_framework:certificate_framework_fuzztest"
]
}
}
}

14
cf.gni Normal file
View File

@ -0,0 +1,14 @@
# Copyright (c) 2023 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.
enable_coverage = false

28
config/build/BUILD.gn Normal file
View File

@ -0,0 +1,28 @@
# Copyright (C) 2023 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.
import("../../cf.gni")
config("coverage_flag") {
if (enable_coverage) {
cflags = [ "--coverage" ]
ldflags = [ "--coverage" ]
}
}
config("coverage_flag_cc") {
if (enable_coverage) {
cflags_cc = [ "--coverage" ]
ldflags = [ "--coverage" ]
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2023 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

View File

@ -62,25 +62,25 @@ namespace OHOS {
{
size_t offset = 0;
if (size < (sizeof(CfParam) * PARAMS_NUM)) {
if (size < (sizeof(CfParam) * PARAMS_SIZE_THREE)) {
return;
}
CfParam params[PARAMS_NUM];
for (int i = 0; i < PARAMS_NUM; i++) {
CfParam params[PARAMS_SIZE_THREE];
for (int i = 0; i < PARAMS_SIZE_THREE; i++) {
params[i].tag = *reinterpret_cast<uint32_t *>(data + offset);
offset += sizeof(uint32_t);
params[i].int32Param = *reinterpret_cast<int32_t *>(data + offset);
offset += sizeof(int32_t);
}
TestCommonfunc(object, PARAMS_NUM, params, CF_TAG_GET_TYPE);
TestCommonfunc(object, PARAMS_NUM, params, CF_TAG_CHECK_TYPE);
TestCommonfunc(object, PARAMS_SIZE_THREE, params, CF_TAG_GET_TYPE);
TestCommonfunc(object, PARAMS_SIZE_THREE, params, CF_TAG_CHECK_TYPE);
}
void TestObjectTypeFunc2(const CfObject *object, uint8_t* data, size_t size)
{
if (size < (sizeof(CfParam) * PARAMS_NUM2)) {
if (size < (sizeof(CfParam) * PARAMS_SIZE_TWO)) {
return;
}
@ -94,7 +94,7 @@ namespace OHOS {
void TestObjectTypeFunc3(const CfObject *object, uint8_t* data, size_t size)
{
if (size < (sizeof(CfParam) * PARAMS_NUM2)) {
if (size < (sizeof(CfParam) * PARAMS_SIZE_TWO)) {
return;
}
@ -108,7 +108,7 @@ namespace OHOS {
void TestObjectTypeFunc4(const CfObject *object, uint8_t* data, size_t size)
{
if (size < (sizeof(CfParam) * PARAMS_NUM)) {
if (size < (sizeof(CfParam) * PARAMS_SIZE_THREE)) {
return;
}
@ -125,7 +125,7 @@ namespace OHOS {
void TestObjectTypeFunc5(const CfObject *object, uint8_t* data, size_t size)
{
if (size < (sizeof(CfParam) * PARAMS_NUM2)) {
if (size < (sizeof(CfParam) * PARAMS_SIZE_TWO)) {
return;
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Copyright (c) 2023 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

View File

@ -17,6 +17,5 @@ group("cf_test") {
"cf_adapter_test:cf_adapter_test",
"cf_core_test:cf_core_test",
"cf_sdk_test:cf_sdk_test",
"v1.0:cf_version1_test",
]
}