| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
|
| 6 |
int dlopen_gnutls(int log_level); |
| 7 |
|
| 8 |
#if HAVE_GNUTLS |
| 9 |
# include <gnutls/gnutls.h> /* IWYU pragma: export */ |
| 10 |
# include <gnutls/x509.h> /* IWYU pragma: export */ |
| 11 |
|
| 12 |
/* gnutls.h installs a function-like macro that wraps gnutls_free() and NULLs the passed pointer. We use |
| 13 |
* dlsym to resolve the underlying function pointer variable, so undef the macro here to keep the variable |
| 14 |
* name visible for DLSYM_PROTOTYPE/DLSYM_ARG. */ |
| 15 |
# ifdef gnutls_free |
| 16 |
# undef gnutls_free |
| 17 |
# endif |
| 18 |
|
| 19 |
# include "dlfcn-util.h" |
| 20 |
|
| 21 |
extern DLSYM_PROTOTYPE(gnutls_certificate_get_peers); |
| 22 |
extern DLSYM_PROTOTYPE(gnutls_certificate_type_get); |
| 23 |
extern DLSYM_PROTOTYPE(gnutls_certificate_verification_status_print); |
| 24 |
extern DLSYM_PROTOTYPE(gnutls_certificate_verify_peers2); |
| 25 |
extern DLSYM_PROTOTYPE(gnutls_free); |
| 26 |
extern DLSYM_PROTOTYPE(gnutls_global_set_log_function); |
| 27 |
extern DLSYM_PROTOTYPE(gnutls_global_set_log_level); |
| 28 |
extern DLSYM_PROTOTYPE(gnutls_x509_crt_deinit); |
| 29 |
extern DLSYM_PROTOTYPE(gnutls_x509_crt_get_dn); |
| 30 |
extern DLSYM_PROTOTYPE(gnutls_x509_crt_import); |
| 31 |
extern DLSYM_PROTOTYPE(gnutls_x509_crt_init); |
| 32 |
#endif |