blob: a74c3230f3f5972e39e7e50e4054c1cfdd27c0d9 [file] [log] [blame]
# Copyright (c) 2020 Project CHIP Authors
#
# 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("//build_overrides/chip.gni")
import("//build_overrides/nlassert.gni")
import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/third_party/mbedtls/mbedtls.gni")
import("${chip_root}/third_party/simw-top-mini/simw_config.gni")
config("se05x_config") {
defines = [ "SSS_USE_FTR_FILE" ]
if (chip_se05x_smcom == "vcom") {
defines += [ "RJCT_VCOM" ]
} else {
defines += [
"T1oI2C",
"T1oI2C_UM11225",
"SMCOM_T1oI2C",
]
}
if (chip_se05x_host_gpio == "rpi") {
defines += [ "SE05X_HOST_GPIO_RPI = 1" ]
}
# defines += ["FLOW_VERBOSE"]
include_dirs = [
"repo/sss/inc",
"repo/sss/port/default",
"repo/sss/ex/src",
"repo/sss/ex/inc",
"repo/hostlib/hostLib/inc",
"repo/hostlib/hostLib/libCommon/infra",
"repo/hostlib/hostLib/libCommon/smCom",
"repo/hostlib/hostLib/libCommon/log",
"repo/hostlib/hostLib/se05x_03_xx_xx",
"repo/hostlib/hostLib/platform/inc",
"repo/hostlib/hostLib/libCommon/smCom",
"repo/hostlib/hostLib/libCommon/smCom/T1oI2C",
"repo/hostlib/hostLib/accessManager/inc",
"repo/demos/se05x_host_gpio",
]
if (chip_se05x_auth == "scp03") {
include_dirs += [ "repo/scp03_ftr" ]
} else {
include_dirs += [ "repo" ]
}
}
static_library("se05x") {
sources = [
"repo/demos/se05x_host_gpio/se05x_host_gpio.c",
"repo/hostlib/hostLib/libCommon/infra/global_platf.c",
"repo/hostlib/hostLib/libCommon/infra/sm_apdu.c",
"repo/hostlib/hostLib/libCommon/infra/sm_connect.c",
"repo/hostlib/hostLib/libCommon/infra/sm_errors.c",
"repo/hostlib/hostLib/libCommon/infra/sm_printf.c",
"repo/hostlib/hostLib/libCommon/log/nxLog.c",
"repo/hostlib/hostLib/libCommon/smCom/smCom.c",
"repo/hostlib/hostLib/se05x/src/se05x_ECC_curves.c",
"repo/hostlib/hostLib/se05x/src/se05x_mw.c",
"repo/hostlib/hostLib/se05x/src/se05x_tlv.c",
"repo/hostlib/hostLib/se05x_03_xx_xx/se05x_APDU.c",
"repo/sss/ex/src/ex_sss_boot.c",
"repo/sss/ex/src/ex_sss_boot_connectstring.c",
"repo/sss/ex/src/ex_sss_se05x.c",
"repo/sss/ex/src/ex_sss_se05x_auth.c",
"repo/sss/src/fsl_sss_apis.c",
"repo/sss/src/fsl_sss_util_asn1_der.c",
"repo/sss/src/fsl_sss_util_rsa_sign_utils.c",
"repo/sss/src/keystore/keystore_cmn.c",
"repo/sss/src/keystore/keystore_pc.c",
"repo/sss/src/mbedtls/fsl_sss_mbedtls_apis.c",
"repo/sss/src/se05x/fsl_sss_se05x_apis.c",
"repo/sss/src/se05x/fsl_sss_se05x_mw.c",
"repo/sss/src/se05x/fsl_sss_se05x_policy.c",
]
if (chip_se05x_auth == "scp03") {
sources += [
"repo/hostlib/hostLib/libCommon/nxScp/nxScp03_Com.c",
"repo/sss/ex/src/ex_sss_scp03_auth.c",
"repo/sss/src/se05x/fsl_sss_se05x_eckey.c",
"repo/sss/src/se05x/fsl_sss_se05x_scp03.c",
]
public_deps = [ "${mbedtls_root}:mbedtls" ]
}
if (chip_se05x_smcom == "vcom") {
sources += [
"repo/hostlib/hostLib/libCommon/smCom/smComSerial_PCLinux.c",
"repo/hostlib/hostLib/libCommon/smCom/smComSocket_fd.c",
]
} else {
sources += [
"repo/hostlib/hostLib/libCommon/smCom/T1oI2C/phNxpEsePal_i2c.c",
"repo/hostlib/hostLib/libCommon/smCom/T1oI2C/phNxpEseProto7816_3.c",
"repo/hostlib/hostLib/libCommon/smCom/T1oI2C/phNxpEse_Api.c",
"repo/hostlib/hostLib/libCommon/smCom/smComT1oI2C.c",
"repo/hostlib/hostLib/platform/rsp/se05x_reset.c",
]
}
if (chip_device_platform == "linux") {
if (chip_se05x_smcom == "vcom") {
sources += [ "repo/hostlib/hostLib/platform/generic/sm_timer.c" ]
} else {
sources += [
"repo/hostlib/hostLib/platform/generic/sm_timer.c",
"repo/hostlib/hostLib/platform/linux/i2c_a7.c",
]
}
}
public_configs = [ ":se05x_config" ]
}