]>
The Tcpdump Group git mirrors - tcpdump/blob - tests/crypto.sh
4 # Get the tests directory from $0.
6 testsdir
=`dirname "$0"`
12 # Only attempt OpenSSL-specific tests when compiled with the library.
14 if grep '^#define HAVE_LIBCRYPTO 1$' ..
/config.h
>/dev
/null
16 if ${testsdir}/TESTonce esp1 ${testsdir}/02-sunrise-sunset-esp.pcap ${testsdir}/esp1.out
'-E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
18 passed
=`expr $passed + 1`
21 failed
=`expr $failed + 1`
25 if ${testsdir}/TESTonce esp2 ${testsdir}/08-sunrise-sunset-esp2.pcap ${testsdir}/esp2.out
'-E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,0xabcdabcd@192.0.1.1 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043"'
27 passed
=`expr $passed + 1`
30 failed
=`expr $failed + 1`
34 if ${testsdir}/TESTonce esp3 ${testsdir}/02-sunrise-sunset-esp.pcap ${testsdir}/esp1.out
'-E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
36 passed
=`expr $passed + 1`
39 failed
=`expr $failed + 1`
43 # Reading the secret(s) from a file does not work with Capsicum.
44 if grep '^#define HAVE_CAPSICUM 1$' ..
/config.h
>/dev
/null
46 FORMAT
=' %-35s: TEST SKIPPED (compiled w/Capsicum)\n'
49 printf "$FORMAT" espudp1
50 printf "$FORMAT" ikev2pI2
51 printf "$FORMAT" isakmp4
53 if ${testsdir}/TESTonce esp4 ${testsdir}/08-sunrise-sunset-esp2.pcap ${testsdir}/esp2.out "-E \"file ${testsdir}/esp-secrets.txt
\""
55 passed=`expr $passed + 1`
58 failed=`expr $failed + 1`
62 if ${testsdir}/TESTonce esp5 ${testsdir}/08-sunrise-sunset-aes.pcap ${testsdir}/esp5.out "-E \"file ${testsdir}/esp-secrets.txt\""
64 passed
=`expr $passed + 1`
67 failed
=`expr $failed + 1`
71 if ${testsdir}/TESTonce espudp1 ${testsdir}/espudp1.pcap ${testsdir}/espudp1.out "-nnnn -E \"file ${testsdir}/esp-secrets.txt
\""
73 passed=`expr $passed + 1`
76 failed=`expr $failed + 1`
80 if ${testsdir}/TESTonce ikev2pI2 ${testsdir}/ikev2pI2.pcap ${testsdir}/ikev2pI2.out "-E \"file ${testsdir}/ikev2pI2-secrets.txt\" -v -v -v -v"
82 passed
=`expr $passed + 1`
85 failed
=`expr $failed + 1`
89 if ${testsdir}/TESTonce isakmp4 ${testsdir}/isakmp4500.pcap ${testsdir}/isakmp4.out "-E \"file ${testsdir}/esp-secrets.txt
\""
91 passed=`expr $passed + 1`
94 failed=`expr $failed + 1`
99 if ${testsdir}/TESTonce bgp-as-path-oobr-ssl ${testsdir}/bgp-as-path-oobr.pcap ${testsdir}/bgp-as-path-oobr-ssl.out '-vvv -e'
101 passed=`expr $passed + 1`
102 echo $passed >.passed
104 failed=`expr $failed + 1`
105 echo $failed >.failed
108 if ${testsdir}/TESTonce bgp-aigp-oobr-ssl ${testsdir}/bgp-aigp-oobr.pcap ${testsdir}/bgp-aigp-oobr-ssl.out '-vvv -e'
110 passed=`expr $passed + 1`
111 echo $passed >.passed
113 failed=`expr $failed + 1`
114 echo $failed >.failed
117 FORMAT=' %-35s: TEST SKIPPED (compiled w/OpenSSL)\n'
118 printf "$FORMAT" bgp-as-path-oobr-nossl
119 printf "$FORMAT" bgp-aigp-oobr-nossl
121 FORMAT=' %-35s: TEST SKIPPED (compiled w/o OpenSSL)\n'
122 printf "$FORMAT" esp1
123 printf "$FORMAT" esp2
124 printf "$FORMAT" esp3
125 printf "$FORMAT" esp4
126 printf "$FORMAT" esp5
127 printf "$FORMAT" espudp1
128 printf "$FORMAT" ikev2pI2
129 printf "$FORMAT" isakmp4
130 printf "$FORMAT" bgp-as-path-oobr-ssl
131 printf "$FORMAT" bgp-aigp-oobr-ssl
132 if ${testsdir}/TESTonce bgp-as-path-oobr-nossl ${testsdir}/bgp-as-path-oobr.pcap ${testsdir}/bgp-as-path-oobr-nossl.out '-vvv -e'
134 passed=`expr $passed + 1`
135 echo $passed >.passed
137 failed=`expr $failed + 1`
138 echo $failed >.failed
141 if ${testsdir}/TESTonce bgp-aigp-oobr-nossl ${testsdir}/bgp-aigp-oobr.pcap ${testsdir}/bgp-aigp-oobr-nossl.out '-vvv -e'
143 passed=`expr $passed + 1`
144 echo $passed >.passed
146 failed=`expr $failed + 1`
147 echo $failed >.failed