summaryrefslogtreecommitdiff
path: root/openssl-listen
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-12-06 00:06:35 +0100
committerPeter Wu <lekensteyn@gmail.com>2013-12-06 00:06:35 +0100
commit403cfce4177cab791e29209f63f665d7170c20e3 (patch)
tree3662e069015d8776343c4913e3916d2ba577a27f /openssl-listen
parentbefe0f77dd2246e437e61cefb861bf9a6d4ff82b (diff)
downloadwireshark-notes-403cfce4177cab791e29209f63f665d7170c20e3.tar.gz
openssl-{connect,listen}: fix usage, reduce output
The CLIENT_RANDOM is applicable to clients only, so remove it from ServerHello. Also update notes with cmake+gcrypt instructions.
Diffstat (limited to 'openssl-listen')
-rwxr-xr-xopenssl-listen18
1 files changed, 9 insertions, 9 deletions
diff --git a/openssl-listen b/openssl-listen
index 3919c40..c6c1025 100755
--- a/openssl-listen
+++ b/openssl-listen
@@ -15,15 +15,6 @@ PSK=0102030405060708091011121314151617181920
pkdir=$1; shift
portbase=4430
-# assume that openssl options always start with -
-if [[ $1 != -* ]]; then
- portbase=$1; shift
- if ! [[ $portbase -gt 0 ]] || ! [[ $portbase -le 65535 ]]; then
- echo "Port must be between 1 and 65535" >&2
- exit 1
- fi
-fi
-
if [ -z "$pkdir" ]; then
cat <<EOF
Usage: $0 path-to-certsdir [port base] [s_server options]"
@@ -32,6 +23,15 @@ starting at 'port base' (default 4430)
EOF
exit 1
fi
+# assume that openssl options always start with -
+if [ -n "$1" ] && [[ $1 != -* ]]; then
+ portbase=$1; shift
+ if ! [[ $portbase -gt 0 ]] || ! [[ $portbase -le 65535 ]]; then
+ echo "Port must be between 1 and 65535" >&2
+ exit 1
+ fi
+fi
+
[[ $pkdir == */ ]] || pkdir+=/
if ! mkdir -p "$pkdir"; then