From 29844b3efd68ee102686e0ae6a04a926c1dbbbd8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 4 Jun 2015 22:24:26 +0100 Subject: Keep encryption context in MXFWriter. --- src/mxf.cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/mxf.cc') diff --git a/src/mxf.cc b/src/mxf.cc index 3a7080a9..d259bd97 100644 --- a/src/mxf.cc +++ b/src/mxf.cc @@ -43,15 +43,13 @@ using boost::dynamic_pointer_cast; using namespace dcp; MXF::MXF () - : _encryption_context (0) - , _decryption_context (0) + : _decryption_context (0) { } MXF::MXF (boost::filesystem::path file) : Asset (file) - , _encryption_context (0) , _decryption_context (0) { @@ -59,7 +57,6 @@ MXF::MXF (boost::filesystem::path file) MXF::~MXF () { - delete _encryption_context; delete _decryption_context; } @@ -132,18 +129,6 @@ MXF::set_key (Key key) if (ASDCP_FAILURE (_decryption_context->InitKey (_key->value ()))) { throw MiscError ("could not set up decryption context"); } - - _encryption_context = new ASDCP::AESEncContext; - if (ASDCP_FAILURE (_encryption_context->InitKey (_key->value ()))) { - throw MiscError ("could not set up encryption context"); - } - - uint8_t cbc_buffer[ASDCP::CBC_BLOCK_SIZE]; - - Kumu::FortunaRNG rng; - if (ASDCP_FAILURE (_encryption_context->SetIVec (rng.FillRandom (cbc_buffer, ASDCP::CBC_BLOCK_SIZE)))) { - throw MiscError ("could not set up CBC initialization vector"); - } } void -- cgit v1.2.3