Skip to content

Commit

Permalink
security: modify configuration names in SE and TLS
Browse files Browse the repository at this point in the history
Previous configuration names for SE are artik
specific(ex. TLS_WITH_SSS...) As TizenRT would support various SE,
these names can confuse developers. And some name doesn't look proper
like SUPPORT_FULL_SECURITY which set Secure Storage support.
Furthermore TLS and SE share configurations so it shows same options
both SE and TLS menu. But TLS doesn't want to set H/W accelerator even
though SE support it. For example if the SE couldn't support all key
length algorithms, then software logic in TLS should be used.
  • Loading branch information
pillip8282 committed Jul 16, 2019
1 parent 087a253 commit 87864f9
Show file tree
Hide file tree
Showing 46 changed files with 434 additions and 2,089 deletions.
2 changes: 1 addition & 1 deletion apps/examples/security_test/see_api/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
config EXAMPLES_SECURITY_SEE_TEST
bool "Security SEE API Test"
depends on TLS_WITH_SSS && SUPPORT_FULL_SECURITY
depends on TLS_WITH_HW_ACCEL
default n

if EXAMPLES_SECURITY_SEE_TEST
Expand Down
4 changes: 2 additions & 2 deletions apps/examples/security_test/see_api/see_test_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ pthread_addr_t see_test_cb(void *args)
argc = ((struct pthread_arg *)args)->argc;
argv = ((struct pthread_arg *)args)->argv;

#if defined(CONFIG_TLS_WITH_SSS)
#if defined(CONFIG_TLS_WITH_HW_ACCEL)
see_init();
#endif

Expand Down Expand Up @@ -1604,7 +1604,7 @@ pthread_addr_t see_test_cb(void *args)
}

printf("=====SSS Block Test Finish=====\n");
#if defined(CONFIG_TLS_WITH_SSS)
#if defined(CONFIG_TLS_WITH_HW_ACCEL)
see_free();
#endif

Expand Down
4 changes: 2 additions & 2 deletions apps/examples/testcase/le_tc/tcp_tls/tcp_tls_stress.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static tcp_tls_result_e tcp_tls_create(mbedtls_config *tls)
return result;
}

#if defined(CONFIG_TLS_WITH_SSS)
#if defined(CONFIG_TLS_WITH_HW_ACCEL)
ret = see_init();
if (ret != 0) {
printf("failed : see_init returned %d\n\n", ret);
Expand Down Expand Up @@ -398,7 +398,7 @@ static tcp_tls_result_e tcp_tls_destroy(mbedtls_config *tls)
free(tls->entropy);
free(tls->timer);

#if defined(CONFIG_TLS_WITH_SSS)
#if defined(CONFIG_TLS_WITH_HW_ACCEL)
int ret = 0;

ret = see_free();
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/tls_client/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ menu option
config EXAMPLES_TLS_ARTIK_KEY
bool "use artik cloud key"
default n
depends on TLS_WITH_SSS
depends on TLS_WITH_HW_ACCEL
endmenu

endif # EXAMPLE_TLS_CLIENT
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/tls_selftest/tls_selftest_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ pthread_addr_t tls_selftest_cb(void *args)
* Without HW entropy, there is no strong entropy source and
* it will make failure the selftest.
*/
#if defined(MBEDTLS_ENTROPY_C) && defined(CONFIG_HW_RNG)
#if defined(MBEDTLS_ENTROPY_C) && defined(CONFIG_TLS_HW_RNG)
DO_TLS_TEST(mbedtls_entropy_self_test, v);
#endif
#if defined(MBEDTLS_PKCS5_C)
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053/avs_test/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_GRPC is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053/grpc/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,7 @@ CONFIG_GRPC_PTHREAD_SIZE=16384
CONFIG_TSI_MBEDTLS_LOG=0
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053/iotivity/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053/iotjs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053/nettest/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053/st_things/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,7 @@ CONFIG_WGET_USERAGENT="TinyARA"
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053/tc/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,7 @@ CONFIG_NETUTILS_WEBSOCKET=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053s/iotjs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
CONFIG_TLS_WITH_SSS=y
CONFIG_SUPPORT_FULL_SECURITY=y
CONFIG_TLS_WITH_HW_ACCEL=y
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik053s/nettest/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
CONFIG_TLS_WITH_SSS=y
CONFIG_SUPPORT_FULL_SECURITY=y
CONFIG_TLS_WITH_HW_ACCEL=y
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
5 changes: 2 additions & 3 deletions build/configs/artik053s/st_things/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,7 @@ CONFIG_WGET_USERAGENT="TinyARA"
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
CONFIG_TLS_WITH_SSS=y
CONFIG_SUPPORT_FULL_SECURITY=y
CONFIG_TLS_WITH_HW_ACCEL=y
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand All @@ -808,7 +807,7 @@ CONFIG_HW_ECDH_PARAM=y
# CONFIG_HW_RSA_VERIFICATION is not set
CONFIG_HW_ECDSA_VERIFICATION=y
CONFIG_HW_RSA_ENC=y
CONFIG_SE_STORAGE=y
CONFIG_HW_SE_STORAGE=y

#
# Wireless
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik055s/audio/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,7 @@ CONFIG_NETUTILS_DHCPD_DECLINETIME=3600
# CONFIG_GRPC is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_SUPPORT_FULL_SECURITY is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik055s/iotjs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
CONFIG_TLS_WITH_SSS=y
CONFIG_SUPPORT_FULL_SECURITY=y
CONFIG_TLS_WITH_HW_ACCEL=y
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik055s/nettest/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
CONFIG_TLS_WITH_SSS=y
CONFIG_SUPPORT_FULL_SECURITY=y
CONFIG_TLS_WITH_HW_ACCEL=y
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
3 changes: 1 addition & 2 deletions build/configs/artik055s/st_things/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
CONFIG_TLS_WITH_SSS=y
CONFIG_SUPPORT_FULL_SECURITY=y
CONFIG_TLS_WITH_HW_ACCEL=y

#
# HW Selection
Expand Down
2 changes: 1 addition & 1 deletion build/configs/esp_wrover_kit/security/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
CONFIG_TLS_WITH_SSS=y
CONFIG_TLS_WITH_HW_ACCEL=y
CONFIG_TLS_MPI_MAX_SIZE=512

#
Expand Down
2 changes: 1 addition & 1 deletion build/configs/sidk_s5jt200/sidk_tash_aws/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set

#
# Wireless
Expand Down
2 changes: 1 addition & 1 deletion build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ CONFIG_NETUTILS_DHCPC=y
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_MQTT is not set
CONFIG_NET_SECURITY_TLS=y
# CONFIG_TLS_WITH_SSS is not set
# CONFIG_TLS_WITH_HW_ACCEL is not set

#
# Wireless
Expand Down
12 changes: 6 additions & 6 deletions external/include/mbedtls/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2926,29 +2926,29 @@
*
* Uncomment to use your own hardware entropy collector.
*/
#if defined(CONFIG_HW_RNG)
#if defined(CONFIG_TLS_HW_RNG)
#define MBEDTLS_ENTROPY_HARDWARE_ALT
#endif

#if defined(CONFIG_HW_DH_PARAM)
#if defined(CONFIG_TLS_HW_DH_PARAM)
#define MBEDTLS_DHM_ALT
#endif

#if defined(CONFIG_HW_ECDH_PARAM)
#if defined(CONFIG_TLS_HW_ECDH_PARAM)
#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT
#endif

#if defined(CONFIG_HW_ECDSA_VERIFICATION)
#if defined(CONFIG_TLS_HW_ECDSA_VERIFICATION)
#define MBEDTLS_PK_ECDSA_VERIFY_ALT
#endif

#if defined(CONFIG_HW_RSA_VERIFICATION)
#if defined(CONFIG_TLS_HW_RSA_VERIFICATION)
#define MBEDTLS_PK_RSA_VERIFY_ALT
#undef MBEDTLS_PK_RSA_ALT_SUPPORT
#endif

#if defined(CONFIG_HW_RSA_ENC)
#if defined(CONFIG_TLS_HW_RSA_ENC)
#define MBEDTLS_PK_RSA_ENCRYPT_ALT
#undef MBEDTLS_PK_RSA_ALT_SUPPORT
#endif
Expand Down
Loading

0 comments on commit 87864f9

Please sign in to comment.