ssl_pm.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef _SSL_PM_H_
  14. #define _SSL_PM_H_
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include <string.h>
  19. #include "ssl_types.h"
  20. #include "ssl_port.h"
  21. #define LOCAL_ATRR
  22. int ssl_pm_new(SSL *ssl);
  23. void ssl_pm_free(SSL *ssl);
  24. int ssl_pm_handshake(SSL *ssl);
  25. int ssl_pm_shutdown(SSL *ssl);
  26. int ssl_pm_clear(SSL *ssl);
  27. int ssl_pm_read(SSL *ssl, void *buffer, int len);
  28. int ssl_pm_send(SSL *ssl, const void *buffer, int len);
  29. int ssl_pm_pending(const SSL *ssl);
  30. void ssl_pm_set_fd(SSL *ssl, int fd, int mode);
  31. int ssl_pm_get_fd(const SSL *ssl, int mode);
  32. void ssl_pm_set_hostname(SSL *ssl, const char *hostname);
  33. OSSL_HANDSHAKE_STATE ssl_pm_get_state(const SSL *ssl);
  34. void ssl_pm_set_bufflen(SSL *ssl, int len);
  35. int x509_pm_show_info(X509 *x);
  36. int x509_pm_new(X509 *x, X509 *m_x);
  37. void x509_pm_free(X509 *x);
  38. int x509_pm_load(X509 *x, const unsigned char *buffer, int len);
  39. int pkey_pm_new(EVP_PKEY *pk, EVP_PKEY *m_pk);
  40. void pkey_pm_free(EVP_PKEY *pk);
  41. int pkey_pm_load(EVP_PKEY *pk, const unsigned char *buffer, int len);
  42. long ssl_pm_get_verify_result(const SSL *ssl);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif