From 1b18fd3afe950eadfe824524dea548b0c3c07c4b Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 30 Aug 2019 11:18:59 +0100 Subject: [PATCH] ssl-opt.sh: Duplicate context serialization tests for CID This commit introduces a variant of each existing test for context serialization in ssl-opt.sh that also uses the DTLS Connection ID feature. --- tests/ssl-opt.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 67d3b9f85..0d7dba260 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -1290,6 +1290,15 @@ run_test "Context serialization, client serializes" \ -c "Deserializing connection..." \ -S "Deserializing connection..." +requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION +requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID +run_test "Context serialization, client serializes, with CID" \ + "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ + "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ + 0 \ + -c "Deserializing connection..." \ + -S "Deserializing connection..." + requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION run_test "Context serialization, server serializes" \ "$P_SRV dtls=1 serialize=1 exchanges=2" \ @@ -1298,6 +1307,15 @@ run_test "Context serialization, server serializes" \ -C "Deserializing connection..." \ -s "Deserializing connection..." +requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION +requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID +run_test "Context serialization, server serializes, with CID" \ + "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ + "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ + 0 \ + -C "Deserializing connection..." \ + -s "Deserializing connection..." + requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION run_test "Context serialization, both serialize" \ "$P_SRV dtls=1 serialize=1 exchanges=2" \ @@ -1306,6 +1324,15 @@ run_test "Context serialization, both serialize" \ -c "Deserializing connection..." \ -s "Deserializing connection..." +requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION +requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID +run_test "Context serialization, both serialize, with CID" \ + "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ + "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ + 0 \ + -c "Deserializing connection..." \ + -s "Deserializing connection..." + requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION run_test "Context serialization, re-init, client serializes" \ "$P_SRV dtls=1 serialize=0 exchanges=2" \ @@ -1314,6 +1341,15 @@ run_test "Context serialization, re-init, client serializes" \ -c "Deserializing connection..." \ -S "Deserializing connection..." +requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION +requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID +run_test "Context serialization, re-init, client serializes, with CID" \ + "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ + "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ + 0 \ + -c "Deserializing connection..." \ + -S "Deserializing connection..." + requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION run_test "Context serialization, re-init, server serializes" \ "$P_SRV dtls=1 serialize=2 exchanges=2" \ @@ -1322,6 +1358,15 @@ run_test "Context serialization, re-init, server serializes" \ -C "Deserializing connection..." \ -s "Deserializing connection..." +requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION +requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID +run_test "Context serialization, re-init, server serializes, with CID" \ + "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ + "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ + 0 \ + -C "Deserializing connection..." \ + -s "Deserializing connection..." + requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION run_test "Context serialization, re-init, both serialize" \ "$P_SRV dtls=1 serialize=2 exchanges=2" \ @@ -1330,6 +1375,15 @@ run_test "Context serialization, re-init, both serialize" \ -c "Deserializing connection..." \ -s "Deserializing connection..." +requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION +requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID +run_test "Context serialization, re-init, both serialize, with CID" \ + "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ + "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ + 0 \ + -c "Deserializing connection..." \ + -s "Deserializing connection..." + # Tests for DTLS Connection ID extension # So far, the CID API isn't implemented, so we can't