wolfssl.i 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* wolfssl.i
  2. *
  3. * Copyright (C) 2006-2021 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. %module wolfssl
  22. %{
  23. #include <wolfssl/ssl.h>
  24. #include <wolfssl/wolfcrypt/rsa.h>
  25. #include <wolfssl/wolfcrypt/pwdbased.h>
  26. /* defn adds */
  27. char* wolfSSL_error_string(int err);
  28. int wolfSSL_swig_connect(WOLFSSL*, const char* server, int port);
  29. WC_RNG* GetRng(void);
  30. RsaKey* GetRsaPrivateKey(const char* file);
  31. void FillSignStr(unsigned char*, const char*, int);
  32. %}
  33. WOLFSSL_METHOD* wolfTLSv1_2_client_method(void);
  34. WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD*);
  35. int wolfSSL_CTX_load_verify_locations(WOLFSSL_CTX*, const char*, const char*);
  36. WOLFSSL* wolfSSL_new(WOLFSSL_CTX*);
  37. int wolfSSL_get_error(WOLFSSL*, int);
  38. int wolfSSL_write(WOLFSSL*, const char*, int);
  39. int wolfSSL_Debugging_ON(void);
  40. int wolfSSL_Init(void);
  41. char* wolfSSL_error_string(int);
  42. int wolfSSL_swig_connect(WOLFSSL*, const char* server, int port);
  43. int wc_PKCS12_PBKDF(unsigned char* output, const unsigned char* passwd, int pLen, const unsigned char* salt,
  44. int sLen, int iterations, int kLen, int hashType, int purpose);
  45. int wc_RsaSSL_Sign(const unsigned char* in, int inLen, unsigned char* out, int outLen, RsaKey* key, WC_RNG* rng);
  46. int wc_RsaSSL_Verify(const unsigned char* in, int inLen, unsigned char* out, int outLen, RsaKey* key);
  47. WC_RNG* GetRng(void);
  48. RsaKey* GetRsaPrivateKey(const char* file);
  49. void FillSignStr(unsigned char*, const char*, int);
  50. %include carrays.i
  51. %include cdata.i
  52. %array_class(unsigned char, byteArray);
  53. int wolfSSL_read(WOLFSSL*, unsigned char*, int);
  54. #define SSL_FAILURE 0
  55. #define SSL_SUCCESS 1