TinyDTLS: Support build with DTLS_PSK not defined.

As well as adding in the DTLS_PSK wrappers in the appropriate place. add in
coap_dtls_psk_is_supported(), coap_dtls_pki_is_supported(),
coap_dtls_pkcs11_is_supported() and coap_dtls_rpk_is_supported() functions
to support better granularity of what capabilities are available in the
(D)TLS libraries.

Update coap_string_tls_support() to use these new functions.

Uppdated documentation for these new functions.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2022-11-03 09:03:52 +00:00
1 parent df4d475cc7
commit 458f2d5702
12 files changed
+364 -76

No files matched your search

+6 -2
View File
@@ -2083,7 +2083,7 @@ fill_keystore(coap_context_t *ctx) {
if (cert_file == NULL && key_defined == 0) {
if (coap_dtls_is_supported() || coap_tls_is_supported()) {
coap_log(LOG_DEBUG,
"(D)TLS not enabled as neither -k or -c options specified\n");
"(D)TLS not enabled as none of -k, -c or -M options specified\n");
}
return;
}
@@ -2100,7 +2100,11 @@ fill_keystore(coap_context_t *ctx) {
if (key_defined) {
coap_dtls_spsk_t *dtls_spsk = setup_spsk();
coap_context_set_psk2(ctx, dtls_spsk);
if (!coap_context_set_psk2(ctx, dtls_spsk)) {
coap_log(LOG_INFO, "Unable to set up PSK\n");
/* So we do not set up DTLS */
key_defined = 0;
}
}
}