Blame SOURCES/make-dummy-cert

0bf02d
#!/bin/sh
0bf02d
umask 077
0bf02d
0bf02d
answers() {
0bf02d
	echo --
0bf02d
	echo SomeState
0bf02d
	echo SomeCity
0bf02d
	echo SomeOrganization
0bf02d
	echo SomeOrganizationalUnit
0bf02d
	echo localhost.localdomain
0bf02d
	echo root@localhost.localdomain
0bf02d
}
0bf02d
0bf02d
if [ $# -eq 0 ] ; then
0bf02d
	echo $"Usage: `basename $0` filename [...]"
0bf02d
	exit 0
0bf02d
fi
0bf02d
0bf02d
for target in $@ ; do
0bf02d
	PEM1=`/bin/mktemp /tmp/openssl.XXXXXX`
0bf02d
	PEM2=`/bin/mktemp /tmp/openssl.XXXXXX`
0bf02d
	trap "rm -f $PEM1 $PEM2" SIGINT
0bf02d
	answers | /usr/bin/openssl req -newkey rsa:2048 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 2> /dev/null
0bf02d
	cat $PEM1 >  ${target}
0bf02d
	echo ""   >> ${target}
0bf02d
	cat $PEM2 >> ${target}
0bf02d
	rm -f $PEM1 $PEM2
0bf02d
done