Modify the verifyPacketIntegrity to pass the Payload length

Change-Id: I952a8f5d6b953b98e727c5680bd964960ca9db4e
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/message_parsers.cpp b/message_parsers.cpp
index 7b42e00..be70753 100644
--- a/message_parsers.cpp
+++ b/message_parsers.cpp
@@ -171,7 +171,9 @@
 
     if (message->isPacketAuthenticated)
     {
-        if (!(internal::verifyPacketIntegrity(inPacket,*(message.get()))))
+        if (!(internal::verifyPacketIntegrity(inPacket,
+                                              *(message.get()),
+                                              payloadLen)))
         {
             throw std::runtime_error("Packet Integrity check failed");
         }
@@ -230,10 +232,9 @@
 }
 
 bool verifyPacketIntegrity(const std::vector<uint8_t>& packet,
-                           const Message& message)
+                           const Message& message,
+                           size_t payloadLen)
 {
-    auto payloadLen = message.payload.size();
-
     /*
      * Padding bytes are added to cause the number of bytes in the data range
      * covered by the AuthCode(Integrity Data) field to be a multiple of 4 bytes