Merge pull request #4 from cinecert/master
authorWolfgang Ruppel <imftool@t-online.de>
Wed, 23 Oct 2019 18:32:44 +0000 (11:32 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Oct 2019 18:32:44 +0000 (11:32 -0700)
Sync with upstream

configure.ac
src/AS_DCP_MXF.cpp

index d4a74593445dee9fd7ee09f3d8b135d6d1759f8e..be578c8457e4ec43f061b7f41563477a9bde47a2 100644 (file)
@@ -37,7 +37,7 @@ AC_PREREQ([2.59])
 # For example, if asdcplib version 1.0.0 were modified to accomodate changes
 # in file format, and if no changes were made to AS_DCP.h, the new version would be
 # 1.0.1. If changes were also required in AS_DCP.h, the new version would be 1.1.1.
-AC_INIT([asdcplib], [2.10.34], [asdcplib@cinecert.com])
+AC_INIT([asdcplib], [2.10.35], [asdcplib@cinecert.com])
 
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_SRCDIR([src/KM_error.h])
index e23fb8649b07208f54bc2d51db842f463def4de8..d3606fe36a3163110d172096304ada311214e3bb 100755 (executable)
@@ -36,6 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "ACES.h"
 #include "MPEG.h"
 #include "Wav.h"
+#include "KM_util.h"
 #include <iostream>
 #include <iomanip>
 
@@ -688,7 +689,33 @@ ASDCP::IntegrityPack::TestValues(const ASDCP::FrameBuffer& FB, const byte_t* Ass
   HMAC->Update(FB.RoData(), FB.Size() - HMAC_SIZE);
   HMAC->Finalize();
 
-  return HMAC->TestHMACValue(p);
+  Result_t result = RESULT_OK;
+  result = HMAC->TestHMACValue(p);
+
+  if (KM_FAILURE(result))
+    {
+      Result_t r = RESULT_OK;
+      char hmac_str[HMAC_SIZE*10];
+      char found_str[HMAC_SIZE*10];
+      byte_t hmac_buf[HMAC_SIZE];
+
+
+      Kumu::bin2hex(p, HMAC_SIZE, found_str, HMAC_SIZE*10);
+
+      r = HMAC->GetHMACValue(hmac_buf);
+      if ( KM_SUCCESS( r ) )
+        {
+          Kumu::bin2hex(hmac_buf, HMAC_SIZE, hmac_str, HMAC_SIZE*10);
+        }
+      else
+        {
+          snprintf(hmac_str, HMAC_SIZE*10, " - read error - ");
+        }
+
+      DefaultLogSink().Error("IntegrityPack failure: HMAC is %s, expecting %s.\n", found_str, hmac_str);
+    }
+
+  return result;
 }
 
 //