diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/AS_DCP.h | 5 | ||||
| -rwxr-xr-x | src/AS_DCP_AES.cpp | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/AS_DCP.h b/src/AS_DCP.h index f089f06..fa8b00a 100755 --- a/src/AS_DCP.h +++ b/src/AS_DCP.h @@ -508,6 +508,11 @@ namespace ASDCP { // point to a readable area of memory that is at least HMAC_SIZE bytes in length. // Returns error if the buf argument is NULL or if the values do ot match. Result_t TestHMACValue(const byte_t* buf) const; + + // Writes MIC key to given buffer. buf must point to a writable area of + // memory that is at least KeyLen bytes in length. Returns error if the + // buf argument is NULL. + Result_t GetMICKey(byte_t* buf) const; }; //--------------------------------------------------------------------------------- diff --git a/src/AS_DCP_AES.cpp b/src/AS_DCP_AES.cpp index 379e8ab..6409f5b 100755 --- a/src/AS_DCP_AES.cpp +++ b/src/AS_DCP_AES.cpp @@ -349,6 +349,13 @@ public: SHA1_Final(m_SHAValue, &SHA); m_Final = true; } + + // + void + GetMICKey(byte_t* buf) const + { + memcpy(buf, m_key, KeyLen); + } }; @@ -444,6 +451,20 @@ HMACContext::TestHMACValue(const byte_t* buf) const } +// +Result_t +HMACContext::GetMICKey(byte_t* buf) const +{ + KM_TEST_NULL_L(buf); + + if ( m_Context.empty() ) + return RESULT_INIT; + + m_Context->GetMICKey(buf); + return RESULT_OK; +} + + // // end AS_DCP_AES.cpp |
