projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix macOS build.
[dcpomatic.git]
/
test
/
crypto_test.cc
diff --git
a/test/crypto_test.cc
b/test/crypto_test.cc
index 576a6ebc6bdbb28772ebe940ecb82a1dfd941e5d..26c6748b8bd453bc8a2f472d267469c58d3be03b 100644
(file)
--- a/
test/crypto_test.cc
+++ b/
test/crypto_test.cc
@@
-26,19
+26,19
@@
using std::string;
using std::list;
using std::string;
using std::list;
-using boost::shared_array;
BOOST_AUTO_TEST_CASE (crypto_test)
{
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::ArrayData key (dcpomatic::crypto_key_length()
);
+
dcp::ArrayData
iv = dcpomatic::random_iv ();
- RAND_bytes (key.
get
(), dcpomatic::crypto_key_length());
+ RAND_bytes (key.
data
(), dcpomatic::crypto_key_length());
- dcp::Data ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv);
+ dcp::
Array
Data ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv);
BOOST_REQUIRE_EQUAL (dcpomatic::decrypt (ciphertext, key, iv), "Can you see any fish?");
BOOST_REQUIRE_EQUAL (dcpomatic::decrypt (ciphertext, key, iv), "Can you see any fish?");
- key[5]++;
+ key.data()[5]++;
+ key.data()[6]++;
BOOST_REQUIRE_THROW (dcpomatic::decrypt (ciphertext, key, iv), CryptoError);
}
BOOST_REQUIRE_THROW (dcpomatic::decrypt (ciphertext, key, iv), CryptoError);
}