/usr/lib/ipsec/newhostkey is in openswan 1:2.6.37-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #! /bin/sh
# generate new key for this host
# Copyright (C) 2001, 2002 Henry Spencer.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
me="ipsec newhostkey"
usage="Usage: $me --output filename [--random device] [--bits n] [--quiet] [--hostname host] [--configdir nssdbdir] [--password password]
or
$me --output - [--random device] [--bits n] [--quiet] [--verbose] [--hostname host] [--configdir nssdbdir] [--password password] >filename"
bits=2192
verbose=
host=
random="--random /dev/random"
output=
configdir=
password=
for dummy
do
case "$1" in
--bits) bits="$2" ; shift ;;
--quiet) verbose= ;;
--hostname) host="--hostname $2" ; shift ;;
--output) output="$2" ; shift ;;
--verbose) verbose=--verbose ;;
--version) echo "$me $IPSEC_VERSION" ; exit 0 ;;
--random) random="--random $2" ; shift ;;
--configdir) configdir="--configdir $2" ; shift ;;
--password) password="--password $2" ; shift ;;
--help) echo "$usage" ; exit 0 ;;
--) shift ; break ;;
-*) echo "$me: unknown option \`$1'" >&2 ; exit 2 ;;
*) break ;;
esac
shift
done
if test " $output" = " " && test ! -f ${IPSEC_CONFS}/ipsec.secrets
then
output=${IPSEC_CONFS}/ipsec.secrets
fi
if test " $output" = " "
then
echo "$0: no --output specification included" >&2
exit 1
elif test " $verbose" != " " -a " $output" != " -" -a -s "$output"
then
echo "$0: WARNING: file \`$output' exists, appending to it" >&2
fi
(
echo ': RSA {'
ipsec rsasigkey $verbose $random $configdir $password $host $bits
echo ' }'
echo '# do not change the indenting of that "}"'
) |
if test " $output" = " -"
then
cat
else
umask 077
cat >>$output.new
mv $output.new $output
fi
|