Type: fix
Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: Ib454ccae5a81f91a744db82b72c7f1fcb29aa0cc
#include <picotls/openssl.h>
#include <picotls.h>
#include <picotls/openssl.h>
#include <picotls.h>
-#include "pico_vpp_crypto.h"
+#include <tlspicotls/pico_vpp_crypto.h>
+#include <tlspicotls/tls_picotls.h>
typedef void (*ptls_vpp_do_transform_fn) (ptls_cipher_context_t *, void *,
const void *, size_t);
vnet_crypto_main_t *cm = &crypto_main;
typedef void (*ptls_vpp_do_transform_fn) (ptls_cipher_context_t *, void *,
const void *, size_t);
vnet_crypto_main_t *cm = &crypto_main;
+extern picotls_main_t picotls_main;
struct cipher_context_t
{
struct cipher_context_t
{
+ clib_rwlock_writer_lock (&picotls_main.crypto_keys_rw_lock);
ctx->key_index = vnet_crypto_key_add (vm, algo,
(u8 *) key, _ctx->algo->key_size);
ctx->key_index = vnet_crypto_key_add (vm, algo,
(u8 *) key, _ctx->algo->key_size);
+ clib_rwlock_writer_unlock (&picotls_main.crypto_keys_rw_lock);
+ clib_rwlock_writer_lock (&picotls_main.crypto_keys_rw_lock);
ctx->op.key_index =
vnet_crypto_key_add (vm, ctx->alg, (void *) key, key_len);
ctx->op.key_index =
vnet_crypto_key_add (vm, ctx->alg, (void *) key, key_len);
+ clib_rwlock_writer_unlock (&picotls_main.crypto_keys_rw_lock);
ctx->chunk_index = 0;
ctx->super.do_decrypt = ptls_vpp_crypto_aead_decrypt;
ctx->chunk_index = 0;
ctx->super.do_decrypt = ptls_vpp_crypto_aead_decrypt;
-#include "certs.h"
-#include "tls_picotls.h"
-#include "pico_vpp_crypto.h"
+#include <tlspicotls/certs.h>
+#include <tlspicotls/tls_picotls.h>
+#include <tlspicotls/pico_vpp_crypto.h>
picotls_main_t picotls_main;
picotls_main_t picotls_main;
vec_validate (pm->ctx_pool, num_threads - 1);
vec_validate (pm->ctx_pool, num_threads - 1);
+ clib_rwlock_init (&picotls_main.crypto_keys_rw_lock);
+
tls_register_engine (&picotls_engine, CRYPTO_ENGINE_PICOTLS);
return error;
tls_register_engine (&picotls_engine, CRYPTO_ENGINE_PICOTLS);
return error;
{
picotls_ctx_t ***ctx_pool;
picotls_listen_ctx_t *lctx_pool;
{
picotls_ctx_t ***ctx_pool;
picotls_listen_ctx_t *lctx_pool;
+ clib_rwlock_t crypto_keys_rw_lock;
} picotls_main_t;
#endif /* __included_quic_certs_h__ */
} picotls_main_t;
#endif /* __included_quic_certs_h__ */