hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/fips.h
....@@ -2,10 +2,25 @@
22 #ifndef _FIPS_H
33 #define _FIPS_H
44
5
-#ifdef CONFIG_CRYPTO_FIPS
5
+#ifdef BUILD_FIPS140_KO
6
+/*
7
+ * In fips140.ko, enable the behavior that the upstream fips_enabled flag
8
+ * controls, such as the XTS weak key check.
9
+ */
10
+#define fips_enabled 1
11
+#define CONFIG_CRYPTO_FIPS 1
12
+
13
+#elif defined(CONFIG_CRYPTO_FIPS)
614 extern int fips_enabled;
15
+extern struct atomic_notifier_head fips_fail_notif_chain;
16
+
17
+void fips_fail_notify(void);
18
+
719 #else
820 #define fips_enabled 0
21
+
22
+static inline void fips_fail_notify(void) {}
23
+
924 #endif
1025
1126 #endif