tls: change picotls plugin crypto module to accommodate new version picotls 09/32609/3
authorSimon Zhang <yuwei1.zhang@intel.com>
Mon, 7 Jun 2021 15:19:33 +0000 (23:19 +0800)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 7 Jun 2021 15:14:30 +0000 (15:14 +0000)
Type: fix

Change-Id: I58931e235535be7d596ca578790f389b64a4fbd2
Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
src/plugins/tlspicotls/CMakeLists.txt
src/plugins/tlspicotls/pico_vpp_crypto.c

index 64f6071..f23ae6c 100644 (file)
@@ -33,7 +33,7 @@ if(QUICLY_INCLUDE_DIR AND PICOTLS_INCLUDE_DIR AND PICOTLS_LINK_LIBRARIES)
         pico_vpp_crypto.c
         certs.c
 
-        LINK_LIBRARIES ${PICOTLS_LINK_LIBRARIES}
+        LINK_LIBRARIES ${PICOTLS_LINK_LIBRARIES} ${OPENSSL_LIBRARIES}
     )
     message (STATUS "Found picotls in ${PICOTLS_INCLUDE_DIR} and ${PICOTLS_CORE_LIBRARY}")
   else()
index 049b051..9af0f2f 100644 (file)
@@ -141,7 +141,8 @@ ptls_vpp_crypto_aead_decrypt (ptls_aead_context_t *_ctx, void *_output,
   ctx->op.dst = _output;
   ctx->op.src = (void *) input;
   ctx->op.len = inlen - tag_size;;
-  ctx->op.iv = ctx->static_iv;
+  ctx->op.iv = ctx->iv;
+  ptls_aead__build_iv (ctx->super.algo, ctx->op.iv, ctx->static_iv, seq);
   ctx->op.aad = (void *) aad;
   ctx->op.aad_len = aadlen;
   ctx->op.tag = (void *) input + inlen - tag_size;
@@ -160,7 +161,6 @@ ptls_vpp_crypto_aead_encrypt_init (ptls_aead_context_t *_ctx, uint64_t seq,
   struct vpp_aead_context_t *ctx = (struct vpp_aead_context_t *) _ctx;
   ctx->op.iv = ctx->iv;
   ptls_aead__build_iv (ctx->super.algo, ctx->op.iv, ctx->static_iv, seq);
-  ctx->op.iv = ctx->static_iv;
   ctx->op.aad = (void *) aad;
   ctx->op.aad_len = aadlen;
   ctx->op.n_chunks = 2;