mbedtls.sh 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/usr/bin/env bash
  2. set -e
  3. set -x
  4. # Basic TLS test
  5. ./mbedtls/build/programs/ssl/ssl_server2 > /tmp/server.log 2>&1 &
  6. SERVER_PID=$!
  7. sleep 0.1
  8. ./mbedtls/build/programs/ssl/ssl_client2 # Confirm working with mbed
  9. env -C wolfssl ./examples/client/client -p 4433 -g \
  10. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  11. -c ../mbedtls/framework/data_files/cli-rsa-sha256.crt \
  12. -k ../mbedtls/framework/data_files/cli-rsa-sha256.key.pem
  13. kill $SERVER_PID
  14. sleep 0.1
  15. env -C wolfssl ./examples/server/server -p 4433 -i -g \
  16. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  17. -c ../mbedtls/framework/data_files/server2-sha256.crt \
  18. -k ../mbedtls/framework/data_files/server2.key.pem > /tmp/server.log 2>&1 &
  19. SERVER_PID=$!
  20. sleep 0.1
  21. ./mbedtls/build/programs/ssl/ssl_client2
  22. env -C wolfssl ./examples/client/client -p 4433 -g \
  23. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  24. -c ../mbedtls/framework/data_files/cli-rsa-sha256.crt \
  25. -k ../mbedtls/framework/data_files/cli-rsa-sha256.key.pem
  26. kill $SERVER_PID
  27. sleep 0.1
  28. # Basic DTLS test
  29. ./mbedtls/build/programs/ssl/ssl_server2 dtls=1 > /tmp/server.log 2>&1 &
  30. SERVER_PID=$!
  31. sleep 0.1
  32. ./mbedtls/build/programs/ssl/ssl_client2 dtls=1 # Confirm working with mbed
  33. env -C wolfssl ./examples/client/client -p 4433 -g -u \
  34. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  35. -c ../mbedtls/framework/data_files/cli-rsa-sha256.crt \
  36. -k ../mbedtls/framework/data_files/cli-rsa-sha256.key.pem
  37. kill $SERVER_PID
  38. sleep 0.1
  39. env -C wolfssl ./examples/server/server -p 4433 -i -g -u \
  40. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  41. -c ../mbedtls/framework/data_files/server2-sha256.crt \
  42. -k ../mbedtls/framework/data_files/server2.key.pem > /tmp/server.log 2>&1 &
  43. SERVER_PID=$!
  44. sleep 0.1
  45. env -C wolfssl ./examples/client/client -p 4433 -g -u \
  46. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  47. -c ../mbedtls/framework/data_files/cli-rsa-sha256.crt \
  48. -k ../mbedtls/framework/data_files/cli-rsa-sha256.key.pem
  49. ./mbedtls/build/programs/ssl/ssl_client2 dtls=1
  50. kill $SERVER_PID
  51. sleep 0.1
  52. # DTLS 1.2 CID test
  53. ./mbedtls/build/programs/ssl/ssl_server2 dtls=1 cid=1 cid_val=121212 > /tmp/server.log 2>&1 &
  54. SERVER_PID=$!
  55. sleep 0.1
  56. ./mbedtls/build/programs/ssl/ssl_client2 dtls=1 cid=1 cid_val=232323 # Confirm working with mbed
  57. env -C wolfssl ./examples/client/client -p 4433 -g -u --cid 232323 \
  58. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  59. -c ../mbedtls/framework/data_files/cli-rsa-sha256.crt \
  60. -k ../mbedtls/framework/data_files/cli-rsa-sha256.key.pem
  61. kill $SERVER_PID
  62. sleep 0.1
  63. env -C wolfssl ./examples/server/server -p 4433 -i -g -u --cid 121212 \
  64. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  65. -c ../mbedtls/framework/data_files/server2-sha256.crt \
  66. -k ../mbedtls/framework/data_files/server2.key.pem > /tmp/server.log 2>&1 &
  67. SERVER_PID=$!
  68. sleep 0.1
  69. ./mbedtls/build/programs/ssl/ssl_client2 dtls=1 cid_val=232323
  70. env -C wolfssl ./examples/client/client -p 4433 -g -u --cid 232323 \
  71. -A ../mbedtls/framework/data_files/test-ca-sha256.crt \
  72. -c ../mbedtls/framework/data_files/cli-rsa-sha256.crt \
  73. -k ../mbedtls/framework/data_files/cli-rsa-sha256.key.pem
  74. kill $SERVER_PID
  75. sleep 0.1