]>
git.ipfire.org Git - people/ms/strongswan.git/blob - programs/_keycensor/_keycensor.in
2 # implements key censoring for barf
3 # Copyright (C) 1999, 2002 Henry Spencer.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2 of the License, or (at your
8 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # RCSID $Id: _keycensor.in,v 1.1 2004/03/15 20:35:27 as Exp $
17 usage
="Usage: $0 [file ...]"
23 --help) echo "$usage" ; exit 0 ;;
24 --version) echo "$me $IPSEC_VERSION" ; exit 0 ;;
26 -*) echo "$0: unknown option \`$1'" >&2 ; exit 2 ;;
32 awk ' /(sig|enc|auth)key[ \t]*=[ \t]*[^%]/ {
33 i = match($0, /key[ \t]*=[ \t]*/)
35 cold = substr($0, 1, i-1)
37 sub(/[ \t]+(#.*)?$/, "", hot)
38 q = "'"'"'" # single quote
40 cooled = "[cannot be condensed]"
42 cooled = "[keyid " substr(hot, 3, 9) "]"
44 run = "echo " q hot q " | md5sum"
47 cooled = "[sums to " substr($1, 1, 4) "...]"