Blame SOURCES/make-dummy-cert

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