fips.h 514 B

1234567891011121314151617181920212223242526
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _FIPS_H
  3. #define _FIPS_H
  4. #ifdef BUILD_FIPS140_KO
  5. /*
  6. * In fips140.ko, enable the behavior that the upstream fips_enabled flag
  7. * controls, such as the XTS weak key check.
  8. */
  9. #define fips_enabled 1
  10. #define CONFIG_CRYPTO_FIPS 1
  11. #elif defined(CONFIG_CRYPTO_FIPS)
  12. extern int fips_enabled;
  13. extern struct atomic_notifier_head fips_fail_notif_chain;
  14. void fips_fail_notify(void);
  15. #else
  16. #define fips_enabled 0
  17. static inline void fips_fail_notify(void) {}
  18. #endif
  19. #endif