1#!/bin/sh 2 3cmd='../util/shlib_wrap.sh ../apps/openssl x509' 4 5if [ "$1"x != "x" ]; then 6 t=$1 7else 8 t=testx509.pem 9fi 10 11echo testing X509 conversions 12cp $t fff.p 13 14echo "p -> d" 15$cmd -in fff.p -inform p -outform d >f.d 16if [ $? != 0 ]; then exit 1; fi 17echo "p -> n" 18$cmd -in fff.p -inform p -outform n >f.n 19if [ $? != 0 ]; then exit 1; fi 20echo "p -> p" 21$cmd -in fff.p -inform p -outform p >f.p 22if [ $? != 0 ]; then exit 1; fi 23 24echo "d -> d" 25$cmd -in f.d -inform d -outform d >ff.d1 26if [ $? != 0 ]; then exit 1; fi 27echo "n -> d" 28$cmd -in f.n -inform n -outform d >ff.d2 29if [ $? != 0 ]; then exit 1; fi 30echo "p -> d" 31$cmd -in f.p -inform p -outform d >ff.d3 32if [ $? != 0 ]; then exit 1; fi 33 34echo "d -> n" 35$cmd -in f.d -inform d -outform n >ff.n1 36if [ $? != 0 ]; then exit 1; fi 37echo "n -> n" 38$cmd -in f.n -inform n -outform n >ff.n2 39if [ $? != 0 ]; then exit 1; fi 40echo "p -> n" 41$cmd -in f.p -inform p -outform n >ff.n3 42if [ $? != 0 ]; then exit 1; fi 43 44echo "d -> p" 45$cmd -in f.d -inform d -outform p >ff.p1 46if [ $? != 0 ]; then exit 1; fi 47echo "n -> p" 48$cmd -in f.n -inform n -outform p >ff.p2 49if [ $? != 0 ]; then exit 1; fi 50echo "p -> p" 51$cmd -in f.p -inform p -outform p >ff.p3 52if [ $? != 0 ]; then exit 1; fi 53 54cmp fff.p f.p 55if [ $? != 0 ]; then exit 1; fi 56cmp fff.p ff.p1 57if [ $? != 0 ]; then exit 1; fi 58cmp fff.p ff.p2 59if [ $? != 0 ]; then exit 1; fi 60cmp fff.p ff.p3 61if [ $? != 0 ]; then exit 1; fi 62 63cmp f.n ff.n1 64if [ $? != 0 ]; then exit 1; fi 65cmp f.n ff.n2 66if [ $? != 0 ]; then exit 1; fi 67cmp f.n ff.n3 68if [ $? != 0 ]; then exit 1; fi 69 70cmp f.p ff.p1 71if [ $? != 0 ]; then exit 1; fi 72cmp f.p ff.p2 73if [ $? != 0 ]; then exit 1; fi 74cmp f.p ff.p3 75if [ $? != 0 ]; then exit 1; fi 76 77/bin/rm -f f.* ff.* fff.* 78exit 0 79