From 4c1aadb88a42d0cae17bfb60bb683eb5e77b2e15 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Mon, 3 Dec 2018 12:06:46 +0100 Subject: [PATCH] Testing with cryptopp 7.0.0 --- .appveyor.yml | 2 +- .travis.yml | 2 +- CMakeLists.txt | 25 ------------------------- README.md | 2 +- src/xauthentication.cpp | 10 +++------- 5 files changed, 6 insertions(+), 35 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index f2d5b302..8e9a46e8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -22,7 +22,7 @@ install: - conda config --set always_yes yes --set changeps1 no - conda update -q conda - conda info -a - - conda install cmake cppzmq=4.3.0 zeromq=4.2.5 xtl=0.5 nlohmann_json=3.4.0 cryptopp=5.6.5 -c conda-forge + - conda install cmake cppzmq=4.3.0 zeromq=4.2.5 xtl=0.5 nlohmann_json=3.4.0 cryptopp=7.0.0 -c conda-forge - conda install pytest jupyter jupyter_kernel_test=0.3.0 -c conda-forge - mkdir build - cd build diff --git a/.travis.yml b/.travis.yml index 7ce4e054..5a4009ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,7 +112,7 @@ install: # Build dependencies - conda install cmake pkg-config -c conda-forge # Host dependencies - - conda install zeromq=4.2.5 cppzmq=4.3.0 xtl=0.5 cryptopp=5.6.5 -c conda-forge + - conda install zeromq=4.2.5 cppzmq=4.3.0 xtl=0.5 cryptopp=7.0.0 -c conda-forge - conda install nlohmann_json=3.4.0 -c conda-forge/label/gcc7 # Test dependencies - conda install pytest jupyter jupyter_kernel_test=0.3.0 -c conda-forge diff --git a/CMakeLists.txt b/CMakeLists.txt index a3a9cd61..8b55b494 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,31 +149,6 @@ set_target_properties(xeus PROPERTIES SOVERSION ${XEUS_BINARY_CURRENT} OUTPUT_NAME "libxeus") -# Configure Checks -# ================ - -include(CheckCXXSourceCompiles) -include(CMakePushCheckState) - -cmake_push_check_state() - -# HAVE_CRYPTOPP_BYTE_T -get_target_property(cryptopp_INCLUDE_DIR cryptopp-static INTERFACE_INCLUDE_DIRECTORIES) -get_target_property(cryptopp_LIBRARY cryptopp-static LOCATION) -set(CMAKE_REQUIRED_LIBRARIES ${cryptopp_LIBRARY}) -set(CMAKE_REQUIRED_INCLUDES ${cryptopp_INCLUDE_DIR}) -check_cxx_source_compiles(" -#include \"cryptopp/config.h\" -int main(){ - [[maybe_unused]] CryptoPP::byte b = CryptoPP::byte{0x36}; -}" HAVE_CRYPTOPP_BYTE_T) - -cmake_pop_check_state() - -if(HAVE_CRYPTOPP_BYTE_T) - target_compile_definitions(xeus PRIVATE HAVE_CRYPTOPP_BYTE_T) -endif() - # Compilation flags # ================= diff --git a/README.md b/README.md index 57427e9c..3ed31f9d 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Kernel authors can then rebind to the native APIs of the interpreter that is bei | xeus | libzmq | cppzmq | cryptopp | xtl | nlohmann json | |--------|---------|---------|----------------|--------|---------------| -| master | ^4.2.5 | ^4.3.0 | ^5.6.5, ^7.0.0 | ^0.5.0 | ^3.2.0 | +| master | ^4.2.5 | ^4.3.0 | ^7.0.0 | ^0.5.0 | ^3.2.0 | | 0.16.0 | ^4.2.5 | ^4.3.0 | ^5.6.5, ^7.0.0 | ^0.4.0 | 3.2.0 | | 0.15.0 | ^4.2.5 | ^4.3.0 | ^5.6.5, ^7.0.0 | ^0.4.0 | 3.2.0 | | 0.14.1 | ^4.2.5 | ^4.3.0 | ^5.6.5, ^7.0.0 | ^0.4.0 | 3.1.2 | diff --git a/src/xauthentication.cpp b/src/xauthentication.cpp index 19b608e0..6847544d 100644 --- a/src/xauthentication.cpp +++ b/src/xauthentication.cpp @@ -14,10 +14,6 @@ #include "cryptopp/sha.h" #include "cryptopp/hmac.h" -#if defined(HAVE_CRYPTOPP_BYTE_T) -using CryptoPP::byte; -#endif - namespace xeus { template @@ -26,7 +22,7 @@ namespace xeus public: using hmac_type = CryptoPP::HMAC; - using signature_type = std::array; + using signature_type = std::array; explicit xauthentication_impl(const std::string& key); virtual ~xauthentication_impl() = default; @@ -102,7 +98,7 @@ namespace xeus template xauthentication_impl::xauthentication_impl(const std::string& key) { - m_hmac = hmac_type(reinterpret_cast(key.c_str()), key.size()); + m_hmac = hmac_type(reinterpret_cast(key.c_str()), key.size()); } template @@ -138,7 +134,7 @@ namespace xeus std::string hex_sig = hex_string(sig); // Reduces the vulnerability to timing attacks. - bool res = CryptoPP::VerifyBufsEqual(reinterpret_cast(hex_sig.c_str()), + bool res = CryptoPP::VerifyBufsEqual(reinterpret_cast(hex_sig.c_str()), signature.data(), hex_sig.size()); return res;