diff options
author | Daiki Ueno <ueno@gnu.org> | 2022-01-17 17:53:32 +0000 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2022-01-17 17:53:32 +0000 |
commit | 34c6c97bd77975b96597e1e4c03e4d0465dda22a (patch) | |
tree | 666f64e885bb22dd43a89ed9e583680eb6f8c6ce /lib/global.c | |
parent | 0a673a028506c6bff961c41992fb25baa1a11509 (diff) | |
parent | e256951eab4cc44367f8cc7bd2a51eeaacc10f7d (diff) | |
download | gnutls-34c6c97bd77975b96597e1e4c03e4d0465dda22a.tar.gz |
Merge branch 'wip/dueno/fips-module-version' into 'master'
fips: add mechanism to embed FIPS module name in the library
See merge request gnutls/gnutls!1508
Diffstat (limited to 'lib/global.c')
-rw-r--r-- | lib/global.c | 48 |
1 files changed, 48 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; +} |