summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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