From 4c3fb2507a9537331752c1e7308d51849d0fe12e Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Fri, 21 Oct 2022 13:23:55 +0100 Subject: [PATCH] Update for primary commit #2 (to be squashed later) --- man/coap_pdu_setup.txt.in | 2 +- src/coap_openssl.c | 5 ++--- src/coap_oscore.c | 9 ++++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/man/coap_pdu_setup.txt.in b/man/coap_pdu_setup.txt.in index a137d1f9ad..635cf8c935 100644 --- a/man/coap_pdu_setup.txt.in +++ b/man/coap_pdu_setup.txt.in @@ -712,7 +712,7 @@ See "https://tools.ietf.org/html/rfc7959[RFC7959: Block-Wise Transfers in the Constrained Application Protocol (CoAP)]" -https://tools.ietf.org/html/rfc8613[RFC8613: Object Security for Constrained RESTful Environments (OSCORE)]" +"https://tools.ietf.org/html/rfc8613[RFC8613: Object Security for Constrained RESTful Environments (OSCORE)]" "https://tools.ietf.org/html/rfc9175[RFC9175: CoAP: Echo, Request-Tag, and Token Processing]" diff --git a/src/coap_openssl.c b/src/coap_openssl.c index 5a88737ced..8df439dea2 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -3659,11 +3659,10 @@ coap_crypto_output_errors(const char *prefix) { while ((e = ERR_get_error())) coap_log(LOG_WARNING, - "%s: %s at %s:%s\n", + "%s: %s%s\n", prefix, ERR_reason_error_string(e), - ERR_lib_error_string(e), - ERR_func_error_string(e)); + ssl_function_definition(e)); } int diff --git a/src/coap_oscore.c b/src/coap_oscore.c index 4fffdb0c63..ca1b130567 100644 --- a/src/coap_oscore.c +++ b/src/coap_oscore.c @@ -310,7 +310,8 @@ coap_oscore_new_pdu_encrypted(coap_session_t *session, if (coap_check_option(pdu, COAP_OPTION_OBSERVE, &opt_iter)) doing_observe = 1; - coap_show_pdu(COAP_LOG_OSCORE, pdu); + coap_log(LOG_DEBUG, "PDU to encrypt\n"); + coap_show_pdu(LOG_DEBUG, pdu); osc_pdu = coap_pdu_init(pdu->type == COAP_MESSAGE_NON && session->b_2_step != COAP_OSCORE_B_2_NONE ? COAP_MESSAGE_CON : pdu->type, @@ -790,7 +791,8 @@ coap_oscore_decrypt_pdu(coap_session_t *session, if (opt == NULL) return NULL; - coap_show_pdu(COAP_LOG_OSCORE, pdu); + coap_log(LOG_DEBUG, "PDU to decrypt\n"); + coap_show_pdu(LOG_DEBUG, pdu); if (session->context->p_osc_ctx == NULL) { coap_log(LOG_WARNING, "OSCORE: Not enabled\n"); if (!coap_request) @@ -1542,7 +1544,8 @@ coap_oscore_decrypt_pdu(coap_session_t *session, session->con_active--; if (sent_pdu) { coap_send_ack(session, pdu); - coap_show_pdu(COAP_LOG_OSCORE, decrypt_pdu); + coap_log(LOG_DEBUG, "PDU requesting re-transmit\n"); + coap_show_pdu(LOG_DEBUG, decrypt_pdu); coap_log_oscore("RFC9175 retransmit pdu\n"); if (coap_retransmit_oscore_pdu(session, sent_pdu, opt) == COAP_INVALID_MID)