diff --git a/api/oc_network_events.c b/api/oc_network_events.c index f7e82fc92c9d6f0121d0be1c6e0588a12cf2fea7..26c9df8ef6be9726d49c629bff382b5c682484cc 100644 --- a/api/oc_network_events.c +++ b/api/oc_network_events.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2016 Intel Corporation +// Copyright (c) 2016-2018 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/apps/cloud_certification_tests.c b/apps/cloud_certification_tests.c index e39bb82956744ed528d0308124a0fa83bed1e64b..fecf0bd08e383552b6a21d3ed8a968c79884d090 100644 --- a/apps/cloud_certification_tests.c +++ b/apps/cloud_certification_tests.c @@ -441,6 +441,7 @@ ocf_event_thread(void *data) printf("pthread_mutex_init failed!\n"); return NULL; } + oc_set_con_res_announced(false); oc_set_max_app_data_size(6000); int init = oc_main_init(&handler); if (init < 0) diff --git a/include/oc_acl_common.h b/include/oc_acl_common.h index 6fb836d78266ab34c9f00a489ebbbfcb1773bcac..7a2f9af11e16f344a361a454bdf043f1f2def390 100644 --- a/include/oc_acl_common.h +++ b/include/oc_acl_common.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017-2019 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/include/oc_api.h b/include/oc_api.h index 9fcf0cab86e3deb8deca8bac31d70147fe4ccbba..f062518d10918a8c262a43ce5f9fb4b1b2a64616 100644 --- a/include/oc_api.h +++ b/include/oc_api.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2016 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/include/oc_collection.h b/include/oc_collection.h index 49e3ca6c0cede4b936f56c67b417989a5a321e2f..ca875cfef00297f44d5712ddac6b26eb35d1db6a 100644 --- a/include/oc_collection.h +++ b/include/oc_collection.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2016 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/include/oc_cred_common.h b/include/oc_cred_common.h index cf138f140116d0901388c01577134f6949f1e0de..24e0e998b0fd33da170d5b2190ab63e27a192575 100644 --- a/include/oc_cred_common.h +++ b/include/oc_cred_common.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017-2019 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/include/oc_network_events.h b/include/oc_network_events.h index 701729fe5c20b3d7caca3b6600263e22570f114d..e119f9541565e730c20222d02e773e08cd95408e 100644 --- a/include/oc_network_events.h +++ b/include/oc_network_events.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2016 Intel Corporation +// Copyright (c) 2016-2018 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/include/oc_rep.h b/include/oc_rep.h index 80e6c09791692bbdb4300687620882654d09f82c..969c22aac66b36e78fadc60359417582d865e047 100644 --- a/include/oc_rep.h +++ b/include/oc_rep.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2016 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/include/oc_ri.h b/include/oc_ri.h index 2ba19345532f893bd271dd4413e439b0fde3190d..51aae0b8d4fa4154b8a012dcd9ac28558d3f18cc 100644 --- a/include/oc_ri.h +++ b/include/oc_ri.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2016 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/port/linux/Makefile b/port/linux/Makefile index 152921c2b7a39e4e7bf764ab5910b269bf2a59c9..4d9c134f88fcfb1d7e55ee0b7b30818804d53da9 100644 --- a/port/linux/Makefile +++ b/port/linux/Makefile @@ -130,12 +130,13 @@ endif OBT = onboarding_tool ifeq ($(DEBUG),1) - CFLAGS += -DOC_DEBUG -g -O0 + EXTRA_CFLAGS += -DOC_DEBUG -g -O0 ifeq ($(DEBUG_TLS),1) - CFLAGS += -DOC_DEBUG_TLS + EXTRA_CFLAGS += -DOC_DEBUG_TLS endif else CFLAGS += -Wl,--gc-sections + CXXFLAGS += -Wl,--gc-sections endif ifeq ($(PKI),1) diff --git a/security/oc_acl.c b/security/oc_acl.c index 3f90917cc230127a4a952085bc2a045a18c27426..b81b55b4b26afe7879b5a338f2a29d0542c40c58 100644 --- a/security/oc_acl.c +++ b/security/oc_acl.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017-2019 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_acl.h b/security/oc_acl.h index 6de7f297c1b56ecb8283b1c384952834bd1ec3af..13cf854d4b45477f8686b851a6fc44c0e17020b8 100644 --- a/security/oc_acl.h +++ b/security/oc_acl.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #ifndef OC_ACL_H #define OC_ACL_H -#include "oc_obt.h" +#include "oc_acl_common.h" #include "oc_ri.h" #include "oc_uuid.h" #include "port/oc_log.h" diff --git a/security/oc_certs.c b/security/oc_certs.c index a3c4fcff9db2d0f8b33bd237fe9dade3f2704de3..fb8e19f22936e363d8fef95eee2e3c6efde37609 100644 --- a/security/oc_certs.c +++ b/security/oc_certs.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_certs.h b/security/oc_certs.h index 373704bfc0874a8bd11b072cc27a2420a6bd0f09..aa73a6ee80271e77729c3f09cb3bffa3cb15f456 100644 --- a/security/oc_certs.h +++ b/security/oc_certs.h @@ -23,13 +23,14 @@ #include "security/oc_cred.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif int oc_certs_parse_CN_for_UUID(const mbedtls_x509_crt *cert, oc_string_t *subjectuuid); int oc_certs_parse_CN_for_UUID_raw(const unsigned char *cert, size_t cert_size, - oc_string_t *uuid); + oc_string_t *uuid); int oc_certs_encode_CN_with_UUID(oc_uuid_t *uuid, char *buf, size_t buf_len); int oc_certs_serialize_chain_to_pem(const mbedtls_x509_crt *cert_chain, char *output_buffer, diff --git a/security/oc_cred.c b/security/oc_cred.c index 6e3218b98d4ce75ed5d077edb971b25b8b64137d..18fb455a6c47efb4acf83c04493923fdbd63ecc2 100644 --- a/security/oc_cred.c +++ b/security/oc_cred.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017-2019 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_cred.h b/security/oc_cred.h index 8e0d7796cfbd6ff638d000dcbd1d20c4a45f137a..13c6055ded4700b0b8a94182d038b24777ad0716 100644 --- a/security/oc_cred.h +++ b/security/oc_cred.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017-2019 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_csr.c b/security/oc_csr.c index 31f7d742fb0128cb48c48275d1ca136380b76dee..4928d28c7b3cd13bf82ebdc3bcbb03af6c147881 100644 --- a/security/oc_csr.c +++ b/security/oc_csr.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_csr.h b/security/oc_csr.h index ed86589944fc2c83b54f237ddfcec16aac040d50..5fdffbd79d316e4b71b2257dc0771af3866104a2 100644 --- a/security/oc_csr.h +++ b/security/oc_csr.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,8 @@ #include "oc_ri.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif void get_csr(oc_request_t *request, oc_interface_mask_t iface_mask, void *data); diff --git a/security/oc_doxm.c b/security/oc_doxm.c index 41904c2d7d7b9ef9a684ac659d61365a49f943e1..685c044bb0dd8c3e86347461925498f577e2f102 100644 --- a/security/oc_doxm.c +++ b/security/oc_doxm.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ oc_sec_doxm_init(void) void oc_sec_doxm_default(size_t device) { - doxm[device].oxmsel = -1; + doxm[device].oxmsel = 0; #ifdef OC_PKI doxm[device].sct = 9; #else /* OC_PKI */ diff --git a/security/oc_doxm.h b/security/oc_doxm.h index c6f52858d94a69ae1bf0930a309d4730ecdfb266..fee744bf257f8c2d4a4d8003e39238debe68c879 100644 --- a/security/oc_doxm.h +++ b/security/oc_doxm.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -52,7 +52,8 @@ bool oc_sec_decode_doxm(oc_rep_t *rep, bool from_storage, size_t device); void oc_sec_encode_doxm(size_t device); oc_sec_doxm_t *oc_sec_get_doxm(size_t device); void oc_sec_doxm_default(size_t device); -void get_doxm(oc_request_t *request, oc_interface_mask_t iface_mask, void *data); +void get_doxm(oc_request_t *request, oc_interface_mask_t iface_mask, + void *data); void post_doxm(oc_request_t *request, oc_interface_mask_t iface_mask, void *data); diff --git a/security/oc_keypair.c b/security/oc_keypair.c index 9f4b8a94f09144a8858bfcd992fc5b1beac78370..e0b32a88519c4aed8a44e8fd088476b275795eca 100644 --- a/security/oc_keypair.c +++ b/security/oc_keypair.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -207,7 +207,7 @@ oc_generate_ecdsa_keypair_for_device(size_t device) return 0; } -#else /* OC_PKI */ +#else /* OC_PKI */ typedef int dummy_declaration; #endif /* !OC_PKI */ #endif /* OC_SECURITY */ diff --git a/security/oc_keypair.h b/security/oc_keypair.h index 967685856766be85e8cc945055ab20c6fab02fcd..0dcaee2050896d5e1836a851b91484fb54bb1dc8 100644 --- a/security/oc_keypair.h +++ b/security/oc_keypair.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,8 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #define OC_KEYPAIR_PUBKEY_SIZE (91) diff --git a/security/oc_obt_otm_cert.c b/security/oc_obt_otm_cert.c index 31fe24a20ee7472813ee5867fbbfa85f9a15330b..66e2ef890b22b337447c9d0a75b993377bb3dc46 100644 --- a/security/oc_obt_otm_cert.c +++ b/security/oc_obt_otm_cert.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017-2019 Intel Corporation +// Copyright (c) 2019 Intel Corporation // // Li!censed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_pstat.c b/security/oc_pstat.c index bf2303d355ce54301cfffa93b351c1ee65acd337..69c4dc1c9e336658c319ce8b2c678db971d3bae6 100644 --- a/security/oc_pstat.c +++ b/security/oc_pstat.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_pstat.h b/security/oc_pstat.h index ec0cc8d406919b0aa3e5e03540fafc582e1b0b56..97c34e124726580c26cd84f69ecc2cd398034f74 100644 --- a/security/oc_pstat.h +++ b/security/oc_pstat.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_roles.c b/security/oc_roles.c index 2f2815539d5def3206828fa9ca6e53a55b2e112a..767a592b37d9b3d1adc3508bb5dfa07cbb65d9df 100644 --- a/security/oc_roles.c +++ b/security/oc_roles.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_roles.h b/security/oc_roles.h index f357621695440b507e6561bbde1729dcdbe3ba0d..4e010c4b99d1a79a5e251eaf33eee8d40eba10ed 100644 --- a/security/oc_roles.h +++ b/security/oc_roles.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,8 @@ #include "security/oc_tls.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* Used on the server-side for handling role assertions via /oic/sec/roles */ diff --git a/security/oc_sp.c b/security/oc_sp.c index 3c6178156f2e085ce08aa8ffc2f810dc05dd5de4..76b76f5ec250f511596437a4b48687b9f3067d24 100644 --- a/security/oc_sp.c +++ b/security/oc_sp.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_sp.h b/security/oc_sp.h index 471f1e3b3e7d3b5ddaddfa510f50de43375d5f78..42c43dd7ef086dbe3cf3364de69b404341a99e89 100644 --- a/security/oc_sp.h +++ b/security/oc_sp.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2018-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,8 @@ #include "oc_pki.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif typedef struct diff --git a/security/oc_store.c b/security/oc_store.c index c8c764d3106e19e62d4bbbc5a7b38338ee96a147..7d4a4e329345bd3e0a2aa72b159621dccc16c1cc 100644 --- a/security/oc_store.c +++ b/security/oc_store.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_store.h b/security/oc_store.h index 0afd4766c4c7e2e912f5828c4ac16addd30d11cc..4f5eee531871e8de958fa6028880dd1de0bf2c49 100644 --- a/security/oc_store.h +++ b/security/oc_store.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_svr.c b/security/oc_svr.c index b849499f0b247c13c0e7072ce8f3b8fee87a9e11..ed193f9eed404bcfd9d1f6cc5538838a73d26bb1 100644 --- a/security/oc_svr.c +++ b/security/oc_svr.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_svr.h b/security/oc_svr.h index daa45d00ec860b922e3888bb86764fcdbb527558..182cbf40f46c1ee55d45201e260117a4c4de25b9 100644 --- a/security/oc_svr.h +++ b/security/oc_svr.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2017 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/security/oc_tls.c b/security/oc_tls.c index 1e8328fa85cca0d67ca4e492388783e682d1cce0..a816adeffebecfd31d35873841f722a81e66070e 100644 --- a/security/oc_tls.c +++ b/security/oc_tls.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -139,13 +139,6 @@ static int *ciphers = NULL; #ifdef OC_PKI static int selected_mfg_cred = -1; static int selected_id_cred = -1; - -#ifdef OC_CLIENT -static const int psk_priority[2] = { - MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, 0 -}; -#endif /* OC_CLIENT */ - static const int default_priority[8] = { #else /* OC_PKI */ static const int default_priority[2] = { @@ -163,6 +156,10 @@ static const int default_priority[2] = { }; #ifdef OC_CLIENT +static const int psk_priority[2] = { + MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, 0 +}; + static const int anon_ecdh_priority[2] = { MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, 0 }; @@ -188,6 +185,7 @@ static const int otm_priority[3] = { #ifdef OC_CLIENT #ifdef OC_PKI + static const int cloud_priority[3] = { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0 diff --git a/security/oc_tls.h b/security/oc_tls.h index c8a29c6f3018b44b070430048e8edeac06293fb7..76d28e70bee45e59234c946ec199fe5619635727 100644 --- a/security/oc_tls.h +++ b/security/oc_tls.h @@ -1,5 +1,5 @@ /* -// Copyright (c) 2018 Intel Corporation +// Copyright (c) 2016-2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.