You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.8 KiB

  1. From 01796db0b166e720860eff200acabff410ba6979 Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke@hauke-m.de>
  3. Date: Sun, 4 Dec 2016 00:15:21 +0100
  4. Subject: [PATCH 4/7] ssl: enable usage of patched mbed functions conditionally
  5. Only activate support for the MBEDTLS_KEY_EXCHANGE_ECDH_ANON_ENABLED
  6. cipher suite when this is actually available in mbedtls.
  7. This makes it possible to compile IoTivity against a unpatched mbedtls
  8. version.
  9. Change-Id: Ic56d7faf7597cc5dc08f9d55be29dde898949609
  10. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  11. ---
  12. resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 4 ++++
  13. 1 file changed, 4 insertions(+)
  14. --- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
  15. +++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
  16. @@ -237,7 +237,9 @@ int tlsCipher[ADAPTER_CIPHER_MAX][2] =
  17. {
  18. {MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA, 0},
  19. {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, 0},
  20. +#ifdef MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
  21. {MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, 0},
  22. +#endif
  23. {MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, 0},
  24. {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM, 0},
  25. {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0}
  26. @@ -1943,6 +1945,7 @@ CAResult_t CAsetTlsCipherSuite(const uin
  27. g_caSslContext->cipher = ADAPTER_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8;
  28. break;
  29. }
  30. +#ifdef MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
  31. case MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256:
  32. {
  33. #ifdef __WITH_TLS__
  34. @@ -1960,6 +1963,7 @@ CAResult_t CAsetTlsCipherSuite(const uin
  35. g_caSslContext->cipher = ADAPTER_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA_256;
  36. break;
  37. }
  38. +#endif
  39. case MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256:
  40. {
  41. #if 0 // PIN OTM