BSecurity.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * @file BSecurity.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * This file is part of BadVPN.
  8. *
  9. * BadVPN is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * BadVPN is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. *
  22. * @section DESCRIPTION
  23. *
  24. * Initialization of OpenSSL for security functions.
  25. */
  26. #ifndef BADVPN_SECURITY_BSECURITY_H
  27. #define BADVPN_SECURITY_BSECURITY_H
  28. /**
  29. * Initializes thread safety for security functions.
  30. * Thread safety must not be initialized.
  31. *
  32. * @return 1 on success, 0 on failure
  33. */
  34. int BSecurity_GlobalInitThreadSafe (void);
  35. /**
  36. * Deinitializes thread safety for security functions.
  37. * Thread safety must be initialized.
  38. */
  39. void BSecurity_GlobalFreeThreadSafe (void);
  40. /**
  41. * Asserts that {@link BSecurity_GlobalInitThreadSafe} was done,
  42. * if thread_safe=1.
  43. *
  44. * @param thread_safe whether thread safety is to be asserted.
  45. * Must be 0 or 1.
  46. */
  47. void BSecurity_GlobalAssertThreadSafe (int thread_safe);
  48. #endif