gost_engine.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. #
  3. # Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
  4. #
  5. # Licensed under the Apache License 2.0 (the "License"). You may not use
  6. # this file except in compliance with the License. You can obtain a copy
  7. # in the file LICENSE in the source distribution or at
  8. # https://www.openssl.org/source/license.html
  9. #
  10. # OpenSSL external testing using the GOST engine
  11. #
  12. set -e
  13. PWD="$(pwd)"
  14. SRCTOP="$(cd $SRCTOP; pwd)"
  15. BLDTOP="$(cd $BLDTOP; pwd)"
  16. if [ "$SRCTOP" != "$BLDTOP" ] ; then
  17. echo "Out of tree builds not supported with gost_engine test!"
  18. exit 1
  19. fi
  20. O_EXE="$BLDTOP/apps"
  21. O_BINC="$BLDTOP/include"
  22. O_SINC="$SRCTOP/include"
  23. O_LIB="$BLDTOP"
  24. unset OPENSSL_CONF
  25. export PATH="$O_EXE:$PATH"
  26. export LD_LIBRARY_PATH="$O_LIB:$LD_LIBRARY_PATH"
  27. export OPENSSL_ROOT_DIR="$O_LIB"
  28. # Check/Set openssl version
  29. OPENSSL_VERSION=`openssl version | cut -f 2 -d ' '`
  30. echo "------------------------------------------------------------------"
  31. echo "Testing OpenSSL using GOST engine:"
  32. echo " CWD: $PWD"
  33. echo " SRCTOP: $SRCTOP"
  34. echo " BLDTOP: $BLDTOP"
  35. echo " OPENSSL_ROOT_DIR: $OPENSSL_ROOT_DIR"
  36. echo " OpenSSL version: $OPENSSL_VERSION"
  37. echo "------------------------------------------------------------------"
  38. cmake $SRCTOP/gost-engine -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" -DOPENSSL_ENGINES_DIR="$OPENSSL_ROOT_DIR/engines"
  39. make
  40. export CTEST_OUTPUT_ON_FAILURE=1
  41. export HARNESS_OSSL_PREFIX=''
  42. export OPENSSL_ENGINES="$PWD/bin"
  43. export OPENSSL_APP="$O_EXE/openssl"
  44. make test
  45. make tcl_tests