[IOT-1237] [IOT-1225] [IOT-1233] Resolving build issue related to mbedtls
authorDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Fri, 26 Aug 2016 04:54:07 +0000 (07:54 +0300)
committerDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Fri, 26 Aug 2016 11:07:22 +0000 (11:07 +0000)
Change-Id: I73f1b46f149328c2c9ee8467bb6605b3b165b717
Signed-off-by: saurabh sharma <saurabh.s9@samsung.com>
Signed-off-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10881
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: dongik Lee <dongik.lee@samsung.com>
build_common/android/SConscript
extlibs/mbedtls/SConscript
resource/csdk/SConscript
resource/csdk/connectivity/api/casecurityinterface.h
resource/csdk/connectivity/src/caconnectivitymanager.c
resource/csdk/security/include/internal/credresource.h
resource/csdk/security/provisioning/SConscript
resource/csdk/security/src/credresource.c
service/notification/cpp-wrapper/examples/linux/SConscript
service/notification/cpp-wrapper/unittest/SConscript
service/notification/unittest/SConscript

index e0c4c80..2b20c10 100644 (file)
@@ -223,6 +223,8 @@ env.AppendUnique(LIBS = ['log', 'coap'])
 if env.get('SECURED') == '1':
        env.AppendUnique(LIBS = ['tinydtls'])
 
+if env.get('WITH_TCP'):
+       env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto'])
 # From android-5 (API > 20), all application must be built with flags '-fPIE' '-pie'.
 # Due to the limitation of Scons, it's required to added it into the command line
 # directly (otherwise, it will also be added when build share library)
index fe1b75e..0e5cd89 100644 (file)
@@ -23,6 +23,11 @@ Import('env')
 import os
 import sys
 
+target_os = env.get('TARGET_OS')
+root_dir = env.get('SRC_DIR')
+mbedtls_dir = os.path.join(root_dir, 'extlibs','mbedtls','mbedtls/')
+libs_list = ['libmbedcrypto','libmbedtls','libmbedx509']
+
 def run(cmd):
     """Run a command and decipher the return code. Exit by default."""
     res = os.system(cmd)
@@ -34,54 +39,122 @@ def run(cmd):
             if SCons.Script.keep_going_on_error == 0:
                 sys.exit(code)
 
-root_dir = env.get('SRC_DIR')
 
-tls_dir = os.path.join(root_dir, 'extlibs','mbedtls','mbedtls')
-
-if not os.path.exists(tls_dir):
+if not os.path.exists(mbedtls_dir):
     print '''
 *********************************** Error: ****************************************
 * Please download mbedtls using the following command:                            *
 *     $ git clone https://github.com/ARMmbed/mbedtls.git extlibs/mbedtls/mbedtls  *
 ***********************************************************************************
-'''
+ '''
     Exit(1)
-
-start_dir = os.getcwd()
-os.chdir(tls_dir)
-
 #Apply patch to enable TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256 ciphersuite and server identity hint
+start_dir = os.getcwd()
+os.chdir(mbedtls_dir)
 cmd = 'git reset --hard ad249f509fd62a3bbea7ccd1fef605dbd482a7bd && git apply ../ocf.patch'
 run(cmd)
-
-build_dir = env.get('BUILD_DIR')
-libs_list = ['libmbedcrypto.so', 'libmbedtls.so', 'libmbedx509.so']
-
-if env.GetOption('clean'):
-       print 'Clean-up mbedtls...'
-       run('make clean')
-
-       #Delete copied libs from out folder
-       for file_name in libs_list:
-               run("rm -f " + build_dir + file_name + "*")
-else:
-       #Pass to make proper debug option
-       if env.get('RELEASE'): debug = ''
-       else: debug = 'DEBUG=1 '
-
-       cmd = 'export SHARED=1 ' + debug + '&& make no_test'
-
-       print 'Making mbedtls libraries...'
-       print cmd
-       run(cmd)
-       
-       #Copy libs to out folder
-       if not os.path.exists(build_dir): os.makedirs(build_dir)
-       for file_name in libs_list:
-               run("cp -d " + tls_dir + '/library/' + file_name + " " + build_dir)
-               run("cp " + tls_dir + '/library/' + file_name + ".* " + build_dir)
-
 os.chdir(start_dir)
 
 
+mbedtls_env = env.Clone()
+mbedtls_env.PrependUnique(CPPPATH = [mbedtls_dir])
+mbedtls_env.AppendUnique(CPPPATH = [mbedtls_dir+'include/'])
+mbedtls_env.AppendUnique(CFLAGS = ['-fPIC', '-Wall', '-Wextra', '-W', '-Wdeclaration-after-statement', '-Wwrite-strings'])
+
+######################################################################
+# Source files and Target(s)
+######################################################################
+mbedtls_src = [
+                'mbedtls/library/debug.c',
+                'mbedtls/library/net.c',
+                'mbedtls/library/ssl_cache.c',
+                'mbedtls/library/ssl_ciphersuites.c',
+                'mbedtls/library/ssl_cli.c',
+                'mbedtls/library/ssl_cookie.c',
+                'mbedtls/library/ssl_srv.c',
+                'mbedtls/library/ssl_ticket.c',
+                'mbedtls/library/ssl_tls.c'
+        ]
+
+
+mbedcrypto_src = [
+                    'mbedtls/library/aes.c',
+                    'mbedtls/library/aesni.c',
+                    'mbedtls/library/arc4.c',
+                    'mbedtls/library/asn1parse.c',
+                    'mbedtls/library/asn1write.c',
+                    'mbedtls/library/base64.c',
+                    'mbedtls/library/bignum.c',
+                    'mbedtls/library/blowfish.c',
+                    'mbedtls/library/camellia.c',
+                    'mbedtls/library/ccm.c',
+                    'mbedtls/library/cipher.c',
+                    'mbedtls/library/cipher_wrap.c',
+                    'mbedtls/library/ctr_drbg.c',
+                    'mbedtls/library/des.c',
+                    'mbedtls/library/dhm.c',
+                    'mbedtls/library/ecdh.c',
+                    'mbedtls/library/ecdsa.c',
+                    'mbedtls/library/ecjpake.c',
+                    'mbedtls/library/ecp.c',
+                    'mbedtls/library/ecp_curves.c',
+                    'mbedtls/library/entropy.c',
+                    'mbedtls/library/entropy_poll.c',
+                    'mbedtls/library/error.c',
+                    'mbedtls/library/gcm.c',
+                    'mbedtls/library/havege.c',
+                    'mbedtls/library/hmac_drbg.c',
+                    'mbedtls/library/md.c',
+                    'mbedtls/library/md2.c',
+                    'mbedtls/library/md4.c',
+                    'mbedtls/library/md5.c',
+                    'mbedtls/library/md_wrap.c',
+                    'mbedtls/library/memory_buffer_alloc.c',
+                    'mbedtls/library/oid.c',
+                    'mbedtls/library/padlock.c',
+                    'mbedtls/library/pem.c',
+                    'mbedtls/library/pk.c',
+                    'mbedtls/library/pk_wrap.c',
+                    'mbedtls/library/pkcs12.c',
+                    'mbedtls/library/pkcs5.c',
+                    'mbedtls/library/pkparse.c',
+                    'mbedtls/library/pkwrite.c',
+                    'mbedtls/library/platform.c',
+                    'mbedtls/library/ripemd160.c',
+                    'mbedtls/library/rsa.c',
+                    'mbedtls/library/sha1.c',
+                    'mbedtls/library/sha256.c',
+                    'mbedtls/library/sha512.c',
+                    'mbedtls/library/threading.c',
+                    'mbedtls/library/timing.c',
+                    'mbedtls/library/version.c',
+                    'mbedtls/library/version_features.c',
+                    'mbedtls/library/xtea.c'
+        ]
+
+mbeX509_src = [
+                'mbedtls/library/certs.c',
+                'mbedtls/library/pkcs11.c',
+                'mbedtls/library/x509.c',
+                'mbedtls/library/x509_create.c',
+                'mbedtls/library/x509_crl.c',
+                'mbedtls/library/x509_crt.c',
+                'mbedtls/library/x509_csr.c',
+                'mbedtls/library/x509write_crt.c',
+                'mbedtls/library/x509write_csr.c'
+        ]
+
+mbedcrypto_env = mbedtls_env.Clone()
+static_libmbedcrypto = mbedcrypto_env.StaticLibrary('mbedcrypto', mbedcrypto_src)
+mbedcrypto_env.InstallTarget(static_libmbedcrypto, 'mbedcrypto')
+
+mbex509_env = mbedtls_env.Clone()
+mbex509_env.AppendUnique(LIBS = ['mbedcrypto'])
+static_libmbedx509 = mbex509_env.StaticLibrary('mbedx509', mbeX509_src)
+mbex509_env.InstallTarget(static_libmbedx509, 'mbedx509')
+
+
+mbedtls_env.AppendUnique(LIBS = ['mbedx509', 'mbedcrypto'])
+static_libmbedtls = mbedtls_env.StaticLibrary('mbedtls', mbedtls_src)
+mbedtls_env.InstallTarget(static_libmbedtls, 'mbedtls')
 
index 62ff0be..194d03d 100644 (file)
@@ -83,6 +83,12 @@ if target_os not in ['windows']:
 liboctbstack_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 
 liboctbstack_env.PrependUnique(LIBS = ['ocsrm', 'coap'])
+
+if env.get('SECURED') == '1':
+       liboctbstack_env.AppendUnique(LIBS = ['tinydtls'])
+       if env.get('WITH_TCP') == True:
+               liboctbstack_env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto'])
+
 if target_os in ['android', 'linux', 'tizen', 'msys_nt', 'windows']:
        liboctbstack_env.PrependUnique(LIBS = ['connectivity_abstraction'])
 
@@ -114,11 +120,6 @@ if target_os not in ['arduino', 'windows']:
 if target_os == 'android':
     liboctbstack_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,liboctbstack.so'])
 
-if env.get('SECURED') == '1':
-       liboctbstack_env.AppendUnique(LIBS = ['tinydtls'])
-       if env.get('WITH_TCP') == True:
-               liboctbstack_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
-
 if env.get('LOGGING'):
        liboctbstack_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
 
index 277c4ff..e9a27cb 100644 (file)
@@ -134,7 +134,6 @@ CAResult_t CAregisterTlsCredentialsHandler(CAGetDTLSPskCredentialsHandler getTls
 typedef void (*CAgetPkixInfoHandler)(PkiInfo_t * inf);
 
 //TODO
-void GetPkixInfo(PkiInfo_t * inf);
 CAResult_t CAregisterPkixInfoHandler(CAgetPkixInfoHandler getPkixInfoHandler);
 #endif //__WITH_TLS__
 
index f333b59..18f3509 100644 (file)
@@ -210,16 +210,6 @@ CAResult_t CAregisterTlsCredentialsHandler(CAGetDTLSPskCredentialsHandler getTls
     return CA_STATUS_OK;
 }
 
-void GetPkixInfo(PkiInfo_t * inf)
-{
-    OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
-    GetDerOwnCert(&inf->crt);
-    GetDerKey(&inf->key);
-    GetDerCaCert(&inf->ca);
-    GetDerCrl(&inf->crl);
-    OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
-}
-
 CAResult_t CAregisterPkixInfoHandler(CAgetPkixInfoHandler getPkixInfoHandler)
 {
     OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
index a1c1c5a..d3161ad 100644 (file)
@@ -194,15 +194,7 @@ OCStackResult GetCredRownerId(OicUuid_t *rowneruuid);
  * @brief subject uuid for credential with CA certificates
  */
 #define CA_SUBJECT_ID ("00000000-0000-0000-0000-000000000000")
-/**
- * Adds the new CA to the chain
- *
- * @param cert is the pointer to DER encoded certificate
- *
- * @return ::OC_STACK_OK, cert not NULL and persistent storage gets updated.
- * ::OC_STACK_ERROR, cert is NULL or fails to update persistent storage.
- */
-OCStackResult AddCA(OicSecCert_t * cert);
+void GetPkixInfo(PkiInfo_t * inf);
 #endif
 #ifdef __cplusplus
 }
index df501af..d5ab9e1 100644 (file)
@@ -63,12 +63,14 @@ if 'g++' in provisioning_env.get('CXX'):
     provisioning_env.AppendUnique(CXXFLAGS = ['-std=c++0x'])
 
 provisioning_env.AppendUnique(LIBPATH = [provisioning_env.get('BUILD_DIR')])
-provisioning_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
+provisioning_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'ocsrm'])
 
 provisioning_env.AppendUnique(LIBS = ['tinydtls'])
 
 if provisioning_env.get('DTLS_WITH_X509') == '1':
        provisioning_env.AppendUnique(LIBS = ['CKManager', 'asn1'])
+if provisioning_env.get('WITH_TCP') == True:
+       provisioning_env.AppendUnique(LIBS = ['mbedtls'])
 
 if target_os not in ['msys_nt', 'windows', 'android']:
        provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
index 47d1aed..2e2bba5 100644 (file)
@@ -1893,219 +1893,6 @@ OCStackResult GetCredRownerId(OicUuid_t *rowneruuid)
 }
 
 #ifdef __WITH_TLS__
-OCStackResult AddCA(OicSecCert_t * cert)
-{
-    OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
-    OCStackResult ret = OC_STACK_ERROR;
-    if (NULL == cert || NULL == cert->data)
-    {
-        return OC_STACK_INVALID_PARAM;
-    }
-    OicUuid_t  subject;
-    OicUuid_t rowner;
-    ret = GetCredRownerId(&rowner);
-    VERIFY_SUCCESS(TAG, OC_STACK_OK == ret, ERROR);
-    ret = ConvertStrToUuid(CA_SUBJECT_ID, &subject);
-    VERIFY_SUCCESS(TAG, OC_STACK_OK == ret, ERROR);
-
-    OicSecCred_t * cred  = GetCredResourceData(&subject);
-    if (NULL == cred)
-    {
-        //Generating new credential for CA
-        cred = GenerateCredential(&subject, SIGNED_ASYMMETRIC_KEY, cert, NULL, &rowner);
-        VERIFY_NON_NULL(TAG, cred, ERROR);
-        return AddCredential(cred);
-    }
-
-    uint8_t * tempData = OICRealloc(cred->publicData.data, cred->publicData.len + cert->len);
-    if (NULL == tempData)
-    {
-        return OC_STACK_NO_MEMORY;
-    }
-
-    memcpy(tempData + cred->publicData.len, cert->data, cert->len);
-    cred->publicData.data = tempData;
-    cred->publicData.len += cert->len;
-
-    if (UpdatePersistentStorage(gCred))
-    {
-        ret = OC_STACK_OK;
-    }
-
-exit:
-    OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
-    return ret;
-}
-// TODO for testing only
-// will be removed
-const unsigned char ca_cert[] = {
-// AMAZON
-0x30, 0x82, 0x02, 0xFE, 0x30, 0x82, 0x01, 0xE6, 0x02, 0x01, 0x01, 0x30, 0x0D, 0x06, 0x09, 0x2A,
-0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x45, 0x31, 0x0B, 0x30, 0x09,
-0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
-0x04, 0x08, 0x0C, 0x0A, 0x53, 0x6F, 0x6D, 0x65, 0x2D, 0x53, 0x74, 0x61, 0x74, 0x65, 0x31, 0x21,
-0x30, 0x1F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x18, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x6E, 0x65,
-0x74, 0x20, 0x57, 0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4C, 0x74,
-0x64, 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x36, 0x30, 0x36, 0x32, 0x38, 0x30, 0x35, 0x33, 0x33, 0x35,
-0x38, 0x5A, 0x17, 0x0D, 0x32, 0x36, 0x30, 0x36, 0x32, 0x36, 0x30, 0x35, 0x33, 0x33, 0x35, 0x38,
-0x5A, 0x30, 0x45, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x41, 0x55,
-0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x53, 0x6F, 0x6D, 0x65, 0x2D,
-0x53, 0x74, 0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x18,
-0x49, 0x6E, 0x74, 0x65, 0x72, 0x6E, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67, 0x69, 0x74, 0x73,
-0x20, 0x50, 0x74, 0x79, 0x20, 0x4C, 0x74, 0x64, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D, 0x06, 0x09,
-0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00,
-0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xB5, 0x1C, 0x79, 0x1F, 0x30, 0x6F, 0x5C,
-0x04, 0x9E, 0xD9, 0x78, 0x22, 0x01, 0x29, 0xEE, 0xE9, 0x4A, 0x3A, 0x69, 0xB6, 0xF8, 0xBE, 0x87,
-0x3A, 0x5D, 0x57, 0xBD, 0x96, 0xEE, 0xCC, 0xE9, 0x58, 0x39, 0x53, 0x41, 0xD5, 0x1A, 0x47, 0x12,
-0x8B, 0xF5, 0xAA, 0x0D, 0xC5, 0xBC, 0xAE, 0x17, 0x93, 0x8B, 0xF3, 0x10, 0x10, 0x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 0xBF, 0x05, 0xF0, 0xF3, 0x6B, 0x99,
-0x1E, 0x46, 0x4C, 0x26, 0x95, 0xD2, 0x58, 0x86, 0x5C, 0x78, 0xAD, 0x01, 0xF9, 0xC9, 0x54, 0x67,
-0xB7, 0x99, 0x3C, 0xEE, 0xF8, 0xD7, 0xD2, 0x1E, 0xE6, 0xF0, 0xCC, 0xC8, 0xC2, 0x20, 0x1B, 0xDA,
-0xCF, 0xDB, 0xF5, 0x70, 0x65, 0x33, 0x51, 0x6E, 0x17, 0x1D, 0xC5, 0xC5, 0xC5, 0x63, 0x06, 0x5E,
-0xCA, 0xB5, 0x40, 0x14, 0xEE, 0xDC, 0x14, 0xF2, 0xFE, 0x4B, 0x7A, 0x78, 0xD6, 0x0D, 0x21, 0xF5,
-0x0F, 0x58, 0xE7, 0x2A, 0x26, 0x54, 0x52, 0xCA, 0x60, 0xA2, 0xF8, 0x68, 0xB0, 0xF4, 0x6A, 0x9B,
-0x11, 0x8D, 0x5E, 0x57, 0x5A, 0x5F, 0x51, 0x3E, 0x44, 0x99, 0xB1, 0x76, 0xDA, 0x94, 0x56, 0x0E,
-0x1C, 0xA3, 0xFC, 0xE3, 0x01, 0xB4, 0xD8, 0xEC, 0x2F, 0xBB, 0x65, 0x82, 0x19, 0x06, 0x8E, 0x3A,
-0x2E, 0x5D,
-//Google
-
-0x30, 0x82, 0x03, 0x54, 0x30, 0x82, 0x02, 0x3c, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x02,
-0x34, 0x56, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05,
-0x00, 0x30, 0x42, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
-0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, 0x47, 0x65, 0x6f, 0x54, 0x72,
-0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04,
-0x03, 0x13, 0x12, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62,
-0x61, 0x6c, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x32, 0x30, 0x35, 0x32, 0x31, 0x30,
-0x34, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x32, 0x30, 0x35, 0x32, 0x31, 0x30, 0x34,
-0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x42, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
-0x13, 0x02, 0x55, 0x53, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, 0x47,
-0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x1b, 0x30, 0x19,
-0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x12, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20,
-0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06,
-0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
-0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xda, 0xcc, 0x18, 0x63, 0x30, 0xfd,
-0xf4, 0x17, 0x23, 0x1a, 0x56, 0x7e, 0x5b, 0xdf, 0x3c, 0x6c, 0x38, 0xe4, 0x71, 0xb7, 0x78, 0x91,
-0xd4, 0xb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, 0x39, 0xe2, 0xfa, 0x36, 0x53, 0x13, 0x39,
-0xd4, 0x5e, 0x26, 0x2b, 0xdb, 0x3d, 0xa8, 0x14, 0xbd, 0x32, 0xeb, 0x18, 0x03, 0x28, 0x52, 0x04,
-0x71, 0xe5, 0xab, 0x33, 0x3d, 0xe1, 0x38, 0xbb, 0x07, 0x36, 0x84, 0x62, 0x9c, 0x79, 0xea, 0x16,
-0x30, 0xf4, 0x5f, 0xc0, 0x2b, 0xe8, 0x71, 0x6b, 0xe4, 0xf9, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3,
-0x53, 0x30, 0x51, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30,
-0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xc0,
-0x7a, 0x98, 0x68, 0x8d, 0x89, 0xfb, 0xab, 0x05, 0x64, 0x0c, 0x11, 0x7d, 0xaa, 0x7d, 0x65, 0xb8,
-0xca, 0xcc, 0x4e, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
-0xc0, 0x7a, 0x98, 0x68, 0x8d, 0x89, 0xfb, 0xab, 0x05, 0x64, 0x0c, 0x11, 0x7d, 0xaa, 0x7d, 0x65,
-0xb8, 0xca, 0xcc, 0x4e, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
-0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x35, 0xe3, 0x29, 0x6a, 0xe5, 0x2f, 0x5d, 0x54,
-0x8e, 0x29, 0x50, 0x94, 0x9f, 0x99, 0x1a, 0x14, 0xe4, 0x8f, 0x78, 0x2a, 0x62, 0x94, 0xa2, 0x27,
-0x67, 0x9e, 0xd0, 0xcf, 0x1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 0xc7, 0x1d, 0x76, 0x13, 0xa9, 0xd5,
-0xe5, 0xf1, 0x16, 0x09, 0x11, 0x35, 0xd5, 0xac, 0xdb, 0x24, 0x71, 0x70, 0x2c, 0x98, 0x56, 0x0b,
-0xd9, 0x17, 0xb4, 0xd1, 0xe3, 0x51, 0x2b, 0x5e, 0x75, 0xe8, 0xd5, 0xd0, 0xdc, 0x4f, 0x34, 0xed,
-0xc2, 0x05, 0x66, 0x80, 0xa1, 0xcb, 0xe6, 0x33,
-// Device
-0x30, 0x82, 0x01, 0x55, 0x30, 0x81, 0xFB, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30,
-0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x34, 0x31, 0x32, 0x30,
-0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x29, 0x75, 0x75, 0x69, 0x64, 0x3A, 0x33, 0x32, 0x33,
-0x32, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D,
-0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33,
-0x32, 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x36, 0x30, 0x37, 0x32, 0x36, 0x31, 0x34, 0x31, 0x32, 0x32,
-0x31, 0x5A, 0x17, 0x0D, 0x31, 0x37, 0x30, 0x31, 0x30, 0x31, 0x32, 0x32, 0x30, 0x30, 0x30, 0x30,
-0x5A, 0x30, 0x34, 0x31, 0x32, 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x29, 0x75, 0x75,
-0x69, 0x64, 0x3A, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32,
-0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x33,
-0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48,
-0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42,
-0x00, 0x04, 0x19, 0x1D, 0x6B, 0x4A, 0x12, 0xA7, 0x20, 0xF1, 0x95, 0xC6, 0x6D, 0x2A, 0xD7, 0x3B,
-0xFA, 0x90, 0x8C, 0x52, 0xEB, 0x75, 0x67, 0xFF, 0x0A, 0x3F, 0xF2, 0xDF, 0x8D, 0x81, 0x44, 0xC7,
-0xC8, 0x84, 0x60, 0xD4, 0x07, 0x57, 0xB1, 0x96, 0xAF, 0x5E, 0x00, 0xA5, 0xED, 0xA1, 0x48, 0x3F,
-0x88, 0x43, 0x8D, 0x15, 0x81, 0x0A, 0x21, 0x9B, 0x6C, 0xD3, 0xBD, 0x85, 0x86, 0xE1, 0xA6, 0xDA,
-0xC5, 0xCE, 0x30, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x03, 0x49,
-0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xF7, 0x8E, 0x43, 0x19, 0xD2, 0x86, 0xF9, 0x21, 0x84, 0x66,
-0x23, 0x4B, 0x18, 0x7C, 0x56, 0x18, 0x37, 0x48, 0xDF, 0x16, 0x3B, 0x70, 0x52, 0x26, 0x62, 0xB3,
-0xAA, 0xD8, 0x3D, 0xE9, 0x43, 0xC3, 0x02, 0x21, 0x00, 0xD0, 0x16, 0xA4, 0x33, 0x7A, 0xE3, 0x7C,
-0x62, 0x88, 0x88, 0x7B, 0x76, 0x99, 0xBF, 0x2D, 0xDF, 0x6C, 0xF5, 0xD0, 0x5F, 0xBE, 0x4B, 0xAE,
-0xBA, 0xE5, 0xC0, 0x05, 0x26, 0xBC, 0x8B, 0x20, 0x84
-};
-const unsigned char own_cert[] = {
-0x30, 0x82, 0x01, 0x55, 0x30, 0x81, 0xFB, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30,
-0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x34, 0x31, 0x32, 0x30,
-0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x29, 0x75, 0x75, 0x69, 0x64, 0x3A, 0x33, 0x32, 0x33,
-0x32, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D,
-0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33,
-0x32, 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x36, 0x30, 0x37, 0x32, 0x36, 0x31, 0x34, 0x31, 0x32, 0x32,
-0x31, 0x5A, 0x17, 0x0D, 0x31, 0x37, 0x30, 0x31, 0x30, 0x31, 0x32, 0x32, 0x30, 0x30, 0x30, 0x30,
-0x5A, 0x30, 0x34, 0x31, 0x32, 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x29, 0x75, 0x75,
-0x69, 0x64, 0x3A, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32,
-0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x2D, 0x33, 0x32, 0x33, 0x32, 0x33,
-0x32, 0x33, 0x32, 0x33, 0x32, 0x33, 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48,
-0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42,
-0x00, 0x04, 0x19, 0x1D, 0x6B, 0x4A, 0x12, 0xA7, 0x20, 0xF1, 0x95, 0xC6, 0x6D, 0x2A, 0xD7, 0x3B,
-0xFA, 0x90, 0x8C, 0x52, 0xEB, 0x75, 0x67, 0xFF, 0x0A, 0x3F, 0xF2, 0xDF, 0x8D, 0x81, 0x44, 0xC7,
-0xC8, 0x84, 0x60, 0xD4, 0x07, 0x57, 0xB1, 0x96, 0xAF, 0x5E, 0x00, 0xA5, 0xED, 0xA1, 0x48, 0x3F,
-0x88, 0x43, 0x8D, 0x15, 0x81, 0x0A, 0x21, 0x9B, 0x6C, 0xD3, 0xBD, 0x85, 0x86, 0xE1, 0xA6, 0xDA,
-0xC5, 0xCE, 0x30, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x03, 0x49,
-0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xF7, 0x8E, 0x43, 0x19, 0xD2, 0x86, 0xF9, 0x21, 0x84, 0x66,
-0x23, 0x4B, 0x18, 0x7C, 0x56, 0x18, 0x37, 0x48, 0xDF, 0x16, 0x3B, 0x70, 0x52, 0x26, 0x62, 0xB3,
-0xAA, 0xD8, 0x3D, 0xE9, 0x43, 0xC3, 0x02, 0x21, 0x00, 0xD0, 0x16, 0xA4, 0x33, 0x7A, 0xE3, 0x7C,
-0x62, 0x88, 0x88, 0x7B, 0x76, 0x99, 0xBF, 0x2D, 0xDF, 0x6C, 0xF5, 0xD0, 0x5F, 0xBE, 0x4B, 0xAE,
-0xBA, 0xE5, 0xC0, 0x05, 0x26, 0xBC, 0x8B, 0x20, 0x84
-};
-const unsigned char ca_key[] = {
-0x30, 0x81, 0x93, 0x02, 0x01, 0x00, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
-0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x04, 0x79, 0x30, 0x77, 0x02,
-0x01, 0x01, 0x04, 0x20, 0xe9, 0xe4, 0x27, 0xb2, 0x5c, 0xe1, 0xe9, 0xc4, 0x9d, 0x23, 0x55, 0x67,
-0x08, 0x66, 0x0c, 0xe5, 0x83, 0xa9, 0xf1, 0xe2, 0x09, 0xfb, 0x89, 0xea, 0xa8, 0xe4, 0x46, 0x6e,
-0x76, 0xff, 0x75, 0x02, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07,
-0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x19, 0x1d, 0x6b, 0x4a, 0x12, 0xa7, 0x20, 0xf1, 0x95, 0xc6,
-0x6d, 0x2a, 0xd7, 0x3b, 0xfa, 0x90, 0x8c, 0x52, 0xeb, 0x75, 0x67, 0xff, 0x0a, 0x3f, 0xf2, 0xdf,
-0x8d, 0x81, 0x44, 0xc7, 0xc8, 0x84, 0x60, 0xd4, 0x07, 0x57, 0xb1, 0x96, 0xaf, 0x5e, 0x00, 0xa5,
-0xed, 0xa1, 0x48, 0x3f, 0x88, 0x43, 0x8d, 0x15, 0x81, 0x0a, 0x21, 0x9b, 0x6c, 0xd3, 0xbd, 0x85,
-0x86, 0xe1, 0xa6, 0xda, 0xc5, 0xce
-};
-
 void GetDerCaCert(ByteArray * crt)
 {
     uint8_t *data = NULL;
@@ -2150,9 +1937,26 @@ void GetDerCaCert(ByteArray * crt)
 
 void GetDerKey(ByteArray * key)
 {
-    key->data = OICMalloc(sizeof(ca_key));
-    memcpy(key->data, ca_key, sizeof(ca_key));
-    key->len = sizeof(ca_key);
+    // TODO Add implementation
+    key->data = NULL;
+    key->len = 0;
+    return;
+}
+
+void GetDerOwnCert(ByteArray * cert)
+{
+    // TODO Add implementation
+    cert->data = NULL;
+    cert->len = 0;
     return;
 }
+void GetPkixInfo(PkiInfo_t * inf)
+{
+    OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
+    GetDerOwnCert(&inf->crt);
+    GetDerKey(&inf->key);
+    GetDerCaCert(&inf->ca);
+    OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
+}
+
 #endif
index 14c344a..9c8891a 100755 (executable)
@@ -68,6 +68,11 @@ if not env.get('RELEASE'):
 if env.get('WITH_CLOUD') == True:
        notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
 
+if env.get('WITH_TCP') == True:
+       notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+       if env.get('SECURED') == '1':
+               notification_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+
 ####################################################################
 # Source files and Targets
 ######################################################################
index 0ff9943..b9230db 100644 (file)
@@ -56,6 +56,11 @@ notification_wrapper_test_env.AppendUnique(LIBS = [
     'connectivity_abstraction', 'oc', 'octbstack', 'oc_logger', 'coap', 'notification_provider', 'notification_consumer' ,
     GTest_Main, GTest])
 
+if env.get('WITH_TCP') == True:
+       notification_wrapper_test_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+       if env.get('SECURED') == '1':
+               notification_wrapper_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+
 if target_os not in ['windows', 'winrt']:
     notification_wrapper_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
 
index e089f42..a0aae39 100644 (file)
@@ -67,6 +67,11 @@ notification_test_env.AppendUnique(LIBS = ['pthread'])
 notification_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master', gtest_dir + '/include'])
 notification_test_env.AppendUnique(CPPPATH = ['../include'])
 
+if env.get('WITH_TCP') == True:
+       notification_test_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+       if env.get('SECURED') == '1':
+               notification_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+
 ######################################################################
 # Build Test
 ######################################################################