#include "log.h"
#include "utils.h"
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
+static inline unsigned long ERR_get_error_all(const char **file, int *line,
+ const char **func,
+ const char **data, int *flags)
+{
+ if (func != NULL) *func = "";
+
+ return ERR_get_error_line_data(file, line, data, flags);
+}
+#endif
+
/** Holds the state of a log BIO
*
* Most of these fields are expected to change between uses of the BIO.
int line;
char const *file;
+ char const *func;
char const *data;
int flags = 0;
* can be used to determine if there are
* multiple errors.
*/
- error = ERR_get_error_line_data(&file, &line, &data, &flags);
+ error = ERR_get_error_all(&file, &line, &func, &data, &flags);
if (!(flags & ERR_TXT_STRING)) data = NULL;
if (msg) {
data ? ':' : '\0', data ? data : "");
}
in_stack++;
- } while ((error = ERR_get_error_line_data(&file, &line, &data, &flags)));
+ } while ((error = ERR_get_error_all(&file, &line, &func, &data, &flags)));
return in_stack;
}
int line;
char const *file;
+ char const *func;
char const *data;
int flags = 0;
* can be used to determine if there are
* multiple errors.
*/
- error = ERR_get_error_line_data(&file, &line, &data, &flags);
+ error = ERR_get_error_all(&file, &line, &func, &data, &flags);
if (!(flags & ERR_TXT_STRING)) data = NULL;
if (msg) {
return 0;
}
- while ((error = ERR_get_error_line_data(&file, &line, &data, &flags))) {
+ while ((error = ERR_get_error_all(&file, &line, &func, &data, &flags))) {
if (!(flags & ERR_TXT_STRING)) data = NULL;
ERR_error_string_n(error, buffer, sizeof(buffer));