1
0

ada_binding.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* ada_binding.c
  2. *
  3. * Copyright (C) 2006-2024 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. #ifdef HAVE_CONFIG_H
  22. #include <config.h>
  23. #endif
  24. /* wolfSSL */
  25. #include <wolfssl/wolfcrypt/settings.h>
  26. #include <wolfssl/ssl.h>
  27. /* These functions give access to the integer values of the enumeration
  28. constants used in WolfSSL. These functions make it possible
  29. for the WolfSSL implementation to change the values of the constants
  30. without the need to make a corresponding change in the Ada code. */
  31. extern int get_wolfssl_error_want_read(void);
  32. extern int get_wolfssl_error_want_write(void);
  33. extern int get_wolfssl_max_error_size (void);
  34. extern int get_wolfssl_success(void);
  35. extern int get_wolfssl_failure(void);
  36. extern int get_wolfssl_verify_none(void);
  37. extern int get_wolfssl_verify_peer(void);
  38. extern int get_wolfssl_verify_fail_if_no_peer_cert(void);
  39. extern int get_wolfssl_verify_client_once(void);
  40. extern int get_wolfssl_verify_post_handshake(void);
  41. extern int get_wolfssl_verify_fail_except_psk(void);
  42. extern int get_wolfssl_verify_default(void);
  43. extern int get_wolfssl_filetype_asn1(void);
  44. extern int get_wolfssl_filetype_pem(void);
  45. extern int get_wolfssl_filetype_default(void);
  46. extern int get_wolfssl_error_want_read(void) {
  47. return WOLFSSL_ERROR_WANT_READ;
  48. }
  49. extern int get_wolfssl_error_want_write(void) {
  50. return WOLFSSL_ERROR_WANT_WRITE;
  51. }
  52. extern int get_wolfssl_max_error_size(void) {
  53. return WOLFSSL_MAX_ERROR_SZ;
  54. }
  55. extern int get_wolfssl_success(void) {
  56. return WOLFSSL_SUCCESS;
  57. }
  58. extern int get_wolfssl_failure(void) {
  59. return WOLFSSL_FAILURE;
  60. }
  61. extern int get_wolfssl_verify_none(void) {
  62. return WOLFSSL_VERIFY_NONE;
  63. }
  64. extern int get_wolfssl_verify_peer(void) {
  65. return WOLFSSL_VERIFY_PEER;
  66. }
  67. extern int get_wolfssl_verify_fail_if_no_peer_cert(void) {
  68. return WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT;
  69. }
  70. extern int get_wolfssl_verify_client_once(void) {
  71. return WOLFSSL_VERIFY_CLIENT_ONCE;
  72. }
  73. extern int get_wolfssl_verify_post_handshake(void) {
  74. return WOLFSSL_VERIFY_POST_HANDSHAKE;
  75. }
  76. extern int get_wolfssl_verify_fail_except_psk(void) {
  77. return WOLFSSL_VERIFY_FAIL_EXCEPT_PSK;
  78. }
  79. extern int get_wolfssl_verify_default(void) {
  80. return WOLFSSL_VERIFY_DEFAULT;
  81. }
  82. extern int get_wolfssl_filetype_asn1(void) {
  83. return WOLFSSL_FILETYPE_ASN1;
  84. }
  85. extern int get_wolfssl_filetype_pem(void) {
  86. return WOLFSSL_FILETYPE_PEM;
  87. }
  88. extern int get_wolfssl_filetype_default(void) {
  89. return WOLFSSL_FILETYPE_DEFAULT;
  90. }