summaryrefslogtreecommitdiffstats
path: root/src/plugins/quic/quic.c
diff options
context:
space:
mode:
authorMathias Raoul <mathias.raoul@gmail.com>2019-07-12 19:11:49 +0200
committerMathias Raoul <mathias.raoul@gmail.com>2019-07-15 23:29:21 +0200
commit9082b43dd06fcd8888eebd95857ef2fb8177d475 (patch)
treecb5e25ca9f2d686c3dc02c0370203842896f46a0 /src/plugins/quic/quic.c
parent4b0b0d4b53cec5eeb0e12fd7c4ce55cc4052ad0c (diff)
quic: integrate vpp crypto api for quic packets encryption
Type: feature Change-Id: I740f15a5ef959d31e94e59d652aa9f691db1f289 Signed-off-by: Mathias Raoul <mathias.raoul@gmail.com>
Diffstat (limited to 'src/plugins/quic/quic.c')
-rw-r--r--src/plugins/quic/quic.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index b46cdb3f018..6c1a3c37bd5 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -30,6 +30,8 @@
#include <picotls/openssl.h>
#include <picotls/pembase64.h>
+#include <quic/quic_crypto.h>
+
static quic_main_t quic_main;
static void quic_update_timer (quic_ctx_t * ctx);
@@ -2539,7 +2541,40 @@ quic_init (vlib_main_t * vm)
VLIB_INIT_FUNCTION (quic_init);
+static clib_error_t *
+quic_plugin_crypto_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "vpp"))
+ {
+ quic_tlsctx.cipher_suites = vpp_crypto_cipher_suites;
+ return 0;
+ }
+ else if (unformat (input, "picotls"))
+ {
+ quic_tlsctx.cipher_suites = ptls_openssl_cipher_suites;
+ return 0;
+ }
+ else
+ return clib_error_return (0, "unknown input '%U'",
+ format_unformat_error, input);
+ }
+
+ return clib_error_return (0, "unknown input '%U'",
+ format_unformat_error, input);
+}
+
/* *INDENT-OFF* */
+VLIB_CLI_COMMAND(quic_plugin_crypto_command, static)=
+{
+ .path = "quic set crypto api",
+ .short_help = "quic set crypto api [picotls, vpp]",
+ .function = quic_plugin_crypto_command_fn,
+};
+
VLIB_PLUGIN_REGISTER () =
{
.version = VPP_BUILD_VER,