summaryrefslogtreecommitdiff
path: root/generate-wireshark-cs
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-12-05 15:39:16 +0100
committerPeter Wu <lekensteyn@gmail.com>2013-12-09 22:51:20 +0100
commitf0acd61fb7c0b412f330eff267d32f6d8eb0d086 (patch)
treee8daa8ae8d15b541a57db575853abbca9a96ed27 /generate-wireshark-cs
parent2f5de61ce333fc38c3a7ca6f40bb07b3f5e2819e (diff)
downloadwireshark-notes-f0acd61fb7c0b412f330eff267d32f6d8eb0d086.tar.gz
generate-wireshark-cs: some fixes for CCM
This applies some fixes for CCM to the cipher suite generation script. There are some special cases for CCM ciphers: the iv blocksize is always 4, it does not have a digest and the mode should be CCM or CCM_8. [ Peter: basically restructure (indent+case) and fix CCM block size. I removed the digest as that was already covered and diglen=0; is not meaningful ]
Diffstat (limited to 'generate-wireshark-cs')
-rwxr-xr-xgenerate-wireshark-cs58
1 files changed, 35 insertions, 23 deletions
diff --git a/generate-wireshark-cs b/generate-wireshark-cs
index 5b9a9a4..ad86816 100755
--- a/generate-wireshark-cs
+++ b/generate-wireshark-cs
@@ -103,20 +103,25 @@ p() {
# TLS 1.1: http://tools.ietf.org/html/rfc4346#page-69
# TLS 1.2: http://tools.ietf.org/html/rfc5246#page-84
# GCM's IV size is always 4 regardless of underlying block cipher
- [[ $1 == *_GCM_* ]] && blocksize=4 ||
- case $cipher in
- AES|AES256|CAMELLIA128|CAMELLIA256|SEED)
- blocksize=16 ;;
- DES|3DES|IDEA)
- blocksize=8 ;;
- RC2)
- blocksize=8 ;;
- RC4|NULL)
- # N/A for stream cipher RC4
- blocksize=0 ;;
+ case $1 in
+ *_GCM_*|*_CCM|*_CCM_8)
+ blocksize=4 ;;
*)
- warn "Unknown cipher $cipher in $hexid $1"
- return
+ case $cipher in
+ AES|AES256|CAMELLIA128|CAMELLIA256|SEED)
+ blocksize=16 ;;
+ DES|3DES|IDEA)
+ blocksize=8 ;;
+ RC2)
+ blocksize=8 ;;
+ RC4|NULL)
+ # N/A for stream cipher RC4
+ blocksize=0 ;;
+ *)
+ warn "Unknown cipher $cipher in $hexid $1"
+ return
+ ;;
+ esac
;;
esac
@@ -146,17 +151,24 @@ p() {
warn "Export cipher, actual keysize may not be accurate: $hexid $1"
fi
- [[ $1 == *_GCM_* ]] && mode=GCM ||
- [[ $1 == *_CCM ]] && mode=CCM ||
- [[ $1 == *_CCM_8 ]] && mode=CCM_8 ||
- case $cipher in
- AES|AES256|DES|3DES|CAMELLIA128|CAMELLIA256|SEED|IDEA|RC2)
- mode=CBC ;;
- RC4|NULL)
- mode=STREAM ;;
+ case $1 in
+ *_GCM_*)
+ mode=GCM ;;
+ *_CCM)
+ mode=CCM ;;
+ *_CCM_8)
+ mode=CCM_8 ;;
*)
- warn "Unknown mode in $hexid $1 (cipher=$cipher)"
- return
+ case $cipher in
+ AES|AES256|DES|3DES|CAMELLIA128|CAMELLIA256|SEED|IDEA|RC2)
+ mode=CBC ;;
+ RC4|NULL)
+ mode=STREAM ;;
+ *)
+ warn "Unknown mode in $hexid $1 (cipher=$cipher)"
+ return
+ ;;
+ esac
;;
esac