From 8732a9f38ae56a079cd5e493b64e016b2563111a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 9 Nov 2018 11:50:29 -0600 Subject: [PATCH] main: Add checks for asymmetric key support Tell the user that Kernel 4.20 with asymmetric key support enabled is required to support TLS based (EAP/PEAP/TTLS) WPA-Enterprise methods. --- src/main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main.c b/src/main.c index 536d954b..c1a2c423 100644 --- a/src/main.c +++ b/src/main.c @@ -324,6 +324,25 @@ static int check_crypto() l_hashmap_insert(options, "CONFIG_KEY_DH_OPERATIONS", &r); } + if (!l_key_is_supported(L_KEY_FEATURE_RESTRICT)) { + l_warn("No keyring restrictions support found."); + l_hashmap_insert(options, "CONFIG_KEYS", &r); + } + + if (!l_key_is_supported(L_KEY_FEATURE_CRYPTO)) { + l_warn("No asymmetric key support found."); + l_warn("TLS based WPA-Enterprise authentication methods will" + " not function."); + l_warn("Kernel 4.20+ is required for this feature."); + l_hashmap_insert(options, "CONFIG_ASYMMETRIC_KEY_TYPE", &r); + l_hashmap_insert(options, + "CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE", &r); + l_hashmap_insert(options, "CONFIG_X509_CERTIFICATE_PARSER", &r); + l_hashmap_insert(options, "CONFIG_PKCS7_MESSAGE_PARSER", &r); + l_hashmap_insert(options, + "CONFIG_PKCS8_PRIVATE_KEY_PARSER", &r); + }; + if (l_hashmap_isempty(options)) goto done;