Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing with cryptopp 7.0.0 #103

Merged
merged 1 commit into from
Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 0 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
# =================

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
10 changes: 3 additions & 7 deletions src/xauthentication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class T>
Expand All @@ -26,7 +22,7 @@ namespace xeus
public:

using hmac_type = CryptoPP::HMAC<T>;
using signature_type = std::array<byte, hmac_type::DIGESTSIZE>;
using signature_type = std::array<CryptoPP::byte, hmac_type::DIGESTSIZE>;

explicit xauthentication_impl(const std::string& key);
virtual ~xauthentication_impl() = default;
Expand Down Expand Up @@ -102,7 +98,7 @@ namespace xeus
template <class T>
xauthentication_impl<T>::xauthentication_impl(const std::string& key)
{
m_hmac = hmac_type(reinterpret_cast<const byte*>(key.c_str()), key.size());
m_hmac = hmac_type(reinterpret_cast<const CryptoPP::byte*>(key.c_str()), key.size());
}

template <class T>
Expand Down Expand Up @@ -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<const byte*>(hex_sig.c_str()),
bool res = CryptoPP::VerifyBufsEqual(reinterpret_cast<const CryptoPP::byte*>(hex_sig.c_str()),
signature.data<const unsigned char>(),
hex_sig.size());
return res;
Expand Down