From a6ff63b15921076c0b73c92d1141f7f66f06c7ce Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Thu, 10 Jan 2019 20:49:32 +0100 Subject: [PATCH] coap_gnutls.c: enable cipher suites required by RFC 7252 As discussed in issue #286 [1], the mandatory-to-implement cipher suites TLS_PSK_WITH_AES_128_CCM_8 and TLS_ECDHE_ECDSA_AES_128_CCM_8 should be enabled if possible. [1] https://github.com/obgm/libcoap/issues/286 Signed-off-by: Olaf Bergmann --- src/coap_gnutls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c index df722ca0..3c3e76a1 100644 --- a/src/coap_gnutls.c +++ b/src/coap_gnutls.c @@ -88,7 +88,11 @@ typedef struct coap_gnutls_context_t { gnutls_priority_t priority_cache; } coap_gnutls_context_t; +#if (GNUTLS_VERSION_NUMBER >= 0x030505) +#define VARIANTS "NORMAL:+ECDHE-PSK:+PSK:+ECDHE-ECDSA:+AES-128-CCM-8" +#else #define VARIANTS "NORMAL:+ECDHE-PSK:+PSK" +#endif #define G_ACTION(xx) do { \ ret = (xx); \