summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathiasRaoul <mathias.raoul@gmail.com>2019-11-28 11:04:59 +0000
committerDave Wallace <dwallacelf@gmail.com>2019-12-06 22:37:42 +0000
commit69885b72a982defbbfddec6c8e82efde88fbb86d (patch)
tree99b98330f28237d4c9bce32b6aac1ed5fd789c3a
parent8d820857d91efa9adca86e935e2d559d310ee2a1 (diff)
quic: update quicly to v0.0.7-vpp
Type: feature Change-Id: Ieeb9abb59b4d094bbd7bfc04a9007d3cebd645d7 Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
-rw-r--r--build/external/packages/quicly.mk4
-rw-r--r--build/external/patches/quicly_0.0.7-vpp/0001-cmake-install.patch60
-rw-r--r--src/plugins/quic/quic_crypto.c31
3 files changed, 85 insertions, 10 deletions
diff --git a/build/external/packages/quicly.mk b/build/external/packages/quicly.mk
index 07630d451d2..1b57c84b04e 100644
--- a/build/external/packages/quicly.mk
+++ b/build/external/packages/quicly.mk
@@ -11,9 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-quicly_version := 0.0.6-vpp
+quicly_version := 0.0.7-vpp
quicly_tarball := quicly_$(quicly_version).tar.gz
-quicly_tarball_md5sum := 416c29e455e0bd5025e32a3393fc3647
+quicly_tarball_md5sum := 2608aef70e3dc89406d3d20b71d02a4c
quicly_tarball_strip_dirs := 1
quicly_url := https://github.com/vpp-quic/quicly/releases/download/v$(quicly_version)/quicly_$(quicly_version).tar.gz
diff --git a/build/external/patches/quicly_0.0.7-vpp/0001-cmake-install.patch b/build/external/patches/quicly_0.0.7-vpp/0001-cmake-install.patch
new file mode 100644
index 00000000000..0ca7d2986d4
--- /dev/null
+++ b/build/external/patches/quicly_0.0.7-vpp/0001-cmake-install.patch
@@ -0,0 +1,60 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f5478d3..156df4c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -65,6 +65,8 @@ IF (WITH_DTRACE)
+ ENDIF ()
+ ENDIF ()
+
++SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
++
+ ADD_LIBRARY(quicly ${QUICLY_LIBRARY_FILES})
+
+ ADD_CUSTOM_COMMAND(
+@@ -84,6 +86,16 @@ TARGET_LINK_LIBRARIES(examples-echo quicly ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS}
+
+ ADD_EXECUTABLE(udpfw t/udpfw.c)
+
++INSTALL (
++ DIRECTORY ${CMAKE_SOURCE_DIR}/include/
++ DESTINATION include
++ FILES_MATCHING PATTERN "*.h")
++
++INSTALL(TARGETS quicly
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib)
++
+ ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} WITH_DTRACE=${WITH_DTRACE} prove --exec "sh -c" -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS cli test.t)
+Submodule deps/picotls contains untracked content
+Submodule deps/picotls contains modified content
+diff --git a/deps/picotls/CMakeLists.txt b/deps/picotls/CMakeLists.txt
+index 874b9be..14411e2 100644
+--- a/deps/picotls/CMakeLists.txt
++++ b/deps/picotls/CMakeLists.txt
+@@ -12,6 +12,7 @@ IF (WITH_DTRACE)
+ MESSAGE(STATUS "Enabling USDT support")
+ ENDIF ()
+
++SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
+ SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
+ INCLUDE_DIRECTORIES(
+ deps/cifra/src/ext
+@@ -131,6 +132,15 @@ ELSE ()
+ MESSAGE(WARNING "Disabling OpenSSL support (requires 1.0.1 or newer)")
+ ENDIF ()
+
++INSTALL (DIRECTORY ${CMAKE_SOURCE_DIR}/include/
++ DESTINATION include
++ FILES_MATCHING PATTERN "*.h")
++
++INSTALL(TARGETS picotls-core picotls-openssl
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib)
++
+ ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} prove --exec '' -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TEST_EXES} cli)
+
+ IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff --git a/src/plugins/quic/quic_crypto.c b/src/plugins/quic/quic_crypto.c
index 2223ab66eab..ca2eaced19e 100644
--- a/src/plugins/quic/quic_crypto.c
+++ b/src/plugins/quic/quic_crypto.c
@@ -136,12 +136,10 @@ aes256ctr_setup_crypto (ptls_cipher_context_t * ctx, int is_enc,
quic_crypto_cipher_encrypt);
}
-size_t
-quic_crypto_aead_encrypt (ptls_aead_context_t * _ctx, void *output,
- const void *input, size_t inlen, uint64_t seq,
- const void *iv, const void *aad, size_t aadlen)
+void
+quic_crypto_aead_encrypt_init (ptls_aead_context_t * _ctx, const void *iv,
+ const void *aad, size_t aadlen)
{
- vlib_main_t *vm = vlib_get_main ();
struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *) _ctx;
vnet_crypto_op_id_t id;
@@ -162,15 +160,30 @@ quic_crypto_aead_encrypt (ptls_aead_context_t * _ctx, void *output,
ctx->op.aad = (u8 *) aad;
ctx->op.aad_len = aadlen;
ctx->op.iv = (u8 *) iv;
+ ctx->op.key_index = ctx->key_index;
+}
+
+size_t
+quic_crypto_aead_encrypt_update (ptls_aead_context_t * _ctx, void *output,
+ const void *input, size_t inlen)
+{
+ struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *) _ctx;
ctx->op.src = (u8 *) input;
ctx->op.dst = output;
- ctx->op.key_index = ctx->key_index;
ctx->op.len = inlen;
-
ctx->op.tag_len = ctx->super.algo->tag_size;
ctx->op.tag = ctx->op.src + inlen;
+ return 0;
+}
+
+size_t
+quic_crypto_aead_encrypt_final (ptls_aead_context_t * _ctx, void *output)
+{
+ vlib_main_t *vm = vlib_get_main ();
+ struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *) _ctx;
+
vnet_crypto_process_ops (vm, &ctx->op, 1);
return ctx->op.len + ctx->op.tag_len;
@@ -246,7 +259,9 @@ quic_crypto_aead_setup_crypto (ptls_aead_context_t * _ctx, int is_enc,
}
ctx->super.do_decrypt = quic_crypto_aead_decrypt;
- ctx->super.do_encrypt = quic_crypto_aead_encrypt;
+ ctx->super.do_encrypt_init = quic_crypto_aead_encrypt_init;
+ ctx->super.do_encrypt_update = quic_crypto_aead_encrypt_update;
+ ctx->super.do_encrypt_final = quic_crypto_aead_encrypt_final;
ctx->super.dispose_crypto = quic_crypto_aead_dispose_crypto;
ctx->key_index = vnet_crypto_key_add (vm, algo,