.. | .. |
---|
2 | 2 | #ifndef _FIPS_H |
---|
3 | 3 | #define _FIPS_H |
---|
4 | 4 | |
---|
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) |
---|
6 | 14 | extern int fips_enabled; |
---|
| 15 | +extern struct atomic_notifier_head fips_fail_notif_chain; |
---|
| 16 | + |
---|
| 17 | +void fips_fail_notify(void); |
---|
| 18 | + |
---|
7 | 19 | #else |
---|
8 | 20 | #define fips_enabled 0 |
---|
| 21 | + |
---|
| 22 | +static inline void fips_fail_notify(void) {} |
---|
| 23 | + |
---|
9 | 24 | #endif |
---|
10 | 25 | |
---|
11 | 26 | #endif |
---|