testgen 927 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. T=testcert
  3. KEY=512
  4. CA=../certs/testca.pem
  5. /bin/rm -f $T.1 $T.2 $T.key
  6. if test "$OSTYPE" = msdosdjgpp; then
  7. PATH=../apps\;$PATH;
  8. else
  9. PATH=../apps:$PATH;
  10. fi
  11. export PATH
  12. echo "generating certificate request"
  13. echo "string to make the random number generator think it has entropy" >> ./.rnd
  14. if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
  15. req_new='-newkey dsa:../apps/dsa512.pem'
  16. else
  17. req_new='-new'
  18. echo "There should be a 2 sequences of .'s and some +'s."
  19. echo "There should not be more that at most 80 per line"
  20. fi
  21. echo "This could take some time."
  22. rm -f testkey.pem testreq.pem
  23. ../util/shlib_wrap.sh ../apps/openssl req -config test.cnf $req_new -out testreq.pem
  24. if [ $? != 0 ]; then
  25. echo problems creating request
  26. exit 1
  27. fi
  28. ../util/shlib_wrap.sh ../apps/openssl req -config test.cnf -verify -in testreq.pem -noout
  29. if [ $? != 0 ]; then
  30. echo signature on req is wrong
  31. exit 1
  32. fi
  33. exit 0