summaryrefslogtreecommitdiff
path: root/src/AS_DCP_AES.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/AS_DCP_AES.cpp')
-rwxr-xr-xsrc/AS_DCP_AES.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/AS_DCP_AES.cpp b/src/AS_DCP_AES.cpp
index 51955f6..379e8ab 100755
--- a/src/AS_DCP_AES.cpp
+++ b/src/AS_DCP_AES.cpp
@@ -58,6 +58,7 @@ print_ssl_error()
class ASDCP::AESEncContext::h__AESContext : public AES_KEY
{
public:
+ Kumu::SymmetricKey m_KeyBuf;
byte_t m_IVec[CBC_BLOCK_SIZE];
};
@@ -76,8 +77,9 @@ ASDCP::AESEncContext::InitKey(const byte_t* key)
return RESULT_INIT;
m_Context = new h__AESContext;
+ m_Context->m_KeyBuf.Set(key);
- if ( AES_set_encrypt_key(key, KEY_SIZE_BITS, m_Context) )
+ if ( AES_set_encrypt_key(m_Context->m_KeyBuf.Value(), KEY_SIZE_BITS, m_Context) )
{
print_ssl_error();
return RESULT_CRYPT_INIT;
@@ -159,6 +161,7 @@ ASDCP::AESEncContext::EncryptBlock(const byte_t* pt_buf, byte_t* ct_buf, ui32_t
class ASDCP::AESDecContext::h__AESContext : public AES_KEY
{
public:
+ Kumu::SymmetricKey m_KeyBuf;
byte_t m_IVec[CBC_BLOCK_SIZE];
};
@@ -177,8 +180,9 @@ ASDCP::AESDecContext::InitKey(const byte_t* key)
return RESULT_INIT;
m_Context = new h__AESContext;
+ m_Context->m_KeyBuf.Set(key);
- if ( AES_set_decrypt_key(key, KEY_SIZE_BITS, m_Context) )
+ if ( AES_set_decrypt_key(m_Context->m_KeyBuf.Value(), KEY_SIZE_BITS, m_Context) )
{
print_ssl_error();
return RESULT_CRYPT_INIT;