FD.io VPP  v21.01.1
Vector Packet Processing
tls_openssl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Intel and/or its affiliates.
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  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <openssl/ssl.h>
17 #include <openssl/conf.h>
18 #include <openssl/err.h>
19 #include <openssl/engine.h>
20 #include <vnet/plugin/plugin.h>
21 #include <vpp/app/version.h>
22 #include <vnet/tls/tls.h>
23 
24 typedef struct tls_ctx_openssl_
25 {
26  tls_ctx_t ctx; /**< First */
28  SSL_CTX *ssl_ctx;
29  SSL *ssl;
30  BIO *rbio;
31  BIO *wbio;
33 
34 typedef struct tls_listen_ctx_opensl_
35 {
37  SSL_CTX *ssl_ctx;
38  SSL *ssl;
39  X509 *srvcert;
40  EVP_PKEY *pkey;
42 
43 typedef struct openssl_main_
44 {
47 
48  /* API message ID base */
50 
51  X509_STORE *cert_store;
54  int async;
56 
57 typedef int openssl_resume_handler (tls_ctx_t * ctx, session_t * tls_session);
58 
59 tls_ctx_t *openssl_ctx_get_w_thread (u32 ctx_index, u8 thread_index);
61  openssl_resume_handler * handler,
62  session_t * session);
63 int vpp_tls_async_update_event (tls_ctx_t * ctx, int eagain);
64 int tls_async_openssl_callback (SSL * s, void *evt);
65 int openssl_evt_free (int event_idx, u8 thread_index);
66 void openssl_polling_start (ENGINE * engine);
67 int openssl_engine_register (char *engine, char *alg, int async);
70 int tls_openssl_set_ciphers (char *ciphers);
72 
73 /*
74  * fd.io coding-style-patch-verification: ON
75  *
76  * Local Variables:
77  * eval: (c-set-style "gnu")
78  * End:
79  */
openssl_listen_ctx_t * lctx_pool
Definition: tls_openssl.h:46
struct openssl_main_ openssl_main_t
int openssl_evt_free(int event_idx, u8 thread_index)
Definition: tls_async.c:212
X509_STORE * cert_store
Definition: tls_openssl.h:51
tls_ctx_t * openssl_ctx_get_w_thread(u32 ctx_index, u8 thread_index)
Definition: tls_openssl.c:80
vlib_main_t * vm
Definition: in2out_ed.c:1580
clib_error_t * tls_openssl_api_init(vlib_main_t *vm)
unsigned char u8
Definition: types.h:56
int vpp_openssl_is_inflight(tls_ctx_t *ctx)
Definition: tls_async.c:306
SSL_CTX * ssl_ctx
Definition: tls_openssl.h:28
#define event_idx
Definition: tls_async.c:41
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
void openssl_polling_start(ENGINE *engine)
Definition: tls.h:58
int vpp_tls_async_init_event(tls_ctx_t *ctx, openssl_resume_handler *handler, session_t *session)
Definition: tls_async.c:280
struct tls_ctx_openssl_ openssl_ctx_t
openssl_ctx_t *** ctx_pool
Definition: tls_openssl.h:45
int tls_async_openssl_callback(SSL *s, void *evt)
Definition: tls_async.c:243
int vpp_tls_async_update_event(tls_ctx_t *ctx, int eagain)
Definition: tls_async.c:319
int openssl_resume_handler(tls_ctx_t *ctx, session_t *tls_session)
Definition: tls_openssl.h:57
int openssl_engine_register(char *engine, char *alg, int async)
Definition: tls_async.c:116
struct tls_listen_ctx_opensl_ openssl_listen_ctx_t
void openssl_async_node_enable_disable(u8 is_en)
Definition: tls_async.c:412
tls_ctx_t ctx
First.
Definition: tls_openssl.h:26
int tls_openssl_set_ciphers(char *ciphers)
Definition: tls_openssl.c:912