Skip to content

Commit

Permalink
tls: print error log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Aug 19, 2023
1 parent bd19efd commit 18bebeb
Show file tree
Hide file tree
Showing 5 changed files with 268 additions and 114 deletions.
2 changes: 1 addition & 1 deletion port/linux/tcpsession.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ try_connect_nonblocking(int sockfd, const struct sockaddr *r, socklen_t r_len)

int n = connect(sockfd, r, r_len);
if (n < 0 && errno != EINPROGRESS) {
OC_DBG("connect to socked(%d) failed with error: %d", sockfd, (int)errno);
OC_ERR("connect to socked(%d) failed with error: %d", sockfd, (int)errno);
return -1;
}
return n == 0 ? OC_TCP_SOCKET_STATE_CONNECTED
Expand Down
8 changes: 5 additions & 3 deletions security/oc_certs.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,14 @@ oc_certs_parse_CN_buffer_for_UUID(mbedtls_asn1_buf val, char *buffer,
if (uuid_prefix_len == 0 ||
val.len - uuid_prefix_len <
OC_UUID_LEN - 1) { // -1 because val is not nul-terminated
#if OC_ERR_IS_ENABLED
#if OC_DBG_IS_ENABLED
oc_string_t cn;
oc_new_string(&cn, uuid_CN, val.len);
OC_ERR("invalid Common Name field (tag:%d val:%s)", val.tag, oc_string(cn));
OC_DBG("Common Name field (tag:%d val:%s) is not in format " UUID_PREFIX
":<UUID string>",
val.tag, oc_string(cn));
oc_free_string(&cn);
#endif /* OC_ERR_IS_ENABLED */
#endif /* OC_DBG_IS_ENABLED */
return false;
}

Expand Down
Loading

0 comments on commit 18bebeb

Please sign in to comment.