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 x509-fff.p 13 14echo "p -> d" 15$cmd -in x509-fff.p -inform p -outform d >x509-f.d 16if [ $? != 0 ]; then exit 1; fi 17echo "p -> n" 18$cmd -in x509-fff.p -inform p -outform n >x509-f.n 19if [ $? != 0 ]; then exit 1; fi 20echo "p -> p" 21$cmd -in x509-fff.p -inform p -outform p >x509-f.p 22if [ $? != 0 ]; then exit 1; fi 23 24echo "d -> d" 25$cmd -in x509-f.d -inform d -outform d >x509-ff.d1 26if [ $? != 0 ]; then exit 1; fi 27echo "n -> d" 28$cmd -in x509-f.n -inform n -outform d >x509-ff.d2 29if [ $? != 0 ]; then exit 1; fi 30echo "p -> d" 31$cmd -in x509-f.p -inform p -outform d >x509-ff.d3 32if [ $? != 0 ]; then exit 1; fi 33 34echo "d -> n" 35$cmd -in x509-f.d -inform d -outform n >x509-ff.n1 36if [ $? != 0 ]; then exit 1; fi 37echo "n -> n" 38$cmd -in x509-f.n -inform n -outform n >x509-ff.n2 39if [ $? != 0 ]; then exit 1; fi 40echo "p -> n" 41$cmd -in x509-f.p -inform p -outform n >x509-ff.n3 42if [ $? != 0 ]; then exit 1; fi 43 44echo "d -> p" 45$cmd -in x509-f.d -inform d -outform p >x509-ff.p1 46if [ $? != 0 ]; then exit 1; fi 47echo "n -> p" 48$cmd -in x509-f.n -inform n -outform p >x509-ff.p2 49if [ $? != 0 ]; then exit 1; fi 50echo "p -> p" 51$cmd -in x509-f.p -inform p -outform p >x509-ff.p3 52if [ $? != 0 ]; then exit 1; fi 53 54cmp x509-fff.p x509-f.p 55if [ $? != 0 ]; then exit 1; fi 56cmp x509-fff.p x509-ff.p1 57if [ $? != 0 ]; then exit 1; fi 58cmp x509-fff.p x509-ff.p2 59if [ $? != 0 ]; then exit 1; fi 60cmp x509-fff.p x509-ff.p3 61if [ $? != 0 ]; then exit 1; fi 62 63cmp x509-f.n x509-ff.n1 64if [ $? != 0 ]; then exit 1; fi 65cmp x509-f.n x509-ff.n2 66if [ $? != 0 ]; then exit 1; fi 67cmp x509-f.n x509-ff.n3 68if [ $? != 0 ]; then exit 1; fi 69 70cmp x509-f.p x509-ff.p1 71if [ $? != 0 ]; then exit 1; fi 72cmp x509-f.p x509-ff.p2 73if [ $? != 0 ]; then exit 1; fi 74cmp x509-f.p x509-ff.p3 75if [ $? != 0 ]; then exit 1; fi 76 77echo "Parsing test certificates" 78 79$cmd -in certs/pss1.pem -text -noout >/dev/null 80if [ $? != 0 ]; then exit 1; fi 81 82echo OK 83 84/bin/rm -f x509-f.* x509-ff.* x509-fff.* 85exit 0 86