server-tls.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* server-tls.h
  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. #ifndef _SERVER_TLS_
  22. #define _SERVER_TLS_
  23. #include <wolfssl/wolfcrypt/settings.h> /* includes wolfSSL user-settings.h */
  24. #include <wolfssl/ssl.h>
  25. #include "sdkconfig.h"
  26. #if defined(SINGLE_THREADED)
  27. #define WOLFSSL_ESP_TASK int
  28. #else
  29. #include "freertos/FreeRTOS.h"
  30. #define WOLFSSL_ESP_TASK void
  31. #endif
  32. #ifdef CONFIG_WOLFSSL_TARGET_PORT
  33. #define TLS_SMP_DEFAULT_PORT CONFIG_WOLFSSL_TARGET_PORT
  34. #else
  35. #define TLS_SMP_DEFAULT_PORT 11111
  36. #endif
  37. typedef struct {
  38. int port;
  39. int loops;
  40. } tls_args;
  41. /* Function to show the ciphers available / in use. */
  42. #if defined(DEBUG_WOLFSSL)
  43. int ShowCiphers(WOLFSSL* ssl);
  44. #endif
  45. /* This is the TLS Server function, possibly in an RTOS thread. */
  46. WOLFSSL_ESP_TASK tls_smp_server_task(void *args);
  47. /* init will create an RTOS task, otherwise server is simply function call. */
  48. #if defined(SINGLE_THREADED)
  49. /* no init needed */
  50. #else
  51. WOLFSSL_ESP_TASK tls_smp_server_init(void* args);
  52. #endif
  53. #endif /* _SERVER_TLS_ */