fips.py 641 B

12345678910111213141516171819202122232425262728
  1. # This file is dual licensed under the terms of the Apache License, Version
  2. # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  3. # for complete details.
  4. from __future__ import absolute_import, division, print_function
  5. INCLUDES = """
  6. #include <openssl/crypto.h>
  7. """
  8. TYPES = """
  9. static const long Cryptography_HAS_FIPS;
  10. """
  11. FUNCTIONS = """
  12. int FIPS_mode_set(int);
  13. int FIPS_mode(void);
  14. """
  15. CUSTOMIZATIONS = """
  16. #if CRYPTOGRAPHY_IS_LIBRESSL
  17. static const long Cryptography_HAS_FIPS = 0;
  18. int (*FIPS_mode_set)(int) = NULL;
  19. int (*FIPS_mode)(void) = NULL;
  20. #else
  21. static const long Cryptography_HAS_FIPS = 1;
  22. #endif
  23. """