engine.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/engine.h>
  7. """
  8. TYPES = """
  9. typedef ... ENGINE;
  10. typedef ... UI_METHOD;
  11. static const long Cryptography_HAS_ENGINE;
  12. """
  13. FUNCTIONS = """
  14. ENGINE *ENGINE_by_id(const char *);
  15. int ENGINE_init(ENGINE *);
  16. int ENGINE_finish(ENGINE *);
  17. ENGINE *ENGINE_get_default_RAND(void);
  18. int ENGINE_set_default_RAND(ENGINE *);
  19. void ENGINE_unregister_RAND(ENGINE *);
  20. int ENGINE_ctrl_cmd(ENGINE *, const char *, long, void *, void (*)(void), int);
  21. int ENGINE_free(ENGINE *);
  22. const char *ENGINE_get_name(const ENGINE *);
  23. // These bindings are unused by cryptography or pyOpenSSL but are present
  24. // for advanced users who need them.
  25. int ENGINE_ctrl_cmd_string(ENGINE *, const char *, const char *, int);
  26. void ENGINE_load_builtin_engines(void);
  27. EVP_PKEY *ENGINE_load_private_key(ENGINE *, const char *, UI_METHOD *, void *);
  28. EVP_PKEY *ENGINE_load_public_key(ENGINE *, const char *, UI_METHOD *, void *);
  29. """
  30. CUSTOMIZATIONS = """
  31. #ifdef OPENSSL_NO_ENGINE
  32. static const long Cryptography_HAS_ENGINE = 0;
  33. ENGINE *(*ENGINE_by_id)(const char *) = NULL;
  34. int (*ENGINE_init)(ENGINE *) = NULL;
  35. int (*ENGINE_finish)(ENGINE *) = NULL;
  36. ENGINE *(*ENGINE_get_default_RAND)(void) = NULL;
  37. int (*ENGINE_set_default_RAND)(ENGINE *) = NULL;
  38. void (*ENGINE_unregister_RAND)(ENGINE *) = NULL;
  39. int (*ENGINE_ctrl_cmd)(ENGINE *, const char *, long, void *,
  40. void (*)(void), int) = NULL;
  41. int (*ENGINE_free)(ENGINE *) = NULL;
  42. const char *(*ENGINE_get_id)(const ENGINE *) = NULL;
  43. const char *(*ENGINE_get_name)(const ENGINE *) = NULL;
  44. int (*ENGINE_ctrl_cmd_string)(ENGINE *, const char *, const char *,
  45. int) = NULL;
  46. void (*ENGINE_load_builtin_engines)(void) = NULL;
  47. EVP_PKEY *(*ENGINE_load_private_key)(ENGINE *, const char *, UI_METHOD *,
  48. void *) = NULL;
  49. EVP_PKEY *(*ENGINE_load_public_key)(ENGINE *, const char *,
  50. UI_METHOD *, void *) = NULL;
  51. #else
  52. static const long Cryptography_HAS_ENGINE = 1;
  53. #endif
  54. """