diff --git a/unit/test-eapol.c b/unit/test-eapol.c index 58f3e054..49f7aac5 100644 --- a/unit/test-eapol.c +++ b/unit/test-eapol.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -3923,6 +3924,18 @@ static bool aes_precheck(const void *data) static bool pkcs8_precheck(const void *data) { + struct stat st; + + /* + * Despite the path, this directory exists whether the module + * is external or built-in. + */ + if (stat("/sys/module/pkcs8_key_parser", &st) < 0) + return false; + + if (!S_ISDIR(st.st_mode)) + return false; + return (IS_ENABLED(HAVE_PKCS8_SUPPORT) && l_cipher_is_supported(L_CIPHER_AES) && l_cipher_is_supported(L_CIPHER_AES_CBC) &&