1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 * SSL helper functions shared by sign-file and extract-cert.
6 static void drain_openssl_errors(int l
, int silent
)
12 if (ERR_peek_error() == 0)
15 fprintf(stderr
, "At main.c:%d:\n", l
);
17 while ((e
= ERR_peek_error_line(&file
, &line
))) {
18 ERR_error_string(e
, buf
);
20 fprintf(stderr
, "- SSL %s: %s:%d\n", buf
, file
, line
);
25 #define ERR(cond, fmt, ...) \
27 bool __cond = (cond); \
28 drain_openssl_errors(__LINE__, 0); \
30 errx(1, fmt, ## __VA_ARGS__); \