Debian Codegraph @

check-vendor-ids

raw
1 #!/bin/sh
2 # The IKE Scanner (ike-scan) is Copyright (C) 2003-2007 Roy Hills,
3 # NTA Monitor Ltd.
4 #
5 # This file is part of ike-scan.
6 #
7 # ike-scan is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # ike-scan is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with ike-scan. If not, see <http://www.gnu.org/licenses/>.
19 #
20 # check-vendor-ids -- Shell script to test ike-scan to localhost
21 #
22 # Author: Jonathan Claudius
23 # Date: 17 August 2013
24 #
25 # This shell script runs ike-scan using the ike-vendor-ids file to
26 # validate that all patterns are parsed correctly
27 #
28 TMPFILE=/tmp/ike-scan-test.$$.tmp
29 #
30 echo "Checking ike-scan vendor-ids ..."
31 $srcdir/ike-scan -v -v -v --vidpatterns=ike-vendor-ids --sport=1024 --dport=1024 127.0.0.1 >$TMPFILE 2>&1
32 if test $? -ne 0; then
33 rm -f $TMPFILE
34 echo "FAILED - ike-scan returned non-zero exit code"
35 exit 1
36 fi
37
38 grep 'WARNING: Could not parse vendor id pattern' $TMPFILE >/dev/null
39 if test $? -eq 0; then
40 echo "FAILED - Could not parse a vendor id pattern"
41 grep 'WARNING: Could not parse vendor id pattern' $TMPFILE
42 rm -f $TMPFILE
43 exit 1
44 fi
45 echo "ok"
46 #
47 rm -f $TMPFILE