sniffer-testsuite.test 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 X25519 (and resumption)
  33. if test $# -ne 0
  34. then
  35. ./sslSniffer/sslSnifferTest/snifftest ./scripts/sniffer-tls13-x25519.pcap ./certs/statickeys/x25519.pem 127.0.0.1 11111
  36. RESULT=$?
  37. [ $RESULT -ne 0 ] && echo -e "\nsnifftest TLS v1.3 X25519\n" && exit 1
  38. fi
  39. # TLS v1.3 sniffer test hello_retry_request (HRR) with ECDHE
  40. if test $# -ne 0
  41. then
  42. ./sslSniffer/sslSnifferTest/snifftest ./scripts/sniffer-tls13-hrr.pcap ./certs/statickeys/ecc-secp256r1.pem 127.0.0.1 11111
  43. RESULT=$?
  44. [ $RESULT -ne 0 ] && echo -e "\nsnifftest TLS v1.3 HRR\n" && exit 1
  45. fi
  46. # IPv6
  47. if test $# -ne 0 && test "x$1" = "x-6";
  48. then
  49. echo -e "\nStaring snifftest on sniffer-ipv6.pcap...\n"
  50. ./sslSniffer/sslSnifferTest/snifftest ./scripts/sniffer-ipv6.pcap ./certs/server-key.pem ::1 11111
  51. RESULT=$?
  52. [ $RESULT -ne 0 ] && echo -e "\nsnifftest (ipv6) failed\n" && exit 1
  53. fi
  54. echo -e "\nSuccess!\n"
  55. exit 0