Skip to content

Commit

Permalink
CryptoPkg: Extend TLS handshake debug output
Browse files Browse the repository at this point in the history
The error codes during TLS handshake errors are sometimes
not enough to understand the root cause of the problem.
Extending the debug output by the function and optional data helps
in some cases.

Signed-off-by: Sebastian Witt <[email protected]>
  • Loading branch information
SeWittSiemens authored and mergify[bot] committed Jun 25, 2024
1 parent 84d8eb0 commit dc93ff8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CryptoPkg/Library/TlsLib/TlsProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,23 @@ TlsDoHandshake (
DEBUG_CODE_BEGIN ();
while (TRUE) {
unsigned long ErrorCode;
const char *Func;
const char *Data;

ErrorCode = ERR_get_error ();
ErrorCode = ERR_get_error_all (NULL, NULL, &Func, &Data, NULL);
if (ErrorCode == 0) {
break;
}

DEBUG ((
DEBUG_ERROR,
"%a ERROR 0x%x=L%x:R%x\n",
"%a ERROR 0x%x=L%x:R%x %a(): %a\n",
__func__,
ErrorCode,
ERR_GET_LIB (ErrorCode),
ERR_GET_REASON (ErrorCode)
ERR_GET_REASON (ErrorCode),
Func,
Data
));
}

Expand Down

0 comments on commit dc93ff8

Please sign in to comment.