Commit 803fec91 authored by Kishen Maloor's avatar Kishen Maloor

Minor cleanup

Change-Id: I4e5c96472460ecf9c23c3f03ab7e0d9559f8eaab
Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent a33af367
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2018 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
...@@ -441,6 +441,7 @@ ocf_event_thread(void *data) ...@@ -441,6 +441,7 @@ ocf_event_thread(void *data)
printf("pthread_mutex_init failed!\n"); printf("pthread_mutex_init failed!\n");
return NULL; return NULL;
} }
oc_set_con_res_announced(false);
oc_set_max_app_data_size(6000); oc_set_max_app_data_size(6000);
int init = oc_main_init(&handler); int init = oc_main_init(&handler);
if (init < 0) if (init < 0)
......
/* /*
// Copyright (c) 2017-2019 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017-2019 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2018 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
...@@ -130,12 +130,13 @@ endif ...@@ -130,12 +130,13 @@ endif
OBT = onboarding_tool OBT = onboarding_tool
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
CFLAGS += -DOC_DEBUG -g -O0 EXTRA_CFLAGS += -DOC_DEBUG -g -O0
ifeq ($(DEBUG_TLS),1) ifeq ($(DEBUG_TLS),1)
CFLAGS += -DOC_DEBUG_TLS EXTRA_CFLAGS += -DOC_DEBUG_TLS
endif endif
else else
CFLAGS += -Wl,--gc-sections CFLAGS += -Wl,--gc-sections
CXXFLAGS += -Wl,--gc-sections
endif endif
ifeq ($(PKI),1) ifeq ($(PKI),1)
......
/* /*
// Copyright (c) 2017-2019 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#ifndef OC_ACL_H #ifndef OC_ACL_H
#define OC_ACL_H #define OC_ACL_H
#include "oc_obt.h" #include "oc_acl_common.h"
#include "oc_ri.h" #include "oc_ri.h"
#include "oc_uuid.h" #include "oc_uuid.h"
#include "port/oc_log.h" #include "port/oc_log.h"
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
...@@ -23,13 +23,14 @@ ...@@ -23,13 +23,14 @@
#include "security/oc_cred.h" #include "security/oc_cred.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C"
{
#endif #endif
int oc_certs_parse_CN_for_UUID(const mbedtls_x509_crt *cert, int oc_certs_parse_CN_for_UUID(const mbedtls_x509_crt *cert,
oc_string_t *subjectuuid); oc_string_t *subjectuuid);
int oc_certs_parse_CN_for_UUID_raw(const unsigned char *cert, size_t cert_size, 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_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, int oc_certs_serialize_chain_to_pem(const mbedtls_x509_crt *cert_chain,
char *output_buffer, char *output_buffer,
......
/* /*
// Copyright (c) 2017-2019 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017-2019 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include "oc_ri.h" #include "oc_ri.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C"
{
#endif #endif
void get_csr(oc_request_t *request, oc_interface_mask_t iface_mask, void *data); void get_csr(oc_request_t *request, oc_interface_mask_t iface_mask, void *data);
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -62,7 +62,7 @@ oc_sec_doxm_init(void) ...@@ -62,7 +62,7 @@ oc_sec_doxm_init(void)
void void
oc_sec_doxm_default(size_t device) oc_sec_doxm_default(size_t device)
{ {
doxm[device].oxmsel = -1; doxm[device].oxmsel = 0;
#ifdef OC_PKI #ifdef OC_PKI
doxm[device].sct = 9; doxm[device].sct = 9;
#else /* OC_PKI */ #else /* OC_PKI */
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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); ...@@ -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); void oc_sec_encode_doxm(size_t device);
oc_sec_doxm_t *oc_sec_get_doxm(size_t device); oc_sec_doxm_t *oc_sec_get_doxm(size_t device);
void oc_sec_doxm_default(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 post_doxm(oc_request_t *request, oc_interface_mask_t iface_mask,
void *data); void *data);
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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) ...@@ -207,7 +207,7 @@ oc_generate_ecdsa_keypair_for_device(size_t device)
return 0; return 0;
} }
#else /* OC_PKI */ #else /* OC_PKI */
typedef int dummy_declaration; typedef int dummy_declaration;
#endif /* !OC_PKI */ #endif /* !OC_PKI */
#endif /* OC_SECURITY */ #endif /* OC_SECURITY */
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C"
{
#endif #endif
#define OC_KEYPAIR_PUBKEY_SIZE (91) #define OC_KEYPAIR_PUBKEY_SIZE (91)
......
/* /*
// Copyright (c) 2017-2019 Intel Corporation // Copyright (c) 2019 Intel Corporation
// //
// Li!censed under the Apache License, Version 2.0 (the "License"); // Li!censed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include "security/oc_tls.h" #include "security/oc_tls.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C"
{
#endif #endif
/* Used on the server-side for handling role assertions via /oic/sec/roles */ /* Used on the server-side for handling role assertions via /oic/sec/roles */
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
#include "oc_pki.h" #include "oc_pki.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C"
{
#endif #endif
typedef struct typedef struct
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2017 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -139,13 +139,6 @@ static int *ciphers = NULL; ...@@ -139,13 +139,6 @@ static int *ciphers = NULL;
#ifdef OC_PKI #ifdef OC_PKI
static int selected_mfg_cred = -1; static int selected_mfg_cred = -1;
static int selected_id_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] = { static const int default_priority[8] = {
#else /* OC_PKI */ #else /* OC_PKI */
static const int default_priority[2] = { static const int default_priority[2] = {
...@@ -163,6 +156,10 @@ static const int default_priority[2] = { ...@@ -163,6 +156,10 @@ static const int default_priority[2] = {
}; };
#ifdef OC_CLIENT #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] = { static const int anon_ecdh_priority[2] = {
MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, 0 MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, 0
}; };
...@@ -188,6 +185,7 @@ static const int otm_priority[3] = { ...@@ -188,6 +185,7 @@ static const int otm_priority[3] = {
#ifdef OC_CLIENT #ifdef OC_CLIENT
#ifdef OC_PKI #ifdef OC_PKI
static const int cloud_priority[3] = { static const int cloud_priority[3] = {
MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0
......
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2016-2019 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment