projects
/
platform
/
upstream
/
iotivity.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update Snapshot(2018-02-28)
[platform/upstream/iotivity.git]
/
resource
/
csdk
/
connectivity
/
src
/
adapter_util
/
ca_adapter_net_ssl.c
diff --git
a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
index
7be3576
..
6dd925a
100644
(file)
--- a/
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+++ b/
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
@@
-1698,6
+1698,11
@@
static void SetupCipher(mbedtls_ssl_config * config, CATransportAdapter_t adapte
memset(g_cipherSuitesList, 0, sizeof(g_cipherSuitesList));
memset(g_cipherSuitesList, 0, sizeof(g_cipherSuitesList));
+ if (SSL_CIPHER_MAX < g_caSslContext->cipher)
+ {
+ OIC_LOG(ERROR, NET_SSL_TAG, "Maximum ciphersuite index exceeded");
+ }
+
// Add the preferred ciphersuite first
if (SSL_CIPHER_MAX != g_caSslContext->cipher)
{
// Add the preferred ciphersuite first
if (SSL_CIPHER_MAX != g_caSslContext->cipher)
{
@@
-1708,6
+1713,7
@@
static void SetupCipher(mbedtls_ssl_config * config, CATransportAdapter_t adapte
// Add PSK ciphersuite
if (true == g_caSslContext->cipherFlag[0] &&
// Add PSK ciphersuite
if (true == g_caSslContext->cipherFlag[0] &&
+ SSL_CIPHER_MAX != g_caSslContext->cipher &&
MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 != tlsCipher[g_caSslContext->cipher][0])
{
g_cipherSuitesList[index] = MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256;
MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 != tlsCipher[g_caSslContext->cipher][0])
{
g_cipherSuitesList[index] = MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256;