diff options
author | Ping Yu <ping.yu@intel.com> | 2018-05-30 18:16:08 -0400 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-06-15 01:30:23 +0000 |
commit | e43832c7e77b8b008ab452386b143bb3f7f5be40 (patch) | |
tree | c0cee763c6e2bdaaa758d15bf9a2638e4cbd1ea2 /src/plugins/tlsopenssl/tls_openssl.h | |
parent | d465631c3c97b4eb387b4b2dd851e301dc09e007 (diff) |
TLS async support
Change-Id: I26194e00dfb85e5cd1c65ff4e6ffd665be2d719b
Signed-off-by: Ping Yu <ping.yu@intel.com>
Diffstat (limited to 'src/plugins/tlsopenssl/tls_openssl.h')
-rw-r--r-- | src/plugins/tlsopenssl/tls_openssl.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/plugins/tlsopenssl/tls_openssl.h b/src/plugins/tlsopenssl/tls_openssl.h new file mode 100644 index 00000000000..b01814939af --- /dev/null +++ b/src/plugins/tlsopenssl/tls_openssl.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018 Intel and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <openssl/ssl.h> +#include <openssl/conf.h> +#include <openssl/err.h> +#include <openssl/engine.h> +#include <vnet/plugin/plugin.h> +#include <vpp/app/version.h> +#include <vnet/tls/tls.h> + +typedef struct tls_ctx_openssl_ +{ + tls_ctx_t ctx; /**< First */ + u32 openssl_ctx_index; + SSL_CTX *ssl_ctx; + SSL *ssl; + BIO *rbio; + BIO *wbio; + X509 *srvcert; + EVP_PKEY *pkey; +} openssl_ctx_t; + +typedef struct openssl_main_ +{ + openssl_ctx_t ***ctx_pool; + + X509_STORE *cert_store; + int engine_init; + int async; +} openssl_main_t; + +typedef struct openssl_tls_callback_ +{ + int (*callback) (void *arg); + void *arg; +} openssl_tls_callback_t; + +typedef int openssl_resume_handler (tls_ctx_t * ctx, + stream_session_t * tls_session); + +tls_ctx_t *openssl_ctx_get_w_thread (u32 ctx_index, u8 thread_index); +openssl_tls_callback_t *vpp_add_async_pending_event (tls_ctx_t * ctx, + openssl_resume_handler * + handler); +void openssl_polling_start (ENGINE * engine); +int openssl_engine_register (char *engine, char *alg); +void openssl_async_node_enable_disable (u8 is_en); + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ |