2015-03-26 15:56:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
t=$1
|
|
|
|
ktype=$2
|
|
|
|
ptype=$3
|
|
|
|
|
|
|
|
if ../util/shlib_wrap.sh ../apps/openssl no-$ktype; then
|
|
|
|
echo skipping $ktype $ptype conversion test
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $ptype = "public" ]; then
|
|
|
|
cmd="../util/shlib_wrap.sh ../apps/openssl $ktype -pubin -pubout"
|
|
|
|
else
|
|
|
|
cmd="../util/shlib_wrap.sh ../apps/openssl $ktype"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo testing $ktype $ptype conversions
|
|
|
|
cp $t $ktype-fff.p
|
|
|
|
|
|
|
|
echo "p -> d"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-fff.p -inform p -outform d >$ktype-f.d || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
echo "p -> p"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-fff.p -inform p -outform p >$ktype-f.p || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
echo "d -> d"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.d -inform d -outform d >$ktype-ff.d1 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
echo "p -> d"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.p -inform p -outform d >$ktype-ff.d3 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
echo "d -> p"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.d -inform d -outform p >$ktype-ff.p1 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
echo "p -> p"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.p -inform p -outform p >$ktype-ff.p3 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
|
2015-04-10 14:06:17 +00:00
|
|
|
cmp $ktype-fff.p $ktype-f.p || exit 1
|
|
|
|
cmp $ktype-fff.p $ktype-ff.p1 || exit 1
|
|
|
|
cmp $ktype-fff.p $ktype-ff.p3 || exit 1
|
|
|
|
cmp $ktype-f.p $ktype-ff.p1 || exit 1
|
|
|
|
cmp $ktype-f.p $ktype-ff.p3 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
/bin/rm -f $ktype-f.* $ktype-ff.* $ktype-fff.*
|
|
|
|
|
2015-04-10 14:06:17 +00:00
|
|
|
[ $ptype = "public" ] && exit 0
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
echo testing $ktype PKCS#8 conversions
|
2015-04-10 14:06:17 +00:00
|
|
|
cmd="../util/shlib_wrap.sh ../apps/openssl pkey"
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
$cmd -in $t -out $ktype-fff.p
|
|
|
|
|
|
|
|
echo "p -> d"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-fff.p -inform p -outform d >$ktype-f.d || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
echo "p -> p"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-fff.p -inform p -outform p >$ktype-f.p || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
echo "d -> d"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.d -inform d -outform d >$ktype-ff.d1 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
echo "p -> d"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.p -inform p -outform d >$ktype-ff.d3 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
echo "d -> p"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.d -inform d -outform p >$ktype-ff.p1 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
echo "p -> p"
|
2015-04-10 14:06:17 +00:00
|
|
|
$cmd -in $ktype-f.p -inform p -outform p >$ktype-ff.p3 || exit 1
|
|
|
|
|
|
|
|
cmp $ktype-fff.p $ktype-f.p || exit 1
|
|
|
|
cmp $ktype-fff.p $ktype-ff.p1 || exit 1
|
|
|
|
cmp $ktype-fff.p $ktype-ff.p3 || exit 1
|
|
|
|
cmp $ktype-f.p $ktype-ff.p1 || exit 1
|
|
|
|
cmp $ktype-f.p $ktype-ff.p3 || exit 1
|
2015-03-26 15:56:00 +00:00
|
|
|
|
|
|
|
/bin/rm -f $ktype-f.* $ktype-ff.* $ktype-fff.*
|