1#!/bin/sh 2 3if test "$OSTYPE" = msdosdjgpp; then 4 PATH=../apps\;$PATH 5else 6 PATH=../apps:$PATH 7fi 8export PATH 9 10cmd='../util/shlib_wrap.sh ../apps/openssl req -config ../apps/openssl.cnf' 11 12if [ "$1"x != "x" ]; then 13 t=$1 14else 15 t=testreq.pem 16fi 17 18if $cmd -in $t -inform p -noout -text | fgrep 'Unknown Public Key'; then 19 echo "skipping req conversion test for $t" 20 exit 0 21fi 22 23echo testing req conversions 24cp $t fff.p 25 26echo "p -> d" 27$cmd -in fff.p -inform p -outform d >f.d 28if [ $? != 0 ]; then exit 1; fi 29#echo "p -> t" 30#$cmd -in fff.p -inform p -outform t >f.t 31#if [ $? != 0 ]; then exit 1; fi 32echo "p -> p" 33$cmd -in fff.p -inform p -outform p >f.p 34if [ $? != 0 ]; then exit 1; fi 35 36echo "d -> d" 37$cmd -verify -in f.d -inform d -outform d >ff.d1 38if [ $? != 0 ]; then exit 1; fi 39#echo "t -> d" 40#$cmd -in f.t -inform t -outform d >ff.d2 41#if [ $? != 0 ]; then exit 1; fi 42echo "p -> d" 43$cmd -verify -in f.p -inform p -outform d >ff.d3 44if [ $? != 0 ]; then exit 1; fi 45 46#echo "d -> t" 47#$cmd -in f.d -inform d -outform t >ff.t1 48#if [ $? != 0 ]; then exit 1; fi 49#echo "t -> t" 50#$cmd -in f.t -inform t -outform t >ff.t2 51#if [ $? != 0 ]; then exit 1; fi 52#echo "p -> t" 53#$cmd -in f.p -inform p -outform t >ff.t3 54#if [ $? != 0 ]; then exit 1; fi 55 56echo "d -> p" 57$cmd -in f.d -inform d -outform p >ff.p1 58if [ $? != 0 ]; then exit 1; fi 59#echo "t -> p" 60#$cmd -in f.t -inform t -outform p >ff.p2 61#if [ $? != 0 ]; then exit 1; fi 62echo "p -> p" 63$cmd -in f.p -inform p -outform p >ff.p3 64if [ $? != 0 ]; then exit 1; fi 65 66cmp fff.p f.p 67if [ $? != 0 ]; then exit 1; fi 68cmp fff.p ff.p1 69if [ $? != 0 ]; then exit 1; fi 70#cmp fff.p ff.p2 71#if [ $? != 0 ]; then exit 1; fi 72cmp fff.p ff.p3 73if [ $? != 0 ]; then exit 1; fi 74 75#cmp f.t ff.t1 76#if [ $? != 0 ]; then exit 1; fi 77#cmp f.t ff.t2 78#if [ $? != 0 ]; then exit 1; fi 79#cmp f.t ff.t3 80#if [ $? != 0 ]; then exit 1; fi 81 82cmp f.p ff.p1 83if [ $? != 0 ]; then exit 1; fi 84#cmp f.p ff.p2 85#if [ $? != 0 ]; then exit 1; fi 86cmp f.p ff.p3 87if [ $? != 0 ]; then exit 1; fi 88 89/bin/rm -f f.* ff.* fff.* 90exit 0 91