Security error notification engine 23/20323/26
authorsaurabh.s9 <saurabh.s9@samsung.com>
Fri, 1 Sep 2017 05:40:59 +0000 (11:10 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Thu, 14 Sep 2017 03:59:02 +0000 (03:59 +0000)
commitad1f7db68c64e3c410020777a29f6da4ef89e557
tree68c7df68501df93d2f7310dd5fa0c7a8f0655689
parent48a45c009c908d291aac92365acbf8d7d589bd2d
Security error notification engine

Purpose:
Errors happens during OCDoResource calls should be returned to app layer

Previously, session errors (handshake failed) didn't returned properly to app layer
and this cause side effects (CA retransmission works in cases when it should not)

Current state:
1. Source code builds ok
2. Secure stack samples (UDP/TCP) works well (both positive/negative cases)
3. Provisioning (OTM, 20th menu item) works well for following:
   a. justworks    positive UDP/TCP, negative UDP case
   b. mfg          positive UDP/TCP, negative UDP case
   c. mv_justworks positive UDP/TCP, negative UDP case
   d. randompin    positive UDP/TCP, negative UDP case
4. OTM in provisioning via TCP - negative case - should work properly after fix IOT-2454

How to test:
1. Positive case - just test samples (f.e secure stack samples) & provisioning with all servers
2. Negative case - add following code which artificially breaks handshake (to ca_adapter_net_ssl.c)
   if (peer->ssl.state == MBEDTLS_SSL_CERTIFICATE_REQUEST)
   {
       ret = MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR;
   }
   And again test all samples and provisioning with all servers.
   As result - you should see an error returned to app immidiately (without timeouts, etc)
   and there should be no CA retransmission attempts (UDP case)

Change-Id: Ia1fe1c7c58f9e40040a0be5e7e83abbc66f80bfe
Signed-off-by: Andrii Shtompel <a.shtompel@samsung.com>
Signed-off-by: saurabh.s9 <saurabh.s9@samsung.com>
24 files changed:
resource/csdk/connectivity/api/cacommon.h
resource/csdk/connectivity/api/casecurityinterface.h
resource/csdk/connectivity/inc/ca_adapter_net_ssl.h
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
resource/csdk/connectivity/src/caconnectivitymanager.c
resource/csdk/connectivity/src/camessagehandler.c
resource/csdk/connectivity/src/ip_adapter/caipadapter.c
resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c
resource/csdk/connectivity/test/ssladapter_test.cpp
resource/csdk/include/octypes.h
resource/csdk/security/include/internal/doxmresource.h
resource/csdk/security/include/internal/secureresourcemanager.h
resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c
resource/csdk/security/provisioning/src/ownershiptransfermanager.c
resource/csdk/security/provisioning/src/oxmjustworks.c
resource/csdk/security/provisioning/src/oxmmanufacturercert.c
resource/csdk/security/provisioning/src/oxmpreconfpin.c
resource/csdk/security/provisioning/src/oxmrandompin.c
resource/csdk/security/src/directpairing.c
resource/csdk/security/src/doxmresource.c
resource/csdk/security/src/dpairingresource.c
resource/csdk/security/src/secureresourcemanager.c
resource/csdk/stack/src/ocstack.c