Blame SOURCES/make-dummy-cert

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