1
0

ada_binding.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* ada_binding.c
  2. *
  3. * Copyright (C) 2006-2023 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. /* wolfSSL */
  22. #include <wolfssl/wolfcrypt/settings.h>
  23. #include <wolfssl/ssl.h>
  24. /* These functions give access to the integer values of the enumeration
  25. constants used in WolfSSL. These functions make it possible
  26. for the WolfSSL implementation to change the values of the constants
  27. without the need to make a corresponding change in the Ada code. */
  28. extern int get_wolfssl_error_want_read(void);
  29. extern int get_wolfssl_error_want_write(void);
  30. extern int get_wolfssl_max_error_size (void);
  31. extern int get_wolfssl_success(void);
  32. extern int get_wolfssl_failure(void);
  33. extern int get_wolfssl_verify_none(void);
  34. extern int get_wolfssl_verify_peer(void);
  35. extern int get_wolfssl_verify_fail_if_no_peer_cert(void);
  36. extern int get_wolfssl_verify_client_once(void);
  37. extern int get_wolfssl_verify_post_handshake(void);
  38. extern int get_wolfssl_verify_fail_except_psk(void);
  39. extern int get_wolfssl_verify_default(void);
  40. extern int get_wolfssl_filetype_asn1(void);
  41. extern int get_wolfssl_filetype_pem(void);
  42. extern int get_wolfssl_filetype_default(void);
  43. extern int get_wolfssl_error_want_read(void) {
  44. return WOLFSSL_ERROR_WANT_READ;
  45. }
  46. extern int get_wolfssl_error_want_write(void) {
  47. return WOLFSSL_ERROR_WANT_WRITE;
  48. }
  49. extern int get_wolfssl_max_error_size(void) {
  50. return WOLFSSL_MAX_ERROR_SZ;
  51. }
  52. extern int get_wolfssl_success(void) {
  53. return WOLFSSL_SUCCESS;
  54. }
  55. extern int get_wolfssl_failure(void) {
  56. return WOLFSSL_FAILURE;
  57. }
  58. extern int get_wolfssl_verify_none(void) {
  59. return WOLFSSL_VERIFY_NONE;
  60. }
  61. extern int get_wolfssl_verify_peer(void) {
  62. return WOLFSSL_VERIFY_PEER;
  63. }
  64. extern int get_wolfssl_verify_fail_if_no_peer_cert(void) {
  65. return WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT;
  66. }
  67. extern int get_wolfssl_verify_client_once(void) {
  68. return WOLFSSL_VERIFY_CLIENT_ONCE;
  69. }
  70. extern int get_wolfssl_verify_post_handshake(void) {
  71. return WOLFSSL_VERIFY_POST_HANDSHAKE;
  72. }
  73. extern int get_wolfssl_verify_fail_except_psk(void) {
  74. return WOLFSSL_VERIFY_FAIL_EXCEPT_PSK;
  75. }
  76. extern int get_wolfssl_verify_default(void) {
  77. return WOLFSSL_VERIFY_DEFAULT;
  78. }
  79. extern int get_wolfssl_filetype_asn1(void) {
  80. return WOLFSSL_FILETYPE_ASN1;
  81. }
  82. extern int get_wolfssl_filetype_pem(void) {
  83. return WOLFSSL_FILETYPE_PEM;
  84. }
  85. extern int get_wolfssl_filetype_default(void) {
  86. return WOLFSSL_FILETYPE_DEFAULT;
  87. }