aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-04-02 16:37:40 +0000
committerGerald Combs <gerald@wireshark.org>2012-04-02 16:37:40 +0000
commit95bd0745b91bf8e41a0fbda33d0a260b778224a1 (patch)
tree0fe5a972cb5bc2e5eb206ca94befab24b62f8690 /test
parente12df043a778a575d426376a0f03648f4f8a3554 (diff)
Add a test for DTLS decryption.
svn path=/trunk/; revision=41896
Diffstat (limited to 'test')
-rw-r--r--test/captures/snakeoil-dtls.pcapbin0 -> 2327 bytes
-rw-r--r--test/config/dtlsdecrypttablefile.tmpl1
-rw-r--r--test/keys/snakeoil-rsa.key15
-rwxr-xr-xtest/suite-decryption.sh19
4 files changed, 35 insertions, 0 deletions
diff --git a/test/captures/snakeoil-dtls.pcap b/test/captures/snakeoil-dtls.pcap
new file mode 100644
index 0000000000..ef5fd2110a
--- /dev/null
+++ b/test/captures/snakeoil-dtls.pcap
Binary files differ
diff --git a/test/config/dtlsdecrypttablefile.tmpl b/test/config/dtlsdecrypttablefile.tmpl
new file mode 100644
index 0000000000..7f85f81c95
--- /dev/null
+++ b/test/config/dtlsdecrypttablefile.tmpl
@@ -0,0 +1 @@
+"127.0.0.1","4433","http","TEST_KEYS_DIRsnakeoil-rsa.key",""
diff --git a/test/keys/snakeoil-rsa.key b/test/keys/snakeoil-rsa.key
new file mode 100644
index 0000000000..49ec507410
--- /dev/null
+++ b/test/keys/snakeoil-rsa.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQCkblMUCt4s42BVmvJCpq9HEi8Xzvq63E5jVjS5unNLeEQ9xmxp
+pCWzYQKdCQQ/cj3YJ9OwWkV3tzbkJiPMEriu3qe2OoI8fCRZCviWQ4ujKTY/kX9d
+xyOUKX8Kzgq9jZsvGReq1Y7sZqI36z9XUzzyqrt5GUuQfqejmf6ETInwPQIDAQAB
+AoGAedqEWKsBIPTTtDziYYBTDnEsUxGA/685rCX7ZtQEkx4qPDlqqBMMGVW/8Q34
+hugrap+BIgSTzHcLB6I4DwiksUpR08x0hf0oxqqjMo0KykhZDfUUfxR85JHUrFZM
+GznurVhfSBXX4Il9Tgc/RPzD32FZ6gaz9sFumJh0LKKadeECQQDWOfP6+nIAvmyH
+aRINErBSlK+xv2mZ4jEKvROIQmrpyNyoOStYLG/DRPlEzAIA6oQnowGgS6gwaibg
+g7yVTgBpAkEAxH6dcwhIDRTILvtUdKSWB6vdhtXFGdebaU4cuUOW2kWwPpyIj4XN
+D+rezwfptmeOr34DCA/QKCI/BWkbFDG2tQJAVAH971nvAuOp46AMeBvwETJFg8qw
+Oqw81x02X6TMEEm4Xi+tE7K5UTXnGld2Ia3VjUWbCaUhm3rFLB39Af/IoQJAUn/G
+o5GKjtN26SLk5sRjqXzjWcVPJ/Z6bdA6Bx71q1cvFFqsi3XmDxTRz6LG4arBIbWK
+mEvrXa5jP2ZN1EC7MQJAYTfwPZ8/4x/USmA4vx9FKdADdDoZnA9ZSwezWaqa44My
+bJ0SY/WmNU+Z4ldVIkcevwwwcxqLF399hjrXWhzlBQ==
+-----END RSA PRIVATE KEY-----
diff --git a/test/suite-decryption.sh b/test/suite-decryption.sh
index 0e86255d4f..76a1366748 100755
--- a/test/suite-decryption.sh
+++ b/test/suite-decryption.sh
@@ -31,6 +31,7 @@ EXIT_ERROR=2
UAT_FILES="
80211_keys
+ dtlsdecrypttablefile
ssl_keys
"
@@ -51,6 +52,7 @@ DC_ID="suite-decryption.sh-$$"
# WPA PSK
+# http://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=view&target=wpa-Induction.pcap
decryption_step_80211_wpa_psk() {
env $TS_DC_ENV $TSHARK $TS_DC_ARGS \
-o "wlan.enable_decryption: TRUE" \
@@ -66,7 +68,23 @@ decryption_step_80211_wpa_psk() {
test_step_ok
}
+# DTLS
+# http://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=view&target=snakeoil.tgz
+decryption_step_dtls() {
+ env $TS_DC_ENV $TSHARK $TS_DC_ARGS \
+ -Tfields -e data.data \
+ -r captures/snakeoil-dtls.pcap -R http \
+ | grep "69:74:20:77:6f:72:6b:20:21:0a" > /dev/null 2>&1
+ RETURNVALUE=$?
+ if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
+ test_step_failed "Failed to decrypt SSL"
+ return
+ fi
+ test_step_ok
+}
+
# SSL
+# http://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=view&target=snakeoil2_070531.tgz
decryption_step_ssl() {
env $TS_DC_ENV $TSHARK $TS_DC_ARGS -Tfields -e http.request.uri -r captures/rsasnakeoil2.pcap -R http | grep favicon.ico > /dev/null 2>&1
RETURNVALUE=$?
@@ -79,6 +97,7 @@ decryption_step_ssl() {
tshark_decryption_suite() {
test_step_add "IEEE 802.11 WPA PSK Decryption" decryption_step_80211_wpa_psk
+ test_step_add "DTLS Decryption" decryption_step_dtls
test_step_add "SSL Decryption" decryption_step_ssl
}