diff options
Diffstat (limited to 'src/crypto_context.h')
| -rw-r--r-- | src/crypto_context.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/crypto_context.h b/src/crypto_context.h index b01efce4..e8ed5857 100644 --- a/src/crypto_context.h +++ b/src/crypto_context.h @@ -47,7 +47,7 @@ template <class T> class CryptoContext { public: - CryptoContext (boost::optional<Key> key, Standard standard) + CryptoContext (boost::optional<Key> key, Standard standard, bool use_hmac) : _context (0) , _hmac (0) { @@ -67,8 +67,6 @@ public: throw MiscError ("could not set up CBC initialization vector"); } - _hmac = new ASDCP::HMACContext; - ASDCP::LabelSet_t type; if (standard == INTEROP) { type = ASDCP::LS_MXF_INTEROP; @@ -76,8 +74,11 @@ public: type = ASDCP::LS_MXF_SMPTE; } - if (ASDCP_FAILURE (_hmac->InitKey (key->value(), type))) { - throw MiscError ("could not set up HMAC context"); + if (use_hmac) { + _hmac = new ASDCP::HMACContext; + if (ASDCP_FAILURE(_hmac->InitKey(key->value(), type))) { + throw MiscError ("could not set up HMAC context"); + } } } |
