FD.io VPP
v20.01-48-g3e0dafb74
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 */
27
u32
openssl_ctx_index
;
28
SSL_CTX *
ssl_ctx
;
29
SSL *
ssl
;
30
BIO *
rbio
;
31
BIO *
wbio
;
32
}
openssl_ctx_t
;
33
34
typedef
struct
tls_listen_ctx_opensl_
35
{
36
u32
openssl_lctx_index
;
37
SSL_CTX *
ssl_ctx
;
38
SSL *
ssl
;
39
X509 *
srvcert
;
40
EVP_PKEY *
pkey
;
41
}
openssl_listen_ctx_t
;
42
43
typedef
struct
openssl_main_
44
{
45
openssl_ctx_t
***
ctx_pool
;
46
openssl_listen_ctx_t
*
lctx_pool
;
47
48
/* API message ID base */
49
u16
msg_id_base
;
50
51
X509_STORE *
cert_store
;
52
u8
*
ciphers
;
53
int
engine_init
;
54
int
async
;
55
}
openssl_main_t
;
56
57
typedef
struct
openssl_tls_callback_
58
{
59
int (*callback) (SSL *
ssl
,
void
*arg);
60
void
*
arg
;
61
}
openssl_tls_callback_t
;
62
63
typedef
int
openssl_resume_handler
(
tls_ctx_t
*
ctx
,
session_t
* tls_session);
64
65
tls_ctx_t
*
openssl_ctx_get_w_thread
(
u32
ctx_index,
u8
thread_index);
66
openssl_tls_callback_t
*
vpp_add_async_pending_event
(
tls_ctx_t
*
ctx
,
67
openssl_resume_handler
*
68
handler);
69
int
vpp_add_async_run_event
(
tls_ctx_t
*
ctx
,
openssl_resume_handler
*
70
handler);
71
int
tls_async_openssl_callback
(SSL * s,
void
*evt);
72
void
openssl_polling_start
(ENGINE * engine);
73
int
openssl_engine_register
(
char
*engine,
char
*alg);
74
void
openssl_async_node_enable_disable
(
u8
is_en);
75
clib_error_t
*
tls_openssl_api_init
(
vlib_main_t
*
vm
);
76
int
tls_openssl_set_ciphers
(
char
*ciphers);
77
78
/*
79
* fd.io coding-style-patch-verification: ON
80
*
81
* Local Variables:
82
* eval: (c-set-style "gnu")
83
* End:
84
*/
tls.h
openssl_main_::lctx_pool
openssl_listen_ctx_t * lctx_pool
Definition:
tls_openssl.h:46
tls_listen_ctx_opensl_::ssl_ctx
SSL_CTX * ssl_ctx
Definition:
tls_openssl.h:37
session_
Definition:
session_types.h:173
openssl_main_t
struct openssl_main_ openssl_main_t
tls_ctx_openssl_::ssl
SSL * ssl
Definition:
tls_openssl.h:29
openssl_main_::cert_store
X509_STORE * cert_store
Definition:
tls_openssl.h:51
openssl_main_
Definition:
tls_openssl.h:43
tls_listen_ctx_opensl_::srvcert
X509 * srvcert
Definition:
tls_openssl.h:39
tls_listen_ctx_opensl_
Definition:
tls_openssl.h:34
openssl_ctx_get_w_thread
tls_ctx_t * openssl_ctx_get_w_thread(u32 ctx_index, u8 thread_index)
Definition:
tls_openssl.c:77
tls_openssl_api_init
clib_error_t * tls_openssl_api_init(vlib_main_t *vm)
Definition:
tls_openssl_api.c:65
u8
unsigned char u8
Definition:
types.h:56
openssl_tls_callback_::arg
void * arg
Definition:
tls_openssl.h:60
plugin.h
tls_ctx_openssl_::ssl_ctx
SSL_CTX * ssl_ctx
Definition:
tls_openssl.h:28
u32
unsigned int u32
Definition:
types.h:88
openssl_main_::async
int async
Definition:
tls_openssl.h:54
u16
unsigned short u16
Definition:
types.h:57
openssl_polling_start
void openssl_polling_start(ENGINE *engine)
tls_listen_ctx_opensl_::pkey
EVP_PKEY * pkey
Definition:
tls_openssl.h:40
tls_ctx_
Definition:
tls.h:58
vm
vlib_main_t * vm
Definition:
in2out_ed.c:1810
openssl_ctx_t
struct tls_ctx_openssl_ openssl_ctx_t
openssl_engine_register
int openssl_engine_register(char *engine, char *alg)
Definition:
tls_async.c:124
tls_listen_ctx_opensl_::openssl_lctx_index
u32 openssl_lctx_index
Definition:
tls_openssl.h:36
tls_ctx_openssl_::wbio
BIO * wbio
Definition:
tls_openssl.h:31
openssl_main_::ctx_pool
openssl_ctx_t *** ctx_pool
Definition:
tls_openssl.h:45
tls_async_openssl_callback
int tls_async_openssl_callback(SSL *s, void *evt)
Definition:
tls_async.c:248
openssl_tls_callback_
Definition:
tls_openssl.h:57
openssl_main_::engine_init
int engine_init
Definition:
tls_openssl.h:53
openssl_main_::msg_id_base
u16 msg_id_base
Definition:
tls_openssl.h:49
vpp_add_async_pending_event
openssl_tls_callback_t * vpp_add_async_pending_event(tls_ctx_t *ctx, openssl_resume_handler *handler)
Definition:
tls_async.c:284
openssl_resume_handler
int openssl_resume_handler(tls_ctx_t *ctx, session_t *tls_session)
Definition:
tls_openssl.h:63
tls_ctx_openssl_
Definition:
tls_openssl.h:24
openssl_listen_ctx_t
struct tls_listen_ctx_opensl_ openssl_listen_ctx_t
clib_error_t
Definition:
clib_error.h:21
openssl_tls_callback_t
struct openssl_tls_callback_ openssl_tls_callback_t
vlib_main_t
Definition:
main.h:83
openssl_async_node_enable_disable
void openssl_async_node_enable_disable(u8 is_en)
Definition:
tls_async.c:426
openssl_main_::ciphers
u8 * ciphers
Definition:
tls_openssl.h:52
tls_ctx_openssl_::openssl_ctx_index
u32 openssl_ctx_index
Definition:
tls_openssl.h:27
tls_ctx_openssl_::rbio
BIO * rbio
Definition:
tls_openssl.h:30
tls_ctx_openssl_::ctx
tls_ctx_t ctx
First.
Definition:
tls_openssl.h:26
vpp_add_async_run_event
int vpp_add_async_run_event(tls_ctx_t *ctx, openssl_resume_handler *handler)
Definition:
tls_async.c:314
tls_openssl_set_ciphers
int tls_openssl_set_ciphers(char *ciphers)
Definition:
tls_openssl.c:862
tls_listen_ctx_opensl_::ssl
SSL * ssl
Definition:
tls_openssl.h:38
src
plugins
tlsopenssl
tls_openssl.h
Generated on Wed Sep 9 2020 00:04:12 for FD.io VPP by
1.8.13