2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Report file and line when converting OpenSSL errors

This provides more detail about which instance of specific OpenSSL
calls that have failed by reporting the file name and line numbers
involved when dst__openssl_toresult2 and dst__openssl_toresult3 are
called.
This commit is contained in:
Mark Andrews
2022-08-07 21:41:18 +10:00
parent 2baa58c59f
commit ba34255648
2 changed files with 18 additions and 11 deletions

View File

@@ -175,24 +175,26 @@ dst__openssl_toresult(isc_result_t fallback) {
}
isc_result_t
dst__openssl_toresult2(const char *funcname, isc_result_t fallback) {
return (dst__openssl_toresult3(DNS_LOGCATEGORY_GENERAL, funcname,
fallback));
dst___openssl_toresult2(const char *funcname, isc_result_t fallback,
const char *file, int line) {
return (dst___openssl_toresult3(DNS_LOGCATEGORY_GENERAL, funcname,
fallback, file, line));
}
isc_result_t
dst__openssl_toresult3(isc_logcategory_t *category, const char *funcname,
isc_result_t fallback) {
dst___openssl_toresult3(isc_logcategory_t *category, const char *funcname,
isc_result_t fallback, const char *file, int line) {
isc_result_t result;
unsigned long err;
const char *file, *func, *data;
int line, flags;
const char *func, *data;
int flags;
char buf[256];
result = toresult(fallback);
isc_log_write(dns_lctx, category, DNS_LOGMODULE_CRYPTO, ISC_LOG_WARNING,
"%s failed (%s)", funcname, isc_result_totext(result));
"%s (%s:%d) failed (%s)", funcname, file, line,
isc_result_totext(result));
if (result == ISC_R_NOMEMORY) {
goto done;