Skip to content

Commit

Permalink
Update for primary commit obgm#5 (to be squashed later)
Browse files Browse the repository at this point in the history
Re-order when coap_show_pdu() is called in coap_dispatch() to aid
debugging when there are critical options.
  • Loading branch information
mrdeep1 committed Dec 30, 2022
1 parent 972e84a commit ea790f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/coap_oscore.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,6 @@ coap_oscore_decrypt_pdu(coap_session_t *session,
if (opt == NULL)
return NULL;

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)
Expand Down
8 changes: 4 additions & 4 deletions src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -3285,10 +3285,8 @@ coap_dispatch(coap_context_t *context, coap_session_t *session,
#if HAVE_OSCORE
if (coap_option_check_critical(session, pdu, &opt_filter) == 0) {
if (pdu->type == COAP_MESSAGE_NON) {
if (coap_option_check_critical(session, pdu, &opt_filter) == 0) {
coap_send_rst(session, pdu);
goto cleanup;
}
coap_send_rst(session, pdu);
goto cleanup;
} else if (pdu->type == COAP_MESSAGE_CON) {
if (COAP_PDU_IS_REQUEST(pdu)) {
response =
Expand Down Expand Up @@ -3358,6 +3356,8 @@ coap_dispatch(coap_context_t *context, coap_session_t *session,
session->oscore_encryption = 1;
pdu = dec_pdu;
}
coap_log_debug("Decrypted PDU\n");
coap_show_pdu(LOG_DEBUG, pdu);
}
}
#endif /* HAVE_OSCORE */
Expand Down

0 comments on commit ea790f2

Please sign in to comment.