From 1e4f7bf5d0995e636d30e2553c4260cb6fb02a38 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 1 Aug 2015 18:11:07 +0300 Subject: [PATCH] Add 'GET_CAPABILITY fips' to enable runtime check for CONFIG_FIPS=y This can be used to check whether the running wpa_supplicant version was built with CONFIG_FIPS=y. Signed-off-by: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 6dca2527f..cbb877e9f 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3961,6 +3961,15 @@ static int wpa_supplicant_ctrl_iface_get_capability( } #endif /* CONFIG_EPR */ +#ifdef CONFIG_FIPS + if (os_strcmp(field, "fips") == 0) { + res = os_snprintf(buf, buflen, "FIPS"); + if (os_snprintf_error(buflen, res)) + return -1; + return res; + } +#endif /* CONFIG_FIPS */ + wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown GET_CAPABILITY field '%s'", field);