Fix License in spec
[platform/upstream/libwebsockets.git] / lib / tls / openssl / private-lib-tls-openssl.h
1 /*
2  * libwebsockets - small server side websockets and web server implementation
3  *
4  * Copyright (C) 2010 - 2019 Andy Green <andy@warmcat.com>
5  *
6  *  This library is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Lesser General Public
8  *  License as published by the Free Software Foundation:
9  *  version 2.1 of the License.
10  *
11  *  This library is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  *  Lesser General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Lesser General Public
17  *  License along with this library; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  *  MA  02110-1301  USA
20  *
21  *  gencrypto openssl-specific helper declarations
22  */
23
24 /*
25  * one of these per different client context
26  * cc_owner is in lws_context.lws_context_tls
27  */
28
29 struct lws_tls_client_reuse {
30         lws_tls_ctx *ssl_client_ctx;
31         uint8_t hash[32];
32         struct lws_dll2 cc_list;
33         int refcount;
34         int index;
35 };
36
37 typedef int (*next_proto_cb)(SSL *, const unsigned char **out,
38                              unsigned char *outlen, const unsigned char *in,
39                              unsigned int inlen, void *arg);
40
41 struct lws_x509_cert {
42         X509 *cert; /* X509 is opaque, this has to be a pointer */
43 };
44
45 int
46 lws_gencrypto_openssl_hash_to_NID(enum lws_genhash_types hash_type);
47
48 const EVP_MD *
49 lws_gencrypto_openssl_hash_to_EVP_MD(enum lws_genhash_types hash_type);
50
51 #if !defined(LWS_HAVE_BN_bn2binpad)
52 int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
53 #endif