X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fcrypto_test.cc;h=d96deafa4e023258afea0be39fe678a447db2792;hb=55f8dac645e2e36575def1021bb1b92b86fb12b5;hp=576a6ebc6bdbb28772ebe940ecb82a1dfd941e5d;hpb=5ab0c3bc04e4aa5acd883bb8126fc6b185c6c5d6;p=dcpomatic.git diff --git a/test/crypto_test.cc b/test/crypto_test.cc index 576a6ebc6..d96deafa4 100644 --- a/test/crypto_test.cc +++ b/test/crypto_test.cc @@ -26,19 +26,18 @@ using std::string; using std::list; -using boost::shared_array; BOOST_AUTO_TEST_CASE (crypto_test) { - shared_array key (new unsigned char[dcpomatic::crypto_key_length()]); - shared_array 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); }