diff --git a/include/coap/net.h b/include/coap/net.h index aee58ec3..45edfc44 100644 --- a/include/coap/net.h +++ b/include/coap/net.h @@ -199,7 +199,7 @@ coap_context_t *coap_new_context(const coap_address_t *listen_addr); */ void coap_context_set_psk( coap_context_t *ctx, const char *hint, - const uint8_t *key, unsigned key_len ); + const uint8_t *key, size_t key_len ); /** * Returns a new message id and updates @p context->message_id accordingly. The diff --git a/src/coap_openssl.c b/src/coap_openssl.c index 0b2d549b..6337a18d 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -606,4 +606,10 @@ int coap_dtls_receive(coap_session_t *session, return r; } +#else /* !HAVE_OPENSSL */ + +/* make compilers happy that do not like empty modules */ +static inline void dummy(void) { +} + #endif /* HAVE_OPENSSL */ diff --git a/src/coap_tinydtls.c b/src/coap_tinydtls.c index 33521d0d..13bcc3f9 100644 --- a/src/coap_tinydtls.c +++ b/src/coap_tinydtls.c @@ -312,11 +312,13 @@ int coap_dtls_get_context_timeout(void *dtls_context) { } int coap_dtls_get_timeout(coap_session_t *session) { + (void)session; return -1; } void coap_dtls_handle_timeout(coap_session_t *session) { - return 0; + (void)session; + return; } int diff --git a/src/net.c b/src/net.c index 6c6d05f4..665ef5b0 100644 --- a/src/net.c +++ b/src/net.c @@ -349,6 +349,8 @@ coap_get_session_client_psk( uint8_t *identity, size_t *identity_len, size_t max_identity_len, uint8_t *psk, size_t max_psk_len ) { + (void)hint; + (void)hint_len; if (session->psk_identity && session->psk_identity_len > 0 && session->psk_key && session->psk_key_len > 0) { if (session->psk_identity_len <= max_identity_len && session->psk_key_len <= max_psk_len) { memcpy(identity, session->psk_identity, session->psk_identity_len); @@ -373,6 +375,8 @@ coap_get_context_server_psk( const uint8_t *identity, size_t identity_len, uint8_t *psk, size_t max_psk_len ) { + (void)identity; + (void)identity_len; const coap_context_t *ctx = session->context; if (ctx && ctx->psk_key && ctx->psk_key_len > 0 && ctx->psk_key_len <= max_psk_len) { memcpy(psk, ctx->psk_key, ctx->psk_key_len);