sniffer-testsuite.test 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/sh
  2. #sniffer-testsuite.test
  3. # if we can, isolate the network namespace to eliminate port collisions.
  4. if [ "${AM_BWRAPPED-}" != "yes" ]; then
  5. bwrap_path="$(command -v bwrap)"
  6. if [ -n "$bwrap_path" ]; then
  7. export AM_BWRAPPED=yes
  8. exec "$bwrap_path" --unshare-net --dev-bind / / "$0" "$@"
  9. fi
  10. unset AM_BWRAPPED
  11. fi
  12. # ./configure --enable-sniffer [--enable-session-ticket]
  13. # Resumption tests require "--enable-session-ticket"
  14. echo -e "\nStaring snifftest on testsuite.pcap...\n"
  15. ./sslSniffer/sslSnifferTest/snifftest ./scripts/testsuite.pcap ./certs/server-key.pem 127.0.0.1 11111
  16. RESULT=$?
  17. [ $RESULT -ne 0 ] && echo -e "\nsnifftest failed\n" && exit 1
  18. # TLS v1.3 sniffer test ECC (and resumption)
  19. if test $# -ne 0
  20. then
  21. ./sslSniffer/sslSnifferTest/snifftest ./scripts/sniffer-tls13-ecc.pcap ./certs/statickeys/ecc-secp256r1.pem 127.0.0.1 11111
  22. RESULT=$?
  23. [ $RESULT -ne 0 ] && echo -e "\nsnifftest TLS v1.3 ECC\n" && exit 1
  24. fi
  25. # TLS v1.3 sniffer test DH (and resumption)
  26. if test $# -ne 0
  27. then
  28. ./sslSniffer/sslSnifferTest/snifftest ./scripts/sniffer-tls13-dh.pcap ./certs/statickeys/dh-ffdhe2048.pem 127.0.0.1 11111
  29. RESULT=$?
  30. [ $RESULT -ne 0 ] && echo -e "\nsnifftest TLS v1.3 DH\n" && exit 1
  31. fi
  32. # TLS v1.3 sniffer test hello_retry_request (HRR) with ECDHE
  33. if test $# -ne 0
  34. then
  35. ./sslSniffer/sslSnifferTest/snifftest ./scripts/sniffer-tls13-hrr.pcap ./certs/statickeys/ecc-secp256r1.pem 127.0.0.1 11111
  36. RESULT=$?
  37. [ $RESULT -ne 0 ] && echo -e "\nsnifftest TLS v1.3 HRR\n" && exit 1
  38. fi
  39. # IPv6
  40. if test $# -ne 0 && test "x$1" = "x-6";
  41. then
  42. echo -e "\nStaring snifftest on sniffer-ipv6.pcap...\n"
  43. ./sslSniffer/sslSnifferTest/snifftest ./scripts/sniffer-ipv6.pcap ./certs/server-key.pem ::1 11111
  44. RESULT=$?
  45. [ $RESULT -ne 0 ] && echo -e "\nsnifftest (ipv6) failed\n" && exit 1
  46. fi
  47. echo -e "\nSuccess!\n"
  48. exit 0