From 37d417561d855f81f5ff15b3d71b9757a50f5f65 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 26 Apr 2018 15:06:56 +0200 Subject: [PATCH] Add test case for SSL async resume after resume Add a test case for SSL asynchronous signature where f_async_resume is called twice. Verify that f_async_sign_start is only called once. This serves as a non-regression test for a bug where f_async_sign_start was only called once, which turned out to be due to a stale build artifacts with mismatched numerical values of MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS. --- tests/ssl-opt.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 6261225b2..bf7d914b2 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -4088,6 +4088,18 @@ run_test "SSL async private: sign, delay=1" \ -s "Async resume (slot [0-9]): call 0 more times." \ -s "Async resume (slot [0-9]): sign done, status=0" +requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE +run_test "SSL async private: sign, delay=2" \ + "$P_SRV \ + async_operations=s async_private_delay1=2 async_private_delay2=2" \ + "$P_CLI" \ + 0 \ + -s "Async sign callback: using key slot " \ + -U "Async sign callback: using key slot " \ + -s "Async resume (slot [0-9]): call 1 more times." \ + -s "Async resume (slot [0-9]): call 0 more times." \ + -s "Async resume (slot [0-9]): sign done, status=0" + # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE