Blame SOURCES/make-dummy-cert

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