private-lib-tls-openssl.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * libwebsockets - small server side websockets and web server implementation
  3. *
  4. * Copyright (C) 2010 - 2019 Andy Green <[email protected]>
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to
  8. * deal in the Software without restriction, including without limitation the
  9. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10. * sell copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  22. * IN THE SOFTWARE.
  23. *
  24. * gencrypto openssl-specific helper declarations
  25. */
  26. #if !defined(__LWS_PRIVATE_LIB_TLS_OPENSSL_H__)
  27. #define __LWS_PRIVATE_LIB_TLS_OPENSSL_H__
  28. /*
  29. * one of these per different client context
  30. * cc_owner is in lws_context.lws_context_tls
  31. */
  32. struct lws_tls_client_reuse {
  33. lws_tls_ctx *ssl_client_ctx;
  34. uint8_t hash[32];
  35. struct lws_dll2 cc_list;
  36. int refcount;
  37. int index;
  38. };
  39. typedef int (*next_proto_cb)(SSL *, const unsigned char **out,
  40. unsigned char *outlen, const unsigned char *in,
  41. unsigned int inlen, void *arg);
  42. struct lws_x509_cert {
  43. X509 *cert; /* X509 is opaque, this has to be a pointer */
  44. };
  45. int
  46. lws_gencrypto_openssl_hash_to_NID(enum lws_genhash_types hash_type);
  47. const EVP_MD *
  48. lws_gencrypto_openssl_hash_to_EVP_MD(enum lws_genhash_types hash_type);
  49. #if !defined(LWS_HAVE_BN_bn2binpad)
  50. int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
  51. #endif
  52. #endif