fips_status.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2019, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _FIPS_STATUS__H
  7. #define _FIPS_STATUS__H
  8. #include <linux/types.h>
  9. #include <linux/ioctl.h>
  10. /**
  11. * fips_status: global FIPS140-2 status
  12. * @FIPS140_STATUS_NA:
  13. * Not a FIPS140-2 compliant Build.
  14. * The flag status won't
  15. * change throughout
  16. * the lifetime
  17. * @FIPS140_STATUS_PASS_CRYPTO:
  18. * KAT self tests are passed.
  19. * @FIPS140_STATUS_QCRYPTO_ALLOWED:
  20. * Integrity test is passed.
  21. * @FIPS140_STATUS_PASS:
  22. * All tests are passed and build
  23. * is in FIPS140-2 mode
  24. * @FIPS140_STATUS_FAIL:
  25. * One of the test is failed.
  26. * This will block all requests
  27. * to crypto modules
  28. */
  29. enum fips_status {
  30. FIPS140_STATUS_NA = 0,
  31. FIPS140_STATUS_PASS_CRYPTO = 1,
  32. FIPS140_STATUS_QCRYPTO_ALLOWED = 2,
  33. FIPS140_STATUS_PASS = 3,
  34. FIPS140_STATUS_FAIL = 0xFF
  35. };
  36. #endif /* _FIPS_STATUS__H */