From: Dmitry Belyavskiy Date: Sun, 18 Nov 2018 11:07:04 +0000 (+0300) Subject: Merge branch 'master' of https://github.com/gost-engine/engine X-Git-Tag: v3.0.0~331 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=ee7efcec44edd11e64b5c4ad76e72e2a7acbdf9d;hp=08515dc5a74c62d082e6f7f745fac2000f26614a;p=openssl-gost%2Fengine.git Merge branch 'master' of https://github.com/gost-engine/engine --- diff --git a/.gitignore b/.gitignore index 3558c56..567609b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -bin/ build/ diff --git a/.travis.yml b/.travis.yml index e9c90be..dd84cdb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ env: - PREFIX=${HOME}/opt - LD_LIBRARY_PATH=${PREFIX}/lib - PATH=${PREFIX}/bin:${PATH} - - OPENSSL_ENGINES=${TRAVIS_BUILD_DIR}/bin matrix: include: @@ -31,5 +30,8 @@ before_script: - cd .. script: - - cmake -DOPENSSL_ROOT_DIR=${PREFIX} -DOPENSSL_LIBRARIES=${PREFIX}/lib && make - - prove -v test/{00-engine.t,01-digest.t,02-mac.t,03-encrypt.t} + - mkdir build + - cd build + - cmake -DOPENSSL_ROOT_DIR=${PREFIX} -DOPENSSL_LIBRARIES=${PREFIX}/lib -DOPENSSL_ENGINES_DIR=${PREFIX}/engines .. + - make + - make test diff --git a/CMakeLists.txt b/CMakeLists.txt index 774a1a7..26d2a40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,12 +32,22 @@ endif() set(BIN_DIRECTORY bin) -set(OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/${BIN_DIRECTORY}) +set(OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${BIN_DIRECTORY}) #set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}) +# Remove when https://gitlab.kitware.com/cmake/cmake/issues/18525 is addressed +set(OPENSSL_ENGINES_DIR "" CACHE PATH "OpenSSL Engines Directory") +if ("${OPENSSL_ENGINES_DIR}" STREQUAL "") + include(FindPkgConfig) + pkg_get_variable(OPENSSL_ENGINES_DIR libcrypto enginesdir) + if ("${OPENSSL_ENGINES_DIR}" STREQUAL "") + message( FATAL_ERROR "Unable to discover the OpenSSL engines directory. Provide the path using -DOPENSSL_ENGINES_DIR" ) + endif() +endif() + set(GOST_89_SOURCE_FILES gost89.c gost89.h @@ -131,6 +141,7 @@ add_test(NAME grasshopper add_test(NAME engine COMMAND perl run_tests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) +set_tests_properties(engine PROPERTIES ENVIRONMENT OPENSSL_ENGINES=${OUTPUT_DIRECTORY}) add_library(gost_core STATIC ${GOST_LIB_SOURCE_FILES}) set_target_properties(gost_core PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -164,14 +175,13 @@ add_custom_target(tags WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) # install -set(OPENSSL_ENGINES_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/engines-${OPENSSL_VERSION_MAJOR}_${OPENSSL_VERSION_MINOR}) set(OPENSSL_MAN_INSTALL_DIR ${CMAKE_INSTALL_MANDIR}/man1) install(TARGETS gost_engine gostsum gost12sum EXPORT GostEngineConfig - LIBRARY DESTINATION ${OPENSSL_ENGINES_INSTALL_DIR} + LIBRARY DESTINATION ${OPENSSL_ENGINES_DIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES gostsum.1 gost12sum.1 DESTINATION ${OPENSSL_MAN_INSTALL_DIR}) if (MSVC) - install(FILES $ DESTINATION ${OPENSSL_ENGINES_INSTALL_DIR} OPTIONAL) + install(FILES $ DESTINATION ${OPENSSL_ENGINES_DIR} OPTIONAL) install(FILES $ $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) endif() diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2717da8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,53 @@ +/* ==================================================================== + * Copyright (c) 2008-2018 Cryptocom LTD. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ \ No newline at end of file