Add link with anl to fix Centos 8 build.
[dcpomatic.git] / test / crypto_test.cc
index 576a6ebc6bdbb28772ebe940ecb82a1dfd941e5d..d96deafa4e023258afea0be39fe678a447db2792 100644 (file)
 
 using std::string;
 using std::list;
-using boost::shared_array;
 
 BOOST_AUTO_TEST_CASE (crypto_test)
 {
-       shared_array<unsigned char> key (new unsigned char[dcpomatic::crypto_key_length()]);
-       shared_array<unsigned char> iv = dcpomatic::random_iv ();
+       dcp::Data key (dcpomatic::crypto_key_length());
+       dcp::Data iv = dcpomatic::random_iv ();
 
-       RAND_bytes (key.get(), dcpomatic::crypto_key_length());
+       RAND_bytes (key.data().get(), dcpomatic::crypto_key_length());
 
        dcp::Data ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv);
        BOOST_REQUIRE_EQUAL (dcpomatic::decrypt (ciphertext, key, iv), "Can you see any fish?");
 
-       key[5]++;
+       key.data()[5]++;
        BOOST_REQUIRE_THROW (dcpomatic::decrypt (ciphertext, key, iv), CryptoError);
 }