4
LIBSSL=$(apt-cache policy libssl0.9.8 | grep Installed | awk '{print $NF}')
5
dpkg --compare-versions "$LIBSSL" lt 0.9.8g-9 || {
6
echo "Your libssl0.9.8 is newer than the fixed version (0.9.8g-9)." >&2
7
echo "This script is only sensible to run with a broken version. :)" >&2
11
KEYTYPE=$(echo "$1" | tr A-Z a-z)
13
if [ -z "$KEYTYPE" ] || [ -z "$KEYSIZE" ]; then
14
echo "Usage: $0 KEYTYPE KEYSIZE" >&2
18
WORKDIR=$(mktemp -d -t blacklist-XXXXXX)
25
gcc -fPIC -c getpid.c -o getpid.o
26
gcc -shared -o getpid.so getpid.o
30
FORCE_PID=1234 LD_PRELOAD=./getpid.so bash
33
# Copyright (C) 2001-2008 Kees Cook
34
# kees@outflux.net, http://outflux.net/
36
# This program is free software; you can redistribute it and/or
37
# modify it under the terms of the GNU General Public License
38
# as published by the Free Software Foundation; either version 2
39
# of the License, or (at your option) any later version.
41
# This program is distributed in the hope that it will be useful,
42
# but WITHOUT ANY WARRANTY; without even the implied warranty of
43
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44
# GNU General Public License for more details.
46
# You should have received a copy of the GNU General Public License
47
# along with this program; if not, write to the Free Software
48
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
49
# http://www.gnu.org/copyleft/gpl.html
53
#include <sys/types.h>
59
return atoi(getenv("FORCE_PID"));
63
gcc -fPIC -c getpid.c -o getpid.o
64
gcc -shared -o getpid.so getpid.o
66
echo "# generated on $(uname -m) at $(date)"
68
for pid in $(seq 1 32767)
71
HASH=$(FORCE_PID="$pid" LD_PRELOAD=./getpid.so \
72
ssh-keygen -P "" -t "$KEYTYPE" -b "$KEYSIZE" -f "$FILE" | \
73
grep :..: | cut -d" " -f1 | sed -e 's/://g')
74
rm -f "$FILE" "$FILE".pub