diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-12-23 21:04:38 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-12-23 21:04:49 +0000 |
| commit | 3526252ff2fd80a459c72ab1c55ea5a6ee61aa2f (patch) | |
| tree | c9e9774de4acfa562f83db39a900fe4d0b241945 /test | |
| parent | a65efe6bd00fbba4f075c4c666dafafb8a5eed4d (diff) | |
swaroop: encrypt decryption private key with motherboard UUID.
Diffstat (limited to 'test')
| -rw-r--r-- | test/crypto_test.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/crypto_test.cc b/test/crypto_test.cc index 576a6ebc6..586535dfe 100644 --- a/test/crypto_test.cc +++ b/test/crypto_test.cc @@ -30,15 +30,15 @@ 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); } |
