diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/global.c | 48 | ||||
-rw-r--r-- | lib/includes/gnutls/gnutls.h.in | 7 | ||||
-rw-r--r-- | lib/libgnutls.map | 1 |
3 files changed, 56 insertions, 0 deletions
diff --git a/lib/global.c b/lib/global.c index 77039d9ded..65c0b81709 100644 --- a/lib/global.c +++ b/lib/global.c @@ -531,3 +531,51 @@ static void _DESTRUCTOR lib_deinit(void) _gnutls_global_deinit(1); } + +static const struct gnutls_library_config_st _gnutls_library_config[] = { +#ifdef FIPS_MODULE_NAME + { "fips-module-name", FIPS_MODULE_NAME }, +#endif +#ifdef FIPS_MODULE_VERSION + { "fips-module-version", FIPS_MODULE_VERSION }, +#endif + { "libgnutls-soname", GNUTLS_LIBRARY_SONAME }, + { "libnettle-soname", NETTLE_LIBRARY_SONAME }, + { "libhogweed-soname", HOGWEED_LIBRARY_SONAME }, + { "libgmp-soname", GMP_LIBRARY_SONAME }, + { "hardware-features", HW_FEATURES }, + { "tls-features", TLS_FEATURES }, + { NULL, NULL } +}; + +/** + * gnutls_get_library_config: + * + * Returns the library configuration as key value pairs. + * Currently defined keys are: + * + * - fips-module-name: the name of the FIPS140 module + * + * - fips-module-version: the version of the FIPS140 module + * + * - libgnutls-soname: the SONAME of the library itself + * + * - libnettle-soname: the library SONAME of linked libnettle + * + * - libhogweed-soname: the library SONAME of linked libhogweed + * + * - libgmp-soname: the library SONAME of linked libgmp + * + * - hardware-features: enabled hardware support features + * + * - tls-features: enabled TLS protocol features + * + * Returns: a NUL-terminated %gnutls_library_config_st array + * + * Since: 3.7.3 + */ +const gnutls_library_config_st * +gnutls_get_library_config(void) +{ + return _gnutls_library_config; +} diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index 0e96be81e8..6359a0edb6 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -1232,6 +1232,11 @@ typedef struct { unsigned int size; } gnutls_datum_t; +typedef struct gnutls_library_config_st { + const char *name; + const char *value; +} gnutls_library_config_st; + typedef struct gnutls_params_st { gnutls_params_type_t type; @@ -2284,6 +2289,8 @@ int gnutls_certificate_set_rawpk_key_file(gnutls_certificate_credentials_t cred, int gnutls_global_init(void); void gnutls_global_deinit(void); +const gnutls_library_config_st *gnutls_get_library_config(void); + /** * gnutls_time_func: * @t: where to store time. diff --git a/lib/libgnutls.map b/lib/libgnutls.map index 40a3984cbf..30e96abafe 100644 --- a/lib/libgnutls.map +++ b/lib/libgnutls.map @@ -1375,6 +1375,7 @@ GNUTLS_3_7_3 gnutls_fips140_get_operation_state; gnutls_fips140_push_context; gnutls_fips140_pop_context; + gnutls_get_library_config; local: *; } GNUTLS_3_7_2; |